Automated Reasoning in First-Order Logic
Peter Baumgartner
http://users.cecs.anu.edu.au/~baumgart/
NICTA and ANU
7/11/2011
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 1 / 88
Automated Reasoning in First-Order Logic Peter Baumgartner - - PowerPoint PPT Presentation
Automated Reasoning in First-Order Logic Peter Baumgartner http://users.cecs.anu.edu.au/~baumgart/ NICTA and ANU 7/11/2011 Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 1 / 88 Automated Reasoning in
NICTA and ANU
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 1 / 88
◮ Object level: It follows ∀x (x · x) = 1 → ∀x, y x · y = y · x ◮ Meta-level: the word problem for groups is decidable
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 2 / 88
1 = 1 ∧ R12 = x′ 0 ∗ x′ 0 ∧ R23 = R12 ∗ x′ 0 ∧ z′ 0 = R23
5 = R12 + 1 ∧ x0 = x′ 0 ∧ y0 = y ′ 0 ∧ z0 = z′
5
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 3 / 88
◮ Previous slides gave motivation: logical analysis of systems
◮ First-order logic is expressive but not too expressive, i.e., admits complete
◮ So, reasoning with it can be automated on computer. BUT
◮ How to do it in the first place: suitable calculi? ◮ How to do it efficiently: search space control? ◮ How to do it optimally: reasoning support for specific theories like equality and
◮ The lecture will touch on some of these issues and explain basic approaches
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 4 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 5 / 88
◮ Some history ◮ Propositional logic: syntax, semantics, some important results, automated
◮ First-order logic: syntax, semantics, automated reasoning (“Resolution”) ◮ A specific Resolution method – SLD-Resolution – for logic programming
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 6 / 88
◮ Aristotle’s: ”‘Syllogisms”’. ◮ Peano/Boole/Frege, end of 19. century: formal notation (propositional logic,
◮ G¨
◮ Beginning of 19th century: Whitehead/Russel: ”‘Principia Mathematica”’ -
◮ G¨
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 7 / 88
◮ Herbrand 1930, Davis/Putnam/Logeman/Loveland 1962: Mechanical
◮ Robinson 1965: ”‘A Machine Oriented Logic Based on the Resolution
◮ 1990s: refined theory of Resolution - used today.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 8 / 88
◮ a denumerable set of atomic formulas Pi (also: “propositional variables”,
◮ the connectives ∧, ∨ and ¬, and ◮ the symbols ( and ).
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 9 / 88
i=1 Fi
i=1 Fi
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 10 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 11 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 12 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 13 / 88
◮ A is suitable for F and A(F) = T. ◮ A |
◮ A is a model of F. ◮ F is valid under A.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 14 / 88
◮ satisfiable if F has at least one model ◮ unsatisfiable if F has no model ◮ valid (tautological, tautology) iff every suitable assignment is a model of F.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 15 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 16 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 17 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 18 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 19 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 20 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 21 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 22 / 88
n
mi
n
mi
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 23 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 24 / 88
i=1 (mi j=1 Li,j)) be a formula in CNF. The formula F can also be
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 25 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 26 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 27 / 88
◮ To prove the completeness of the propositional Resolution calculus. ◮ Characterizes a specific, refined Resolution calculus. ◮ To prove the compactness theorem of propositional logic.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 28 / 88
◮ is an acyclic, connected, directed graph, where ◮ every node has at most one incoming edge.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 29 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 30 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 31 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 32 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 33 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 34 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 35 / 88
◮ a decidable set of formulas, called axioms, ◮ a collection of transformation rules between formulas, called inference rules, ◮ a notion of derivation that prescribes how inference rules, axioms and another
◮ a notion of proof that singles out certain derivations.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 36 / 88
◮ Axioms: None ◮ Inference rules: the Resolution inference rule combines two clauses into a new
◮ Derivation: a sequence of clauses, starting with the hypothesis clauses, called
◮ Proof: a Resolution derivation that contains the empty clause
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 37 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 38 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 39 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 40 / 88
n≥0 Resn(M)
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 41 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 42 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 43 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 44 / 88
A → UA
A
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 45 / 88
◮ A variable has the form xi. ◮ A predicate symbol has the form Pk i ◮ A function symbol has the form f k i
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 46 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 47 / 88
◮ ∀x F ∈ FOF (universally quantified formula), and ◮ ∃x F ∈ FOF (existentially quantified formula).
◮ The connectives → , ← , ↔ . ◮ The precedences of the connectives. The quantifiers ∀ and ∃ have highest
◮ The definition of subformula.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 48 / 88
scope
scope
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 49 / 88
◮ every k-ary predicate symbol P in its domain to a k-ary relation over UA,
A,
◮ every k-ary function symbol in its domain f to a k-ary function over UA
A → UA, and
◮ every variable x in its domain to an element from UA, that is,
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 50 / 88
◮ We have fixed a priori one set of predicate symbols and one set of function
◮ It is also customary to separate IA into two components, corresponding to
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 51 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 52 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 53 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 54 / 88
◮ A is suitable for F and A(F) = T. ◮ A |
◮ A is a model of F. ◮ F is valid under A.
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 55 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 56 / 88
◮ All equivalences in Proposition 12 are valid in FOF, too. ◮ The Substitution Theorem (Theorem 11) holds analogously. ◮ In addition, all of the following equivalences hold:
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 57 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 58 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 59 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 60 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 61 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 62 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 63 / 88
◮ It fixes a priori a single domain UA, the Herbrand universe. ◮ The interpretation function IA for function symbols is fixed, too. ◮ Only the interpretation function IA for predicate symbols can vary in
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 64 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 65 / 88
◮ Variable-free terms are mapped to “themselves”: syntax and semantics
◮ Notation: the interpretation function IA for predicate symbols can be
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 66 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 67 / 88
H∈M H ∧ ¬F is unsatisfiable
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 68 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 69 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 70 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 71 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 72 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 73 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 74 / 88
1, . . . , C′ n} where C′ i is the set
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 75 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 76 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 77 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 78 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 79 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 80 / 88
◮ {p(x), q(x)} and {p(y), q(y)} are variants ◮ {p(x, y), q(x, y)} and {p(y, x), q(y, x)} are variants ◮ {p(x), q(x)} and {p(y), q(z)} are no variants ◮ {p(x), q(x)} and {p(y), q(a)} are no variants
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 81 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 82 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 83 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 84 / 88
n≥0 Resn(M)
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 85 / 88
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 86 / 88
◮ Every clause in MGr is an instance of a clause in M (this is easy to see), and ◮ If CGr in RGr is a binary resolvent of two clauses CGr 1
2
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 87 / 88
1 and Cf 2 obtained from C1 and C2, respectively, by
1
2
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 7/11/2011 88 / 88