SlideShare una empresa de Scribd logo
1 de 102
Lecture Notes,
                                  Artificial Intelligence ((ENCS434))
                                                    University of Birzeit
                                                     1st Semester, 2011




 Artificial Intelligence (ENCS434)




First Order Logic


      Dr. Mustafa Jarrar
          University of Birzeit
          mjarrar@birzeit.edu
            www.jarrar.info


                Jarrar © 2011                                               1
Acknowledgement

The slides in this lecture are based on the slides developed by Prof.
  Enrico Franconi*
See the online course on Description Logics
  http://www.inf.unibz.it/~franconi/dl/course/

(But notice that I introduced some modifications.)




                             Jarrar © 2011                              2
Reading

All slides + everything I say

Chapter 8 and Chapter 9




                                Jarrar © 2011   3
Outline
• FOL, First Order Logic
     • Motivation (why FOL)
     • Syntax
     • Semantics

• FOL Inference Methods
     • Enumeration Method
     • Inference rules
     • Resolution
     • Forward and backward Chaining
                    Jarrar © 2011      4
Motivation

• We can already do a lot with propositional logic.

•    But it is unpleasant that we cannot access the structure of atomic
    sentences.

•    Atomic formulas of propositional logic are too atomic . they are just
    statement.

• which my be true or false but which have no internal structure.

•    In First Order Logic (FOL) the atomic formulas are interpreted as
    statements about relationships between objects.




                                 Jarrar © 2011                               5
Predicates and Constants

Let's consider the statements:
   • Mary is female
   • John is male
   • Mary and John are siblings

In propositional logic the above statements are atomic propositions:
    • Mary-is-female
    • John-is-male
    • Mary-and-John-are-siblings

In FOL atomic statements use predicates, with constants as argument:
   • Female(mary)
   • Male(john)
   • Siblings(mary, john)
                               Jarrar © 2011                           6
Variables and Quantifiers

Let's consider the statements:
    • Everybody is male or female
    • A male is not a female

In FOL predicates may have variables as arguments, whose value is
   bounded by quantifiers:
    •   x. Male(x) Female(x)
    •   x. Male(x)    Female(x)

Deduction (why?):
  • Mary is not male
  •    Male(mary)



                             Jarrar © 2011                          7
Functions

Let's consider the statement:
    • The father of a person is male



In FOL objects of the domain may be denoted by functions applied to
 (other) objects:
    •     x. Male(father(x))




                               Jarrar © 2011                          8
Syntax of FOL: atomic sentences
Countably infinite supply of symbols (signature):
  variable symbols: x, y, z, …
  n-ary function symbols: f, g, h,…
  individual constants: a, b, c,…
  n-are predicate symbols: P, Q, R,…

Terms:     t       x           variable
               | a             constant
               | f (t1,…,tn)   function application

Ground terms: terms that do not contain variables
Formulas:     P(t1,…,tn) atomic formulas

E.g., Brother(kingJohn; richardTheLionheart)
      >(length(leftLegOf(richard)), length(leftLegOf(kingJohn)))
                                 Jarrar © 2011                     9
Outline
• FOL, First Order Logic
     • Motivation (why FOL)
     • Syntax
     • Semantics

• FOL Inference Methods
     • Enumeration Method
     • Inference rules
     • Resolution
     • Forward and backward Chaining
                    Jarrar © 2011      10
Syntax of Propositional Logic

Formulas: ,         P(t1,…,tn)atomic formulas
                 |            false
                 | T          true
                 |            negation
                 |            conjunction
                 |            disjunction
                 |            implication
                 |            equivalence
                (Ground) atoms and (ground) literals.

E.g. Sibling(kingJohn, richard)     Sibling(richard, kingJohn)
      >(1, 2)    ≤(1, 2)
      >(1, 2)     >(1, 2)


                                  Jarrar © 2011                  11
Syntax of First Order Logic

Formulas: ,        P(t1,…,tn)    atomic formulas
               |                 false
               |   T             true
               |                 negation
               |                 conjunction
               |                 disjunction
               |                 implication
               |                 equivalence
               |       x.         universal quantification
               |       x.         existential quantification

E.g. Everyone in Italy is smart:         x. In(x, Italy) Smart(x)
     Someone in France is smart:         x. In(x, France) Smart(x)


                                Jarrar © 2011                        12
Summary of Syntax of FOL

Terms
  –     variables
  –     constants
  –     functions


Literals
   – atomic formula
        •   relation (predicate)
   – negation


Well formed formulas
   – truth-functional connectives
   – existential and universal quantifiers

                                   Jarrar © 2011   13
Outline
• FOL, First Order Logic
     • Motivation (why FOL)
     • Syntax
     • Semantics

• FOL Inference Methods
     • Enumeration Method
     • Inference rules
     • Resolution
     • Forward and backward Chaining
                    Jarrar © 2011      14
Semantics of FOL: intuition

• Just like in propositional logic, a (complex) FOL formula may be true (or
  false) with respect to a given interpretation.

• An interpretation specifies referents for
              constant symbols       objects
              predicate symbols      relations
              function symbols       functional relations

• An atomic sentence P(t1,…, tn) is true in a given interpretation
                       iff the objects referred to by t1,…, tn
   are in the relation referred to by the predicate P.

• An interpretation in which a formula is true is called a model for the
  formula.

                                Jarrar © 2011                              15
Models for FOL: Example




               Jarrar © 2011   16
Models for FOL: Example


  Objects


 Relations: sets of tuples of objects




Functional relations: all tuples of objects + "value" object




                           Jarrar © 2011                       17
Semantic of FOL: Interpretations


Interpretation: = , .      where    is an arbitrary non-empty set and   is
   a function that maps:

• Individual constants to elements of      :
   a

• n-ary predicate symbols to relation over     :
   P       n



• n-ary function symbols to functions over     :
    f     [ n     ]




                               Jarrar © 2011                            18
Semantic of FOL: Satisfaction

Interpretation of ground terms:
                 ( f (t1,…,tn))I    =         f I (t I 1,…,t I n) (    )




Satisfaction of ground atoms P(t1,…,tn):
                 I ╞ P(t1,…,tn)         iff       t I 1,…,t I n       PI




                                   Jarrar © 2011                           19
Examples

         =    {d1,…, dn, n > 1}                        = {1,2,3,…}
    aI   =    d1                                    1I = 1
    bI   =    d2                                    2I = 2
BlockI   =   {d1}                                      ….
 RedI    =                                        EvenI = {2,4,6,…}
                                                  SuccI = {(12), (23),…}




                                  Jarrar © 2011                          20
Examples

         =    {d1,…, dn, n > 1}                        = {1,2,3,…}
    aI   =    d1                                    1I = 1
    bI   =    d2                                    2I = 2
BlockI   =   {d1}                                      ….
 RedI    =                                        EvenI = {2,4,6,…}
                                                  SuccI = {(12), (23),…}



   I ╞ Red(b)                                        I | Even(3)
   I | Block(b)                                      I ╞ Even(succ(3))




                                  Jarrar © 2011                          21
Semantics of FOL: Variable Assignments

V set of all variables. Function : V            .
Notation: [x/d] means assign d to x


Interpretation of terms under c
                     xI, = (x)
                     aI, = aI
        (f (t1,..,tn))I, = f I (t1I, ,…,tnI, )


Satisfiability of atomic formulas:
     I, ╞ P(t1,…,tn)      iff   t1I, ,…,tnI,        PI



                                Jarrar © 2011            22
Variable Assignment example


          = {(x  d1), (y  d2)}
     I, ╞ Red(x)
I, [y/d1] ╞ Block(y)




                     Jarrar © 2011   23
Interpretation (Example)


                  a
                  b     d
                  c     e


        BlockI = {<a>,<b>,<c>,<d>,<e>}
        AboveI = {<a,b>,<b,c>,<d,e>}
        ClearI = {<a>,<d>}
        TableI = {<c>,<e>}


 I |= Block(a)              I | Above(b,e)
 I |   Block(f)             I |= Above(b,c)


                      Jarrar © 2011           24
Semantics of FOL: Satisfiability of formulas


A formula is satisfied by (is true in) an interpretation I under a
   variable
assignment ,
I, ╞ :
       I, ╞ P(t1,…,tn)    iff     t1I, ,…,tnI,    PI
       I, ╞               iff    I, |
      I, ╞                iff    I, ╞        and I ╞
      I, ╞                iff    I, ╞        or I ╞
      I, ╞ x.              iff for all d        : I, [x/d] ╞
      I, ╞ x.              iff there exits a d        : I, [x/d] ╞




                            Jarrar © 2011                            25
Satisfiability and Validity


An interpretation I is a model of    under , if
                                     I, ╞
Similarly as in propositional logic, a formula can be satisfiable,
unsatisfiable, falsifiable or valid -the definition is in terms of the pair (I, ).

A formula is
     satisfiable, if there is some (I, ) that satisfies ,
     un satisfiable, if is not satisfiable,
     falsifiable, if there is some (I, ) that does not satisfy ,
     valid (i.e., a tautology), if every (I, ) is a model of .




                                    Jarrar © 2011                              26
Equivalence

Analogously, two formulas are logically equivalent (   ), if
  for all I; we have:
                    I, ╞       iff   I, ╞




                          Jarrar © 2011                        27
Entailment


Entailment is defined similarly as in propositional logic.

The formula      is logically implied by a formula , if    is true in all models of

(symbolically,    ╞ ):

                         ╞   iff I ╞ for all models I of




                                      Jarrar © 2011                               28
Properties of quantifiers

( x . y. ) is the same as ( y . x. )

( x . y. ) is the same as ( y . x. )

( x . y. ) is not the same as ( y . x. )

 x . y.Loves(x,y)      “There is a person who loves everyone in the world”

 y. x.Loves(x,y)       “Everyone in the world is loved by at least one person”

Quantifier duality: each can be expressed using the other

 x. Likes(x,Falafel)              x. Likes(x,Falafel)

 x.Likes(x,Salad)                  x Likes(x,Salad)
                                Jarrar © 2011                                29
Equivalences




               Jarrar © 2011   30
Knowledge Engineering in FOL

1. Identify the task
2. Assemble the relevant knowledge
3. Decide on a vocabulary of predicates, functions, and
   constants
4. Encode general knowledge about the domain
5. Encode a description of the specific problem instance
6. Pose queries to the inference procedure and get answers
7. Debug the knowledge base




                        Jarrar © 2011                   31
A simple genealogy KB (Another Example)

•   Build a small genealogy knowledge base by FOL that
     – contains facts of immediate family relations (spouses, parents, etc.)
     – contains definitions of more complex relations (ancestors, relatives)
     – is able to answer queries about relationships between people
•   Predicates:
     – parent(x, y), child (x, y), father(x, y), daughter(x, y), etc.
     – spouse(x, y), husband(x, y), wife(x,y)
     – ancestor(x, y), descendent(x, y)
     – relative(x, y)
•   Facts:
     – husband(Joe, Mary), son(Fred, Joe)
     – spouse(John, Nancy), male(John), son(Mark, Nancy)
     – father(Jack, Nancy), daughter(Linda, Jack)
     – daughter(Liz, Linda)
     – etc.




                                  Jarrar © 2011                                32
A simple genealogy KB (Another Example)

•   Rules for genealogical relations
     – ( x,y) parent(x, y) <=> child (y, x)
       ( x,y) father(x, y) <=> parent(x, y) ^ male(x) (similarly for mother(x, y))
       ( x,y) daughter(x, y) <=> child(x, y) ^ female(x) (similarly for son(x, y))
     – ( x,y) husband(x, y) <=> spouse(x, y) ^ male(x) (similarly for wife(x, y))
       ( x,y) spouse(x, y) <=> spouse(y, x) (spouse relation is symmetric)
     – ( x,y) parent(x, y) => ancestor(x, y)
       ( x,y)( z) parent(x, z) ^ ancestor(z, y) => ancestor(x, y)
     – ( x,y) descendent(x, y) <=> ancestor(y, x)
     – ( x,y)( z) ancestor(z, x) ^ ancestor(z, y) => relative(x, y)
               (related by common ancestry)
       ( x,y) spouse(x, y) => relative(x, y) (related by marriage)
       ( x,y)( z) relative(z, x) ^ relative(z, y) => relative(x, y) (transitive)
       ( x,y) relative(x, y) => relative(y, x) (symmetric)
•   Queries
     – ancestor(Jack, Fred) /* the answer is yes */
     – relative(Liz, Joe)      /* the answer is yes */
     – relative(Nancy, Mathews)
           /* no answer in general, no if under closed world assumption */
                                    Jarrar © 2011                                    33
The electronic circuits domain

One-bit full adder




                     Jarrar © 2011   34
The electronic circuits domain

1. Identify the task
   – Does the circuit actually add properly? (circuit
     verification)
2. Assemble the relevant knowledge
   – Composed of wires and gates; Types of gates (AND,
     OR, XOR, NOT)
   – Irrelevant: size, shape, color, cost of gates
3. Decide on a vocabulary
   – Alternatives:
      Type(X1) = XOR
      Type(X1, XOR)
      XOR(X1)




                          Jarrar © 2011                  35
The electronic circuits domain

4. Encode general knowledge of the domain
5.       t1,t2 Connected(t1, t2)     Signal(t1) = Signal(t2)
     –       t Signal(t) = 1 Signal(t) = 0
     –     1≠0
     –       t1,t2 Connected(t1, t2)    Connected(t2, t1)
     –       g Type(g) = OR       Signal(Out(1,g)) = 1       n
           Signal(In(n,g)) = 1
     –       g Type(g) = AND        Signal(Out(1,g)) = 0       n
           Signal(In(n,g)) = 0
     –       g Type(g) = XOR        Signal(Out(1,g)) = 1
           Signal(In(1,g)) ≠ Signal(In(2,g))
     –       g Type(g) = NOT        Signal(Out(1,g)) ≠
           Signal(In(1,g))


                               Jarrar © 2011                       36
The electronic circuits domain

5. Encode the specific problem instance
   Type(X1) = XOR            Type(X2) = XOR
   Type(A1) = AND            Type(A2) = AND
   Type(O1) = OR

   Connected(Out(1,X1),In(1,X2))        Connected(In(1,C1),In(1,X1))
   Connected(Out(1,X1),In(2,A2))        Connected(In(1,C1),In(1,A1))
   Connected(Out(1,A2),In(1,O1))        Connected(In(2,C1),In(2,X1))
   Connected(Out(1,A1),In(2,O1))        Connected(In(2,C1),In(2,A1))
   Connected(Out(1,X2),Out(1,C1))       Connected(In(3,C1),In(2,X2))
   Connected(Out(1,O1),Out(2,C1))       Connected(In(3,C1),In(1,A2))




                            Jarrar © 2011                              37
The electronic circuits domain

6. Pose queries to the inference procedure
7. What are the possible sets of values of all the
   terminals for the adder circuit?
8.        i1,i2,i3,o1,o2 Signal(In(1,C_1)) = i1 Signal(In(2,C1)) = i2
      Signal(In(3,C1)) = i3 Signal(Out(1,C1)) = o1 Signal(Out(2,C1)) = o2


7. Debug the knowledge base
     May have omitted assertions like 1 ≠ 0




                               Jarrar © 2011                          38
Summary

• First-order logic:
   – objects and relations are semantic primitives
   – syntax: constants, functions, predicates, equality,
     quantifiers

• Increased expressive power: sufficient to define
  Wumpus world




                          Jarrar © 2011                    39
Outline
• FOL, First Order Logic
     • Motivation (why FOL)
     • Syntax
     • Semantics

• FOL Inference Methods
     • Enumeration Method
     • Inference rules
     • Resolution
     • Forward and backward Chaining
                    Jarrar © 2011      40
Knowledge Bases vs. Databases

                                                                Transactions
     Knowledge Base System                                      i.e insert, update, delete...
Wffs :
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                        Query
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                Constraints
                                                                                DBMS
                                            Query
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




                                                                                                         Query Answer
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

                                             Proof

            Provability




      Query Answer
Proof Theoretic View                                         Model Theoretic View


The KB is a set of formulae and the                       Evaluating the truth formula for
query evaluation is to prove that the                     each tuple in the table “Publish”
result is provable.
                                                     Jarrar © 2011                                      41
Outline


• Reducing first-order inference to propositional inference

• Unification

• Generalized Modus Ponens

• Forward chaining

• Backward chaining

• Resolution

                       Jarrar © 2011                     42
Inference in First-Order Logic


• We may inference in FOL by mapping FOL sentences into
  propositions, and apply the inference methods of propositional logic.

• This mapping is called propositionalization.


• Thus, Inference in first-order logic can be achieved using:
    –   Inference rules
    –   Forward chaining
    –   Backward chaining
    –   Resolution
         •   Unification
         •   Proofs
         •   Clausal form
         •   Resolution as search
                                    Jarrar © 2011                         43
Universal Instantiation (UI)

• Every instantiation of a universally quantified sentence is entailed by it:
                                     vα
                                 Subst({v/g}, α)

    for any variable v and ground term g
•   Example:

                         x King(x) Greedy(x)       Evil(x)
                        King(John)
                        Greedy(John)




                 King(John) Greedy(John)    Evil(John)
                 King(Richard) Greedy(Richard)    Evil(Richard)


                                Jarrar © 2011                              44
Existential Instantiation (EI)

For any sentence α, variable v, and constant symbol k that does not
   appear elsewhere in the knowledge base:
                                    vα
                              Subst({v/k}, α)
Example:                   x Crown(x)    OnHead(x,John)


                          Crown(C1)     OnHead(C1,John)

provided C1 is a new constant symbol, called a Skolem constant.

• The variable symbol can be replaced by any ground term, i.e., any
  constant symbol or function symbol applied to ground terms only.
• In other words, we don’t want to accidentally draw other inferences about it
  by introducing the constant.
• Convenient to use this to reason about the unknown object, rather than
  constantly manipulating the existential quantifier.
                                    Jarrar © 2011                                45
Reduction to Propositional Inference

Suppose the KB contains just 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: proposition symbols are
             King(John), Greedy(John), Evil(John), King(Richard), etc.

                                 Jarrar © 2011                           46
Reduction contd.

• Every FOL KB can be propositionalized so as to preserve entailment

• (A ground sentence is entailed by new KB iff entailed by original KB)

• Idea: propositionalize KB and query, apply resolution, return result

• Problem: with function symbols, there are infinitely many ground terms,
    – e.g., Father(Father(Father(John)))




                                 Jarrar © 2011                            47
Reduction contd.

Theorem: Herbrand (1930). If a sentence α is entailed by an FOL KB, it is
  entailed by a finite subset of the propositionalized KB


Idea: For n = 0 to ∞ do

      create a propositional KB by instantiating with depth-$n$ terms
      see if α is entailed by this KB

Problem: works if α is entailed, loops if α is not entailed.

Godel's Completeness Theorem says that FOL entailment is only
   semidecidable:
    – If a sentence is true given a set of axioms, there is a procedure that will
      determine this.
    – If the sentence is false, then there is no guarantee that a procedure will
      ever determine this–i.e., it may never halt.
                                   Jarrar © 2011                                    48
Completeness of some inference techniques

• Truth Tabling is not complete for FOL because truth table size may
  be infinite.

• Natural Deduction is complete for FOL but is not practical because
  the “branching factor” in the search is too large (so we would have to
  potentially try every inference rule in every possible way using the set
  of known sentences).

• Generalized Modus Ponens is not complete for FOL.

• Generalized Modus Ponens is complete for KBs containing only Horn
  clauses.




                                Jarrar © 2011                            49
Problems with Propositionalization

• Propositionalization seems to generate lots of irrelevant sentences.
  E.g., from:
        x King(x) Greedy(x)     Evil(x)
       King(John)
        y Greedy(y)
       Brother(Richard, John)



• It seems obvious that Evil(John), but propositionalization produces lots
  of facts such as Greedy(Richard) that are irrelevant

• With p k-ary predicates and n constants, there are p·nk instantiations.




                                Jarrar © 2011                            50
Problems with Propositionalization

Given this KB:
       King(x) Greedy(x)    Evil(x)
       King(John)
       Greedy(John)

How do we really know that Evil(John)?
   –      We find x that is a King and Greedy, if so then x is Evil.
   –      That is, we need to a substitution {x/John}

But Given this KB:
     x King(x) Greedy(x)          Evil(x)
    King(John)
     y Greedy(y)

How do we really know that Evil(John)?
    – That is, we need to the substitutions {x/John, y,John}, but how?



                                      Jarrar © 2011                      51
Unification

• We can get the inference immediately if we can find a substitution θ
  such that King(x) and Greedy(x) match King(John) and Greedy(y)
          θ = {x/John,y/John}

• This called Unification, a “pattern-matching” procedure:
    – Takes two atomic sentences, called literals, as input
    – Returns “Failure” if they do not match and a substitution list, θ, if they do
                          Unify(P,Q) = θ if Pθ = Qθ

• That is, unify(p,q) = θ means subst(θ, p) = subst(θ, q) for two
  atomic sentences, p and q
• θ is called the Most General Unifier (MGU)
• All variables in the given two literals are implicitly universally
  quantified.
• To make literals match, replace (universally quantified) variables
  by terms
                                    Jarrar © 2011                                     52
Unification Example

           Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we a query Knows(John,x), we need to unify Knows(John,x)
  with all sentences in KD.


       P               Q                     θ
Knows(John,x)   Knows(John,Jane)
Knows(John,x)   Knows(y,Bill)
Knows(John,x)   Knows(y,Mother(y))
Knows(John,x)   Knows(x,Elizabeth)




                             Jarrar © 2011                         53
Unification Example

           Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we a query Knows(John,x), we need to unify Knows(John,x)
  with all sentences in KD.


       P              Q                            θ
Knows(John,x)                           {x/Jane}
      Knows(John,Jane)
Knows(John,x)
      Knows(y,Bill)
Knows(John,x)
      Knows(y,Mother(y))
Knows(John,x)
      Knows(x,Elizabeth)


                            Jarrar © 2011                          54
Unification Example

           Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we a query Knows(John,x), we need to unify Knows(John,x)
  with all sentences in KD.


       P              Q                          θ
Knows(John,x)                           {x/Jane}
      Knows(John,Jane)                  {x/Bill,y/John}
Knows(John,x)
      Knows(y,Bill)
Knows(John,x)
      Knows(y,Mother(y))
Knows(John,x)
      Knows(x,Elizabeth)


                            Jarrar © 2011                          55
Unification Example

           Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we have a query Knows(John,x), we need to unify
  Knows(John,x) with all sentences in KD.


       P              Q                          θ
Knows(John,x)                            {x/Jane}
      Knows(John,Jane)                   {x/Bill,y/John}
Knows(John,x)                            {y/John,x/Mother(John)}
      Knows(y,Bill)
Knows(John,x)
      Knows(y,Mother(y))
Knows(John,x)
      Knows(x,Elizabeth)


                             Jarrar © 2011                         56
Unification Example

Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we have a query Knows(John,x), we need to unify
  Knows(John,x) with all sentences in KD.


         P                 Q                           θ
Knows(John,x)                                {x/Jane}
        Knows(John,Jane)                    {x/Bill,y/John}
Knows(John,x)                               {y/John,x/Mother(John)}
        Knows(y,Bill)                       fail
Knows(John,x)
        Knows(y,Mother(y))
• The last unification failed because x cannot take on the values John and
Knows(John,x) same time.
  Elizabeth at the
        Knows(x,Elizabeth)
• Because it happens that both sentences use the same variable name.
•   Solution: rename x in Knows(x,Elizabeth) into Knows(z17,Elizabeth) , without
    changing its meaning. (this is called standardizing apart)
                                   Jarrar © 2011                               57
Unification Example

Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we have a query Knows(John,x), we need to unify
  Knows(John,x) with all sentences in KD.


         P                 Q                            θ
Knows(John,x)     Knows(John,Jane)             {x/Jane}
Knows(John,x)     Knows(y,Bill)                {x/Bill,y/John}
Knows(John,x)     Knows(y,Mother(y))           {y/John,x/Mother(John)}
Knows(John,x)     Knows(z17,Elizabeth)         {x/Elizabeth, z17/John}

•   The last unification failed because x cannot take on the values John and
    Elizabeth at the same time.
•   Because it happens that both sentences use the same variable name.
•   Solution: rename x in Knows(x,Elizabeth) into Knows(z17,Elizabeth) , without
    changing its meaning. (this is called standardizing apart)
                                   Jarrar © 2011                               58
Unification Example

Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we have a query Knows(John,x), we need to unify
  Knows(John,x) with all sentences in KD.


       P              Q                          θ
Knows(John,x)                            {x/Jane}
      Knows(John,Jane)                   {x/Bill,y/John}
Knows(John,x)                            {y/John,x/Mother(John)}
      Knows(y,Bill)                      {x/Elizabeth, z17/John}
Knows(John,x)
      Knows(y,Mother(y))
Knows(John,x)
      Knows(z17,Elizabeth)


                             Jarrar © 2011                         59
Unification Example

Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we have a query Knows(John,x), we need to unify
  Knows(John,x) with all sentences in KD.


       P               Q                            θ
Knows(John,x)   Knows(John,Jane)          {x/Jane}
Knows(John,x)   Knows(y,Bill)             {x/Bill,y/John}
Knows(John,x)   Knows(y,Mother(y))        {y/John,x/Mother(John)}
Knows(John,x)   Knows(z17,Elizabeth)      {x/Elizabeth, z17/John}
Knows(John,x)   Knows(y,z)                ??

In the last case, we have two answers:        This first unification is more genera
      θ= {y/John,x/z}, or                     as it places fewer restrictions on th
      θ= {y/John,x/John, z/John}              values of the variables.

                              Jarrar © 2011                                    60
Unification Example

Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q)

Suppose we have a query Knows(John,x), we need to unify
  Knows(John,x) with all sentences in KD.


       P               Q                           θ
Knows(John,x)   Knows(John,Jane)          {x/Jane}
Knows(John,x)   Knows(y,Bill)             {x/Bill,y/John}
Knows(John,x)   Knows(y,Mother(y))        {y/John,x/Mother(John)}
Knows(John,x)   Knows(z17,Elizabeth)      {x/Elizabeth, z17/John}
Knows(John,x)   Knows(y,z)                {y/John,x/z}

In the last case, we have two answers:        For every unifiable pair of
      θ= {y/John,x/z}, or                     expressions, there is a
      θ= {y/John,x/John, z/John}              Most General Unifier MGU

                              Jarrar © 2011                                 61
Another Example

• Example:
  – parents(x, father(x), mother(Bill))
  – parents(Bill, father(Bill), y)
  – {x/Bill, y/mother(Bill)}
• Example:
  – parents(x, father(x), mother(Bill))
  – parents(Bill, father(y), z)
  – {x/Bill, y/Bill, z/mother(Bill)}
• Example:
  – parents(x, father(x), mother(Jane))
  – parents(Bill, father(y), mother(y))
  – Failure


                       Jarrar © 2011      62
Generalized Modus Ponens (GMP)

• A first-order inference rule, to find substitutions easily.
• Apply modus ponens reasoning to generalized rules.
• Combines And-Introduction, Universal-Elimination, and Modus
  Ponens . Example: {P(c), Q(c), x(P(x) Q(x)) R(x)} derive R(c)
• General case: Given
   – Atomic sentences P1, P2, ..., Pn
   – Implication sentence (Q1 Q2 ... Qn) R
       • Q1, ..., Qn and R are atomic sentences
   – Substitution subst(θ, Pi) = subst(θ, Qi)   (for i=1,...,n)
   – Derive new sentence: subst(θ, R)
• Substitutions
   – subst(θ, α) denotes the result of applying a set of substitutions defined by
     θ to the sentence α
   – A substitution list θ = {v1/t1, v2/t2, ..., vn/tn} means to replace all occurrences
     of variable symbol vi by term ti
   – Substitutions are made in left-to-right order in the list
                                    Jarrar © 2011                                     63
Generalized Modus Ponens (GMP)

A first-order inference rule, to find substitutions
easily.
       P1, P2, … , Pn, ( Q1   Q2    …     Qn    R)
                                                     where Pi θ = Qi θ for all i
                     Subst (R, θ)



     King(John), Greedy(y),   (King(x), Greedy(x)    Evil(x))
                Subst(Evil(x), {x/John, y/John})



• GMP used with KB of definite clauses (exactly one positive literal).

• All variables assumed universally quantified.


                                    Jarrar © 2011                                  64
Soundness of GMP


Need to show that

              P1, …, Pn, (Q1     …      Qn   Q) ╞ R θ

   provided that Pi θ = Qi θ for all i

Lemma: For any sentence Q, we have Q ╞ Q θ by UI
 (P1 … Pn    R) ╞ (P1 … pn    R) θ = (P1 θ … Pn θ        R θ)

    Q1 …, Pn ╞ Q1 … Qn ╞ P1 θ … Qn θ
    From 1 and 2, R θ follows by ordinary Modus Ponens

                            Jarrar © 2011                       65
Forward Chaining

• Proofs start with the given axioms/premises in KB,
  deriving new sentences using GMP until the goal/query
  sentence is derived

• This defines a forward-chaining inference procedure
  because it moves “forward” from the KB to the goal

• Natural deduction using GMP is complete for KBs
  containing only Horn clauses




                        Jarrar © 2011                     66
Example Knowledge Base

• The law says that 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




                          Jarrar © 2011                     67
Example Knowledge Base contd.

... it is a crime for an American to sell weapons to hostile nations:
    American(x)     Weapon(y)    Sells(x,y,z)        Hostile(z)   Criminal(x)
Nono … has some missiles, i.e., x Owns(Nono,x)                    Missile(x):

    Owns(Nono,M1)      Missile(M1)
… all of its missiles were sold to it by Colonel West
    Missile(x)    Owns(Nono,x)       Sells(West,x,Nono)
Missiles are weapons:

    Missile(x)    Weapon(x)
An enemy of America counts as "hostile“:
    Enemy(x,America)      Hostile(x)
West, who is American …

    American(West)
The country Nono, an enemy of America …

    Enemy(Nono,America)
                                     Jarrar © 2011                              68
Forward Chaining Proof




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     69
Forward Chaining Proof




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     70
Forward Chaining Proof




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     71
Forward Chaining Proof




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     72
Forward Chaining Proof




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     73
Forward Chaining Proof




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     74
Properties of Forward Chaining

• Sound and complete for first-order definite clauses.

• Datalog = first-order definite clauses + no functions
• FC terminates for Datalog in finite number of iterations.

• May not terminate in general if α is not entailed.

• This is unavoidable: entailment with definite clauses is
  semidecidable.




                           Jarrar © 2011                      75
Efficiency of Forward Chaining

Incremental forward chaining: no need to match a rule on
   iteration k if a premise wasn't added on iteration k-1
      Match each rule whose premise contains a newly added positive
     literal.


Matching itself can be expensive:
Database indexing allows O(1) retrieval of known facts
    e.g., query Missile(x) retrieves Missile(M1)

Forward chaining is widely used in deductive databases.




                              Jarrar © 2011                           76
Backward Chaining

• Proofs start with the goal query, find implications that
  would allow you to prove it, and then prove each of the
  antecedents in the implication, continuing to work
  “backwards” until you arrive at the axioms, which we know
  are true.
• Backward-chaining deduction using GMP is complete for
  KBs containing only Horn clauses.




                         Jarrar © 2011                    77
Backward chaining example




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     78
Backward chaining example




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     79
Backward chaining example




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     80
Backward chaining example




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     81
Backward chaining example




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     82
Backward chaining example




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     83
Backward chaining example




American(x)     Weapon(y)      Sells(x,y,z)       Criminal(x)
Owns(Nono,M1)        Missile(M1)
Missile(x)    Owns(Nono,x)         Sells(West,x,Nono)
Missile(x)     Weapon(x)
Enemy(x,America)      Hostile(x)
American(West)
Enemy(Nono,America)
                              Jarrar © 2011                     84
Properties of Backward Chaining

• Depth-first recursive proof search: space is linear in size of
  proof.

• Incomplete due to infinite loops
      fix by checking current goal against every goal on stack.


• Inefficient due to repeated subgoals (both success and
  failure).
      fix using caching of previous results (extra space)


• Widely used for logic programming.


                               Jarrar © 2011                      85
Forward vs. Backward Chaining

• FC is data-driven
  –   Automatic, unconscious processing
  –   E.g., object recognition, routine decisions
  –   May do lots of work that is irrelevant to the goal
  –   More efficient when you want to compute all conclusions.

• BC is goal-driven, better for problem-solving
  – Where are my keys? How do I get to my next class?
  – Complexity of BC can be much less than linear in the size of the KB
  – More efficient when you want one or a few decisions.




                               Jarrar © 2011                         86
Logic Programming

• Algorithm = Logic + Control
• A backward chain reasoning theorem-prover applied to declarative
  sentences in the form of implications:
                  If B1 and … and Bn then H

• Implications are treated as goal-reduction procedures:
                                to show/solve H, show/solve B1 and … and Bn.
         where implication would be interpreted as a solution of problem H
         given solutions of B1 … Bn.

• Find a solution is a proof search, which done Depth-first backward
  chaining.
• Because automated proof search is generally infeasible, logic
  programming relies on the programmer to ensure that inferences are
  generated efficiently. Also by restricting the underlying logic to a "well-
  behaved" fragment such as Horn clauses or Hereditary Harrop formulas.
                                 Jarrar © 2011                               87
Logic Programming: Prolog

Developed by Alain Colmerauer(Marseille) and Robert Kowalski(Edinburgh)
in 1972.

Program = set of clauses of the form
       P(x)1 …      p(xn)   head
written as
        head :- P(x1), … , P(xn).

For example:
 criminal(X) :- american(X), weapon(Y), sells(X,Y,Z), hostile(Z).


Closed-world assumption ("negation as failure").
    – alive(X) :- not dead(X).
    – alive(joe) succeeds if dead(joe) fails.




                                Jarrar © 2011                             88
Logic Programming: Prolog

mother(Nuha, Sara).
father(Ali, Sara).
father(Ali, Dina).
father(Said, Ali).
sibling(X, Y) :- parent(Z, X), parent(Z, Y).
parent (X, Y) :- father(X, Y).
parent(X, Y) :- mother (X, Y).


               ?- sibling(Sara, Dina).
               Yes


              ?- father(Father, Child).               // enumerates all valid answers



                                               Jarrar © 2011                            89
Resolution in FOL




   Jarrar © 2011    90
Resolution in FOL

• Recall: We saw that the propositional resolution is a refutationly
  complete inference procedure for Propositional Logic.

• Here, we extend resolution to FOL.

• First we need to covert sentences in to CNF, for example:

     x American(x)    Weapon(y)     Sells(x,y,z)    Hostile(z)     Criminal(x)

• becomes

    American(x)      Weapon(y)       Sells(x,y,z)     Hostile(z)    Criminal(x)

• Every sentence of first-order logic can be converted into inferentially
  equivalent CNF sentence.

• The procedure for conversion to CNF is similar to the propositional
  case.
                                 Jarrar © 2011                                    91
Conversion to CNF

• The procedure for conversion to CNF is similar to the positional
  case.

• For example: “Everyone who loves all animals is loved by someone”, or
     x [ y Animal(y)     Loves(x,y)]            [ y Loves(y,x)]

Step 1 Eliminate Implications

     x[    y Animal(y)     Loves(x,y)]   [ y Loves(y,x)]

Step 2. Move    inwards:      x p ≡ x p,               xp≡ x p
     x [ y ( Animal(y) Loves(x,y))] [ y Loves(y,x)]
     x[ y     Animal(y)    Loves(x,y)] [ y Loves(y,x)]
     x [ y Animal(y)    Loves(x,y)] [ y Loves(y,x)]


                                Jarrar © 2011                             92
Conversion to CNF contd.

Step 2. Move    inwards:

      x [ y Animal(y)  Loves(x,y)] [ y Loves(y,x)]
Step 3. Standardize variables: each quantifier should use a different one

     x [ y Animal(y)       Loves(x,y)]    [ z Loves(z,x)]
Step 4. Skolemize: a more general form of existential instantiation. Each
     existential variable is replaced by a Skolem function of the enclosing
     universally quantified variables:
      x [Animal(F(x))      Loves(x,F(x))]     Loves(G(x),x)
Step 5. Drop universal quantifiers:
    [Animal(F(x))       Loves(x,F(x))]     Loves(G(x),x)
Step 6. Distribute      over   :
    [Animal(F(x))    Loves(G(x),x)]      [ Loves(x,F(x))    Loves(G(x),x)]
                                   Jarrar © 2011                              93
Resolution in FOL

• The inference rule (FOL version):
                      l1 ··· lk,                  m1      ···    mn
        (l1   ···   li-1   li+1   ···   lk   m1     ···   mj-1    mj+1   ···   m n) θ

   where Unify(li, mj) = θ.

• The two clauses are assumed to be standardized apart so that they
  share no variables.

• Apply resolution steps to CNF(KB                  α).

• Let’s extend the previous example, and apply the resolution:
      Everyone who loves all animals is loved by someone.
      Anyone who kills an animal is loved by no one.
      Ali loves all animals.
      Either Ali or Kais killed the cat, who is named Foxi.
      Did Kais killed the cat?
                                        Jarrar © 2011                                   94
Resolution in FOL (Example)

Let’s extend the previous example, and apply the resolution:
      Everyone who loves all animals is loved by someone.
      Anyone who kills an animal is loved by no one.
      Ali loves all animals.
      Either Ali or Kais killed the cat, who is an animal and its is named Foxi.
      Did Kais killed the cat?


In FOL:
     A. x [ y Animal(y)       Loves(x,y)]                 [ y Loves(y,x)]
     B. x [ y Animal(y)      Kills(x,y)]                [ z Loves(z,x)]
     C. x Animal(x)      Loves(Ali,x)
     D. Kills (Ali,Foxi) Kills(Kais,x)
     E. Cat(Foxi)
     F. x Cat(x) Animal (x)
     G. Kills(Kais,Foxi)

                                     Jarrar © 2011                                 95
Resolution in FOL (Example)

     A. x [ y Animal(y)       Loves(x,y)]           [ y Loves(y,x)]
     B. x [ y Animal(y)      Kills(x,y)]          [ z Loves(z,x)]
     C. x Animal(x)      Loves(Ali,x)
     D. Kills (Ali,Foxi) Kills(Kais,x)
     E. Cat(Foxi)
     F. x Cat(x) Animal (x)
     G. Kills(Kais,Foxi)
After applying the CNF, we obtain:

    A1. Animal(F(x))     Loves(G(x),x)
    A2. Loves(x,F(x))    Loves(G(x),x)
     B. Animal(y)      Kills(x,y)    Loves(z,x)
     C. Animal(x) Cat(Foxi) Loves(Ali,x)
     D. Kills(Ali,Foxi) Kills(Kais, Foxi)
     E. Cat(Foxi)
     F. Cat(x) Animal (x)
     G.  Kills(Kais,Foxi)

                                  Jarrar © 2011                       96
Resolution in FOL (Example)
A1   Animal(F(x))         Loves(G(x),x)
A2       Loves(x,F(x))      Loves(G(x),x)
B        Loves(y,x)       Animal(z)       Kills(x,z)
C        Animal(x) Cat(Foxi) Loves(Ali,x)
D    Kills(Ali,Foxi)      Kills(Kais, Foxi)
E    Cat(Foxi)
F        Cat(x)   Animal (x)
G        Kills(Kais,Foxi)
H    Animal (Foxi)                                     E,F    {x/Foxi}
I    Kills(Ali,Foxi)                                   D,G    {}
J        Animal(F(Ali))     Loves(G(Ali), Ali)         A2,C   {x/Ali, F(x)/x}
K    Loves(G(Ali), Ali)                                J,A1   {F(x)/F(Ali), X/Ali}
L        Loves(y,x)       Kills(x,Foxi)                H,B    {z/Foxi}
M        Loves(y,Ali)                                  I,L    {x/Ali}
N    .                                                 M,K    {y/G(Ali)}
                                      Jarrar © 2011                                  97
Resolution in FOL (Another Example)

• The law says that 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
• Assume this is represented in FOL (and in CNF):
     American(x)     Weapon(y)   Sells(x,y,z) Hostile(z)   Criminal(x)
     Missile(x)  Owns(Nono,x) Sells(West,x,Nano)
     Enemy(x,America) Hostile(x)
     Missile(x) Weapon(x)
    Owns(Nono,M1)
    Missile(M1)
    American(West)
    Enemy(Nano,America)
     Criminal (West)

                              Jarrar © 2011                              98
Resolution in FOL (Another Example)
1     American(x)      Weapon(y)        Sells(x,y,z)   Hostile(z)   Criminal(x)
2    Missile(x)     Owns(Nono,x)       Sells(West,x,Nano)
3    Enemy(x,America)     Hostile(x)
4    Missile(x)   Weapon(x)
5   Owns(Nono,M1)
6   Missile(M1)
7   American(West)
8   Enemy(Nano,America)
9    Criminal (West)




                                               Jarrar © 2011                      99
Resolution in FOL (Another Example)
1        American(x)        Weapon(y)        Sells(x,y,z)   Hostile(z)   Criminal(x)
2        Missile(x)     Owns(Nono,x)        Sells(West,x,Nano)
3        Enemy(x,America)      Hostile(x)
4        Missile(x)    Weapon(x)
5    Owns(Nono,M1)
6    Missile(M1)
7    American(West)
8    Enemy(Nano,America)
9        Criminal (West)
10       American(West)        Weapon(y)         Sells(West,y,z)    Hostile(z)         1,9    {x/West}
11       Weapon(y)       Sells(West,y,z)       Hostile(z)                              7,10   {x/West}
12       Missile(y)     Sells(West,y,z)      Hostile(z)                                4,11   {x/y}
13       Sells(West,M1,z)      Hostile(z)                                              6,12   {y/M1}
14       Missile(M1)     Owns(Nono, M1)          Hostile(Nano)                         2,13   {x/M1, z/Nano}
15       Owns(Nono, M1)        Hostile(Nano)                                           6,14   {}
16       Hostile(Nano)                                                                 5,15   {}
17       Enemy(Nano,America)                                                           3,16   {x/Nano}
18   .                                                                                 8,17   {}
                                                    Jarrar © 2011                                          100
Resolution in FOL (Another Example)
    Another representation (as Tree)
1                                                                    9

                         7                                                     10

                     4                                               11

                                 6                                   12

     2                                                          13

                             6                                           14

                     5                                     15

             3                                        16

                 8                                   17

                                           18
                                     Jarrar © 2011                            101
Summary

• Instantiating quantifiers is typically very low.
• Unification is much more efficient than Instantiating quantifiers.
• Generalized Modus Ponens = Modus Ponens + unification, which is
  then used in forward/backward chaining.
• Generalized Modus Ponens is complete but semidecidable.
• Forward chaining is complete, and used in deductive databases, and
  Datalogs with polynomial time.
• Backward chaining is complete, used in logic programming, suffers
  from redundant inference and infinite loops.
• Generalized Resolution is refutation complete for sentences with CNF.
• There are no decidable inference methods for FOL.
• The exam will evaluate: WhatHowWhy (for all above)
• Next Lecture: Description logics are decidable logics.
                                 Jarrar © 2011                         102

Más contenido relacionado

La actualidad más candente

Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
On almost generalized semi continuous
On almost    generalized semi continuousOn almost    generalized semi continuous
On almost generalized semi continuousAlexander Decker
 
11.on almost generalized semi continuous
11.on almost    generalized semi continuous11.on almost    generalized semi continuous
11.on almost generalized semi continuousAlexander Decker
 
Fundamentals of Parameterised Covering Approximation Space
Fundamentals of Parameterised Covering Approximation SpaceFundamentals of Parameterised Covering Approximation Space
Fundamentals of Parameterised Covering Approximation SpaceYogeshIJTSRD
 
congruence lattices of algebras
congruence lattices of algebrascongruence lattices of algebras
congruence lattices of algebrasfilipke85
 
Fuzzy Homogeneous Bitopological Spaces
Fuzzy  Homogeneous Bitopological Spaces Fuzzy  Homogeneous Bitopological Spaces
Fuzzy Homogeneous Bitopological Spaces IJECEIAES
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and LiftingMegha Sharma
 
On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...
On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...
On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...Editor IJCATR
 
First Order Logic resolution
First Order Logic resolutionFirst Order Logic resolution
First Order Logic resolutionAmar Jukuntla
 

La actualidad más candente (16)

First order logic
First order logicFirst order logic
First order logic
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
Pl vol1
Pl vol1Pl vol1
Pl vol1
 
On almost generalized semi continuous
On almost    generalized semi continuousOn almost    generalized semi continuous
On almost generalized semi continuous
 
11.on almost generalized semi continuous
11.on almost    generalized semi continuous11.on almost    generalized semi continuous
11.on almost generalized semi continuous
 
Chapter 4 (final)
Chapter 4 (final)Chapter 4 (final)
Chapter 4 (final)
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
Semantics
SemanticsSemantics
Semantics
 
W.cholamjiak
W.cholamjiakW.cholamjiak
W.cholamjiak
 
Fundamentals of Parameterised Covering Approximation Space
Fundamentals of Parameterised Covering Approximation SpaceFundamentals of Parameterised Covering Approximation Space
Fundamentals of Parameterised Covering Approximation Space
 
Icml12
Icml12Icml12
Icml12
 
congruence lattices of algebras
congruence lattices of algebrascongruence lattices of algebras
congruence lattices of algebras
 
Fuzzy Homogeneous Bitopological Spaces
Fuzzy  Homogeneous Bitopological Spaces Fuzzy  Homogeneous Bitopological Spaces
Fuzzy Homogeneous Bitopological Spaces
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
 
On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...
On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...
On Some New Contra Continuous and Contra Open Mappings in Intuitionistic Fuzz...
 
First Order Logic resolution
First Order Logic resolutionFirst Order Logic resolution
First Order Logic resolution
 

Destacado

Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logicankush_kumar
 
First order logic in knowledge representation
First order logic in knowledge representationFirst order logic in knowledge representation
First order logic in knowledge representationSabaragamuwa University
 
Jarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference MethodsJarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference MethodsMustafa Jarrar
 
Jarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inferenceJarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inferencePalGov
 
Inference in first order logic12
Inference in first order logic12Inference in first order logic12
Inference in first order logic12yosser atassi
 
Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents Mustafa Jarrar
 
Class first order logic
Class first order logicClass first order logic
Class first order logicchandsek666
 
Jarrar: Description Logic
Jarrar: Description LogicJarrar: Description Logic
Jarrar: Description LogicMustafa Jarrar
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolutionTianlu Wang
 
Classic Formal Methods Model Checking
Classic Formal Methods Model CheckingClassic Formal Methods Model Checking
Classic Formal Methods Model Checkingtyramisu
 
Logical Agents
Logical AgentsLogical Agents
Logical AgentsYasir Khan
 
Jarrar: Arabic Ontology
Jarrar: Arabic OntologyJarrar: Arabic Ontology
Jarrar: Arabic OntologyMustafa Jarrar
 
English Comprehension (Inference Qns)
English Comprehension (Inference Qns)English Comprehension (Inference Qns)
English Comprehension (Inference Qns)Adrian Peeris
 
Logic Notes
Logic NotesLogic Notes
Logic Notesacavis
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inferenceSlideshare
 
Jarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language ProcessingJarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language ProcessingMustafa Jarrar
 

Destacado (20)

Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logic
 
First order logic
First order logicFirst order logic
First order logic
 
First order logic in knowledge representation
First order logic in knowledge representationFirst order logic in knowledge representation
First order logic in knowledge representation
 
Jarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference MethodsJarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference Methods
 
Jarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inferenceJarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inference
 
Inference in first order logic12
Inference in first order logic12Inference in first order logic12
Inference in first order logic12
 
Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents
 
Class first order logic
Class first order logicClass first order logic
Class first order logic
 
Jarrar: Description Logic
Jarrar: Description LogicJarrar: Description Logic
Jarrar: Description Logic
 
Chap05
Chap05Chap05
Chap05
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolution
 
3 fol examples v2
3 fol examples v23 fol examples v2
3 fol examples v2
 
Temporal logic-model-checking
Temporal logic-model-checkingTemporal logic-model-checking
Temporal logic-model-checking
 
Classic Formal Methods Model Checking
Classic Formal Methods Model CheckingClassic Formal Methods Model Checking
Classic Formal Methods Model Checking
 
Logical Agents
Logical AgentsLogical Agents
Logical Agents
 
Jarrar: Arabic Ontology
Jarrar: Arabic OntologyJarrar: Arabic Ontology
Jarrar: Arabic Ontology
 
English Comprehension (Inference Qns)
English Comprehension (Inference Qns)English Comprehension (Inference Qns)
English Comprehension (Inference Qns)
 
Logic Notes
Logic NotesLogic Notes
Logic Notes
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
 
Jarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language ProcessingJarrar: Introduction to Natural Language Processing
Jarrar: Introduction to Natural Language Processing
 

Similar a Jarrar: First Order Logic

Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionPalGov
 
Jarrar.lecture notes.aai.2012s.descriptionlogic
Jarrar.lecture notes.aai.2012s.descriptionlogicJarrar.lecture notes.aai.2012s.descriptionlogic
Jarrar.lecture notes.aai.2012s.descriptionlogicSinaInstitute
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in folchandsek666
 
A brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTA brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTJiahao Chen
 
Logic and Reasoning in the Semantic Web (part II –OWL)
Logic and Reasoning in the Semantic Web (part II –OWL)Logic and Reasoning in the Semantic Web (part II –OWL)
Logic and Reasoning in the Semantic Web (part II –OWL)Fulvio Corno
 
First Order Logic
First Order LogicFirst Order Logic
First Order LogicMianMubeen3
 
Exchanging More than Complete Data
Exchanging More than Complete DataExchanging More than Complete Data
Exchanging More than Complete Datanet2-project
 
A T(1)-type theorem for entangled multilinear Calderon-Zygmund operators
A T(1)-type theorem for entangled multilinear Calderon-Zygmund operatorsA T(1)-type theorem for entangled multilinear Calderon-Zygmund operators
A T(1)-type theorem for entangled multilinear Calderon-Zygmund operatorsVjekoslavKovac1
 
Ch2 (8).pptx
Ch2 (8).pptxCh2 (8).pptx
Ch2 (8).pptxDeyaHani
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logicschauhankapil
 
Normalization
NormalizationNormalization
Normalizationmomo2187
 
Can we estimate a constant?
Can we estimate a constant?Can we estimate a constant?
Can we estimate a constant?Christian Robert
 
Ecml2010 Slides
Ecml2010 SlidesEcml2010 Slides
Ecml2010 Slidesfanizzi
 

Similar a Jarrar: First Order Logic (20)

Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
 
Jarrar.lecture notes.aai.2012s.descriptionlogic
Jarrar.lecture notes.aai.2012s.descriptionlogicJarrar.lecture notes.aai.2012s.descriptionlogic
Jarrar.lecture notes.aai.2012s.descriptionlogic
 
Fol
FolFol
Fol
 
Lec 3.pdf
Lec 3.pdfLec 3.pdf
Lec 3.pdf
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in fol
 
AI-09 Logic in AI
AI-09 Logic in AIAI-09 Logic in AI
AI-09 Logic in AI
 
A brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTA brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFT
 
Logic and Reasoning in the Semantic Web (part II –OWL)
Logic and Reasoning in the Semantic Web (part II –OWL)Logic and Reasoning in the Semantic Web (part II –OWL)
Logic and Reasoning in the Semantic Web (part II –OWL)
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
 
Exchanging More than Complete Data
Exchanging More than Complete DataExchanging More than Complete Data
Exchanging More than Complete Data
 
A T(1)-type theorem for entangled multilinear Calderon-Zygmund operators
A T(1)-type theorem for entangled multilinear Calderon-Zygmund operatorsA T(1)-type theorem for entangled multilinear Calderon-Zygmund operators
A T(1)-type theorem for entangled multilinear Calderon-Zygmund operators
 
Unit 1.5
Unit 1.5Unit 1.5
Unit 1.5
 
Ch2 (8).pptx
Ch2 (8).pptxCh2 (8).pptx
Ch2 (8).pptx
 
Unit 1.4
Unit 1.4Unit 1.4
Unit 1.4
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logics
 
Hak ontoforum
Hak ontoforumHak ontoforum
Hak ontoforum
 
AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 
Normalization
NormalizationNormalization
Normalization
 
Can we estimate a constant?
Can we estimate a constant?Can we estimate a constant?
Can we estimate a constant?
 
Ecml2010 Slides
Ecml2010 SlidesEcml2010 Slides
Ecml2010 Slides
 

Más de Mustafa Jarrar

Clustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisClustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisMustafa Jarrar
 
Classifying Processes and Basic Formal Ontology
Classifying Processes  and Basic Formal OntologyClassifying Processes  and Basic Formal Ontology
Classifying Processes and Basic Formal OntologyMustafa Jarrar
 
Discrete Mathematics Course Outline
Discrete Mathematics Course OutlineDiscrete Mathematics Course Outline
Discrete Mathematics Course OutlineMustafa Jarrar
 
Business Process Implementation
Business Process ImplementationBusiness Process Implementation
Business Process ImplementationMustafa Jarrar
 
Business Process Design and Re-engineering
Business Process Design and Re-engineeringBusiness Process Design and Re-engineering
Business Process Design and Re-engineeringMustafa Jarrar
 
BPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsBPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsMustafa Jarrar
 
BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs  BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs Mustafa Jarrar
 
Introduction to Business Process Management
Introduction to Business Process ManagementIntroduction to Business Process Management
Introduction to Business Process ManagementMustafa Jarrar
 
Customer Complaint Ontology
Customer Complaint Ontology Customer Complaint Ontology
Customer Complaint Ontology Mustafa Jarrar
 
Subset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesSubset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesMustafa Jarrar
 
Schema Modularization in ORM
Schema Modularization in ORMSchema Modularization in ORM
Schema Modularization in ORMMustafa Jarrar
 
On Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineOn Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineMustafa Jarrar
 
Lessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesLessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesMustafa Jarrar
 
Presentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalPresentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalMustafa Jarrar
 
Jarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsJarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsMustafa Jarrar
 
Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingMustafa Jarrar
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Mustafa Jarrar
 
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsRiestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsMustafa Jarrar
 
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Mustafa Jarrar
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql ProjectMustafa Jarrar
 

Más de Mustafa Jarrar (20)

Clustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment AnalysisClustering Arabic Tweets for Sentiment Analysis
Clustering Arabic Tweets for Sentiment Analysis
 
Classifying Processes and Basic Formal Ontology
Classifying Processes  and Basic Formal OntologyClassifying Processes  and Basic Formal Ontology
Classifying Processes and Basic Formal Ontology
 
Discrete Mathematics Course Outline
Discrete Mathematics Course OutlineDiscrete Mathematics Course Outline
Discrete Mathematics Course Outline
 
Business Process Implementation
Business Process ImplementationBusiness Process Implementation
Business Process Implementation
 
Business Process Design and Re-engineering
Business Process Design and Re-engineeringBusiness Process Design and Re-engineering
Business Process Design and Re-engineering
 
BPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical ConstructsBPMN 2.0 Analytical Constructs
BPMN 2.0 Analytical Constructs
 
BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs  BPMN 2.0 Descriptive Constructs
BPMN 2.0 Descriptive Constructs
 
Introduction to Business Process Management
Introduction to Business Process ManagementIntroduction to Business Process Management
Introduction to Business Process Management
 
Customer Complaint Ontology
Customer Complaint Ontology Customer Complaint Ontology
Customer Complaint Ontology
 
Subset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion RulesSubset, Equality, and Exclusion Rules
Subset, Equality, and Exclusion Rules
 
Schema Modularization in ORM
Schema Modularization in ORMSchema Modularization in ORM
Schema Modularization in ORM
 
On Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in PalestineOn Computer Science Trends and Priorities in Palestine
On Computer Science Trends and Priorities in Palestine
 
Lessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online CoursesLessons from Class Recording & Publishing of Eight Online Courses
Lessons from Class Recording & Publishing of Eight Online Courses
 
Presentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-finalPresentation curras paper-emnlp2014-final
Presentation curras paper-emnlp2014-final
 
Jarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 CallsJarrar: Future Internet in Horizon 2020 Calls
Jarrar: Future Internet in Horizon 2020 Calls
 
Habash: Arabic Natural Language Processing
Habash: Arabic Natural Language ProcessingHabash: Arabic Natural Language Processing
Habash: Arabic Natural Language Processing
 
Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing Adnan: Introduction to Natural Language Processing
Adnan: Introduction to Natural Language Processing
 
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 ProposalsRiestra: How to Design and engineer Competitive Horizon 2020 Proposals
Riestra: How to Design and engineer Competitive Horizon 2020 Proposals
 
Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020Bouquet: SIERA Workshop on The Pillars of Horizon2020
Bouquet: SIERA Workshop on The Pillars of Horizon2020
 
Jarrar: Sparql Project
Jarrar: Sparql ProjectJarrar: Sparql Project
Jarrar: Sparql Project
 

Último

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 

Jarrar: First Order Logic

  • 1. Lecture Notes, Artificial Intelligence ((ENCS434)) University of Birzeit 1st Semester, 2011 Artificial Intelligence (ENCS434) First Order Logic Dr. Mustafa Jarrar University of Birzeit mjarrar@birzeit.edu www.jarrar.info Jarrar © 2011 1
  • 2. Acknowledgement The slides in this lecture are based on the slides developed by Prof. Enrico Franconi* See the online course on Description Logics http://www.inf.unibz.it/~franconi/dl/course/ (But notice that I introduced some modifications.) Jarrar © 2011 2
  • 3. Reading All slides + everything I say Chapter 8 and Chapter 9 Jarrar © 2011 3
  • 4. Outline • FOL, First Order Logic • Motivation (why FOL) • Syntax • Semantics • FOL Inference Methods • Enumeration Method • Inference rules • Resolution • Forward and backward Chaining Jarrar © 2011 4
  • 5. Motivation • We can already do a lot with propositional logic. • But it is unpleasant that we cannot access the structure of atomic sentences. • Atomic formulas of propositional logic are too atomic . they are just statement. • which my be true or false but which have no internal structure. • In First Order Logic (FOL) the atomic formulas are interpreted as statements about relationships between objects. Jarrar © 2011 5
  • 6. Predicates and Constants Let's consider the statements: • Mary is female • John is male • Mary and John are siblings In propositional logic the above statements are atomic propositions: • Mary-is-female • John-is-male • Mary-and-John-are-siblings In FOL atomic statements use predicates, with constants as argument: • Female(mary) • Male(john) • Siblings(mary, john) Jarrar © 2011 6
  • 7. Variables and Quantifiers Let's consider the statements: • Everybody is male or female • A male is not a female In FOL predicates may have variables as arguments, whose value is bounded by quantifiers: • x. Male(x) Female(x) • x. Male(x) Female(x) Deduction (why?): • Mary is not male • Male(mary) Jarrar © 2011 7
  • 8. Functions Let's consider the statement: • The father of a person is male In FOL objects of the domain may be denoted by functions applied to (other) objects: • x. Male(father(x)) Jarrar © 2011 8
  • 9. Syntax of FOL: atomic sentences Countably infinite supply of symbols (signature): variable symbols: x, y, z, … n-ary function symbols: f, g, h,… individual constants: a, b, c,… n-are predicate symbols: P, Q, R,… Terms: t x variable | a constant | f (t1,…,tn) function application Ground terms: terms that do not contain variables Formulas: P(t1,…,tn) atomic formulas E.g., Brother(kingJohn; richardTheLionheart) >(length(leftLegOf(richard)), length(leftLegOf(kingJohn))) Jarrar © 2011 9
  • 10. Outline • FOL, First Order Logic • Motivation (why FOL) • Syntax • Semantics • FOL Inference Methods • Enumeration Method • Inference rules • Resolution • Forward and backward Chaining Jarrar © 2011 10
  • 11. Syntax of Propositional Logic Formulas: , P(t1,…,tn)atomic formulas | false | T true | negation | conjunction | disjunction | implication | equivalence (Ground) atoms and (ground) literals. E.g. Sibling(kingJohn, richard) Sibling(richard, kingJohn) >(1, 2) ≤(1, 2) >(1, 2) >(1, 2) Jarrar © 2011 11
  • 12. Syntax of First Order Logic Formulas: , P(t1,…,tn) atomic formulas | false | T true | negation | conjunction | disjunction | implication | equivalence | x. universal quantification | x. existential quantification E.g. Everyone in Italy is smart: x. In(x, Italy) Smart(x) Someone in France is smart: x. In(x, France) Smart(x) Jarrar © 2011 12
  • 13. Summary of Syntax of FOL Terms – variables – constants – functions Literals – atomic formula • relation (predicate) – negation Well formed formulas – truth-functional connectives – existential and universal quantifiers Jarrar © 2011 13
  • 14. Outline • FOL, First Order Logic • Motivation (why FOL) • Syntax • Semantics • FOL Inference Methods • Enumeration Method • Inference rules • Resolution • Forward and backward Chaining Jarrar © 2011 14
  • 15. Semantics of FOL: intuition • Just like in propositional logic, a (complex) FOL formula may be true (or false) with respect to a given interpretation. • An interpretation specifies referents for constant symbols objects predicate symbols relations function symbols functional relations • An atomic sentence P(t1,…, tn) is true in a given interpretation iff the objects referred to by t1,…, tn are in the relation referred to by the predicate P. • An interpretation in which a formula is true is called a model for the formula. Jarrar © 2011 15
  • 16. Models for FOL: Example Jarrar © 2011 16
  • 17. Models for FOL: Example Objects Relations: sets of tuples of objects Functional relations: all tuples of objects + "value" object Jarrar © 2011 17
  • 18. Semantic of FOL: Interpretations Interpretation: = , . where is an arbitrary non-empty set and is a function that maps: • Individual constants to elements of : a • n-ary predicate symbols to relation over : P n • n-ary function symbols to functions over : f [ n ] Jarrar © 2011 18
  • 19. Semantic of FOL: Satisfaction Interpretation of ground terms: ( f (t1,…,tn))I = f I (t I 1,…,t I n) ( ) Satisfaction of ground atoms P(t1,…,tn): I ╞ P(t1,…,tn) iff t I 1,…,t I n PI Jarrar © 2011 19
  • 20. Examples = {d1,…, dn, n > 1} = {1,2,3,…} aI = d1 1I = 1 bI = d2 2I = 2 BlockI = {d1} …. RedI = EvenI = {2,4,6,…} SuccI = {(12), (23),…} Jarrar © 2011 20
  • 21. Examples = {d1,…, dn, n > 1} = {1,2,3,…} aI = d1 1I = 1 bI = d2 2I = 2 BlockI = {d1} …. RedI = EvenI = {2,4,6,…} SuccI = {(12), (23),…} I ╞ Red(b) I | Even(3) I | Block(b) I ╞ Even(succ(3)) Jarrar © 2011 21
  • 22. Semantics of FOL: Variable Assignments V set of all variables. Function : V . Notation: [x/d] means assign d to x Interpretation of terms under c xI, = (x) aI, = aI (f (t1,..,tn))I, = f I (t1I, ,…,tnI, ) Satisfiability of atomic formulas: I, ╞ P(t1,…,tn) iff t1I, ,…,tnI, PI Jarrar © 2011 22
  • 23. Variable Assignment example = {(x  d1), (y  d2)} I, ╞ Red(x) I, [y/d1] ╞ Block(y) Jarrar © 2011 23
  • 24. Interpretation (Example) a b d c e BlockI = {<a>,<b>,<c>,<d>,<e>} AboveI = {<a,b>,<b,c>,<d,e>} ClearI = {<a>,<d>} TableI = {<c>,<e>} I |= Block(a) I | Above(b,e) I | Block(f) I |= Above(b,c) Jarrar © 2011 24
  • 25. Semantics of FOL: Satisfiability of formulas A formula is satisfied by (is true in) an interpretation I under a variable assignment , I, ╞ : I, ╞ P(t1,…,tn) iff t1I, ,…,tnI, PI I, ╞ iff I, | I, ╞ iff I, ╞ and I ╞ I, ╞ iff I, ╞ or I ╞ I, ╞ x. iff for all d : I, [x/d] ╞ I, ╞ x. iff there exits a d : I, [x/d] ╞ Jarrar © 2011 25
  • 26. Satisfiability and Validity An interpretation I is a model of under , if I, ╞ Similarly as in propositional logic, a formula can be satisfiable, unsatisfiable, falsifiable or valid -the definition is in terms of the pair (I, ). A formula is satisfiable, if there is some (I, ) that satisfies , un satisfiable, if is not satisfiable, falsifiable, if there is some (I, ) that does not satisfy , valid (i.e., a tautology), if every (I, ) is a model of . Jarrar © 2011 26
  • 27. Equivalence Analogously, two formulas are logically equivalent ( ), if for all I; we have: I, ╞ iff I, ╞ Jarrar © 2011 27
  • 28. Entailment Entailment is defined similarly as in propositional logic. The formula is logically implied by a formula , if is true in all models of (symbolically, ╞ ): ╞ iff I ╞ for all models I of Jarrar © 2011 28
  • 29. Properties of quantifiers ( x . y. ) is the same as ( y . x. ) ( x . y. ) is the same as ( y . x. ) ( x . y. ) is not the same as ( y . x. ) x . y.Loves(x,y) “There is a person who loves everyone in the world” y. x.Loves(x,y) “Everyone in the world is loved by at least one person” Quantifier duality: each can be expressed using the other x. Likes(x,Falafel) x. Likes(x,Falafel) x.Likes(x,Salad) x Likes(x,Salad) Jarrar © 2011 29
  • 30. Equivalences Jarrar © 2011 30
  • 31. Knowledge Engineering in FOL 1. Identify the task 2. Assemble the relevant knowledge 3. Decide on a vocabulary of predicates, functions, and constants 4. Encode general knowledge about the domain 5. Encode a description of the specific problem instance 6. Pose queries to the inference procedure and get answers 7. Debug the knowledge base Jarrar © 2011 31
  • 32. A simple genealogy KB (Another Example) • Build a small genealogy knowledge base by FOL that – contains facts of immediate family relations (spouses, parents, etc.) – contains definitions of more complex relations (ancestors, relatives) – is able to answer queries about relationships between people • Predicates: – parent(x, y), child (x, y), father(x, y), daughter(x, y), etc. – spouse(x, y), husband(x, y), wife(x,y) – ancestor(x, y), descendent(x, y) – relative(x, y) • Facts: – husband(Joe, Mary), son(Fred, Joe) – spouse(John, Nancy), male(John), son(Mark, Nancy) – father(Jack, Nancy), daughter(Linda, Jack) – daughter(Liz, Linda) – etc. Jarrar © 2011 32
  • 33. A simple genealogy KB (Another Example) • Rules for genealogical relations – ( x,y) parent(x, y) <=> child (y, x) ( x,y) father(x, y) <=> parent(x, y) ^ male(x) (similarly for mother(x, y)) ( x,y) daughter(x, y) <=> child(x, y) ^ female(x) (similarly for son(x, y)) – ( x,y) husband(x, y) <=> spouse(x, y) ^ male(x) (similarly for wife(x, y)) ( x,y) spouse(x, y) <=> spouse(y, x) (spouse relation is symmetric) – ( x,y) parent(x, y) => ancestor(x, y) ( x,y)( z) parent(x, z) ^ ancestor(z, y) => ancestor(x, y) – ( x,y) descendent(x, y) <=> ancestor(y, x) – ( x,y)( z) ancestor(z, x) ^ ancestor(z, y) => relative(x, y) (related by common ancestry) ( x,y) spouse(x, y) => relative(x, y) (related by marriage) ( x,y)( z) relative(z, x) ^ relative(z, y) => relative(x, y) (transitive) ( x,y) relative(x, y) => relative(y, x) (symmetric) • Queries – ancestor(Jack, Fred) /* the answer is yes */ – relative(Liz, Joe) /* the answer is yes */ – relative(Nancy, Mathews) /* no answer in general, no if under closed world assumption */ Jarrar © 2011 33
  • 34. The electronic circuits domain One-bit full adder Jarrar © 2011 34
  • 35. The electronic circuits domain 1. Identify the task – Does the circuit actually add properly? (circuit verification) 2. Assemble the relevant knowledge – Composed of wires and gates; Types of gates (AND, OR, XOR, NOT) – Irrelevant: size, shape, color, cost of gates 3. Decide on a vocabulary – Alternatives: Type(X1) = XOR Type(X1, XOR) XOR(X1) Jarrar © 2011 35
  • 36. The electronic circuits domain 4. Encode general knowledge of the domain 5. t1,t2 Connected(t1, t2) Signal(t1) = Signal(t2) – t Signal(t) = 1 Signal(t) = 0 – 1≠0 – t1,t2 Connected(t1, t2) Connected(t2, t1) – g Type(g) = OR Signal(Out(1,g)) = 1 n Signal(In(n,g)) = 1 – g Type(g) = AND Signal(Out(1,g)) = 0 n Signal(In(n,g)) = 0 – g Type(g) = XOR Signal(Out(1,g)) = 1 Signal(In(1,g)) ≠ Signal(In(2,g)) – g Type(g) = NOT Signal(Out(1,g)) ≠ Signal(In(1,g)) Jarrar © 2011 36
  • 37. The electronic circuits domain 5. Encode the specific problem instance Type(X1) = XOR Type(X2) = XOR Type(A1) = AND Type(A2) = AND Type(O1) = OR Connected(Out(1,X1),In(1,X2)) Connected(In(1,C1),In(1,X1)) Connected(Out(1,X1),In(2,A2)) Connected(In(1,C1),In(1,A1)) Connected(Out(1,A2),In(1,O1)) Connected(In(2,C1),In(2,X1)) Connected(Out(1,A1),In(2,O1)) Connected(In(2,C1),In(2,A1)) Connected(Out(1,X2),Out(1,C1)) Connected(In(3,C1),In(2,X2)) Connected(Out(1,O1),Out(2,C1)) Connected(In(3,C1),In(1,A2)) Jarrar © 2011 37
  • 38. The electronic circuits domain 6. Pose queries to the inference procedure 7. What are the possible sets of values of all the terminals for the adder circuit? 8. i1,i2,i3,o1,o2 Signal(In(1,C_1)) = i1 Signal(In(2,C1)) = i2 Signal(In(3,C1)) = i3 Signal(Out(1,C1)) = o1 Signal(Out(2,C1)) = o2 7. Debug the knowledge base May have omitted assertions like 1 ≠ 0 Jarrar © 2011 38
  • 39. Summary • First-order logic: – objects and relations are semantic primitives – syntax: constants, functions, predicates, equality, quantifiers • Increased expressive power: sufficient to define Wumpus world Jarrar © 2011 39
  • 40. Outline • FOL, First Order Logic • Motivation (why FOL) • Syntax • Semantics • FOL Inference Methods • Enumeration Method • Inference rules • Resolution • Forward and backward Chaining Jarrar © 2011 40
  • 41. Knowledge Bases vs. Databases Transactions Knowledge Base System i.e insert, update, delete... Wffs : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Query ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Constraints DBMS Query ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Query Answer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Proof Provability Query Answer Proof Theoretic View Model Theoretic View The KB is a set of formulae and the Evaluating the truth formula for query evaluation is to prove that the each tuple in the table “Publish” result is provable. Jarrar © 2011 41
  • 42. Outline • Reducing first-order inference to propositional inference • Unification • Generalized Modus Ponens • Forward chaining • Backward chaining • Resolution Jarrar © 2011 42
  • 43. Inference in First-Order Logic • We may inference in FOL by mapping FOL sentences into propositions, and apply the inference methods of propositional logic. • This mapping is called propositionalization. • Thus, Inference in first-order logic can be achieved using: – Inference rules – Forward chaining – Backward chaining – Resolution • Unification • Proofs • Clausal form • Resolution as search Jarrar © 2011 43
  • 44. Universal Instantiation (UI) • Every instantiation of a universally quantified sentence is entailed by it: vα Subst({v/g}, α) for any variable v and ground term g • Example: x King(x) Greedy(x) Evil(x) King(John) Greedy(John) King(John) Greedy(John) Evil(John) King(Richard) Greedy(Richard) Evil(Richard) Jarrar © 2011 44
  • 45. Existential Instantiation (EI) For any sentence α, variable v, and constant symbol k that does not appear elsewhere in the knowledge base: vα Subst({v/k}, α) Example: x Crown(x) OnHead(x,John) Crown(C1) OnHead(C1,John) provided C1 is a new constant symbol, called a Skolem constant. • The variable symbol can be replaced by any ground term, i.e., any constant symbol or function symbol applied to ground terms only. • In other words, we don’t want to accidentally draw other inferences about it by introducing the constant. • Convenient to use this to reason about the unknown object, rather than constantly manipulating the existential quantifier. Jarrar © 2011 45
  • 46. Reduction to Propositional Inference Suppose the KB contains just 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: proposition symbols are King(John), Greedy(John), Evil(John), King(Richard), etc. Jarrar © 2011 46
  • 47. Reduction contd. • Every FOL KB can be propositionalized so as to preserve entailment • (A ground sentence is entailed by new KB iff entailed by original KB) • Idea: propositionalize KB and query, apply resolution, return result • Problem: with function symbols, there are infinitely many ground terms, – e.g., Father(Father(Father(John))) Jarrar © 2011 47
  • 48. Reduction contd. Theorem: Herbrand (1930). If a sentence α is entailed by an FOL KB, it is entailed by a finite subset of the propositionalized KB Idea: For n = 0 to ∞ do create a propositional KB by instantiating with depth-$n$ terms see if α is entailed by this KB Problem: works if α is entailed, loops if α is not entailed. Godel's Completeness Theorem says that FOL entailment is only semidecidable: – If a sentence is true given a set of axioms, there is a procedure that will determine this. – If the sentence is false, then there is no guarantee that a procedure will ever determine this–i.e., it may never halt. Jarrar © 2011 48
  • 49. Completeness of some inference techniques • Truth Tabling is not complete for FOL because truth table size may be infinite. • Natural Deduction is complete for FOL but is not practical because the “branching factor” in the search is too large (so we would have to potentially try every inference rule in every possible way using the set of known sentences). • Generalized Modus Ponens is not complete for FOL. • Generalized Modus Ponens is complete for KBs containing only Horn clauses. Jarrar © 2011 49
  • 50. Problems with Propositionalization • Propositionalization seems to generate lots of irrelevant sentences. E.g., from: x King(x) Greedy(x) Evil(x) King(John) y Greedy(y) Brother(Richard, John) • It seems obvious that Evil(John), but propositionalization produces lots of facts such as Greedy(Richard) that are irrelevant • With p k-ary predicates and n constants, there are p·nk instantiations. Jarrar © 2011 50
  • 51. Problems with Propositionalization Given this KB: King(x) Greedy(x) Evil(x) King(John) Greedy(John) How do we really know that Evil(John)? – We find x that is a King and Greedy, if so then x is Evil. – That is, we need to a substitution {x/John} But Given this KB: x King(x) Greedy(x) Evil(x) King(John) y Greedy(y) How do we really know that Evil(John)? – That is, we need to the substitutions {x/John, y,John}, but how? Jarrar © 2011 51
  • 52. Unification • We can get the inference immediately if we can find a substitution θ such that King(x) and Greedy(x) match King(John) and Greedy(y) θ = {x/John,y/John} • This called Unification, a “pattern-matching” procedure: – Takes two atomic sentences, called literals, as input – Returns “Failure” if they do not match and a substitution list, θ, if they do Unify(P,Q) = θ if Pθ = Qθ • That is, unify(p,q) = θ means subst(θ, p) = subst(θ, q) for two atomic sentences, p and q • θ is called the Most General Unifier (MGU) • All variables in the given two literals are implicitly universally quantified. • To make literals match, replace (universally quantified) variables by terms Jarrar © 2011 52
  • 53. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) Knows(John,Jane) Knows(John,x) Knows(y,Bill) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,Elizabeth) Jarrar © 2011 53
  • 54. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) {x/Jane} Knows(John,Jane) Knows(John,x) Knows(y,Bill) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,Elizabeth) Jarrar © 2011 54
  • 55. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) {x/Jane} Knows(John,Jane) {x/Bill,y/John} Knows(John,x) Knows(y,Bill) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,Elizabeth) Jarrar © 2011 55
  • 56. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we have a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) {x/Jane} Knows(John,Jane) {x/Bill,y/John} Knows(John,x) {y/John,x/Mother(John)} Knows(y,Bill) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,Elizabeth) Jarrar © 2011 56
  • 57. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we have a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) {x/Jane} Knows(John,Jane) {x/Bill,y/John} Knows(John,x) {y/John,x/Mother(John)} Knows(y,Bill) fail Knows(John,x) Knows(y,Mother(y)) • The last unification failed because x cannot take on the values John and Knows(John,x) same time. Elizabeth at the Knows(x,Elizabeth) • Because it happens that both sentences use the same variable name. • Solution: rename x in Knows(x,Elizabeth) into Knows(z17,Elizabeth) , without changing its meaning. (this is called standardizing apart) Jarrar © 2011 57
  • 58. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we have a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) Knows(John,Jane) {x/Jane} Knows(John,x) Knows(y,Bill) {x/Bill,y/John} Knows(John,x) Knows(y,Mother(y)) {y/John,x/Mother(John)} Knows(John,x) Knows(z17,Elizabeth) {x/Elizabeth, z17/John} • The last unification failed because x cannot take on the values John and Elizabeth at the same time. • Because it happens that both sentences use the same variable name. • Solution: rename x in Knows(x,Elizabeth) into Knows(z17,Elizabeth) , without changing its meaning. (this is called standardizing apart) Jarrar © 2011 58
  • 59. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we have a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) {x/Jane} Knows(John,Jane) {x/Bill,y/John} Knows(John,x) {y/John,x/Mother(John)} Knows(y,Bill) {x/Elizabeth, z17/John} Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(z17,Elizabeth) Jarrar © 2011 59
  • 60. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we have a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) Knows(John,Jane) {x/Jane} Knows(John,x) Knows(y,Bill) {x/Bill,y/John} Knows(John,x) Knows(y,Mother(y)) {y/John,x/Mother(John)} Knows(John,x) Knows(z17,Elizabeth) {x/Elizabeth, z17/John} Knows(John,x) Knows(y,z) ?? In the last case, we have two answers: This first unification is more genera θ= {y/John,x/z}, or as it places fewer restrictions on th θ= {y/John,x/John, z/John} values of the variables. Jarrar © 2011 60
  • 61. Unification Example Unify (p,q) = θ where Subst(θ,p) = Subset(θ,q) Suppose we have a query Knows(John,x), we need to unify Knows(John,x) with all sentences in KD. P Q θ Knows(John,x) Knows(John,Jane) {x/Jane} Knows(John,x) Knows(y,Bill) {x/Bill,y/John} Knows(John,x) Knows(y,Mother(y)) {y/John,x/Mother(John)} Knows(John,x) Knows(z17,Elizabeth) {x/Elizabeth, z17/John} Knows(John,x) Knows(y,z) {y/John,x/z} In the last case, we have two answers: For every unifiable pair of θ= {y/John,x/z}, or expressions, there is a θ= {y/John,x/John, z/John} Most General Unifier MGU Jarrar © 2011 61
  • 62. Another Example • Example: – parents(x, father(x), mother(Bill)) – parents(Bill, father(Bill), y) – {x/Bill, y/mother(Bill)} • Example: – parents(x, father(x), mother(Bill)) – parents(Bill, father(y), z) – {x/Bill, y/Bill, z/mother(Bill)} • Example: – parents(x, father(x), mother(Jane)) – parents(Bill, father(y), mother(y)) – Failure Jarrar © 2011 62
  • 63. Generalized Modus Ponens (GMP) • A first-order inference rule, to find substitutions easily. • Apply modus ponens reasoning to generalized rules. • Combines And-Introduction, Universal-Elimination, and Modus Ponens . Example: {P(c), Q(c), x(P(x) Q(x)) R(x)} derive R(c) • General case: Given – Atomic sentences P1, P2, ..., Pn – Implication sentence (Q1 Q2 ... Qn) R • Q1, ..., Qn and R are atomic sentences – Substitution subst(θ, Pi) = subst(θ, Qi) (for i=1,...,n) – Derive new sentence: subst(θ, R) • Substitutions – subst(θ, α) denotes the result of applying a set of substitutions defined by θ to the sentence α – A substitution list θ = {v1/t1, v2/t2, ..., vn/tn} means to replace all occurrences of variable symbol vi by term ti – Substitutions are made in left-to-right order in the list Jarrar © 2011 63
  • 64. Generalized Modus Ponens (GMP) A first-order inference rule, to find substitutions easily. P1, P2, … , Pn, ( Q1 Q2 … Qn R) where Pi θ = Qi θ for all i Subst (R, θ) King(John), Greedy(y), (King(x), Greedy(x) Evil(x)) Subst(Evil(x), {x/John, y/John}) • GMP used with KB of definite clauses (exactly one positive literal). • All variables assumed universally quantified. Jarrar © 2011 64
  • 65. Soundness of GMP Need to show that P1, …, Pn, (Q1 … Qn Q) ╞ R θ provided that Pi θ = Qi θ for all i Lemma: For any sentence Q, we have Q ╞ Q θ by UI (P1 … Pn R) ╞ (P1 … pn R) θ = (P1 θ … Pn θ R θ) Q1 …, Pn ╞ Q1 … Qn ╞ P1 θ … Qn θ From 1 and 2, R θ follows by ordinary Modus Ponens Jarrar © 2011 65
  • 66. Forward Chaining • Proofs start with the given axioms/premises in KB, deriving new sentences using GMP until the goal/query sentence is derived • This defines a forward-chaining inference procedure because it moves “forward” from the KB to the goal • Natural deduction using GMP is complete for KBs containing only Horn clauses Jarrar © 2011 66
  • 67. Example Knowledge Base • The law says that 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 Jarrar © 2011 67
  • 68. Example Knowledge Base contd. ... it is a crime for an American to sell weapons to hostile nations: American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x) Nono … has some missiles, i.e., x Owns(Nono,x) Missile(x): Owns(Nono,M1) Missile(M1) … all of its missiles were sold to it by Colonel West Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missiles are weapons: Missile(x) Weapon(x) An enemy of America counts as "hostile“: Enemy(x,America) Hostile(x) West, who is American … American(West) The country Nono, an enemy of America … Enemy(Nono,America) Jarrar © 2011 68
  • 69. Forward Chaining Proof American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 69
  • 70. Forward Chaining Proof American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 70
  • 71. Forward Chaining Proof American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 71
  • 72. Forward Chaining Proof American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 72
  • 73. Forward Chaining Proof American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 73
  • 74. Forward Chaining Proof American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 74
  • 75. Properties of Forward Chaining • Sound and complete for first-order definite clauses. • Datalog = first-order definite clauses + no functions • FC terminates for Datalog in finite number of iterations. • May not terminate in general if α is not entailed. • This is unavoidable: entailment with definite clauses is semidecidable. Jarrar © 2011 75
  • 76. Efficiency of Forward Chaining Incremental forward chaining: no need to match a rule on iteration k if a premise wasn't added on iteration k-1 Match each rule whose premise contains a newly added positive literal. Matching itself can be expensive: Database indexing allows O(1) retrieval of known facts e.g., query Missile(x) retrieves Missile(M1) Forward chaining is widely used in deductive databases. Jarrar © 2011 76
  • 77. Backward Chaining • Proofs start with the goal query, find implications that would allow you to prove it, and then prove each of the antecedents in the implication, continuing to work “backwards” until you arrive at the axioms, which we know are true. • Backward-chaining deduction using GMP is complete for KBs containing only Horn clauses. Jarrar © 2011 77
  • 78. Backward chaining example American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 78
  • 79. Backward chaining example American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 79
  • 80. Backward chaining example American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 80
  • 81. Backward chaining example American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 81
  • 82. Backward chaining example American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 82
  • 83. Backward chaining example American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 83
  • 84. Backward chaining example American(x) Weapon(y) Sells(x,y,z) Criminal(x) Owns(Nono,M1) Missile(M1) Missile(x) Owns(Nono,x) Sells(West,x,Nono) Missile(x) Weapon(x) Enemy(x,America) Hostile(x) American(West) Enemy(Nono,America) Jarrar © 2011 84
  • 85. Properties of Backward Chaining • Depth-first recursive proof search: space is linear in size of proof. • Incomplete due to infinite loops fix by checking current goal against every goal on stack. • Inefficient due to repeated subgoals (both success and failure). fix using caching of previous results (extra space) • Widely used for logic programming. Jarrar © 2011 85
  • 86. Forward vs. Backward Chaining • FC is data-driven – Automatic, unconscious processing – E.g., object recognition, routine decisions – May do lots of work that is irrelevant to the goal – More efficient when you want to compute all conclusions. • BC is goal-driven, better for problem-solving – Where are my keys? How do I get to my next class? – Complexity of BC can be much less than linear in the size of the KB – More efficient when you want one or a few decisions. Jarrar © 2011 86
  • 87. Logic Programming • Algorithm = Logic + Control • A backward chain reasoning theorem-prover applied to declarative sentences in the form of implications: If B1 and … and Bn then H • Implications are treated as goal-reduction procedures: to show/solve H, show/solve B1 and … and Bn. where implication would be interpreted as a solution of problem H given solutions of B1 … Bn. • Find a solution is a proof search, which done Depth-first backward chaining. • Because automated proof search is generally infeasible, logic programming relies on the programmer to ensure that inferences are generated efficiently. Also by restricting the underlying logic to a "well- behaved" fragment such as Horn clauses or Hereditary Harrop formulas. Jarrar © 2011 87
  • 88. Logic Programming: Prolog Developed by Alain Colmerauer(Marseille) and Robert Kowalski(Edinburgh) in 1972. Program = set of clauses of the form P(x)1 … p(xn) head written as head :- P(x1), … , P(xn). For example: criminal(X) :- american(X), weapon(Y), sells(X,Y,Z), hostile(Z). Closed-world assumption ("negation as failure"). – alive(X) :- not dead(X). – alive(joe) succeeds if dead(joe) fails. Jarrar © 2011 88
  • 89. Logic Programming: Prolog mother(Nuha, Sara). father(Ali, Sara). father(Ali, Dina). father(Said, Ali). sibling(X, Y) :- parent(Z, X), parent(Z, Y). parent (X, Y) :- father(X, Y). parent(X, Y) :- mother (X, Y). ?- sibling(Sara, Dina). Yes ?- father(Father, Child). // enumerates all valid answers Jarrar © 2011 89
  • 90. Resolution in FOL Jarrar © 2011 90
  • 91. Resolution in FOL • Recall: We saw that the propositional resolution is a refutationly complete inference procedure for Propositional Logic. • Here, we extend resolution to FOL. • First we need to covert sentences in to CNF, for example: x American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x) • becomes American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x) • Every sentence of first-order logic can be converted into inferentially equivalent CNF sentence. • The procedure for conversion to CNF is similar to the propositional case. Jarrar © 2011 91
  • 92. Conversion to CNF • The procedure for conversion to CNF is similar to the positional case. • For example: “Everyone who loves all animals is loved by someone”, or x [ y Animal(y) Loves(x,y)] [ y Loves(y,x)] Step 1 Eliminate Implications x[ y Animal(y) Loves(x,y)] [ y Loves(y,x)] Step 2. Move inwards: x p ≡ x p, xp≡ x p x [ y ( Animal(y) Loves(x,y))] [ y Loves(y,x)] x[ y Animal(y) Loves(x,y)] [ y Loves(y,x)] x [ y Animal(y) Loves(x,y)] [ y Loves(y,x)] Jarrar © 2011 92
  • 93. Conversion to CNF contd. Step 2. Move inwards: x [ y Animal(y) Loves(x,y)] [ y Loves(y,x)] Step 3. Standardize variables: each quantifier should use a different one x [ y Animal(y) Loves(x,y)] [ z Loves(z,x)] Step 4. Skolemize: a more general form of existential instantiation. Each existential variable is replaced by a Skolem function of the enclosing universally quantified variables: x [Animal(F(x)) Loves(x,F(x))] Loves(G(x),x) Step 5. Drop universal quantifiers: [Animal(F(x)) Loves(x,F(x))] Loves(G(x),x) Step 6. Distribute over : [Animal(F(x)) Loves(G(x),x)] [ Loves(x,F(x)) Loves(G(x),x)] Jarrar © 2011 93
  • 94. Resolution in FOL • The inference rule (FOL version): l1 ··· lk, m1 ··· mn (l1 ··· li-1 li+1 ··· lk m1 ··· mj-1 mj+1 ··· m n) θ where Unify(li, mj) = θ. • The two clauses are assumed to be standardized apart so that they share no variables. • Apply resolution steps to CNF(KB α). • Let’s extend the previous example, and apply the resolution: Everyone who loves all animals is loved by someone. Anyone who kills an animal is loved by no one. Ali loves all animals. Either Ali or Kais killed the cat, who is named Foxi. Did Kais killed the cat? Jarrar © 2011 94
  • 95. Resolution in FOL (Example) Let’s extend the previous example, and apply the resolution: Everyone who loves all animals is loved by someone. Anyone who kills an animal is loved by no one. Ali loves all animals. Either Ali or Kais killed the cat, who is an animal and its is named Foxi. Did Kais killed the cat? In FOL: A. x [ y Animal(y) Loves(x,y)] [ y Loves(y,x)] B. x [ y Animal(y) Kills(x,y)] [ z Loves(z,x)] C. x Animal(x) Loves(Ali,x) D. Kills (Ali,Foxi) Kills(Kais,x) E. Cat(Foxi) F. x Cat(x) Animal (x) G. Kills(Kais,Foxi) Jarrar © 2011 95
  • 96. Resolution in FOL (Example) A. x [ y Animal(y) Loves(x,y)] [ y Loves(y,x)] B. x [ y Animal(y) Kills(x,y)] [ z Loves(z,x)] C. x Animal(x) Loves(Ali,x) D. Kills (Ali,Foxi) Kills(Kais,x) E. Cat(Foxi) F. x Cat(x) Animal (x) G. Kills(Kais,Foxi) After applying the CNF, we obtain: A1. Animal(F(x)) Loves(G(x),x) A2. Loves(x,F(x)) Loves(G(x),x) B. Animal(y) Kills(x,y) Loves(z,x) C. Animal(x) Cat(Foxi) Loves(Ali,x) D. Kills(Ali,Foxi) Kills(Kais, Foxi) E. Cat(Foxi) F. Cat(x) Animal (x) G. Kills(Kais,Foxi) Jarrar © 2011 96
  • 97. Resolution in FOL (Example) A1 Animal(F(x)) Loves(G(x),x) A2 Loves(x,F(x)) Loves(G(x),x) B Loves(y,x) Animal(z) Kills(x,z) C Animal(x) Cat(Foxi) Loves(Ali,x) D Kills(Ali,Foxi) Kills(Kais, Foxi) E Cat(Foxi) F Cat(x) Animal (x) G Kills(Kais,Foxi) H Animal (Foxi) E,F {x/Foxi} I Kills(Ali,Foxi) D,G {} J Animal(F(Ali)) Loves(G(Ali), Ali) A2,C {x/Ali, F(x)/x} K Loves(G(Ali), Ali) J,A1 {F(x)/F(Ali), X/Ali} L Loves(y,x) Kills(x,Foxi) H,B {z/Foxi} M Loves(y,Ali) I,L {x/Ali} N . M,K {y/G(Ali)} Jarrar © 2011 97
  • 98. Resolution in FOL (Another Example) • The law says that 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 • Assume this is represented in FOL (and in CNF): American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x) Missile(x) Owns(Nono,x) Sells(West,x,Nano) Enemy(x,America) Hostile(x) Missile(x) Weapon(x) Owns(Nono,M1) Missile(M1) American(West) Enemy(Nano,America) Criminal (West) Jarrar © 2011 98
  • 99. Resolution in FOL (Another Example) 1 American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x) 2 Missile(x) Owns(Nono,x) Sells(West,x,Nano) 3 Enemy(x,America) Hostile(x) 4 Missile(x) Weapon(x) 5 Owns(Nono,M1) 6 Missile(M1) 7 American(West) 8 Enemy(Nano,America) 9 Criminal (West) Jarrar © 2011 99
  • 100. Resolution in FOL (Another Example) 1 American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x) 2 Missile(x) Owns(Nono,x) Sells(West,x,Nano) 3 Enemy(x,America) Hostile(x) 4 Missile(x) Weapon(x) 5 Owns(Nono,M1) 6 Missile(M1) 7 American(West) 8 Enemy(Nano,America) 9 Criminal (West) 10 American(West) Weapon(y) Sells(West,y,z) Hostile(z) 1,9 {x/West} 11 Weapon(y) Sells(West,y,z) Hostile(z) 7,10 {x/West} 12 Missile(y) Sells(West,y,z) Hostile(z) 4,11 {x/y} 13 Sells(West,M1,z) Hostile(z) 6,12 {y/M1} 14 Missile(M1) Owns(Nono, M1) Hostile(Nano) 2,13 {x/M1, z/Nano} 15 Owns(Nono, M1) Hostile(Nano) 6,14 {} 16 Hostile(Nano) 5,15 {} 17 Enemy(Nano,America) 3,16 {x/Nano} 18 . 8,17 {} Jarrar © 2011 100
  • 101. Resolution in FOL (Another Example) Another representation (as Tree) 1 9 7 10 4 11 6 12 2 13 6 14 5 15 3 16 8 17 18 Jarrar © 2011 101
  • 102. Summary • Instantiating quantifiers is typically very low. • Unification is much more efficient than Instantiating quantifiers. • Generalized Modus Ponens = Modus Ponens + unification, which is then used in forward/backward chaining. • Generalized Modus Ponens is complete but semidecidable. • Forward chaining is complete, and used in deductive databases, and Datalogs with polynomial time. • Backward chaining is complete, used in logic programming, suffers from redundant inference and infinite loops. • Generalized Resolution is refutation complete for sentences with CNF. • There are no decidable inference methods for FOL. • The exam will evaluate: WhatHowWhy (for all above) • Next Lecture: Description logics are decidable logics. Jarrar © 2011 102