Theory CDCL.CDCL_W_Abstract_State
theory CDCL_W_Abstract_State
imports CDCL_W_Full CDCL_W_Restart CDCL_W_Incremental
begin
section ‹Instantiation of Weidenbach's CDCL by Multisets›
text ‹We first instantiate the locale of Weidenbach's locale. Then we refine it to a 2-WL program.›
type_synonym 'v cdcl⇩W_restart_mset = "('v, 'v clause) ann_lit list ×
'v clauses ×
'v clauses ×
'v clause option"
text ‹We use definition, otherwise we could not use the simplification theorems we have already
shown.›
fun trail :: "'v cdcl⇩W_restart_mset ⇒ ('v, 'v clause) ann_lit list" where
"trail (M, _) = M"
fun init_clss :: "'v cdcl⇩W_restart_mset ⇒ 'v clauses" where
"init_clss (_, N, _) = N"
fun learned_clss :: "'v cdcl⇩W_restart_mset ⇒ 'v clauses" where
"learned_clss (_, _, U, _) = U"
fun conflicting :: "'v cdcl⇩W_restart_mset ⇒ 'v clause option" where
"conflicting (_, _, _, C) = C"
fun cons_trail :: "('v, 'v clause) ann_lit ⇒ 'v cdcl⇩W_restart_mset ⇒ 'v cdcl⇩W_restart_mset" where
"cons_trail L (M, R) = (L # M, R)"
fun tl_trail where
"tl_trail (M, R) = (tl M, R)"
fun add_learned_cls where
"add_learned_cls C (M, N, U, R) = (M, N, {#C#} + U, R)"
fun add_init_cls where
"add_init_cls C (M, N, U, R) = (M, {#C#} + N, U, R)"
fun remove_cls where
"remove_cls C (M, N, U, R) = (M, removeAll_mset C N, removeAll_mset C U, R)"
fun update_conflicting where
"update_conflicting D (M, N, U, _) = (M, N, U, D)"
fun init_state where
"init_state N = ([], N, {#}, None)"
declare trail.simps[simp del] cons_trail.simps[simp del] tl_trail.simps[simp del]
add_learned_cls.simps[simp del] remove_cls.simps[simp del]
update_conflicting.simps[simp del] init_clss.simps[simp del] learned_clss.simps[simp del]
conflicting.simps[simp del] init_state.simps[simp del]
lemmas cdcl⇩W_restart_mset_state = trail.simps cons_trail.simps tl_trail.simps add_learned_cls.simps
remove_cls.simps update_conflicting.simps init_clss.simps learned_clss.simps
conflicting.simps init_state.simps
definition state where
‹state S = (trail S, init_clss S, learned_clss S, conflicting S, ())›
interpretation cdcl⇩W_restart_mset: state⇩W_ops where
state = state and
trail = trail and
init_clss = init_clss and
learned_clss = learned_clss and
conflicting = conflicting and
cons_trail = cons_trail and
tl_trail = tl_trail and
add_learned_cls = add_learned_cls and
remove_cls = remove_cls and
update_conflicting = update_conflicting and
init_state = init_state
.
definition state_eq :: "'v cdcl⇩W_restart_mset ⇒ 'v cdcl⇩W_restart_mset ⇒ bool" (infix "∼m" 50) where
‹S ∼m T ⟷ state S = state T›