1 / 18

Artificial Intelligence

Artificial Intelligence. Why predicate calculus. Provides the ability to access individual assertions. e.g. in Predicate calculus we may say: P denotes “It rained on Tuesday” but in predicate calculus we may have a relation called weather(tuesday,rain).

Download Presentation

Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Artificial Intelligence

  2. Why predicate calculus • Provides the ability to access individual assertions. e.g. in Predicate calculus we may say: P denotes “It rained on Tuesday” but in predicate calculus we may have a relation called weather(tuesday,rain). Also we can have variables such as weather(X,rain)

  3. Predicate calculus symbols • The set of letters, both upper and lower case, of English alphabet • The set of digits: 0, 1, … 9 • The underscore ‘_’ • Symbols begin with a letter and followed by any sequence of legal letters

  4. Symbols (cont.) • Constant symbols begin with “small” letters • Symbols true and false are reserved constants • Variables are used to designate general classes of objects or properties. • Variables begin with “capital” letters

  5. Functions • They start with “small” letters • They have arity, e.g. father(?) has one arity while Plus(?,?) has 2 arity, …etc. • Examples: f(X,Y), father(david), price(house)

  6. Atomic sentences • Is a predicate of arity n followed by n terms enclosed in parentheses and separated by commas. • Examlpes: likes(ahmed,Chocolate) likes(X,ahmed) likes(X,Y) friends(aly,ahmed) friends(father_of(ahmed),father_of(aly))

  7. Logical connectives     ¬   (universal quantifier) (existential quantifier) Examples:  Y friends(Y,peter)  X likes(X,ice_cream)

  8. Examples • Assume time and plus are function symbols of arity 2 and assume equal and good be predicate symbols of arity 2 and 3, respectively. plus(two,three) is a function and thus not an atomic sentence equal(plus(two,three),five) is an atomic sentence equal(plus(2,3),seven) is a sentence (although seems wrong computationally)  X good(X,two,plus(two,three))  equal(plus(two,three),five) is a sentence (good(two,two,plus(two,three)))  (equal(plus(three,two),five)  true ) is a sentence

  9. Example application of predicate calculus • mother(amina,aly) • mother(amina,mahmoud) • father(hasan,aly) • father(hasan,mahmoud) •  X  Y (father(X,Y)  mother(X,Y)  parent(X,Y)) •  X  Y Z (parent(X,Y)  parent(X,Z)  brother(Y,Z))

  10. Predicate calculus semantics (by example) on(c,a) on(b,d) ontable(a) ontable(d) clear(b) clear(c ) hand_empty Rule describing when a block is clear: X(¬ Y on(Y,X))  clear(X)) (i.e. for all X, X is clear if there does not exist a Y such that Y is on X) c b a d

  11. Example (cont.) • To stack one block on top of another: Assume we want to stack X on Y: • Empty the hand • Clear X • Clear Y • pick_up X and put_down X on Y X Y ((hand_empty  clear(X)  clear(Y)  pick_up(X)  put_down(X,Y))  stack(X,Y))

  12. Using Inference Rules to produce predicate calculus expressions • An interpretation that makes a sentence true is said to satisfy that sentence. • An interpretation that satisfies every member of a set of expressions is said to satisfy the set.

  13. Proof Procedure • A proof procedure is a combination of an inference rule and an algorithm for applying that rule to a set of logical expressions to generate new sentences • Defn: a predicate calculus expression X logically follows from a set S of predicate calculus expressions if every interpretation and assignment that satisfies S also satisfies X.

  14. Important definitions • Modus ponens: If P is true and PQ is known to be true then we can infer Q. • Modus tollens: If P Q is known to be true and Q is known to be false we can infer ¬P • And elimination If PQ is true the P is true and Q is true • And introduction: If P and Q are true then PQ is true • Universal Instantiation: If a is from the domain of X, X p(X) lets us infer p(a)

  15. Example on modus ponens • “If it is raining then the ground will be wet” and we know “It is raining” then: • P denotes “It is raining” • Q denotes “The ground is wet” • i.e. PQ is true and P is true then we can infer Q (i.e. The ground is wet)

  16. Another example • “All men are mortal and Socrates is a man” “Is Socrates mortal?” • This sentence can be represented as: X (man(X)  mortal(X)) man(socrates) • If we substitute socrates for X we get: man(scorates)  moral(socrates) Then we can now infer: mortal(socrates)

  17. Unification • Unification is an algorithm for determining the substitutions needed to make two predicate calculus expressions match. • Unification+inference rules (e.g. modus ponens) allow us to make inferences on a set of logical assertions. • To do this, the logical database must be expressed in an appropriate form.

  18. Replacing existentially quantified variables • This is done by replacing all existentially quantified variables by their corresponding constants: e.g. X parent(X,tom) is being replaced by parent(bob,tom) or parent(mary,tom). • Complication : X Y mother(X,Y) where the value of Y is dependent on X

More Related