Formalization of FO resolution definition applicable C 1 C 2 L 1 L 2 σ ⟷ C 1 ≠ {} ∧ C 2 ≠ {} ∧ L 1 ≠ {} ∧ L 2 ≠ {} ∧ vars C 1 ∩ vars C 2 = {} ∧ L 1 ⊆ C 1 ∧ L 2 ⊆ C 2 C )" ∧ mgu σ (L 1 ∪ L 2 definition resolution C 1 C 2 L 1 L 2 σ = ((C 1 - L 1 ) ∪ (C 2 - L 2 )) ⋅ σ DTU Compute, Technical University of Denmark 17
Formalization of FO resolution definition applicable C 1 C 2 L 1 L 2 σ ⟷ C 1 ≠ {} ∧ C 2 ≠ {} ∧ L 1 ≠ {} ∧ L 2 ≠ {} ∧ vars C 1 ∩ vars C 2 = {} ∧ L 1 ⊆ C 1 ∧ L 2 ⊆ C 2 C )" ∧ mgu σ (L 1 ∪ L 2 definition resolution C 1 C 2 L 1 L 2 σ = ((C 1 - L 1 ) ∪ (C 2 - L 2 )) ⋅ σ inductive resolution_step :: fterm clause set ⇒ fterm clause set ⇒ bool where resolution_rule: C 1 ∈ Cs ⟹ C 2 ∈ Cs ⟹ applicable C 1 C 2 L 1 L 2 σ ⟹ resolution_step Cs (Cs ∪ {resolution C 1 C 2 L 1 L 2 σ }) | standardize_apart: C ∈ Cs ⟹ var_renaming_of C C' ⟹ resolution_step Cs (Cs ∪ {C'}) DTU Compute, Technical University of Denmark 17
Formalization of FO resolution definition applicable C 1 C 2 L 1 L 2 σ ⟷ C 1 ≠ {} ∧ C 2 ≠ {} ∧ L 1 ≠ {} ∧ L 2 ≠ {} ∧ vars C 1 ∩ vars C 2 = {} ∧ L 1 ⊆ C 1 ∧ L 2 ⊆ C 2 C )" ∧ mgu σ (L 1 ∪ L 2 definition resolution C 1 C 2 L 1 L 2 σ = ((C 1 - L 1 ) ∪ (C 2 - L 2 )) ⋅ σ inductive resolution_step :: fterm clause set ⇒ fterm clause set ⇒ bool where resolution_rule: C 1 ∈ Cs ⟹ C 2 ∈ Cs ⟹ applicable C 1 C 2 L 1 L 2 σ ⟹ resolution_step Cs (Cs ∪ {resolution C 1 C 2 L 1 L 2 σ }) | standardize_apart: C ∈ Cs ⟹ var_renaming_of C C' ⟹ resolution_step Cs (Cs ∪ {C'}) definition resolution_deriv = rtranclp resolution_step DTU Compute, Technical University of Denmark 17
Refutational completeness DTU Compute, Technical University of Denmark 18
Refutational completeness Refutational completeness: If C is unsatisfiable then the calculus can derive a contradiction DTU Compute, Technical University of Denmark 18
Refutational completeness Refutational completeness: If C is unsatisfiable then the calculus can derive a contradiction unsatisfiable C ⟹ (C ⊢ {}) DTU Compute, Technical University of Denmark 18
Semantic tree DTU Compute, Technical University of Denmark 19
Semantic tree Enumeration of ground terms: p, q, r(c), … DTU Compute, Technical University of Denmark 19
Semantic tree Enumeration of ground terms: p, q, r(c), … DTU Compute, Technical University of Denmark 19
Semantic tree Enumeration of ground terms: p, q, r(c), … Semantic trees are decision trees assigning True and False to the ground atoms. DTU Compute, Technical University of Denmark 19
Semantic tree Enumeration of ground terms: p, q, r(c), … Semantic trees are decision trees assigning True and False to the ground atoms. Node on depth i makes decision for atom i . DTU Compute, Technical University of Denmark 19
Semantic tree A path represents a partial (Herbrand) interpretation. E.g. {p ↦ T , q ↦ F , r(c) ↦ F } DTU Compute, Technical University of Denmark 20
Formalized enumeration DTU Compute, Technical University of Denmark 21
Formalized enumeration definition nat_from_hatom :: hterm atom ⇒ nat where nat_from_hatom ≡ (SOME f. bij f) DTU Compute, Technical University of Denmark 21
Formalized enumeration definition nat_from_hatom :: hterm atom ⇒ nat where nat_from_hatom ≡ (SOME f. bij f) instantiation hterm :: countable begin instance by countable_datatype end DTU Compute, Technical University of Denmark 21
Formalized enumeration definition nat_from_hatom :: hterm atom ⇒ nat where nat_from_hatom ≡ (SOME f. bij f) instantiation hterm :: countable begin instance by countable_datatype end lemma infinite_hatoms: infinite (UNIV :: 't atom set) <proof> DTU Compute, Technical University of Denmark 21
Formalized enumeration definition nat_from_hatom :: hterm atom ⇒ nat where nat_from_hatom ≡ (SOME f. bij f) instantiation hterm :: countable begin instance by countable_datatype end lemma infinite_hatoms: infinite (UNIV :: 't atom set) <proof> lemma nat_from_hatom_bij: bij nat_from_hatom proof - have countable (UNIV :: hterm atom set) by simp moreover have infinite (UNIV :: hterm atom set) using infinite_hatoms by auto ultimately obtain x where bij (x :: hterm atom ⇒ nat) using countableE_infinite by blast then show ?thesis using … someI by metis qed DTU Compute, Technical University of Denmark 21
Formalized enumeration definition nat_from_hatom :: hterm atom ⇒ nat where nat_from_hatom ≡ (SOME f. bij f) instantiation hterm :: countable begin instance by countable_datatype end lemma infinite_hatoms: infinite (UNIV :: 't atom set) <proof> lemma nat_from_hatom_bij: bij nat_from_hatom proof - have countable (UNIV :: hterm atom set) by simp moreover have infinite (UNIV :: hterm atom set) using infinite_hatoms by auto ultimately obtain x where bij (x :: hterm atom ⇒ nat) using countableE_infinite by blast then show ?thesis using … someI by metis qed DTU Compute, Technical University of Denmark 21
Formalized semantic trees DTU Compute, Technical University of Denmark 22
Formalized semantic trees Finite trees: datatype tree = Leaf | Branching tree tree DTU Compute, Technical University of Denmark 22
Formalized semantic trees Finite trees: datatype tree = Leaf | Branching tree tree Paths: type_synonym path = bool list DTU Compute, Technical University of Denmark 22
Formalized semantic trees Finite trees: datatype tree = Leaf | Branching tree tree Paths: type_synonym path = bool list Possibly infinite trees: type_synonym inftree = path set abbreviation wf_tree :: path set ⇒ bool where wf_tree T ≡ ( ∀ ds d. (ds @ d) ∈ T ⟶ ds ∈ T) DTU Compute, Technical University of Denmark 22
Falsification by partial interpretation DTU Compute, Technical University of Denmark 23
Falsification by partial interpretation Falsification of ground clause: {p ↦ T , q ↦ F , r(c) ↦ T } falsifies {q,¬r(c)} DTU Compute, Technical University of Denmark 23
Falsification by partial interpretation Falsification of ground clause: {p ↦ T , q ↦ F , r(c) ↦ T } falsifies {q,¬r(c)} abbreviation falsifies g :: path ⇒ fterm clause ⇒ bool where falsifies g G C ≡ ground C ∧ ( ∀ l ∈ C. falsifies G l) DTU Compute, Technical University of Denmark 23
Falsification by partial interpretation Falsification of ground clause: {p ↦ T , q ↦ F , r(c) ↦ T } falsifies {q,¬r(c)} abbreviation falsifies g :: path ⇒ fterm clause ⇒ bool where falsifies g G C ≡ ground C ∧ ( ∀ l ∈ C. falsifies G l) Falsification of FO clause: {p ↦ T , q ↦ F , r(c) ↦ T } falsifies {q,¬r( x )} DTU Compute, Technical University of Denmark 23
Falsification by partial interpretation Falsification of ground clause: {p ↦ T , q ↦ F , r(c) ↦ T } falsifies {q,¬r(c)} abbreviation falsifies g :: path ⇒ fterm clause ⇒ bool where falsifies g G C ≡ ground C ∧ ( ∀ l ∈ C. falsifies G l) Falsification of FO clause: {p ↦ T , q ↦ F , r(c) ↦ T } falsifies {q,¬r( x )} abbreviation falsifies :: path ⇒ fterm clause ⇒ bool where falsifies G C ≡ ( ∃ C'. instance_of C' C ∧ falsifies g G C') DTU Compute, Technical University of Denmark 23
Closed semantic tree Definition of closed semantic tree: All branches falsify a ground instance of a clause in Cs DTU Compute, Technical University of Denmark 24
Closed semantic tree Definition of closed semantic tree: Definition of closed semantic tree: All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } p ↦ T p ↦ F q ↦ T q ↦ F r(c) ↦ T r(c) ↦ F DTU Compute, Technical University of Denmark 24
Closed semantic tree Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } p ↦ T p ↦ T p ↦ F p ↦ F {p ↦ T , q ↦ T } q ↦ T q ↦ T q ↦ F q ↦ F falsifies {¬q,¬p} r(c) ↦ T r(c) ↦ T r(c) ↦ F r(c) ↦ F DTU Compute, Technical University of Denmark 24
Closed semantic tree Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } p ↦ T p ↦ T p ↦ T p ↦ F p ↦ F p ↦ F {p ↦ T , q ↦ F , r(c) ↦ T } falsifies {p ↦ T , q ↦ T } q ↦ T q ↦ T q ↦ T q ↦ F q ↦ F q ↦ F {¬p,q,¬r(c)} falsifies ground instance of {¬q,¬p} r(c) ↦ T r(c) ↦ T r(c) ↦ T r(c) ↦ F r(c) ↦ F r(c) ↦ F {¬p,q,¬r( y )} DTU Compute, Technical University of Denmark 24
Closed semantic tree Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } p ↦ T p ↦ T p ↦ T p ↦ T p ↦ F p ↦ F p ↦ F p ↦ F {p ↦ T , q ↦ F , r(c) ↦ T } {p ↦ T , q ↦ F , r(c) ↦ T } falsifies falsifies {p ↦ T , q ↦ T } q ↦ T q ↦ T q ↦ T q ↦ T q ↦ F q ↦ F q ↦ F q ↦ F {¬p,q,¬r(c)} {r(c)} falsifies ground instance of ground instance of {¬q,¬p} r(c) ↦ T r(c) ↦ T r(c) ↦ T r(c) ↦ T r(c) ↦ F r(c) ↦ F r(c) ↦ F r(c) ↦ F {¬p,q,¬r( y )} {r( x )} DTU Compute, Technical University of Denmark 24
Closed semantic tree Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: Definition of closed semantic tree: All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs All branches falsify a ground instance of a clause in Cs Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } Cs = { {¬q,¬p}, {r( x )}, {¬p,q,¬r( y )}, {p} } p ↦ T p ↦ F p ↦ T p ↦ T p ↦ T p ↦ T p ↦ F p ↦ F p ↦ F p ↦ F {p ↦ T , q ↦ F , r(c) ↦ T } {p ↦ T , q ↦ F , r(c) ↦ T } {p ↦ F } falsifies falsifies {p ↦ T , q ↦ T } q ↦ T q ↦ T q ↦ T q ↦ T q ↦ T q ↦ F q ↦ F q ↦ F q ↦ F q ↦ F falsifies {¬p,q,¬r(c)} {r(c)} falsifies {p} ground instance of ground instance of {¬q,¬p} r(c) ↦ T r(c) ↦ F r(c) ↦ T r(c) ↦ T r(c) ↦ T r(c) ↦ T r(c) ↦ F r(c) ↦ F r(c) ↦ F r(c) ↦ F {¬p,q,¬r( y )} {r( x )} DTU Compute, Technical University of Denmark 24
Completeness proof 1. Herbrand’s theorem: Any unsatisfiable set of clauses has a finite closed semantic tree. 2. {} is derivable from any set of clauses with a closed semantic tree. The proof follows Chang & Lee (1973). DTU Compute, Technical University of Denmark 25
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} Herbrand’s theorem: Any unsatisfiable set of clauses Cs has a finite closed semantic tree. Proof: Let T be a full infinite semantic tree. Consider any infinite p path in T . p is an interpretation and thus falsifies Cs . A (finite) prefix also falsifies Cs . Let T’ be a copy of T with all paths replaced with finite falsifying prefixes. T’ is finite by König’s lemma. DTU Compute, Technical University of Denmark 26
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} Herbrand’s theorem: Any unsatisfiable set of clauses Cs has a finite closed semantic tree. p is an interpretation? Proof: A path is a list of bools. An interpretation is a Let T be a full infinite semantic tree. fun_sym ⇒ 'u list ⇒ 'u Consider any infinite p path in T . and a p is an interpretation and thus falsifies Cs . pred_sym ⇒ 'u list ⇒ bool A (finite) prefix also falsifies Cs . Let T’ be a copy of T with all paths replaced with finite falsifying prefixes. T’ is finite by König’s lemma. DTU Compute, Technical University of Denmark 26
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} Herbrand’s theorem: Any unsatisfiable set of clauses Cs has a finite closed semantic tree. p is an interpretation? Proof: A path is a list of bools. An interpretation is a Let T be a full infinite semantic tree. fun_sym ⇒ 'u list ⇒ 'u Consider any infinite p path in T . and a p is an interpretation and thus falsifies Cs . pred_sym ⇒ 'u list ⇒ bool A (finite) prefix also falsifies Cs . Let T’ be a copy of T with all paths replaced with Yes, we can make a finite falsifying prefixes. conversion function T’ is finite by König’s lemma. extend. DTU Compute, Technical University of Denmark 26
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} Herbrand’s theorem: Any unsatisfiable set of clauses Cs has a finite closed semantic tree. Proof: Let T be a full infinite semantic tree. Consider any infinite p path in T . p is an interpretation and thus falsifies Cs . Does it? A (finite) prefix also falsifies Cs . Let T’ be a copy of T with all paths replaced with finite falsifying prefixes. T’ is finite by König’s lemma. DTU Compute, Technical University of Denmark 26
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} If an infinite path falsifies a set of clauses, then so does a finite prefix. FO clause set Cs falsified by Interpretation extend p ⟹ Cs falsified by Partial prefix of p interpretation DTU Compute, Technical University of Denmark 27
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} If an infinite path falsifies a set of clauses, then so does a finite prefix. FO clause set Ground clause set Cs falsified by Interpretation extend p ⟹ Cs falsified by Partial prefix of p interpretation DTU Compute, Technical University of Denmark 27
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} If an infinite path falsifies a set of clauses, then so does a finite prefix. FO clause set Ground clause set Cs ʹ falsified by Cs falsified by Interpretation extend p extend p ⟹ Cs falsified by Partial prefix of p interpretation DTU Compute, Technical University of Denmark 27
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} If an infinite path falsifies a set of clauses, then so does a finite prefix. FO clause set Ground clause set ⟹ Cs ʹ falsified by Cs falsified by Interpretation extend p extend p ⟹ Cs falsified by Partial prefix of p interpretation DTU Compute, Technical University of Denmark 27
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} If an infinite path falsifies a set of clauses, then so does a finite prefix. FO clause set Ground clause set ⟹ Cs ʹ falsified by Cs falsified by Interpretation extend p extend p ⟹ Cs ʹ falsified by Cs falsified by Partial prefix of p prefix of p interpretation DTU Compute, Technical University of Denmark 27
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} If an infinite path falsifies a set of clauses, then so does a finite prefix. FO clause set Ground clause set ⟹ Cs ʹ falsified by Cs falsified by Interpretation extend p extend p ⟹ ⟹ Cs ʹ falsified by Cs falsified by Partial prefix of p prefix of p interpretation DTU Compute, Technical University of Denmark 27
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} If an infinite path falsifies a set of clauses, then so does a finite prefix. FO clause set Ground clause set Cs ʹ falsified by Cs falsified by Interpretation ⟹ extend p extend p ⟹ ⟹ Cs ʹ falsified by Cs falsified by Partial ⟹ prefix of p prefix of p interpretation DTU Compute, Technical University of Denmark 27
Completeness proof ↳ 1. Herbrand’s theorem 2. Deriving {} DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 C DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 C DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs ⋃ { C } q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 C DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs ⋃ { C } q ↦ F DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs ⋃ { C } q ↦ F DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs ⋃ { C } q ↦ F DTU Compute, Technical University of Denmark 28
Completeness proof 1. Herbrand’s theorem ↳ 2. Deriving {} Eventually the empty tree is closed for our Cs . Then we have derived {} . DTU Compute, Technical University of Denmark 29
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 C DTU Compute, Technical University of Denmark 30
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 DTU Compute, Technical University of Denmark 30
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 instance of C 1 ʹ C 2 ʹ DTU Compute, Technical University of Denmark 30
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies C 1 C 2 instance of C 1 ʹ C 2 ʹ C ʹ DTU Compute, Technical University of Denmark 30
Completeness proof 1. Herbrand’s theorem 1. Herbrand’s theorem ↳ 2. Deriving {} 2. Deriving {} closed semantic tree for Cs q ↦ F r(c) ↦ T r(c) ↦ F falsifies falsifies C 1 C 2 instance of C 1 ʹ C 2 ʹ by arguments about enumeration C ʹ DTU Compute, Technical University of Denmark 30
Recommend
More recommend