Theory Watched_Literals_Transition_System_Simp
theory Watched_Literals_Transition_System_Simp
imports
Watched_Literals_Transition_System_Reduce
Watched_Literals_Transition_System_Restart
begin
context twl_restart
begin
theorem wf_cdcl_twl_stgy_restart:
‹wf {(T, S :: 'v twl_st_restart). twl_restart_inv S ∧ cdcl_twl_stgy_restart S T}› (is ‹wf ?S›)
proof -
have ‹?S ⊆
{((S', T', U', m', n', g'), (S, T, U, m, n, g)).
pcdcl_stgy_restart_inv (pstate⇩W_of S, pstate⇩W_of T, pstate⇩W_of U, m, n, g) ∧
pcdcl_stgy_restart (pstate⇩W_of S, pstate⇩W_of T, pstate⇩W_of U, m, n, g)
(pstate⇩W_of S', pstate⇩W_of T', pstate⇩W_of U', m', n', g')} ∪
{((S', T', U', m', n', g'), (S, T, U, m, n, g)).
pcdcl_stgy_restart_inv (pstate⇩W_of S, pstate⇩W_of T, pstate⇩W_of U, m, n, g) ∧
S = S' ∧ T = T' ∧ m = m' ∧ n = n' ∧ g = g' ∧
pstate⇩W_of U = pstate⇩W_of U' ∧ (literals_to_update_measure U', literals_to_update_measure U)
∈ lexn less_than 2}› (is ‹_ ⊆ ?A ∪ ?B›)
by (auto dest!: cdcl_twl_stgy_cdcl⇩W_stgy_restart2 simp: twl_restart_inv_def)
moreover have ‹wf (?A ∪ ?B)›
apply (rule wf_union_compatible)
subgoal
by (rule wf_subset[OF wf_if_measure_f[OF wf_pcdcl_twl_stgy_restart],
of _ ‹λ(S, T, U, m, g). (pstate⇩W_of S, pstate⇩W_of T, pstate⇩W_of U, m, g)›]) auto
subgoal
by (rule wf_subset[OF wf_if_measure_f[OF ],
of ‹(lexn less_than 2)› _ ‹λ(S, T, U, m, g). literals_to_update_measure (U)›])
(auto intro!: wf_lexn)
subgoal
by auto
done
ultimately show ?thesis
by (blast intro: wf_subset)
qed
end
context twl_restart_ops
begin
lemma cdcl_twl_stgy_size_get_all_learned:
‹cdcl_twl_stgy S T ⟹ size (get_all_learned_clss S) ≤ size (get_all_learned_clss T)›
by (induction rule: cdcl_twl_stgy.induct)
(auto simp: cdcl_twl_cp.simps cdcl_twl_o.simps update_clauses.simps
dest: multi_member_split)
lemma rtranclp_cdcl_twl_stgy_size_get_all_learned:
‹cdcl_twl_stgy⇧*⇧* S T ⟹ size (get_all_learned_clss S) ≤ size (get_all_learned_clss T)›
by (induction rule: rtranclp_induct)
(auto dest!: cdcl_twl_stgy_size_get_all_learned)
lemma (in -) wf_trancl_iff: ‹wf (r⇧+) ⟷ wf r›
by (auto intro!: wf_subset[of ‹r⇧+› r] simp: wf_trancl)
lemma (in -) tranclp_inv_tranclp:
assumes ‹⋀S T. R S T ⟹ P S ⟹ P T›
shows
‹{(T, S). R S T ∧ P S}⇧+ = {(T, S). R⇧+⇧+ S T ∧ P S}›
proof -
have H: ‹R⇧+⇧+ S T ⟹ P S ⟹ P T› for S T
by (induction rule: tranclp_induct)
(auto dest: assms)
show ?thesis
apply (rule; rule; clarify)
unfolding mem_Collect_eq in_pair_collect_simp
subgoal for a b
by (induction rule: trancl_induct) auto
subgoal for b x
apply (induction rule: tranclp_induct)
subgoal for b
by auto
subgoal for e f
by (rule trancl_into_trancl2[of f e])
(use H[of x e] in auto)
done
done
qed
definition partial_conclusive_TWL_run :: ‹'v twl_st ⇒ (bool × 'v twl_st) nres› where
‹partial_conclusive_TWL_run S = SPEC(λ(b, T). ∃R1 R2 m m⇩0 n⇩0.
cdcl_twl_stgy_restart⇧*⇧* (S, S, S, m⇩0, n⇩0, True) (R1, R2, T, m) ∧ (¬b ⟶ final_twl_state T))›
definition partial_conclusive_TWL_run2
:: ‹nat ⇒ nat ⇒ 'v twl_st ⇒ 'v twl_st ⇒ 'v twl_st ⇒ (bool × 'v twl_st) nres›
where
‹partial_conclusive_TWL_run2 m⇩0 n⇩0 S⇩0 T⇩0 U⇩0 = SPEC(λ(b, T). ∃R1 R2 m.
cdcl_twl_stgy_restart⇧*⇧* (S⇩0, T⇩0, U⇩0, m⇩0, n⇩0, True) (R1, R2, T, m) ∧ (¬b ⟶ final_twl_state T))›
definition conclusive_TWL_run :: ‹'v twl_st ⇒ 'v twl_st nres› where
‹conclusive_TWL_run S = SPEC(λT. (∃R1 R2 m m⇩0 n⇩0.
cdcl_twl_stgy_restart⇧*⇧* (S, S, S, m⇩0, n⇩0, True) (R1, R2, T, m) ∧ final_twl_state T))›
definition conclusive_TWL_run2 :: ‹nat ⇒ nat ⇒ 'v twl_st ⇒ 'v twl_st ⇒ 'v twl_st ⇒ 'v twl_st nres› where
‹conclusive_TWL_run2 m⇩0 n⇩0 S⇩0 T⇩0 U⇩0 = SPEC(λT. (∃R1 R2 m.
cdcl_twl_stgy_restart⇧*⇧* (S⇩0, T⇩0, U⇩0, m⇩0, n⇩0, True) (R1, R2, T, m) ∧ final_twl_state T))›
end
end