[STATEMENT]
lemma InvariantConflictFlagCharacterizationAfterAssertLiteral:
assumes
  "InvariantConsistent ((getM state) @ [(literal, decision)])"
  "InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)" and
  "InvariantWatchesDiffer (getF state) (getWatch1 state) (getWatch2 state)" and
  "InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)" and
  "InvariantWatchListsUniq (getWatchList state)" and
  "InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)"
  "InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)" and
  "InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)"
  "InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)"
shows
  "let state' = (assertLiteral literal decision state) in
      InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
let ?state = "state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
let ?state' = "assertLiteral literal decision state"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
have *:"getConflictFlag ?state' = (getConflictFlag state \<or>
          (\<exists> clause. clause \<in> set (getWatchList ?state (opposite literal)) \<and>
                     clauseFalse (nth (getF ?state) clause) (elements (getM ?state))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
using NotifyWatchesLoopConflictFlagEffect[of "?state"
      "getWatchList ?state (opposite literal)"
      "opposite literal" "[]"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
using \<open>InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
using \<open>InvariantConsistent ((getM state) @ [(literal, decision)])\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
using \<open>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
using \<open>InvariantWatchListsUniq (getWatchList state)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
using \<open>InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
unfolding InvariantWatchListsUniq_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
\<forall>l. uniq (getWatchList state l)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
unfolding InvariantWatchListsCharacterization_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
\<forall>l. uniq (getWatchList state l)
\<forall>c l. (c \<in> set (getWatchList state l)) = (Some l = getWatch1 state c \<or> Some l = getWatch2 state c)

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
unfolding InvariantWatchListsContainOnlyClausesFromF_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
\<forall>l c. c \<in> set (getWatchList state l) \<longrightarrow> 0 \<le> c \<and> c < length (getF state)
\<forall>l. uniq (getWatchList state l)
\<forall>c l. (c \<in> set (getWatchList state l)) = (Some l = getWatch1 state c \<or> Some l = getWatch2 state c)

goal (1 subgoal):
 1. getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
unfolding assertLiteral_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
\<forall>l c. c \<in> set (getWatchList state l) \<longrightarrow> 0 \<le> c \<and> c < length (getF state)
\<forall>l. uniq (getWatchList state l)
\<forall>c l. (c \<in> set (getWatchList state l)) = (Some l = getWatch1 state c \<or> Some l = getWatch2 state c)

goal (1 subgoal):
 1. getConflictFlag (Let (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (notifyWatches (opposite literal))) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
unfolding notifyWatches_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>InvariantWatchesEl (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> 0 \<le> c \<and> c < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); InvariantConsistent (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)); \<forall>c. c \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> Some (opposite literal) = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c \<or> Some (opposite literal) = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) c; literalFalse (opposite literal) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))); uniq (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))\<rbrakk> \<Longrightarrow> let state' = notifyWatches_loop (opposite literal) (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) [] (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) in getConflictFlag state' = (getConflictFlag (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantConsistent (getM state @ [(literal, decision)])
\<forall>l c. c \<in> set (getWatchList state l) \<longrightarrow> 0 \<le> c \<and> c < length (getF state)
\<forall>l. uniq (getWatchList state l)
\<forall>c l. (c \<in> set (getWatchList state l)) = (Some l = getWatch1 state c \<or> Some l = getWatch2 state c)

goal (1 subgoal):
 1. getConflictFlag (let state' = state\<lparr>getM := getM state @ [(literal, decision)]\<rparr> in notifyWatches_loop (opposite literal) (getWatchList state' (opposite literal)) [] state') = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
hence "getConflictFlag state \<longrightarrow> getConflictFlag ?state'"
[PROOF STATE]
proof (prove)
using this:
getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))

goal (1 subgoal):
 1. getConflictFlag state \<longrightarrow> getConflictFlag (assertLiteral literal decision state)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
getConflictFlag state \<longrightarrow> getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
proof (cases "getConflictFlag state")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
 2. \<not> getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
getConflictFlag state

goal (2 subgoals):
 1. getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
 2. \<not> getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
getConflictFlag state

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
using \<open>InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)\<close>
[PROOF STATE]
proof (prove)
using this:
getConflictFlag state
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
using assertLiteralEffect[of "state" "literal" "decision"]
[PROOF STATE]
proof (prove)
using this:
getConflictFlag state
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getM (assertLiteral literal decision state) = getM state @ [(literal, decision)]
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getF (assertLiteral literal decision state) = getF state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getSATFlag (assertLiteral literal decision state) = getSATFlag state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> isPrefix (getQ state) (getQ (assertLiteral literal decision state))

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
using \<open>getConflictFlag state \<longrightarrow> getConflictFlag ?state'\<close>
[PROOF STATE]
proof (prove)
using this:
getConflictFlag state
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getM (assertLiteral literal decision state) = getM state @ [(literal, decision)]
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getF (assertLiteral literal decision state) = getF state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getSATFlag (assertLiteral literal decision state) = getSATFlag state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> isPrefix (getQ state) (getQ (assertLiteral literal decision state))
getConflictFlag state \<longrightarrow> getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
getConflictFlag state
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getM (assertLiteral literal decision state) = getM state @ [(literal, decision)]
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getF (assertLiteral literal decision state) = getF state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getSATFlag (assertLiteral literal decision state) = getSATFlag state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> isPrefix (getQ state) (getQ (assertLiteral literal decision state))
getConflictFlag state \<longrightarrow> getConflictFlag (assertLiteral literal decision state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchesDiffer (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
unfolding InvariantConflictFlagCharacterization_def
[PROOF STATE]
proof (prove)
using this:
getConflictFlag state
getConflictFlag state = formulaFalse (getF state) (elements (getM state))
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getM (assertLiteral literal decision state) = getM state @ [(literal, decision)]
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getF (assertLiteral literal decision state) = getF state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getSATFlag (assertLiteral literal decision state) = getSATFlag state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> isPrefix (getQ state) (getQ (assertLiteral literal decision state))
getConflictFlag state \<longrightarrow> getConflictFlag (assertLiteral literal decision state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchesDiffer (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
getConflictFlag state = formulaFalse (getF state) (elements (getM state))

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in getConflictFlag state' = formulaFalse (getF state') (elements (getM state'))
[PROOF STEP]
by (auto simp add: Let_def formulaFalseAppendValuation)
[PROOF STATE]
proof (state)
this:
let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')

goal (1 subgoal):
 1. \<not> getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> getConflictFlag state

goal (1 subgoal):
 1. \<not> getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
hence "\<not> formulaFalse (getF state) (elements (getM state))"
[PROOF STATE]
proof (prove)
using this:
\<not> getConflictFlag state

goal (1 subgoal):
 1. \<not> formulaFalse (getF state) (elements (getM state))
[PROOF STEP]
using \<open>InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> getConflictFlag state
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)

goal (1 subgoal):
 1. \<not> formulaFalse (getF state) (elements (getM state))
[PROOF STEP]
unfolding InvariantConflictFlagCharacterization_def
[PROOF STATE]
proof (prove)
using this:
\<not> getConflictFlag state
getConflictFlag state = formulaFalse (getF state) (elements (getM state))

goal (1 subgoal):
 1. \<not> formulaFalse (getF state) (elements (getM state))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> formulaFalse (getF state) (elements (getM state))

goal (1 subgoal):
 1. \<not> getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
have **: "\<forall> clause. clause \<notin> set (getWatchList ?state (opposite literal)) \<and>
                          0 \<le> clause \<and> clause < length (getF ?state) \<longrightarrow>
                          \<not> clauseFalse (nth (getF ?state) clause) (elements (getM ?state))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
fix clause
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
assume "clause \<notin> set (getWatchList ?state (opposite literal))" and
          "0 \<le> clause \<and> clause < length (getF ?state)"
[PROOF STATE]
proof (state)
this:
clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))

goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
from \<open>0 \<le> clause \<and> clause < length (getF ?state)\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))
[PROOF STEP]
obtain w1::Literal and w2::Literal
          where "getWatch1 ?state clause = Some w1" and
                "getWatch2 ?state clause = Some w2" and
                "w1 el (nth (getF ?state) clause)" and
                "w2 el (nth (getF ?state) clause)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))

goal (1 subgoal):
 1. (\<And>w1 w2. \<lbrakk>getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w1; getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w2; w1 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause; w2 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)

goal (1 subgoal):
 1. (\<And>w1 w2. \<lbrakk>getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w1; getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w2; w1 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause; w2 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding InvariantWatchesEl_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))
\<forall>clause. 0 \<le> clause \<and> clause < length (getF state) \<longrightarrow> (\<exists>w1 w2. getWatch1 state clause = Some w1 \<and> getWatch2 state clause = Some w2 \<and> w1 el getF state ! clause \<and> w2 el getF state ! clause)

goal (1 subgoal):
 1. (\<And>w1 w2. \<lbrakk>getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w1; getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w2; w1 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause; w2 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w1
getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w2
w1 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause
w2 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause

goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
have "\<not> clauseFalse (nth (getF ?state) clause) (elements (getM ?state))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
from \<open>clause \<notin> set (getWatchList ?state (opposite literal))\<close>
[PROOF STATE]
proof (chain)
picking this:
clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
[PROOF STEP]
have "w1 \<noteq> opposite literal" and
               "w2 \<noteq> opposite literal"
[PROOF STATE]
proof (prove)
using this:
clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))

goal (1 subgoal):
 1. w1 \<noteq> opposite literal &&& w2 \<noteq> opposite literal
[PROOF STEP]
using \<open>InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)\<close>
[PROOF STATE]
proof (prove)
using this:
clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)

goal (1 subgoal):
 1. w1 \<noteq> opposite literal &&& w2 \<noteq> opposite literal
[PROOF STEP]
using \<open>getWatch1 ?state clause = Some w1\<close> and \<open>getWatch2 ?state clause = Some w2\<close>
[PROOF STATE]
proof (prove)
using this:
clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)
getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w1
getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w2

goal (1 subgoal):
 1. w1 \<noteq> opposite literal &&& w2 \<noteq> opposite literal
[PROOF STEP]
unfolding InvariantWatchListsCharacterization_def
[PROOF STATE]
proof (prove)
using this:
clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
\<forall>c l. (c \<in> set (getWatchList state l)) = (Some l = getWatch1 state c \<or> Some l = getWatch2 state c)
getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w1
getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause = Some w2

goal (1 subgoal):
 1. w1 \<noteq> opposite literal &&& w2 \<noteq> opposite literal
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w1 \<noteq> opposite literal
w2 \<noteq> opposite literal

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
from \<open>\<not> formulaFalse (getF state) (elements (getM state))\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> formulaFalse (getF state) (elements (getM state))
[PROOF STEP]
have "\<not> clauseFalse (nth (getF ?state) clause) (elements (getM state))"
[PROOF STATE]
proof (prove)
using this:
\<not> formulaFalse (getF state) (elements (getM state))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM state))
[PROOF STEP]
using  \<open>0 \<le> clause \<and> clause < length (getF ?state)\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> formulaFalse (getF state) (elements (getM state))
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM state))
[PROOF STEP]
by (simp add: formulaFalseIffContainsFalseClause)
[PROOF STATE]
proof (state)
this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM state))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
proof (cases "literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state)) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))

goal (2 subgoals):
 1. literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state)) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
(* Depends on the watch characterization invariant *)
[PROOF STATE]
proof (state)
this:
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))

goal (2 subgoals):
 1. literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state)) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
with \<open>InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)\<close>
[PROOF STATE]
proof (chain)
picking this:
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))
[PROOF STEP]
have $: "(\<exists> l. l el (nth (getF state) clause) \<and> literalTrue l (elements (getM state))) \<or>
                  (\<forall> l. l el (nth (getF state) clause) \<and>
                         l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
              "
[PROOF STATE]
proof (prove)
using this:
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))

goal (1 subgoal):
 1. (\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
[PROOF STEP]
using \<open>getWatch1 ?state clause = Some w1\<close>[THEN sym]
[PROOF STATE]
proof (prove)
using this:
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))
Some w1 = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause

goal (1 subgoal):
 1. (\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
[PROOF STEP]
using \<open>getWatch2 ?state clause = Some w2\<close>[THEN sym]
[PROOF STATE]
proof (prove)
using this:
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))
Some w1 = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause
Some w2 = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause

goal (1 subgoal):
 1. (\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
[PROOF STEP]
using \<open>0 \<le> clause \<and> clause < length (getF ?state)\<close>
[PROOF STATE]
proof (prove)
using this:
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))
Some w1 = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause
Some w2 = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))

goal (1 subgoal):
 1. (\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
[PROOF STEP]
unfolding InvariantWatchCharacterization_def
[PROOF STATE]
proof (prove)
using this:
\<forall>c w1 w2. 0 \<le> c \<and> c < length (getF state) \<and> Some w1 = getWatch1 state c \<and> Some w2 = getWatch2 state c \<longrightarrow> watchCharacterizationCondition w1 w2 (getM state) (getF state ! c) \<and> watchCharacterizationCondition w2 w1 (getM state) (getF state ! c)
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))
Some w1 = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause
Some w2 = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))

goal (1 subgoal):
 1. (\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
[PROOF STEP]
unfolding watchCharacterizationCondition_def
[PROOF STATE]
proof (prove)
using this:
\<forall>c w1 w2. 0 \<le> c \<and> c < length (getF state) \<and> Some w1 = getWatch1 state c \<and> Some w2 = getWatch2 state c \<longrightarrow> (literalFalse w1 (elements (getM state)) \<longrightarrow> (\<exists>l. l el getF state ! c \<and> literalTrue l (elements (getM state)) \<and> elementLevel l (getM state) \<le> elementLevel (opposite w1) (getM state)) \<or> (\<forall>l. l el getF state ! c \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)) \<and> elementLevel (opposite l) (getM state) \<le> elementLevel (opposite w1) (getM state))) \<and> (literalFalse w2 (elements (getM state)) \<longrightarrow> (\<exists>l. l el getF state ! c \<and> literalTrue l (elements (getM state)) \<and> elementLevel l (getM state) \<le> elementLevel (opposite w2) (getM state)) \<or> (\<forall>l. l el getF state ! c \<and> l \<noteq> w2 \<and> l \<noteq> w1 \<longrightarrow> literalFalse l (elements (getM state)) \<and> elementLevel (opposite l) (getM state) \<le> elementLevel (opposite w2) (getM state)))
literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))
Some w1 = getWatch1 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause
Some w2 = getWatch2 (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) clause
0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))

goal (1 subgoal):
 1. (\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))

goal (2 subgoals):
 1. literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state)) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
proof (cases "\<forall> l. l el (nth (getF state) clause) \<and>
                            l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))

goal (2 subgoals):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
have "\<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))
[PROOF STEP]
from \<open>\<not> clauseFalse (nth (getF ?state) clause) (elements (getM state))\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM state))
[PROOF STEP]
obtain l::Literal
                  where "l el (nth (getF ?state) clause)" and "\<not> literalFalse l (elements (getM state))"
[PROOF STATE]
proof (prove)
using this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM state))

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause; \<not> literalFalse l (elements (getM state))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: clauseFalseIffAllLiteralsAreFalse)
[PROOF STATE]
proof (state)
this:
l el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause
\<not> literalFalse l (elements (getM state))

goal (1 subgoal):
 1. \<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))
l el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause
\<not> literalFalse l (elements (getM state))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))
l el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause
\<not> literalFalse l (elements (getM state))

goal (1 subgoal):
 1. \<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))

goal (2 subgoals):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
hence "\<not> literalFalse w1 (elements (getM ?state)) \<or> \<not> literalFalse w2 (elements (getM ?state))"
[PROOF STATE]
proof (prove)
using this:
\<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))

goal (1 subgoal):
 1. \<not> literalFalse w1 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))) \<or> \<not> literalFalse w2 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
using \<open>w1 \<noteq> opposite literal\<close> and \<open>w2 \<noteq> opposite literal\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> literalFalse w1 (elements (getM state)) \<or> \<not> literalFalse w2 (elements (getM state))
w1 \<noteq> opposite literal
w2 \<noteq> opposite literal

goal (1 subgoal):
 1. \<not> literalFalse w1 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))) \<or> \<not> literalFalse w2 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> literalFalse w1 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))) \<or> \<not> literalFalse w2 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (2 subgoals):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
 2. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> literalFalse w1 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))) \<or> \<not> literalFalse w2 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
using \<open>w1 el (nth (getF ?state) clause)\<close> \<open>w2 el (nth (getF ?state) clause)\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> literalFalse w1 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))) \<or> \<not> literalFalse w2 (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
w1 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause
w2 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by (auto simp add: clauseFalseIffAllLiteralsAreFalse)
[PROOF STATE]
proof (state)
this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))

goal (1 subgoal):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
[PROOF STEP]
obtain l::Literal
              where "l el (nth (getF state) clause)" and "literalTrue l (elements (getM state))"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l el getF state ! clause; literalTrue l (elements (getM state))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using $
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))
(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>l el getF state ! clause; literalTrue l (elements (getM state))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l el getF state ! clause
literalTrue l (elements (getM state))

goal (1 subgoal):
 1. \<lbrakk>(\<exists>l. l el getF state ! clause \<and> literalTrue l (elements (getM state))) \<or> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state))); \<not> (\<forall>l. l el getF state ! clause \<and> l \<noteq> w1 \<and> l \<noteq> w2 \<longrightarrow> literalFalse l (elements (getM state)))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
l el getF state ! clause
literalTrue l (elements (getM state))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
using \<open>InvariantConsistent ((getM state) @ [(literal, decision)])\<close>
[PROOF STATE]
proof (prove)
using this:
l el getF state ! clause
literalTrue l (elements (getM state))
InvariantConsistent (getM state @ [(literal, decision)])

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
unfolding InvariantConsistent_def
[PROOF STATE]
proof (prove)
using this:
l el getF state ! clause
literalTrue l (elements (getM state))
consistent (elements (getM state @ [(literal, decision)]))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by (auto simp add: clauseFalseIffAllLiteralsAreFalse inconsistentCharacterization)
[PROOF STATE]
proof (state)
this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state)))

goal (1 subgoal):
 1. \<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state))) \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state)))

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
using \<open>w1 el (nth (getF ?state) clause)\<close> and
                \<open>w1 \<noteq> opposite literal\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (literalFalse w1 (elements (getM state)) \<or> literalFalse w2 (elements (getM state)))
w1 el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause
w1 \<noteq> opposite literal

goal (1 subgoal):
 1. \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by (auto simp add: clauseFalseIffAllLiteralsAreFalse)
[PROOF STATE]
proof (state)
this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?clause2 \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)); 0 \<le> ?clause2 \<and> ?clause2 < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! ?clause2) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?clause2 \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)); 0 \<le> ?clause2 \<and> ?clause2 < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>))\<rbrakk> \<Longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! ?clause2) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<not> getConflictFlag state \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
proof (cases "getConflictFlag ?state'")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
 2. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
getConflictFlag (assertLiteral literal decision state)

goal (2 subgoals):
 1. getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
 2. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
from \<open>\<not> getConflictFlag state\<close> \<open>getConflictFlag ?state'\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> getConflictFlag state
getConflictFlag (assertLiteral literal decision state)
[PROOF STEP]
obtain clause::nat
        where
        "clause \<in> set (getWatchList ?state (opposite literal))" and
         "clauseFalse (nth (getF ?state) clause) (elements (getM ?state))"
[PROOF STATE]
proof (prove)
using this:
\<not> getConflictFlag state
getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. (\<And>clause. \<lbrakk>clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)); clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<not> getConflictFlag state
getConflictFlag (assertLiteral literal decision state)
getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))

goal (1 subgoal):
 1. (\<And>clause. \<lbrakk>clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)); clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (2 subgoals):
 1. getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
 2. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
from \<open>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)\<close>
        \<open>clause \<in> set (getWatchList ?state (opposite literal))\<close>
[PROOF STATE]
proof (chain)
picking this:
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
[PROOF STEP]
have "(nth (getF ?state) clause) el (getF ?state)"
[PROOF STATE]
proof (prove)
using this:
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))

goal (1 subgoal):
 1. getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)
[PROOF STEP]
unfolding InvariantWatchListsContainOnlyClausesFromF_def
[PROOF STATE]
proof (prove)
using this:
\<forall>l c. c \<in> set (getWatchList state l) \<longrightarrow> 0 \<le> c \<and> c < length (getF state)
clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))

goal (1 subgoal):
 1. getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)
[PROOF STEP]
using nth_mem
[PROOF STATE]
proof (prove)
using this:
\<forall>l c. c \<in> set (getWatchList state l) \<longrightarrow> 0 \<le> c \<and> c < length (getF state)
clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal))
?n < length ?xs \<Longrightarrow> ?xs ! ?n \<in> set ?xs

goal (1 subgoal):
 1. getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)

goal (2 subgoals):
 1. getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
 2. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
with \<open>clauseFalse (nth (getF ?state) clause) (elements (getM ?state))\<close>
[PROOF STATE]
proof (chain)
picking this:
clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)
[PROOF STEP]
have "formulaFalse (getF ?state) (elements (getM ?state))"
[PROOF STATE]
proof (prove)
using this:
clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause el getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)

goal (1 subgoal):
 1. formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by (auto simp add: Let_def formulaFalseIffContainsFalseClause)
[PROOF STATE]
proof (state)
this:
formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (2 subgoals):
 1. getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
 2. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
using \<open>\<not> getConflictFlag state\<close> \<open>getConflictFlag ?state'\<close>
[PROOF STATE]
proof (prove)
using this:
formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<not> getConflictFlag state
getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
unfolding InvariantConflictFlagCharacterization_def
[PROOF STATE]
proof (prove)
using this:
formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<not> getConflictFlag state
getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in getConflictFlag state' = formulaFalse (getF state') (elements (getM state'))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<not> getConflictFlag state
getConflictFlag (assertLiteral literal decision state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchesDiffer (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in getConflictFlag state' = formulaFalse (getF state') (elements (getM state'))
[PROOF STEP]
using assertLiteralEffect[of "state" "literal" "decision"]
[PROOF STATE]
proof (prove)
using this:
formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<not> getConflictFlag state
getConflictFlag (assertLiteral literal decision state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchesDiffer (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getM (assertLiteral literal decision state) = getM state @ [(literal, decision)]
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getF (assertLiteral literal decision state) = getF state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> getSATFlag (assertLiteral literal decision state) = getSATFlag state
\<lbrakk>InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state); InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)\<rbrakk> \<Longrightarrow> isPrefix (getQ state) (getQ (assertLiteral literal decision state))

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in getConflictFlag state' = formulaFalse (getF state') (elements (getM state'))
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')

goal (1 subgoal):
 1. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
hence "\<forall> clause::nat. clause \<in> set (getWatchList ?state (opposite literal)) \<longrightarrow>
        \<not> clauseFalse (nth (getF ?state) clause) (elements (getM ?state))"
[PROOF STATE]
proof (prove)
using this:
\<not> getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. \<forall>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<not> getConflictFlag (assertLiteral literal decision state)
getConflictFlag (assertLiteral literal decision state) = (getConflictFlag state \<or> (\<exists>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))))

goal (1 subgoal):
 1. \<forall>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
with **
[PROOF STATE]
proof (chain)
picking this:
\<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<forall>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
have "\<forall> clause. 0 \<le> clause \<and> clause < length (getF ?state) \<longrightarrow>
                          \<not> clauseFalse (nth (getF ?state) clause) (elements (getM ?state))"
[PROOF STATE]
proof (prove)
using this:
\<forall>clause. clause \<notin> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<and> 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<forall>clause. clause \<in> set (getWatchList (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) (opposite literal)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<forall>clause. 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>clause. 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
hence "\<not> formulaFalse (getF ?state) (elements (getM ?state))"
[PROOF STATE]
proof (prove)
using this:
\<forall>clause. 0 \<le> clause \<and> clause < length (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) \<longrightarrow> \<not> clauseFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>) ! clause) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<not> formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
[PROOF STEP]
by (auto simp add:set_conv_nth formulaFalseIffContainsFalseClause)
[PROOF STATE]
proof (state)
this:
\<not> formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. \<not> getConflictFlag (assertLiteral literal decision state) \<Longrightarrow> let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
using \<open>\<not> getConflictFlag state\<close> \<open>\<not> getConflictFlag ?state'\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<not> getConflictFlag state
\<not> getConflictFlag (assertLiteral literal decision state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<not> getConflictFlag state
\<not> getConflictFlag (assertLiteral literal decision state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchesDiffer (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
InvariantConflictFlagCharacterization (getConflictFlag state) (getF state) (getM state)

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')
[PROOF STEP]
unfolding InvariantConflictFlagCharacterization_def
[PROOF STATE]
proof (prove)
using this:
\<not> formulaFalse (getF (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)) (elements (getM (state\<lparr>getM := getM state @ [(literal, decision)]\<rparr>)))
\<not> getConflictFlag state
\<not> getConflictFlag (assertLiteral literal decision state)
InvariantConsistent (getM state @ [(literal, decision)])
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchesDiffer (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchListsContainOnlyClausesFromF (getWatchList state) (getF state)
InvariantWatchListsUniq (getWatchList state)
InvariantWatchListsCharacterization (getWatchList state) (getWatch1 state) (getWatch2 state)
InvariantWatchesEl (getF state) (getWatch1 state) (getWatch2 state)
InvariantWatchCharacterization (getF state) (getWatch1 state) (getWatch2 state) (getM state)
getConflictFlag state = formulaFalse (getF state) (elements (getM state))

goal (1 subgoal):
 1. let state' = assertLiteral literal decision state in getConflictFlag state' = formulaFalse (getF state') (elements (getM state'))
[PROOF STEP]
by (auto simp add: Let_def assertLiteralEffect)
[PROOF STATE]
proof (state)
this:
let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
let state' = assertLiteral literal decision state in InvariantConflictFlagCharacterization (getConflictFlag state') (getF state') (getM state')

goal:
No subgoals!
[PROOF STEP]
qed