INFERENCE IN FIRST-ORDER LOGIC Similar to inference in propositional logic: modus ponens, and-elimination, and-introduction, or-introduction, and resolution. New Inference Rules Universal elimination can substitute specific object for universally quantified variable "x LivingPerson(x) => Breaths(x, Air) LivingPerson (Bob) => Breaths(Bob, Air) Existential elimination can name a previously unused object to satisfy statement $p Parent(p, c) Parent(mother, c) Existential introduction can generalize that if statement is true for a particular object that it is true for a non-empty subset of objects ChildOf(Jill, Julia) $c ChildOf(c, Julia) EXAMPLE The Skiing Domain Novice skiers skiing double-black runs are in danger. " s,r Skiing(s, r) ^ Difficulty(r) = DoubleBlack ^ SkiingAbility(s) = Novice => InDanger(s) Todd is a novice skier. SkiingAbility(Todd) = Novice Outhouse is a double black run. Difficulty(Outhouse) = DoubleBlack All the skiers are skiing Outhouse. " s2 Skiing(s2, Outhouse) Inference Using universal elimination Skiing(Todd, Outhouse) Using universal elimination " s Skiing(s, Outhouse) ^ Difficulty(Outhouse) = DoubleBlack ^ SkiingAbility(s) = Novice => InDanger(s) Using modus ponens InDanger(Todd) GENERALIZED MODUS PONENS Frequent activity in inferences: combine atomic sentences into conjunctions instantiating matching universal rules applying modus ponens Generalized modus ponens -- a larger step inference procedure represent knowledge in canonical form (Horn sentences) identify useful substitutions using unification Converting to Horn sentences c1 ^ c2 ^ ... ^ cn => q existential quantifiers generate multiple atomic sentences universal quantifiers are dropped (variables are assumed to be universally quantified) UNIFICATION Take two sentences, p and q, and return a set of substitutions for variables that make the two look the same. useful modification: not just any set but the minimal set of substitutions Example: Given rule: Skis(John, x) => FallsDown(John, x) Unify sentences with antecedent of rule: Skis(John, Ajax) (x / Ajax) Skis(y, Outhouse) (y / John, x / Outhouse) Skis(x, Cakewalk) fails Skis(p, q) (p / John) How would this be implemented? remember that pattern matcher ... FORWARD CHAINING applying generalized modus ponens to move from existing knowledge towards valid inferences Advantages: can be used to generate inferences not foreseen Disadvantages: relies on a somewhat random substitution of variables and combinations of existing facts Applicable to: design (moving from initial specification to a variety of potentially satisficing outcomes) BACKWARD CHAINING applying generalized modus ponens to move from fact trying to prove valid, invalid, or unknown to needed existing knowledge Advantages: each step works on the problem at hand rather than randomly making substitutions Disadvantages: must know the set of fact(s) trying to be proved or disproved Applicable to: diagnosis (known set of diseases, technical problems, etc.) Problem with using only modus ponens -- incomplete Have to use resolution to have a complete inference procedure