9. Predicate Logic -...
Transcript of 9. Predicate Logic -...
![Page 1: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/1.jpg)
09/1
Foundations of AI
9. Predicate Logic
Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution
Wolfram Burgard, Andreas Karwath,
Bernhard Nebel, and Martin Riedmiller
![Page 2: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/2.jpg)
09/2
Contents
� Motivation
� Syntax and Semantics
� Normal Forms
� Reduction to Propositional Logic: Herbrand Expansion
� Resolution & Unification
� Closing Remarks
![Page 3: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/3.jpg)
09/3
Motivation
We can already do a lot with propositional logic. It is, however, annoying that there is no structure in the atomic propositions.
Example:
“All blocks are red”“There is a block A”It should follow that “A is red”
But propositional logic cannot handle this.
Idea: We introduce individual variables, predicates, functions, … .
� First-Order Predicate Logic (PL1)
![Page 4: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/4.jpg)
09/4
The Alphabet of First-Order Predicate Logic
Symbols:
� Operators:
� Variables:
� Brackets:
� Function symbols (e.g., )
� Predicate symbols (e.g., )
� Predicate and function symbols have an arity (number of arguments).
0-ary predicate: propositional logic atoms0-ary function: constant
� We suppose a countable set of predicates and functions of any arity.
� “=“ is usually not considered a predicate, but a logical symbol
![Page 5: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/5.jpg)
09/5
The Grammar of First-Order Predicate Logic (1)
Terms (represent objects):
1. Every variable is a term.
2. If are terms and is an n-ary function, then
is also a term.Terms without variables: ground terms.
Atomic Formulae (represent statements about objects)
1. If are terms and is an n-ary predicate, then is an atomic formula.
2. If and are terms, then is an atomic formula.Atomic formulae without variables: ground atoms.
![Page 6: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/6.jpg)
09/6
The Grammar of First-Order Predicate Logic (2)
Formulae:
1. Every atomic formula is a formula.
2. If and are formulae and is a variable, then
are also formulae.are as strongly binding as .
Propositional logic is part of the PL1 language:
1. Atomic formulae: only 0-ary predicates
2. Neither variables nor quantifiers.
![Page 7: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/7.jpg)
09/7
Alternative Notation
Here Elsewhere
![Page 8: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/8.jpg)
09/8
Meaning of PL1-Formulae
Our example:
For all objects : If is a block, then is red and is
a block.
Generally:
• Terms are interpreted as objects.
• Universally-quantified variables denote all objects in the universe.
• Existentially-quantified variables represent one of theobjects in the universe (made true by the quantified expression).
• Predicates represent subsets of the universe.
Similar to propositional logic, we define interpretations,satisfiability, models, validity, …
![Page 9: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/9.jpg)
09/9
Semantics of PL1-Logic
Interpretation: where is an arbitrary, non-empty set and is a function that
• maps n-ary function symbols to functions over :
• maps individual constants to elements of :
• maps n-ary predicate symbols to relations over :
Interpretation of ground terms:
Satisfaction of ground atoms P(t1,…,tn):
![Page 10: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/10.jpg)
09/10
Example (1)
![Page 11: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/11.jpg)
09/11
Example (2)
![Page 12: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/12.jpg)
09/12
Semantics of PL1: Variable Assignment
Set of all variables V. Function
Notation: is the same as apart from point .
For
Interpretation of terms under :
Satisfaction of atomic formulae:
![Page 13: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/13.jpg)
09/13
Example
![Page 14: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/14.jpg)
09/14
Semantics of PL1: Satisfiability
A formula is satisfied by an interpretationand a variable assignment , i.e., :
and all other propositional rules as well as
![Page 15: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/15.jpg)
09/15
Example
Questions:
![Page 16: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/16.jpg)
09/16
Free and Bound Variables
The boxed appearances of y and z are free. All other appearances of x,y,z are bound.
Formulae with no free variables are called closed formulae or sentences. We form theories from closed formulae.
Note: With closed formulae, the concepts logical equivalence, satisfiability, and implication, etc. are not dependent on the variable assignment (i.e., we can always ignore all variable assignments).
With closed formulae, can be left out on the left side of the model relationship symbol:
![Page 17: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/17.jpg)
09/17
Terminology
An interpretation I is called a model of under if
A PL1 formula can, as in propositional logic, be satisfiable, unsatisfiable, falsifiable, or valid.
Analogously, two formulae are logically equivalent. if for all :
Note:
Logical Implication is also analogous to propositional logic.
Question: How can we define derivation?
![Page 18: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/18.jpg)
09/18
Prenex Normal Form
Because of the quantifiers, we cannot produce the CNF form of a formula directly.
First step: Produce the prenex normal form
quantifier prefix + (quantifier-free) matrix
![Page 19: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/19.jpg)
09/19
Equivalences for the Production of Prenex Normal Form
… and propositional logic equivalents
![Page 20: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/20.jpg)
09/20
1. Eliminate and 2. Move inwards3. Move quantifiers outwards
Example:
And now?
Production of Prenex Normal Form
![Page 21: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/21.jpg)
09/21
is obtained from by replacing all free appearances of in by .
Lemma: Let be a variable that does not appear in . Then it holds that
and
Theorem: There exists an algorithm that calculates the prenex normal form of any formula.
Renaming of Variables
![Page 22: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/22.jpg)
09/22
Derivation in PL1
Why is prenex normal form useful?
Unfortunately, there is no simple law as in propositional logic that allows us to determine satisfiability or general validity (by transformation into DNF or CNF).
But: we can reduce the satisfiability problem inpredicate logic to the satisfiability problem in propositional logic. In general, however, this produces a very large number of propositional formulae (perhaps infinitely many)
Then: apply resolution.
![Page 23: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/23.jpg)
09/23
Skolemization
Idea: Elimination of existential quantifiers by applying a function that produces the “right” element.
Theorem (Skolem Normal Form): Let be a closed formula in prenex normal form such that all quantified variables are pair-wise distinct and the function symbols do not appear in . Let
then is satisfiable iff
is satisfiable.
Example:
![Page 24: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/24.jpg)
09/24
Skolem Normal Form
Skolem Normal Form: Prenex normal form without existential quantifiers. Notation: ϕ* is the SNF of ϕ.
Theorem: It is possible to calculate the Skolem normal form of every closed formula ϕ.
Example: develops as follows:
Note: This transformation is not an equivalence transformation; it only preserves satisfiability!
Note: … and is not unique.
![Page 25: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/25.jpg)
09/25
Ground Terms & Herbrand Expansion
The set of ground terms (or Herbrand Universe) over a set of SNF formulae is the (infinite) set of all ground terms formed from the symbols of (in case there is no constant symbol, one is added). This set is denoted by .
The Herbrand expansion is the instantiation of the Matrix of all formulae in through all terms
Theorem (Herbrand): Let be a set of formulae in SNF. Then is satisfiable iff is satisfiable.
Note: If and are finite, then the Herbrand expansion is finite � finite propositional logic theory.
Note: This is used heavily in AI and works well most of the time!
![Page 26: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/26.jpg)
09/26
Infinite Propositional Logic Theories
Can a finite proof exist when the set is infinite?
Theorem (compactness of propositional logic): A (countable) set of formulae of propositional logic is satisfiable if and only if every finite subset is satisfiable.
Corollary: A (countable) set of formulae in propositional logic is unsatisfiable if and only if a finite subset is unsatisfiable.
Corollary: (compactness of PL1): A (countable) set of formulae in predicate logic is satisfiable if and only if every finite subset is satisfiable.
![Page 27: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/27.jpg)
09/27
Recursive Enumeration andDecidability
We can construct a semi-decision procedure for validity, i.e., we can give a (rather inefficient) algorithm that enumerates all valid formulae step by step.
Theorem: The set of valid (and unsatisfiable) formulae in PL1 is recursively enumerable.
What about satisfiable formulae?
Theorem (undecidability of PL1): It is undecidable, whether a formula of PL1 is valid.
(Proof by reduction from PCP)
Corollary: The set of satisfiable formulae in PL1 is not recursively enumerable.
In other words: If a formula is valid, we can effectively confirm this fact. Otherwise, we can end up in an infinite loop.
![Page 28: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/28.jpg)
09/28
Derivation in PL1
Clausal Form instead of Herbrand Expansion.
Clauses are universally quantified disjunctions of
literals; all variables are universally quantified
written as
or
![Page 29: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/29.jpg)
09/29
Production of Clausal Form from SNF
Skolem Normal Form
quantifier prefix + (quantifier-free) matrix
1. Put Matrix into CNF using distribution rule
2. Eliminate universal quantifiers
3. Eliminate conjunction symbol
4. Rename variables so that no variable appears in more than one clause.
Theorem: It is possible to calculate the clausal form
of every closed formula .
Note: Same remarks as for SNF
![Page 30: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/30.jpg)
09/30
Conversion to CNF (1)
Everyone who loves all animals is loved by someone:
1. Eliminate biconditionals and implications
2. Move inwards: ,
![Page 31: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/31.jpg)
09/31
Conversion to CNF (2)
3. Standardize variables: each quantifier should use a different one
4. Skolemize: a more general form of existential instantiation. Each existential variable is replaced by a Skolem function of the enclosing universally quantified variables:
5. Drop universal quantifiers:
6. Distribute over :
![Page 32: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/32.jpg)
09/32
Clauses and Resolution
Assumption: All formulae in the KB are clauses.
Equivalently, we can assume that the KB is a set of clauses.
Due to commutativity, associativity, and idempotence of , clauses can also be understood as sets of literals. The empty set of literals is denoted by .
Set of clauses:
Set of literals: C, D
Literal:
Negation of a literal:
![Page 33: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/33.jpg)
09/33
are called resolvents of the parent clausesand . and are the resolution
literals.
Example: resolves with to .
Note: The resolvent is not equivalent to the parent clauses, but it follows from them!
Notation: is a resolvent of two clauses from
–
–
Propositional Resolution
![Page 34: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/34.jpg)
09/34
What Changes?
Examples
We need unification, a way to make literals identical.
Based on the notion of substitution, e.g., .
![Page 35: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/35.jpg)
09/35
Substitutions
A substitution substitutes variables for terms ( does NOT contain ).
Applying a substitution to an expression yields the expression which is with all occurrences of replaced by for all .
![Page 36: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/36.jpg)
09/36
Substitution Examples
no subsitution
![Page 37: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/37.jpg)
09/37
Composing Substitutions
Composing substitutions and giveswhich is that substitution obtained by first applying to the terms in and adding remaining term/variable pairs (not occurring in ) to .
Example:
Application example:
![Page 38: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/38.jpg)
09/38
Properties of substitutions
For a formula and substitutions ,
associativity
no commutativity!
![Page 39: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/39.jpg)
09/39
Unification
Unifying a set of expressions
Find substitution such that for all
Example
The most general unifier, the mgu, g of has the property that if is any unifier of then there exists a substitution such that
Property: The common instance produced is unique up to alphabetic variants (variable renaming)
not the simplest unifier
most general unifier (mgu)
![Page 40: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/40.jpg)
09/40
Subsumption Lattice
a)
b)
![Page 41: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/41.jpg)
09/41
Disagreement Set
The disagreement set of a set of
expressions is the set of
sub-terms of at the first position
in for which the disagree
Examples
gives
gives
gives
![Page 42: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/42.jpg)
09/42
Unification Algorithm
Unify(Terms):
Initialize ;
Initialize = Terms;
Initialize = ;
*If is a singleton, then output . Otherwise continue.
Let be the disagreement set of .
If there exists a var and a term in such that does not occur in , continue. Otherwise, exit with failure.
Goto *.
![Page 43: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/43.jpg)
09/43
Example
![Page 44: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/44.jpg)
09/44
Binary Resolution
where s=mgu( ), the most general unifier
is the resolvent of the parent clauses and .
and do not share variables
and are the resolution literals.
Examples:
![Page 45: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/45.jpg)
09/45
Some Further Examples
Resolve and
Standardizing the variables apart gives and
Substitution Resolvent
Resolve and
Standardizing the variables apart
Substitution and Resolvent
![Page 46: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/46.jpg)
09/46
Factoring
where s=mgu( , ) is the most general unifier.
Needed because:
but cannot be derived by binary resolution
Factoring yields:
and whose resolvent is .
![Page 47: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/47.jpg)
09/47
Derivations
Notation: is a resolvent or a factor of two clauses from
We say can be derived from , i.e.,
If there exist such that
for 1 ≤ i ≤ n.
![Page 48: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/48.jpg)
09/48
Example
From Russell and Norvig :
The law says it is a crime for an American to sell weapons to hostile nations. The country Nono, an enemy of America, has some missiles, and all of its missiles were sold to it by Colonel West, who is American.
Prove that Col. West is a criminal.
![Page 49: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/49.jpg)
09/49
Example
… it is a crime for an American to sell weapons to hostile nations:
Nono … has some missiles, i.e., :
and
… all of its missiles were sold to it by Colonel West.
Missiles are weapons:
An enemy of America counts as “hostile”:
West, who is American …
The country Nono, an enemy of America
![Page 50: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/50.jpg)
09/50
An Example
![Page 51: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/51.jpg)
09/51
Another Example
![Page 52: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/52.jpg)
09/52
Properties of Resolution
Lemma: (soundness) If , then .
Lemma: resolution is refutation-complete:
is unsatisfiable implies .
Theorem: is unsatisfiable iff .
Technique:
to prove that
negate and prove that .
![Page 53: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/53.jpg)
09/53
The Lifting Lemma
Lemma:
Let and be two clauses with no shared variables, and let and be ground instances of and . If is a resolventof and , then there exists a clause such that
(1) is a resolvent of and
(2) is a ground instance of
Can be easily generalized to derivations
![Page 54: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/54.jpg)
09/54
The general picture
Any set of sentences S is representable in clausal form
Assume S is unsatisfiable, and in clausal form
Some set S’ of ground instances is unsatisfiable
Resolution can find a contradiction in S’
There is a resolution proof for the contradiction in S
Herbrand’s theorem
Ground resolution theorem
Lifting lemma
![Page 55: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/55.jpg)
09/55
Closing Remarks: Processing
� PL1-Resolution: forms the basis of
� most state of the art theorem provers for PL1
� the programming language Prolog
� only Horn clauses
� considerably more efficient methods.
� not dealt with : search/resolution strategies
� Finite theories: In applications, we often have to deal with a fixed set of objects. Domain closure axiom:
�
� Translation into finite propositional theory is possible.
![Page 56: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/56.jpg)
09/56
Closing Remarks: Possible Extensions
� PL1 is definitely very expressive, but in some circumstances we would like more …
� Second-Order Logic: Also over predicate quantifiers
�
� Validity is no longer semi-decidable (we have lost compactness)
� Lambda Calculus: Definition of predicates, e.g.,defines a new predicate of arity 2
� Reducible to PL1 through Lambda-Reduction
� Uniqueness quantifier: – there is exactly one …
� Reduction to PL1:
�
![Page 57: 9. Predicate Logic - uni-freiburg.deais.informatik.uni-freiburg.de/teaching/ss09/ki/slides/ai09.pdf · Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution](https://reader035.fdocuments.in/reader035/viewer/2022062508/605c73ee499d4e050d45f390/html5/thumbnails/57.jpg)
09/57
Summary
� PL1 makes it possible to structure statements, thereby giving us considerably more expressive power than propositional logic.
� Formulae consist of terms and atomic formulae, which, together with connectors and quantifiers, can be put together to produce formulae.
� Interpretations in PL1 consist of a universe and an interpretation function.
� The Herbrand Theory shows that satisfiability in PL1 can be reduced to satisfiability in propositional logic (although infinite sets of formulae can arise under certain circumstances).
� Resolution is refutation complete
� Validity in PL1 is not decidable (it is only semi-decidable)