Automated Reasoning in First-Order Logic
Peter Baumgartner
http://users.cecs.anu.edu.au/~baumgart/
NICTA and ANU
5/8/2013
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 1 / 86
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 5/8/2013 Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 1 / 86 Automated Reasoning in
NICTA and ANU
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 1 / 86
◮ 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 5/8/2013 2 / 86
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 5/8/2013 3 / 86
◮ 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 5/8/2013 4 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 5 / 86
◮ Propositional logic: syntax, semantics, some important results, automated
◮ First-order logic: syntax, semantics, automated reasoning (“Resolution”)
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 6 / 86
◮ 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 5/8/2013 7 / 86
i=1 Fi
i=1 Fi
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 8 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 9 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 10 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 11 / 86
◮ 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 5/8/2013 12 / 86
◮ 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 5/8/2013 13 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 14 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 15 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 16 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 17 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 18 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 19 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 20 / 86
n
mi
n
mi
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 21 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 22 / 86
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 5/8/2013 23 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 24 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 25 / 86
◮ 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 5/8/2013 26 / 86
◮ 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 5/8/2013 27 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 28 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 29 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 30 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 31 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 32 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 33 / 86
◮ 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 5/8/2013 34 / 86
◮ 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 5/8/2013 35 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 36 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 37 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 38 / 86
n≥0 Resn(M)
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 39 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 40 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 41 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 42 / 86
A → UA
A
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 43 / 86
◮ 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 5/8/2013 44 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 45 / 86
◮ ∀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 5/8/2013 46 / 86
scope
scope
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 47 / 86
◮ 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 5/8/2013 48 / 86
◮ 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 5/8/2013 49 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 50 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 51 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 52 / 86
◮ 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 5/8/2013 53 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 54 / 86
◮ 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 5/8/2013 55 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 56 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 57 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 58 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 59 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 60 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 61 / 86
◮ 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 5/8/2013 62 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 63 / 86
◮ 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 5/8/2013 64 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 65 / 86
H∈M H ∧ ¬F is unsatisfiable
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 66 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 67 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 68 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 69 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 70 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 71 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 72 / 86
1, . . . , C′ n} where C′ i is the set
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 73 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 74 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 75 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 76 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 77 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 78 / 86
◮ {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 5/8/2013 79 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 80 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 81 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 82 / 86
n≥0 Resn(M)
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 83 / 86
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 84 / 86
◮ 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 5/8/2013 85 / 86
1 and Cf 2 obtained from C1 and C2, respectively, by
1
2
Peter Baumgartner (NICTA and ANU) Automated Reasoning in First-Order Logic 5/8/2013 86 / 86