Artificial Intelligence (AI) - PowerPoint PPT Presentation

artificial intelligence ai n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Artificial Intelligence (AI) PowerPoint Presentation
Download Presentation
Artificial Intelligence (AI)

play fullscreen
1 / 28
Artificial Intelligence (AI)
405 Views
Download Presentation
kathy
Download Presentation

Artificial Intelligence (AI)

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. A.I. is the Future of Computing! Artificial Intelligence (AI) AmanUllah Khan Revised By: Ghulam Irtaza Sheikh

  2. Text: • Artificial Intelligence: Structures and Strategies for Complex Problem Solvingby GEORGE F LUGER • Reference: • Practical Common Lisp by Peter Seibel • Learn Prolog Now, by Patrick Blackburn, Johan Bos and Kristina Striegnitz • CLIPS User and Reference Manuals • Various resources on the Web • CS 607 (VU)

  3. Chapter 2 Institute of Computing

  4. Last Lect • The Propositional Calculus • The Predicate Calculus

  5. Background • Predicate calculus and prepositional Calculus as Representation Language

  6. Today • Quantifiers • First Order Predicate Calculus

  7. Quantifiers • A variable, when it appears as an argument in a sentence, it refers to unspecified objects in the domain. Predicate calculus provides two symbols, the variable quantifiers ∀ (for all) and ∃ (there exist), that constraint the meaning of sentences containing variables. • The proposition “Every human is mortal” shall be expressed as: ∀X human(X) => mortal(X). • The proposition “everybody likes ice_cream” can be expressed as : ∀Y likes(Y, ice_cream). • On the other hand, the proposition “some people likes bitter cucumber” will be expressed as: ∃Z likes(Z, bitter_cucumber). Institute of Computing

  8. Quantification and Negation • ~(x p(x)) equiv x ~p(x) • ~(x p(x)) equiv x ~p(x) • Quantifier duality: each can be expressed using the other • x Likes(x,IceCream) x Likes(x,IceCream) • x Likes(x,Broccoli) xLikes(x,Broccoli)

  9. Equivalence • For predicates p and q, and variables X and Y • Xp(X)  Xp(X) • Xp(X)  Xp(X) • Xp(X)  Yp(Y) • Xp(X)  Yp(Y) • X(p(X)q(X))  Xp(X)Yq(Y)) • X(p(X)q(X))  Xp(X)Yq(Y) )

  10. Examples • Everyone likes chocolate • Someone likes chocolate • Everyone likes chocolate unless they are allergic to it

  11. Examples • Everyone likes chocolate • X person(X)  likes(X, chocolate) • Someone likes chocolate • X person(X) ^ likes(X, chocolate) • Everyone likes chocolate unless they are allergic to it • X (person(X) ^ allergic (X, chocolate))  likes(X, chocolate)

  12. 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”

  13. First Order Predicate Calculus Institute of Computing

  14. First Order PC • First-order predicate calculus allows quantified variables to refer to objects in the domain of discourse and not to predicates or functions. • For Example: (∀ likes) likes(george,kate) Is not a well-formed expression in the first-order predicate calculus. There are higher-order predicate calculi where such expressions are meaningful. Some researchers (McCarthy1968, Appelt 1985) have used higher-order languages to represent knowledge in natural language understanding programs. Institute of Computing

  15. Many grammatically correct English sentences can be represented in the first-order predicate calculus using the symbols, connectives, and variable symbols. • Note: There is no unique mapping of sentences into predicate calculus expressions; in fact, an English sentence may have any number of different predicate calculus representations.

  16. First Order PC … Examples of English sentences represented in predicate calculus are: Institute of Computing

  17. Worked Example 1 • All dogs are animal: • ∀X (dog(X) → animal(X)). • Fido is a dog : • dog(fido). • All animals will die : • ∀Y (animal(Y) → die(Y)). • Will fido die: • die(fido). Institute of Computing

  18. Worked Example 2 • Calculators are used to add up • (∀X)(use_calculator(X) → addup(X)) • Dolphins can not add up • (∀X)(dolphin(Y) → ~addup(Y)) • There are some dolphins which are intelligent • (∃Z)(dolphin(Z) ∧ intelligent(Z)) • Hypothesis: • (∃W)(intelligent(W) ∧ ~use_calculator(W)) Institute of Computing

  19. Worked Example 3 • Premises: • All mammals are animals. (∀X) (mammal(X)→animal(X)). • All elephants are mammals. (∀X) (elephant(X)→mammal(X)). • Clyde is an elephant. elephant(clyde). • All sharks are animals. (∀X)(shark(X)→animal(X)). • Bonnie is a shark. shark(bonnie). • Hypothesis: • Is clyde an animal? animal(clyde). • Is Bonnie an animal? animal(bonnie). Institute of Computing

  20. Knight’s Tour Institute of Computing

  21. Bridges of KÖnigsberg Problem connect(i1,i2,b1) connect(rb1,i1,b2) onnect(rb1,i1,b3) connect(rb1,i2,b4) connect(rb2,i1,b5) connect(rb2,i1,b6) connect(rb2,i2,b7) connect(i2,i1,b1) connect(i1,rb1,b2) onnect(i1,rb1,b3) connect(i2,rb1,b4) connect(i1,rb2,b5) connect(i1,rb2,b6) connect(i2,rb2,b7) Institute of Computing

  22. Block World on(c,a). on(b,d). ontable(a). ontable(d). clear(b). clear(c). hand_empty. Institute of Computing

  23. Master and Dog World Institute of Computing

  24. A Logic-Based Financial Advisor • A Financial advisor helps a user to decide whether to invest in a savings account or the stock market. Some investors may desire to split their money between the two. The investment that will be recommended for individual investors depends on their income and the current amount they have saved according to the following criteria: • Individuals with an inadequate savings account should always make increasing the amount saved their first priority, regardless of their income. • Individuals with an adequate savings account and an adequate income should consider a riskier but potentially more profitable investment in the stock market. • Individuals with a lower income who already have an adequate savings account may want to consider splitting their surplus income between savings and stocks, to increase the cushion in savings while attempting to increase their income through stocks. Institute of Computing

  25. A Logic-Based Financial Advisor … Institute of Computing

  26. Lucky Student Anyone passing his history exams and winning the lottery is happy. But anyone who studies or is lucky can pass all his exams. John did not study but he is lucky. Anyone who is lucky wins the lottery. Is John happy? • Anyone passing his history exams and winning the lottery is happy : ∀X (pass(X,history) /\ win(X,lottery)) → happy(X)). • Anyone who studies or is lucky can pass all his exams: ∀X ∀Y (study(X) \/ lucky(X) → pass(X,Y)) • John did not study but he is lucky: ~study(john) /\ lucky(john). • Anyone who is lucky wins the lottery: ∀X (lucky(X) → win(X,lottery)). • Is john happy? happy(john) Institute of Computing

  27. Exciting Life All people who are not poor and are smart are happy. Those people who read are not stupid. John can read and is wealthy. Happy people have exciting lives. Can anyone be found with an exciting life? Assume :∀X (smart(X) ≡ stupid(X)) and ∀Y(wealthy(Y) ≡ ~poor(Y)) • All people who are not poor and are smart are happy. ∀X (~poor(X) /\ smart(X) → happy(X) • Those people who read are not stupid. ∀Y (read(Y) → smart(Y)) • John can read and is wealthy. read(john) /\ ~poor(john) • Happy people have exciting lives. ∀X (happy(Z) → exciting(Z)) • Can anyone be found with an exciting life? ∃ W (exciting(W)) Institute of Computing