@@ -92,19 +92,6 @@ theorem groundResolution_soundness {A : Atom sig Empty} {C D : Clause sig Empty}
9292
9393/- ### 3.10 General Resolution -/
9494
95- -- TODO: do we need to add that freeVars ∩ freeVars = ∅?
96- @[simp]
97- def GeneralResolutionRule [inst : DecidableEq X] (A B : Atom sig X) (C D : Clause sig X)
98- (σ : Substitution sig X) :
99- Inference sig X :=
100- ⟨{.neg A :: C, .pos B :: D}, (C ++ D).substitute σ, MostGeneralUnifier [(A, B)] σ⟩
101-
102- @[simp]
103- def GeneralFactorizationRule [inst : DecidableEq X] (A B : Atom sig X) (C : Clause sig X)
104- (σ : Substitution sig X) :
105- Inference sig X :=
106- ⟨{.pos A :: .pos B :: C}, Clause.substitute σ (.pos A :: C), MostGeneralUnifier [(A, B)] σ⟩
107-
10895lemma validclosed_of_valid [DecidableEq X] {C: Clause sig X} {I : Interpretation sig univ} :
10996 ValidIn C.toFormula I → ValidIn C.toClosedFormula I := by
11097 intro heval
@@ -114,6 +101,7 @@ lemma validclosed_of_valid [DecidableEq X] {C: Clause sig X} {I : Interpretation
114101 have := (@three_three_seven sig X univ _ n C I xs hxsnodup rfl).mpr
115102 exact fun β => this heval β
116103
104+ /- Direct formalization of Proposition 3.10.14 -/
117105theorem generalResolutionRuleSound [DecidableEq X] (A B : Atom sig X) (C D : Clause sig X)
118106 (σ : Substitution sig X) (hmgu : MostGeneralUnifier [(A, B)] σ) :
119107 @Entails _ _ univ _
@@ -144,7 +132,8 @@ theorem generalResolutionRuleSound [DecidableEq X] (A B : Atom sig X) (C D : Cla
144132
145133 let leftys : List X := (leftinner.substitute σ).freeVarsList
146134 let leftm : ℕ := leftys.length
147- have hleftysnodup : leftys.Nodup := by exact nodup_clauseFreeVarsList sig X (Clause.substitute σ leftinner)
135+ have hleftysnodup : leftys.Nodup := by
136+ exact nodup_clauseFreeVarsList sig X (Clause.substitute σ leftinner)
148137
149138 have hleft338 := @three_three_eight univ sig X _
150139 leftinner I σ leftn leftm leftxs leftys hleftxsnodup rfl hleftysnodup rfl hleftvalid
@@ -164,14 +153,14 @@ theorem generalResolutionRuleSound [DecidableEq X] (A B : Atom sig X) (C D : Cla
164153
165154 -- use 3.3.7
166155 have hleftinnersub : @ValidIn _ X _ _ (leftinner.substitute σ) I := by
167- exact (three_three_seven leftys.length (Clause.toFormula sig X (Clause.substitute σ leftinner)) I
168- leftys hleftysnodup rfl).mp
169- hleft338
156+ exact (three_three_seven leftys.length
157+ (Clause.toFormula sig X (Clause.substitute σ leftinner)) I leftys hleftysnodup rfl).mp
158+ hleft338
170159
171160 have hrightinnersub : @ValidIn _ X _ _ (rightinner.substitute σ) I := by
172- exact (three_three_seven rightys.length (Clause.toFormula sig X (Clause.substitute σ rightinner)) I
173- rightys hrightysnodup rfl).mp
174- hright338
161+ exact (three_three_seven rightys.length
162+ (Clause.toFormula sig X (Clause.substitute σ rightinner)) I rightys hrightysnodup rfl).mp
163+ hright338
175164
176165 have hDσ_of_negBσ : ∀ β : Assignment X univ, ¬Atom.eval I β (B.substitute σ) →
177166 Formula.eval I β (D.substitute σ) := by
@@ -228,38 +217,3 @@ theorem generalResolutionRuleSound [DecidableEq X] (A B : Atom sig X) (C D : Cla
228217 aesop
229218
230219 exact validclosed_of_valid hCDσ β
231-
232- theorem generalResolution_soundness [inst : DecidableEq X] {A B : Atom sig X} {C D : Clause sig X}
233- {σ : Substitution sig X} :
234- @Soundness _ _ univ _ ([GeneralResolutionRule A B C D σ, GeneralFactorizationRule A B C σ]):= by
235- rw [Soundness]
236- intro rule h_rule_general hcond I
237-
238- intro β h_premise_true
239- simp_all only [GeneralResolutionRule, Clause, List.append_eq, GeneralFactorizationRule]
240- rw [List.mem_cons, List.mem_singleton] at h_rule_general
241- cases h_rule_general
242- -- proof of resolution rule
243- next h_res_rule =>
244- subst h_res_rule
245- simp only [GeneralResolutionRule] at h_premise_true
246- simp_all only [Clause, GeneralResolutionRule, List.append_eq, Substitution.eq_1,
247- MostGeneralUnifier, Unifier, Equality.eq_1, EqualityProblem.eq_1, List.mem_singleton,
248- forall_eq, MoreGeneral, Set.mem_insert_iff, Set.mem_singleton_iff,
249- EntailsInterpret, forall_eq_or_imp]
250- rcases hcond with ⟨hunif, hmgu⟩
251- repeat rw [← EntailsInterpret] at h_premise_true
252- clear hmgu
253- rw [eval_append_iff_eval_or_subst, Formula.eval]
254- obtain ⟨first, second⟩ := h_premise_true
255- have hclosed : Formula.closed (Clause.toFormula sig X (Literal.neg A :: C)) := sorry
256- have hclosed₂ : Formula.closed (Clause.toFormula sig X (Literal.pos B :: D)) := sorry
257- have s := validIn_of_entails_closed I _ hclosed (by use β)
258- have t := validIn_of_entails_closed I _ hclosed₂ (by use β)
259- apply valid_sub_of_valid _ σ at s
260- apply valid_sub_of_valid _ σ at t
261- specialize s β
262- specialize t β
263- aesop
264- next h_fact_rule =>
265- sorry
0 commit comments