90 likes | 304 Views
20. Inference in First-Order Logic. Inference in FOL can be done by converting the KB to propositional logic and using propositional inference . Basically, we need convert sentences with quantifiers to corresponding sentences without quantifiers. Recall.
E N D
Inference in First-Order Logic • Inference in FOL can be done by converting the KB to propositional logic and using propositional inference. Basically, we need convert sentences with quantifiers to corresponding sentences without quantifiers
Recall • xP is true in a model iff P is true with x being each possible object in the model • x King(x) Person(x) equivalent to • Richard the LionHeart is a king Richard the LionHeart is a person • King John is a king King John is a person • Richard’s left leg is a king Richard’s left leg is a person • John’s left leg is a king John’s left leg is a person • The crown is a king The crown is a person • Roughly speaking, equivalent to conjunction of instantiations of P
Universal instantiation(a.k.a. universal elimination) • If xP(x) is true, then P(C) is true, where C is any constant in the domain of x • Example: x eats(Ziggy, x) eats(Ziggy, IceCream) • The variable symbol can be replaced by any ground term, i.e., any constant symbol or function symbol applied to ground terms only
Recall • xP is true in a model iff P is true with x being some possible object in the model • x Crown(x)OnHead(x, John)equivalent to • (Richard the LionHeart is a crown Richard the LionHeart is on John’s head) (King John is a crown King John is on John’s head) (Richard’s left leg is a crown Richard’s left leg is on John’s head) (John’s left leg is a crown John’s left leg is on John’s head) (The crown is a crown the crown is on John’s head) • Roughly speaking, equivalent to a disjunction of instantiations of P
Existential instantiation(a.k.a. existential elimination) • From xP(x) infer P(C) • Example: • x eats(Ziggy, x) eats(Ziggy, Stuff) • Note that the variable is replaced by a brand-new constant not occurring in this or any other sentence in the KB • Convenient to use this to reason about the unknown object, rather than constantly manipulating the existential quantifier
Reduction to propositional form • Suppose the KB contains the following x King(x) Greedy(x) Evil(x) King(John) Greedy(John) Brother(Richard,John) • Instantiating the universal sentence in all possible ways, we have King(John) Greedy(John) Evil(John) King(Richard) Greedy(Richard) Evil(Richard) King(John) Greedy(John) Brother(Richard,John) • The new KB is propositionalized, propositional symbols are King(John), Greedy(John), Evil(John), King(Richard), etc
Reasoning in First-Order Logic • Example • The law says that it is a crime for a Gaul to sell potion formulas to hostile nations • The country Rome, and enemy of Gaul, has acquired some potion formulas, and all of its formulas were sold to it by a Druid Traitorix • Traitorix is a Gaul • Is Traitorix a criminal? (DONE IN CLASS)
Inference Approaches in FOL • Forward or Backward Chaining • Use Generalized Modus Ponens to add new atomic sentences • Requires KB to be in form of first-order definite clauses • Previous example used Forward Chaining • Resolution-based inference • Note that all of these methods are generalizations of their propositional equivalents