SlideServe
Menu
Préférences
© SlideServe · v2026

Introduction to First Order Logic and Inference in Artificial Intelligence

frye avatar
17 diapositives · 424 Views · Aug 21, 2014

This resource delves into First Order Logic (FOL) as applied in Artificial Intelligence, outlining foundational inference methods such as DPLL, Walksat, and Resolution. It explores the derivation of new sentences from old ones using established rules like Modus Ponens and the principles of proof by refutation. The document further covers concepts like unification, Skolem functions, and practical applications in Prolog, highlighting how logical structures and algorithms can be employed to derive conclusions from given premises.

Introduction to First Order Logic and Inference in Artificial Intelligence - slide 1
01 / 17Introduction to First Order Logic and Inference in Artificial Intelligence
1 / 17

Télécharger la présentation

Introduction to First Order Logic and Inference in Artificial Intelligence
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. First Order Logic CSE 573 Introduction to Artificial Intelligence Henry Kautz Fall 2005

  2. Resolution • DPLL and Walksat do inference by searching through space of truth assignments • Alternative approach to reasoning: derive new sentences from old sentences, by well-defined rules • Example: Modus Ponens • p, p  qrain, rain  wet • q wet • Resolution: general rule of inference for formulas in CNF (clausal form) • p v F, ~p v Grain v hot, ~rain v wet • F v G hot v wet

  3. Proof by Refutation • S  T • iff (S  T) false • Model theory: • S  T • iff S  T has no models (is unsatisfiable)

  4. Resolution Proof • DAG, where leaves are input clauses • Internal nodes are resolvants • Root is false (empty clause) • if the unicorn is mythical, then it is immortal • if it is not mythical, it is an animal. • If the unicorn is either immortal or an animal, then it is horned. • Prove:the unicorn is horned. (A  H) (I  H) (H) (M  A) (A) (I) (M  I) (M) (M) ()

  5. First Order Logic • Sentence ::= Atom • | (Sentence Connective Sentence) • |  Variable . Sentence • |   Variable . Sentence • |  Sentence • Atom ::= Proposition • | Predicate(Term, ...) • Term ::= Constant • | Variable • | Function(Term, ...)

  6. First-Order Logic • All men are mortal. •  x . (man(x) mortal(x)) • No man is not mortal. •   x . (man(x)  mortal(x) ) • Everybody has somebody they lean on.  x . (person(x)   y . (person(y) leans_on(x,y)) A number is less than it’s successor.  n . (number(x) less_than(x, successor(x)) ) Nothing is less than zero.   x . less_than(x, ZERO)

  7. First-Order Clausal Form • Begin with universal quantifiers (implicit) • Rest is a clause • No , use function symbols instead • Variables in each clause are unique to that clause • “x” in clause 1 is not the same “x” as in clause 2  x . (man(x)  mortal(x)) man(x) mortal(x)

  8. Skolem Functions • Begin with universal quantifiers (implicit) • Rest is a clause • No , use function symbols instead • Variables in each clause are unique to that clause • “x” in clause 1 is not the same “x” as in clause 2  x . (person(x)   y . (person(y) leans_on(x,y))  x .  y . (person(x)  (person(y) leans_on(x,y))  x . (person(x)  (person(f(x)) leans_on(x,f(x)))  x .  person(x) (person(f(x)) leans_on(x,f(x))  x . ( person(x)person(f(x)))  (person(x)leans_on(x,f(x)))  x . person(x)  person(f(x))  x . person(x)  leans_on(x,f(x))

  9. Unification • Can resolve clauses if can unify one pair of literals • Same predicate, one positive, one negative • Match variable(s) to other variables, constants, or complex terms (function symbols) • Carry bindings on variables through to all the other literals in the result! (Mortal(y)Fallible(y)) (Mortal(HENRY)) (Fallible(HENRY))

  10. Unification with Multiple Variables • You always hurt the ones you love. • Politicians love themselves. • Therefore, politicians hurt themselves.  love(x,y)  hurt(x,y) politician(z)  love(z,z) politician(w)  hurt(w,w)

  11. Unification with Function Symbols A number is less than its successor “Less than” is transitive (Less(a,suc(a))) (Less(b,c) Less(c,d) Less(b,d)) {c/a, d/suc(a)} (Less(b,a) Less(b,suc(a))) rename variables: (Less(e,f) Less(e,suc(f))) {e/a,f/suc(a)} A number is less than the successor of its successor Less(a,suc(suc(a)))

  12. Making FOL Practical • Barriers to using FOL: • Choice of clauses to resolve • Huge amount of memory to store DAG • Getting useful answers to queries (not just “yes” or “no”) • PROLOG’s answers: • Simple backward-chaining resolution strategy – left/right, first to last clause • Tree-shaped proofs – no need to store entire proof in memory at one time • Extract answers to queries by returning variable bindings

  13. happy.pl • happy(X) :- rich(X). • happy(X) :- loves(X,Y),happy(Y). • loves(X,Y) :- spouse(X,Y). • loves(X,Y) :- mother(X,Y). • rich(bill). • spouse(melinda,bill). • mother(elaine,melinda). • mother(mary,bill). • rich(paul). • mother(barbara,henry). • QUERIES: • ?- happy(bill). • YES • ?- happy(henry). • NO • ?- happy(Z).

  14. Prolog Interpreter • binding_list disprove(literal neglit){ • choose (clause c) such that (binding = unify(head(c),neglit)) • if (no choice possible){ • backtrack to last choice;} • for (each lit in body(c)){ • binding = binding U disprove(substitute(lit,binding)); • } • return binding; • }

  15. Prolog Limitations • Only handles definite clauses (exactly one positive literal per clause) • Cannot express e.g. happy(bill) v happy(henry) • Tree-shaped proofs means some sub-steps may be repeatedly derived • DATALOG: does forward-chaining inference and caches derived unit clauses • Interpreter can get into an infinite loop if care is not taken in form & order of clauses

  16. toohappy.pl • happy(X) :- rich(X). • happy(X) :- loves(X,Y),happy(Y). • loves(X,Y) :- spouse(X,Y). • loves(X,Y) :- mother(X,Y). • rich(bill). • spouse(melinda,bill). • mother(elaine,melinda). • mother(mary,bill). • rich(paul). • mother(barbara,henry). • loves(henry,barbara).

  17. Exercise • You have just been hired by snacks.com, an Internet startup that provides snacking recommendations. Your first assignment is to create an expert system that will recommend snacks according to the following rules: • Every snack should contain one beverage and one munchie. • Sweet beverages are good with salty munchies. • Bitter beverages are good with sweet munchies or salty munchies. • Define a predicate snack(X,Y) that makes such recommendations.