Theory IsaSAT_Stats
theory IsaSAT_Stats
imports IsaSAT_Literals IsaSAT_EMA IsaSAT_Rephase IsaSAT_Reluctant Tuple16
begin
section ‹Statistics›
text ‹
We do some statistics on the run.
NB: the statistics are not proven correct (especially they might
overflow), there are just there to look for regressions, do some comparisons (e.g., to conclude that
we are propagating slower than the other solvers), or to test different option combinations.
›
type_synonym limit = ‹64 word × 64 word›
text ‹The statistics have the following meaning:
▸ search information
(propagations, conflicts, decision, restarts,
reductions, fixed variables, GCs,
units since last GC, fixed irredundant clss),
▸ binary simplification (binary unit, binary red removed),
▸ pure literals (purelit removed, purelit rounds),
▸ forward subsumption (forward rounds, forward strengthen, forward subsumed)
▸ other: max kept lbd,
▸ ticks
▸ average lbds
▸ heuristics
At first we used a tuple that became longer and longer. We even had statistics bug because we changed
the wrong element of the tuple. Therefore, we changed to a structure and kept some free spots.
›
type_synonym search_stats = ‹64 word × 64 word ×64 word × 64 word × 64 word × 64 word ×64 word × 64 word × 64 word × 64 word›
definition Search_Stats_propagations :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_propagations = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). propa)›
definition Search_Stats_incr_propagation :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_propagation = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa+1, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_incr_propagation_by :: ‹64 word ⇒ search_stats ⇒ search_stats› where
‹Search_Stats_incr_propagation_by = (λp (propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa+p, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_conflicts :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_conflicts = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). confl)›
definition Search_Stats_incr_conflicts :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_conflicts = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl+1, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_decisions :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_decisions = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). dec)›
definition Search_Stats_incr_decisions :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_decisions = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec+1, res, reduction, uset, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_restarts :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_restarts = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). res)›
definition Search_Stats_incr_restarts :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_restarts = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res+1, reduction, uset, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_reductions :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_reductions = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). reduction)›
definition Search_Stats_incr_reductions :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_reductions = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction+1, uset, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_fixed :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_fixed = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). uset)›
definition Search_Stats_incr_fixed :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_fixed = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset+1, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_incr_fixed_by :: ‹64 word ⇒ search_stats ⇒ search_stats› where
‹Search_Stats_incr_fixed_by = (λp (propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset+p, gcs, units, irred_cls, no_conflict_until))›
definition Search_Stats_gcs :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_gcs = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). gcs)›
definition Search_Stats_incr_gcs :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_gcs = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset, gcs+1, units, irred_cls, no_conflict_until))›
definition Search_Stats_reset_units_since_gc :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_reset_units_since_gc = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset, gcs, 0, irred_cls, no_conflict_until))›
definition Search_Stats_units_since_gcs :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_units_since_gcs = (λ(propa, confl, dec, res, reduction, uset, units_since_gcs, units, irred_cls, no_conflict_until). units_since_gcs)›
definition Search_Stats_incr_units_since_gc :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_units_since_gc = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset, gcs, units+1, irred_cls, no_conflict_until))›
definition Search_Stats_incr_units_since_gc_by :: ‹64 word ⇒ search_stats ⇒ search_stats› where
‹Search_Stats_incr_units_since_gc_by = (λp (propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset, gcs, units+p, irred_cls, no_conflict_until))›
definition Search_Stats_incr_irred :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_incr_irred = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset, gcs, units, irred_cls+1, no_conflict_until))›
definition Search_Stats_decr_irred :: ‹search_stats ⇒ search_stats› where
‹Search_Stats_decr_irred = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset, gcs, units, irred_cls-1, no_conflict_until))›
definition Search_Stats_irred :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_irred = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). irred_cls)›
definition Search_Stats_no_conflict_until :: ‹search_stats ⇒ 64 word› where
‹Search_Stats_no_conflict_until = (λ(propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). no_conflict_until)›
definition Search_Stats_set_no_conflict_until :: ‹64 word ⇒ search_stats ⇒ search_stats› where
‹Search_Stats_set_no_conflict_until = (λp (propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, no_conflict_until). (propa, confl, dec, res, reduction, uset, gcs, units, irred_cls, p))›
type_synonym inprocessing_binary_stats = ‹64 word × 64 word × 64 word›
definition Binary_Stats_incr_rounds :: ‹inprocessing_binary_stats ⇒ inprocessing_binary_stats› where
‹Binary_Stats_incr_rounds = (λ(rounds, units, removed). (rounds + 1, units, removed))›
definition Binary_Stats_incr_units :: ‹inprocessing_binary_stats ⇒ inprocessing_binary_stats› where
‹Binary_Stats_incr_units = (λ(rounds, units, removed). (rounds, units+1, removed))›
definition Binary_Stats_incr_removed :: ‹inprocessing_binary_stats ⇒ inprocessing_binary_stats› where
‹Binary_Stats_incr_removed = (λ(rounds, units, removed). (rounds, units, removed+1))›
text ‹\<^term>‹ticks› is currently unused: it is supposed to be used as to limit the number of clauses to try.›
type_synonym inprocessing_subsumption_stats = ‹64 word × 64 word × 64 word × 64 word × 64 word›
definition Subsumption_Stats_rounds where
‹Subsumption_Stats_rounds = (λ(rounds, strengthened, subsumed, _). rounds)›
definition Subsumption_Stats_subsumed where
‹Subsumption_Stats_subsumed = (λ(subsumed, strengthened, subsumed, _). subsumed)›
definition Subsumption_Stats_tried where
‹Subsumption_Stats_tried = (λ(subsumed, strengthened, subsumed, _, tried). tried)›
definition Subsumption_Stats_strengthened where
‹Subsumption_Stats_strengthened = (λ(rounds, strengethened, subsumed, _). strengethened)›
definition Subsumption_Stats_incr_rounds :: ‹inprocessing_subsumption_stats ⇒ inprocessing_subsumption_stats› where
‹Subsumption_Stats_incr_rounds = (λ(rounds, units, removed, ticks, tried). (rounds + 1, units, removed, ticks, tried))›
definition Subsumption_Stats_incr_strengthening :: ‹inprocessing_subsumption_stats ⇒ inprocessing_subsumption_stats› where
‹Subsumption_Stats_incr_strengthening = (λ(rounds, units, removed). (rounds, units+1, removed))›
definition Subsumption_Stats_incr_subsumed :: ‹inprocessing_subsumption_stats ⇒ inprocessing_subsumption_stats› where
‹Subsumption_Stats_incr_subsumed = (λ(rounds, units, removed, ticks). (rounds, units, removed+1, ticks))›
definition Subsumption_Stats_incr_tried :: ‹inprocessing_subsumption_stats ⇒ inprocessing_subsumption_stats› where
‹Subsumption_Stats_incr_tried = (λ(rounds, units, removed, ticks, tried). (rounds, units, removed, ticks, tried+1))›
definition Subsumption_Stats_set_ticks_limit :: ‹64 word ⇒ inprocessing_subsumption_stats ⇒ inprocessing_subsumption_stats› where
‹Subsumption_Stats_set_ticks_limit = (λticks (rounds, units, removed, _, tried). (rounds, units, removed+1, ticks, tried))›
definition Subsumption_Stats_ticks_limit :: ‹inprocessing_subsumption_stats ⇒ 64 word› where
‹Subsumption_Stats_ticks_limit = (λ(rounds, units, removed, ticks, tried). ticks)›
definition Subsumption_Stats_ticks_tried :: ‹inprocessing_subsumption_stats ⇒ 64 word› where
‹Subsumption_Stats_ticks_tried = (λ(rounds, units, removed, ticks, tried). tried)›
type_synonym inprocessing_pure_lits_stats = ‹64 word × 64 word›
definition Pure_lits_Stats_incr_rounds :: ‹inprocessing_pure_lits_stats ⇒ inprocessing_pure_lits_stats› where
‹Pure_lits_Stats_incr_rounds = (λ(rounds, removed). (rounds + 1, removed))›
definition Pure_lits_Stats_incr_removed :: ‹inprocessing_pure_lits_stats ⇒ inprocessing_pure_lits_stats› where
‹Pure_lits_Stats_incr_removed = (λ(rounds, removed). (rounds, removed+1))›
type_synonym lbd_size_limit_stats = ‹nat × nat›
definition LSize_Stats_lbd where
‹LSize_Stats_lbd = (λ(lbd, size). lbd)›
definition LSize_Stats_size where
‹LSize_Stats_size = (λ(lbd, size). size)›
definition LSize_Stats where
‹LSize_Stats lbd size' = (lbd, size')›
type_synonym rephase_stats = ‹64 word × 64 word × 64 word × 64 word × 64 word × 64 word›
definition Rephase_Stats_total :: ‹rephase_stats ⇒ _› where
‹Rephase_Stats_total = (λ(rephased, original, best, invert, flipped, random). rephased)›
definition Rephase_Stats_incr_total :: ‹rephase_stats ⇒ rephase_stats› where
‹Rephase_Stats_incr_total = (λ(rephased, original, best, invert, flipped, random). (rephased+1, original, best, invert, flipped, random))›
type_synonym isasat_stats = ‹(search_stats, inprocessing_binary_stats, inprocessing_subsumption_stats, ema,
inprocessing_pure_lits_stats, lbd_size_limit_stats, rephase_stats, 64 word,
64 word, 64 word,64 word, 64 word,
64 word, 64 word, 32 word, 64 word) tuple16›
abbreviation Stats :: ‹_ ⇒ _ ⇒_ ⇒ _ ⇒_ ⇒ _ ⇒_ ⇒ _ ⇒_ ⇒ _ ⇒_ ⇒ _ ⇒_ ⇒ _ ⇒_ ⇒ _ ⇒ isasat_stats› where
‹Stats ≡ Tuple16›
definition get_search_stats :: ‹isasat_stats ⇒ search_stats› where
‹get_search_stats ≡ Tuple16.Tuple16_get_a›
definition get_binary_stats :: ‹isasat_stats ⇒ inprocessing_binary_stats› where
‹get_binary_stats ≡ Tuple16.Tuple16_get_b›
definition get_subsumption_stats :: ‹isasat_stats ⇒ inprocessing_subsumption_stats› where
‹get_subsumption_stats ≡ Tuple16.Tuple16_get_c›
definition get_avg_lbd_stats :: ‹isasat_stats ⇒ ema› where
‹get_avg_lbd_stats ≡ Tuple16.Tuple16_get_d›
definition get_pure_lits_stats :: ‹isasat_stats ⇒ inprocessing_pure_lits_stats› where
‹get_pure_lits_stats ≡ Tuple16.Tuple16_get_e›
definition get_lsize_limit_stats :: ‹isasat_stats ⇒ lbd_size_limit_stats› where
‹get_lsize_limit_stats ≡ Tuple16.Tuple16_get_f›
definition get_rephase_stats :: ‹isasat_stats ⇒ rephase_stats› where
‹get_rephase_stats ≡ Tuple16.Tuple16_get_g›
definition set_propagation_stats :: ‹search_stats ⇒ isasat_stats ⇒ isasat_stats› where
‹set_propagation_stats ≡ Tuple16.set_a›
definition set_binary_stats :: ‹inprocessing_binary_stats ⇒ isasat_stats ⇒ isasat_stats› where
‹set_binary_stats ≡ Tuple16.set_b›
definition set_subsumption_stats :: ‹inprocessing_subsumption_stats ⇒ isasat_stats ⇒ isasat_stats› where
‹set_subsumption_stats ≡ Tuple16.set_c›
definition set_avg_lbd_stats :: ‹ema ⇒ isasat_stats ⇒ isasat_stats› where
‹set_avg_lbd_stats ≡ Tuple16.set_d›
definition set_pure_lits_stats :: ‹inprocessing_pure_lits_stats ⇒ isasat_stats ⇒ isasat_stats› where
‹set_pure_lits_stats ≡ Tuple16.set_e›
definition set_lsize_limit_stats :: ‹lbd_size_limit_stats ⇒ isasat_stats ⇒ isasat_stats› where
‹set_lsize_limit_stats ≡ Tuple16.set_f›
definition set_rephase_stats :: ‹rephase_stats ⇒ isasat_stats ⇒ isasat_stats› where
‹set_rephase_stats ≡ Tuple16.set_g›
definition incr_propagation :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_propagation S = (set_propagation_stats (Search_Stats_incr_propagation (get_search_stats S)) S)›
definition incr_propagation_by :: ‹64 word ⇒ isasat_stats ⇒ isasat_stats› where
‹incr_propagation_by p S = (set_propagation_stats (Search_Stats_incr_propagation_by p (get_search_stats S)) S)›
definition incr_conflict :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_conflict S = (set_propagation_stats (Search_Stats_incr_conflicts (get_search_stats S)) S)›
definition incr_decision :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_decision S = (set_propagation_stats (Search_Stats_incr_decisions (get_search_stats S)) S)›
definition incr_restart :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_restart S = (set_propagation_stats (Search_Stats_incr_restarts (get_search_stats S)) S)›
definition incr_reduction :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_reduction S = (set_propagation_stats (Search_Stats_incr_reductions (get_search_stats S)) S)›
definition incr_uset :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_uset S = (set_propagation_stats (Search_Stats_incr_fixed (get_search_stats S)) S)›
definition incr_uset_by :: ‹64 word ⇒ isasat_stats ⇒ isasat_stats› where
‹incr_uset_by p S = (set_propagation_stats (Search_Stats_incr_fixed_by p (get_search_stats S)) S)›
definition incr_GC :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_GC S = (set_propagation_stats (Search_Stats_incr_gcs (get_search_stats S)) S)›
definition units_since_last_GC :: ‹isasat_stats ⇒ 64 word› where
‹units_since_last_GC = Search_Stats_units_since_gcs o get_search_stats›
definition units_since_beginning :: ‹isasat_stats ⇒ 64 word› where
‹units_since_beginning = Search_Stats_fixed o get_search_stats›
definition incr_units_since_last_GC :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_units_since_last_GC S = (set_propagation_stats (Search_Stats_incr_units_since_gc (get_search_stats S)) S)›
definition incr_units_since_last_GC_by :: ‹64 word ⇒ isasat_stats ⇒ isasat_stats› where
‹incr_units_since_last_GC_by p S = (set_propagation_stats (Search_Stats_incr_units_since_gc_by p (get_search_stats S)) S)›
definition stats_conflicts :: ‹isasat_stats ⇒ 64 word› where
‹stats_conflicts = Search_Stats_conflicts o get_search_stats›
definition incr_binary_unit_derived :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_binary_unit_derived S = set_binary_stats (Binary_Stats_incr_units (get_binary_stats S)) S›
definition incr_binary_red_removed :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_binary_red_removed S = set_binary_stats (Binary_Stats_incr_removed (get_binary_stats S)) S›
definition incr_forward_strengethening :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_forward_strengethening S = set_subsumption_stats (Subsumption_Stats_incr_strengthening (get_subsumption_stats S)) S›
definition incr_forward_subsumed :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_forward_subsumed S = set_subsumption_stats (Subsumption_Stats_incr_subsumed (get_subsumption_stats S)) S›
definition incr_forward_tried :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_forward_tried S = set_subsumption_stats (Subsumption_Stats_incr_tried (get_subsumption_stats S)) S›
definition incr_forward_rounds :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_forward_rounds S = set_subsumption_stats (Subsumption_Stats_incr_rounds (get_subsumption_stats S)) S›
definition stats_forward_rounds :: ‹isasat_stats ⇒ _› where
‹stats_forward_rounds = Subsumption_Stats_rounds o get_subsumption_stats›
definition stats_forward_subsumed :: ‹isasat_stats ⇒ _› where
‹stats_forward_subsumed = Subsumption_Stats_subsumed o get_subsumption_stats›
definition stats_forward_strengthened :: ‹isasat_stats ⇒ _› where
‹stats_forward_strengthened = Subsumption_Stats_strengthened o get_subsumption_stats›
definition stats_forward_tried :: ‹isasat_stats ⇒ _› where
‹stats_forward_tried = Subsumption_Stats_tried o get_subsumption_stats›
definition get_restart_count where
‹get_restart_count S = Search_Stats_restarts (get_search_stats S)›
definition get_reduction_count where
‹get_reduction_count S = Search_Stats_reductions (get_search_stats S)›
definition incr_rephase_total :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_rephase_total S = (set_rephase_stats (Rephase_Stats_incr_total (get_rephase_stats S)) S)›
definition stats_rephase :: ‹isasat_stats ⇒ 64 word› where
‹stats_rephase = Rephase_Stats_total o get_rephase_stats›
definition print_open_colour :: ‹64 word ⇒ unit› where
‹print_open_colour _ = ()›
definition print_close_colour :: ‹64 word ⇒ unit› where
‹print_close_colour _ = ()›
definition stats_propagations :: ‹isasat_stats ⇒ 64 word› where
‹stats_propagations = Search_Stats_propagations o get_search_stats›
definition stats_restarts :: ‹isasat_stats ⇒ 64 word› where
‹stats_restarts = Search_Stats_restarts o get_search_stats›
definition stats_reductions :: ‹isasat_stats ⇒ 64 word› where
‹stats_reductions = Search_Stats_reductions o get_search_stats›
definition stats_fixed :: ‹isasat_stats ⇒ 64 word› where
‹stats_fixed = Search_Stats_fixed o get_search_stats›
definition stats_gcs :: ‹isasat_stats ⇒ 64 word› where
‹stats_gcs = Search_Stats_gcs o get_search_stats›
definition stats_avg_lbd :: ‹isasat_stats ⇒ ema› where
‹stats_avg_lbd = get_avg_lbd_stats›
definition stats_decisions :: ‹isasat_stats ⇒ 64 word› where
‹stats_decisions = Search_Stats_decisions o get_search_stats›
definition stats_irred :: ‹isasat_stats ⇒ 64 word› where
‹stats_irred = Search_Stats_irred o get_search_stats›
definition Binary_Stats_rounds :: ‹inprocessing_binary_stats ⇒ 64 word› where
‹Binary_Stats_rounds = (λ(rounds, units, removed). rounds)›
definition stats_binary_rounds :: ‹isasat_stats ⇒ 64 word› where
‹stats_binary_rounds = Binary_Stats_rounds o get_binary_stats›
definition Binary_Stats_units :: ‹inprocessing_binary_stats ⇒ 64 word› where
‹Binary_Stats_units = (λ(units, units, removed). units)›
definition stats_binary_units :: ‹isasat_stats ⇒ 64 word› where
‹stats_binary_units = Binary_Stats_units o get_binary_stats›
definition Binary_Stats_removed :: ‹inprocessing_binary_stats ⇒ 64 word› where
‹Binary_Stats_removed = (λ(removed, units, removed). removed)›
definition stats_binary_removed :: ‹isasat_stats ⇒ 64 word› where
‹stats_binary_removed = Binary_Stats_removed o get_binary_stats›
definition Pure_Lits_Stats_removed :: ‹inprocessing_pure_lits_stats ⇒ 64 word› where
‹Pure_Lits_Stats_removed = (λ(removed, removed). removed)›
definition stats_pure_lits_removed :: ‹isasat_stats ⇒ 64 word› where
‹stats_pure_lits_removed = Pure_Lits_Stats_removed o get_pure_lits_stats›
definition Pure_Lits_Stats_rounds :: ‹inprocessing_pure_lits_stats ⇒ 64 word› where
‹Pure_Lits_Stats_rounds = (λ(rounds, rounds). rounds)›
definition stats_pure_lits_rounds :: ‹isasat_stats ⇒ 64 word› where
‹stats_pure_lits_rounds = Pure_Lits_Stats_rounds o get_pure_lits_stats›
definition add_lbd :: ‹32 word ⇒ isasat_stats ⇒ isasat_stats› where
‹add_lbd lbd S = set_avg_lbd_stats (ema_update (unat lbd) (get_avg_lbd_stats S)) S›
definition incr_purelit_elim :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_purelit_elim S = set_pure_lits_stats (Pure_lits_Stats_incr_removed (get_pure_lits_stats S)) S›
definition incr_purelit_rounds :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_purelit_rounds S = set_pure_lits_stats (Pure_lits_Stats_incr_rounds (get_pure_lits_stats S)) S›
definition reset_units_since_last_GC :: ‹isasat_stats ⇒ isasat_stats› where
‹reset_units_since_last_GC S = (set_propagation_stats (Search_Stats_reset_units_since_gc (get_search_stats S)) S)›
definition incr_irred_clss :: ‹isasat_stats ⇒ isasat_stats› where
‹incr_irred_clss S = set_propagation_stats (Search_Stats_incr_irred (get_search_stats S)) S›
definition set_no_conflict_until :: ‹64 word ⇒ isasat_stats ⇒ isasat_stats› where
‹set_no_conflict_until p S = set_propagation_stats (Search_Stats_set_no_conflict_until p (get_search_stats S)) S›
definition no_conflict_until :: ‹isasat_stats ⇒ 64 word› where
‹no_conflict_until S = Search_Stats_no_conflict_until (get_search_stats S)›
definition decr_irred_clss :: ‹isasat_stats ⇒ isasat_stats› where
‹decr_irred_clss S = set_propagation_stats (Search_Stats_decr_irred (get_search_stats S)) S›
definition irredundant_clss :: ‹isasat_stats ⇒ 64 word› where
‹irredundant_clss = Search_Stats_irred o get_search_stats›
abbreviation (input) get_conflict_count :: ‹isasat_stats ⇒ 64 word› where
‹get_conflict_count ≡ stats_conflicts›
definition stats_lbd_limit :: ‹isasat_stats ⇒ nat› where
‹stats_lbd_limit = LSize_Stats_lbd o get_lsize_limit_stats›
definition stats_size_limit :: ‹isasat_stats ⇒ nat› where
‹stats_size_limit = LSize_Stats_size o get_lsize_limit_stats›
definition set_stats_size_limit :: ‹nat ⇒ nat ⇒ isasat_stats ⇒ isasat_stats› where
‹set_stats_size_limit lbd size' = set_lsize_limit_stats (lbd, size')›
section ‹Information related to restarts›
definition FOCUSED_MODE :: ‹64 word› where
‹FOCUSED_MODE = 0›
definition STABLE_MODE :: ‹64 word› where
‹STABLE_MODE = 1›
definition DEFAULT_INIT_PHASE :: ‹64 word› where
‹DEFAULT_INIT_PHASE = 10000›
type_synonym restart_info = ‹64 word × 64 word × 64 word × 64 word × 64 word›
definition incr_conflict_count_since_last_restart :: ‹restart_info ⇒ restart_info› where
‹incr_conflict_count_since_last_restart = (λ(ccount, ema_lvl, restart_phase, end_of_phase, length_phase).
(ccount + 1, ema_lvl, restart_phase, end_of_phase, length_phase))›
definition restart_info_update_lvl_avg :: ‹32 word ⇒ restart_info ⇒ restart_info› where
‹restart_info_update_lvl_avg = (λlvl (ccount, ema_lvl). (ccount, ema_lvl))›
definition restart_info_init :: ‹restart_info› where
‹restart_info_init = (0, 0, FOCUSED_MODE, DEFAULT_INIT_PHASE, 1000)›
definition restart_info_restart_done :: ‹restart_info ⇒ restart_info› where
‹restart_info_restart_done = (λ(ccount, lvl_avg). (0, lvl_avg))›
definition empty_stats :: ‹isasat_stats› where
‹empty_stats = Tuple16( (0,0,0,0,0,0,0,0,0,0)::search_stats)
((0,0,0)::inprocessing_binary_stats) ((0,0,0,0,0)::inprocessing_subsumption_stats)
(ema_fast_init::ema) ((0,0)::inprocessing_pure_lits_stats) (0,0) (0,0,0,0,0,0) 0 0 0 0 0 0 0 0 0›
definition empty_stats_clss :: ‹64 word ⇒ isasat_stats› where
‹empty_stats_clss n = Tuple16( (0,0,0,0,0,0,0,0,n,0)::search_stats)
((0,0,0)::inprocessing_binary_stats) ((0,0,0,0,0)::inprocessing_subsumption_stats)
(ema_fast_init::ema) ((0,0)::inprocessing_pure_lits_stats) (0,0) (0,0,0,0,0,0) 0 0 0 0 0 0 0 0 0›
section ‹Heuristics›
type_synonym schedule_info = ‹64 word × 64 word × 64 word›
definition schedule_next_pure_lits_info :: ‹schedule_info ⇒ schedule_info› where
‹schedule_next_pure_lits_info = (λ(inprocess, reduce, forwardsubsumption). (inprocess * 3 >> 1, reduce, forwardsubsumption))›
definition next_pure_lits_schedule_info :: ‹schedule_info ⇒ 64 word› where
‹next_pure_lits_schedule_info = (λ(inprocess, reduce, forwardsubsumption). inprocess)›
definition schedule_next_reduce_info :: ‹64 word ⇒ schedule_info ⇒ schedule_info› where
‹schedule_next_reduce_info delta = (λ(inprocess, reduce, forwardsubsumption). (inprocess, reduce + delta, forwardsubsumption))›
definition next_reduce_schedule_info :: ‹schedule_info ⇒ 64 word› where
‹next_reduce_schedule_info = (λ(inprocess, reduce, forwardsubsumption). reduce)›
definition next_subsume_schedule_info :: ‹schedule_info ⇒ 64 word› where
‹next_subsume_schedule_info = (λ(inprocess, reduce, forwardsubsumption). forwardsubsumption)›
definition schedule_next_subsume_info :: ‹64 word ⇒ schedule_info ⇒ schedule_info› where
‹schedule_next_subsume_info delta = (λ(inprocess, reduce, forwardsubsumption). (inprocess, reduce, forwardsubsumption + delta))›