910 likes | 1.05k Views
Matrices, connections, matings and reasoning: The connection method. Fred Freitas Centro de Informática, UFPE, Brazil KR & KM Group, Universität Mannheim, Germany Seminar presented at the KI Colloquium, Mannheim, in Jan.22.2010. Summary. Matrices and Normal Forms in ATP Proofs in Matrices
E N D
Matrices, connections, matings and reasoning: The connection method Fred Freitas Centro de Informática, UFPE, Brazil KR & KM Group, Universität Mannheim, Germany Seminar presented at the KI Colloquium, Mannheim, in Jan.22.2010
Summary • Matrices and Normal Forms in ATP • Proofs in Matrices • The Connection Method • Extension Procedure, General Extension Procedure • Comparison with Other Methods • Tableaux, Consolution, Resolution, Model Elimination • Quick view on Improvements & Variants • Conclusions & Future Work
Summary • Matrices and Normal Forms in ATP • Proofs in Matrices • The Connection Method • Extension Procedure, General Extension Procedure • Comparison with Other Methods • Tableaux, Consolution, Resolution, Model Elimination • Quick view on Improvements & Variants • Conclusions & Future Work
Matrices and ATP • Prawitz [1960, 1970] proposed the use of matrices to express logical formulae • Proving is path verification • Example in DNF: F: (¬P ^ Q ^ R) v (¬Q ^ ¬R) v (P ^ Q)
Matrices and ATP • Prawitz [1960, 1970] proposed the use of matrices to express logical formulae • Proving is path verification • Example in DNF: F: (¬P ^ Q ^ R) v (¬Q ^ ¬R) v (P ^ Q) • Same formula negated, in CNF, to be used in refutation proofs: ¬F: (P v ¬Q v ¬R) ^ (Q v R) ^ (¬P v ¬Q)
Matrices and ATP • Prawitz [1960, 1970] proposed the use of matrices to express logical formulae • Proving is path verification • Example in DNF: F: (¬P ^ Q ^ R) v (¬Q ^ ¬R) v (P ^ Q) • Same formula negated, in CNF, to be used in refutation proofs: ¬F: (P v ¬Q v ¬R) ^ (Q v R) ^ (¬P v ¬Q) ¬P ¬Q P P ¬Q ¬R FDNF: Q ¬R Q ¬ FCNF : Q R R ¬P ¬Q
Example of Horn Formula • FDNF : P v (¬P ^ Q) v (¬Q ^ R) v ¬R • FDNF : P ¬P ¬Q ¬R Q R • ¬FCNF : ¬P P ¬Q Q ¬R R
Changing the Perspective… • FDNF : P v (¬P ^ Q) v (¬Q ^ R) v ¬R • Vertically : P ¬P ¬Q ¬R Q R • And horizontally?
Changing the Perspective… • FDNF : P v (¬P ^ Q) v (¬Q ^ R) v ¬R • Vertically : P ¬P ¬Q ¬R Q R • And horizontally? • Paths! • {P, ¬P, ¬Q, ¬R} • {P, ¬P, R, ¬R} • {P, Q, ¬Q, ¬R} • {P, Q, R, ¬R} • What do they mean w.r.t. to the original DNF formula?
The Set of Paths are • The set of paths is the formula in CNF! See: • FDNF : P v (¬P ^ Q) v (¬Q ^ R) v ¬R • {P, ¬P, ¬Q, ¬R} • {P, ¬P, R, ¬R} P ¬P ¬Q ¬R • {P, Q, ¬Q, ¬R} Q R • {P, Q, R, ¬R}
The Set of Paths are • The set of paths is the formula in CNF! See: • FDNF : P v (¬P ^ Q) v (¬Q ^ R) v ¬R • {P, ¬P, ¬Q, ¬R} • {P, ¬P, R, ¬R} P ¬P ¬Q ¬R • {P, Q, ¬Q, ¬R} Q R • {P, Q, R, ¬R} • FCNF(not negated!) : • (P v ¬P v ¬Q v ¬R) ^ • (P v ¬P v R v ¬R) ^ • (P v Q v ¬Q v ¬R) ^ • (P v Q v R v ¬R)
The Set of Paths are • The set of paths is the formula in CNF! See: • FDNF : P v (¬P ^ Q) v (¬Q ^ R) v ¬R • {P, ¬P, ¬Q, ¬R} • {P, ¬P, R, ¬R} P ¬P ¬Q ¬R • {P, Q, ¬Q, ¬R} Q R • {P, Q, R, ¬R} • FCNF(not negated!) : • (P v ¬P v ¬Q v ¬R) ^ • (P v ¬P v R v ¬R) ^ • (P v Q v ¬Q v ¬R) ^ • (P v Q v R v ¬R) How to prove it valid then?
Summary • Matrices and Normal Forms in ATP • Proofs in Matrices • The Connection Method • Extension Procedure, General Extension Procedure • Comparison with Other Methods • Tableaux, Consolution, Resolution, Model Elimination • Quick view on Improvements & Variants • Conclusions & Future Work
Validity in DNF Matrices • ╞ P ¬P ¬Q ¬R ? Q R • In other words, a formula in DNF is valid • when every path is valid (true)! • When is a path true?
Validity in DNF Matrices • ╞ P ¬P ¬Q ¬R ? Q R • In other words, a formula in DNF is valid • when every path is valid (true)! • When is a path true? • When it contains a complimentary pair of literals (P v ¬P, or unifiable predicates, for FOL), a connection: • {P, ¬P, ¬Q, ¬R} • {P, ¬P, R, ¬R} • {P, Q, ¬Q, ¬R} • {P, Q, R, ¬R}
Concepts • Connection: subset of paths formed by complimentary literals ( {P, ¬P} ) • Mating: set of connections • A Matrix (or formula) is spanning or complimentary when every path contains at least one connection • A Matrix (or formula) is valid iff it has a spanning mating
Summary • Matrices and Normal Forms in ATP • Proofs in Matrices • The Connection Method • Extension Procedure, General Extension Procedure • Comparison with Other Methods • Tableaux, Consolution, Resolution, Model Elimination • Quick view on Improvements & Variants • Conclusions & Future Work
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure .
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure .
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure . .
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure . . .
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure . . .
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure . .
The Connection Calculus P ¬P ¬Q ¬R Q Q R R Extension Procedure . . .
The Connection Calculus P ¬P ¬Q ¬R Q Q R R The Extension Procedure is sound For Horn clauses, complete and linear [Bibel 87] . .
Active Paths P ¬P ¬Q ¬R Q Q R ¬Q R Extension Procedure . . .
Active Paths P ¬P ¬Q ¬R Q Q R ¬Q R Extension Procedure with active paths . . . .
Separation Step P ¬P ¬Q Q Q ¬P ¬R R R X . .
Separation Step P ¬P ¬Q Q Q ¬P ¬R R R X Even if X was replaced by ¬Q… . .
Separation Step P ¬P ¬Q Q Q ¬P ¬R R R X Even if X was replaced by ¬Q… . .
Separation Step P ¬P ¬Q Q Q ¬P ¬R R R X This type of matrices can only be complimentary iff the remaining matrices are complimentary and subsume all active paths from the original matrices . .
Separation Step P ¬P ¬Q Q Q ¬P ¬R R R X The algorithm then should exchange the current clause – not difficult to implement. By doing so it can find the complimentary submatrix implicitly. . .
Separation Step P ¬P ¬Q Q Q ¬P ¬R R R X General Extension Procedure = Extension Procedure + Active paths + Separation • Sound and Complete for Propositional Logic . . . . . . . .
Implementation • For enabling a fast search of complimentary literals either • Clauses are stored ordering literals or • An extra copy of the matrix is needed as an index to store the clauses where each literal occurs • Different selection of literals in each step may drastically change the number of steps for a proof • Therefore, they are not easy to predict • Many improvements are available for this
CM without Matrices n(N(n)^S(n,t)R(n,t))^n(N(n)^R(n,t)O(n))^N(c)^O(c)S(c,t)
CM without Matrices n(N(n)^S(n,t)R(n,t))^n(N(n)^R(n,t)O(n))^N(c)^O(c)S(c,t) (S(c,t)R(c,t))^(R(c,t)O(n))^O(c)S(c,t)
CM without Matrices n(N(n)^S(n,t)R(n,t))^n(N(n)^R(n,t)O(n))^N(c)^O(c)S(c,t) (S(c,t)O(n))^O(c)S(c,t)
CM without Matrices n(N(n)^S(n,t)R(n,t))^n(N(n)^R(n,t)O(n))^N(c)^O(c)S(c,t)
CM without Matrices n(N(n)^S(n,t)R(n,t))^n(N(n)^R(n,t)O(n))^N(c)^O(c)S(c,t) (S(c,t)O(n))^O(c)S(c,t) Contraposition: if S(c,t) O(c) then ¬O(c) ¬S(c,t)
Summary • Matrices and Normal Forms in ATP • Proofs in Matrices • The Connection Method • Extension Procedure, General Extension Procedure • Comparison with Other Methods • Tableaux, Consolution, Resolution, Model Elimination • Quick view on Improvements & Variants • Conclusions & Future Work
CM vs Tableaux ¬ F: (¬P v ¬Q) ^ (P v ¬Q v ¬R) ^ (Q v ¬R) ^ R R P ¬P ¬Q ¬R Q Q R Q ¬R R ■ P ¬Q ¬ R ■ ■ ¬P ¬Q ■ ■ . . .
Connection Method: Proofs are only clear in the CM version without matrices The version without matrices require no normal form, but this is not common Direct formulae Less Memory: CM requires only a matrix and a data structure linked to it Search is much more efficient, due to the in situ path search Tableaux: Tableaux proofs are clearer, both logically and procedurally Tableaux do not require normal form Negated formulae Memory for the generated paths Usually requires more (redundant) paths due to the spreading of formulae CM vs Tableaux [Smullyan 71]
Model Elimination [Loveland 69] (¬P v ¬Q) (Pv¬Qv ¬R) (Q v ¬R) R
Model Elimination [Loveland 69] P (¬P v ¬Q) (Pv¬Qv ¬R) (Q v ¬R) R
Model Elimination [Loveland 69] P (¬P v ¬Q) 0 Decision (Pv¬Qv ¬R) (Q v ¬R) R
Model Elimination [Loveland 69] P (¬P v ¬Q) 0 Decision (Pv¬Qv ¬R) (Q v¬R) Q R 0 Decision (Q ^ ¬R) Conflict! Implication Graph R
Model Elimination [Loveland 69] P (¬P v ¬Q) 0 Decision (Pv¬Qv ¬R) (Q v ¬R) Q R 0 Decision Backtrack (Q ^ ¬R) Conflict! Implication Graph R
Model Elimination [Loveland 69] P (¬P v ¬Q) 0 (Pv¬Q v¬R) (Q v¬R) Q R Forced Decision 0 1 (P^¬Q ^ ¬R)) Conflict! Implication Graph R
Model Elimination [Loveland 69] P (¬P v ¬Q) 0 Forced Decision 1 (Pv¬Q v¬R) (Q v ¬R) Q Q R 0 1