Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to AI & AI Principles (Semester 1) WEEK 8 Introduction to AI & AI Principles (Semester 1) WEEK 8 (2008/09) John Barnden Professor of Artificial.

Similar presentations


Presentation on theme: "Introduction to AI & AI Principles (Semester 1) WEEK 8 Introduction to AI & AI Principles (Semester 1) WEEK 8 (2008/09) John Barnden Professor of Artificial."— Presentation transcript:

1 Introduction to AI & AI Principles (Semester 1) WEEK 8 Introduction to AI & AI Principles (Semester 1) WEEK 8 (2008/09) John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK

2 Language-to-Logic in Shopping Trip case study The material in the following slides (before the ones on Reasoning) MAY be used in the Exercises on Wed 19 th November

3  Implication Symbol:  uIf Sally likes Peter then Ben hates Harry.  likes(Sally, Peter)  hates(Ben, Harry).  uA  B is true if and only if B is true or A is false (or both). So:  A  B is false if and only if A is true and B is false. And:  If A is true and A  B is true then it must be that B is true.   uA  B is logically equivalent to (i.e., always has same truth value as)  A  B.   l It is probably best, in fact, to think of A  B as just a sometimes-intuitive ABBREVIATION for  A  B. u  u  is NOT about any intrinsic connection of any sort between the two sides.

4  Equivalence or Double Implication:  or  uIf Sally likes Peter then Ben hates Harry, and vice versa.  likes(Sally, Peter)  hates(Ben, Harry).    uA  B is true if and only if A  B and B  A are both true. So:  A  B is true if and only if A and B are either both true or both false. And:  A  B is false if and only if A and B have different truth values.

5 Existential Quantification uSally likes Peter. l likes(Sally, Peter). uSally likes something.  l (  p) likes(Sally, p).  l Think of “  p” as “there exists something p such that” l Does NOT restrict the claim to exactly one thing: the formula is still true if Sally likes more than one thing. uSally likes someone.  l (  p) (is-person(p)  likes(Sally, p)). uSally likes someone [i.e., at least one particular person] who is tall.  l (  p) (is-person(p)  likes(Sally, p)  tall(p)).

6 Universal Quantification uSally likes everything. (  x) likes(Sally, x). Think of “  x” as “for anything, x, it is the case that” uSally likes every shop.  (  p) (is-shop(p)  likes(Sally, p)). For anything, p, [it is the case that] if p is a shop then Sally likes p. CAUTION: The formula is TRUE if there are no shops at all! uSally likes every shop that is modern.  (  q) ( (is-shop(q)  modern(q))  likes(Sally, q) ). uSally loves or hates anyone who is tall.  (  z) ( (is-person(z)  tall(z))  (loves(Sally, z)  hates(Sally,z) ).

7 Quantification, contd. uSally likes everyone.  (  p) (is-person(p)  likes(Sally, p)). Why is the following wrong?:  (  p) (is-person(p)  likes(Sally, p)). uSally likes someone.  (  p) (is-person(p)  likes(Sally, p)). Why is the following wrong?:  (  p) (is-person(p)  likes(Sally, p)).

8 Quantification, contd. uEveryone likes any shop that’s modern.  (  q,p) ( (is-shop(q)  modern(q)  is-person(p))  likes(p, q) ). uEveryone likes some shop that’s modern.  (  p) (is-person(p))   (  q) (is-shop(q)  modern(q)  likes(p, q) ). This interpretation doesn’t assume it’s the same shop(s) for each person: q can depend on p.  (  q) (is-shop(q)  modern(q)   (  p) (is-person(p))  (likes(p, q)) ). This interpretation does assume it’s the same shop(s) for each person: q does not depend on p.

9 Substances and Lumps of Them uSally likes ice-cream. l likes(Sally, ice-cream). uSally is eating ice-cream. l eating(Sally, ice-cream). uThe ice-cream Sally is eating is famous.  l (  x) eating(Sally,x)  is(x,ice-cream)  famous(x)). uThe ice-cream Sally is eating is melting.  l (  x) eating(Sally,x)  lump-of(x,ice-cream)  melting(x)). l Is there an interpretative problem here?? l The predicate symbol eating can apply to two different sorts of second-argument object: lumps and general substances. l May be better to have two different predicate symbols.

10 Somewhat Similar Issue with Actions uSally eats ice-cream [in the sense of: habitually]. l eats-hab(Sally, ice-cream). uSally eats ice-cream [in the sense of: mainly]. l eats-main(Sally, ice-cream). uSally eats ice-cream [in the sense of: is prepared to]. l eats-prep(Sally, ice-cream). uSally is eating ice-cream [at the present moment]. l eating(Sally, ice-cream). uCould not use the same predicate symbol for two or more of the above.

11 Expressing Uniqueness uSally likes [exactly] one person.  l (  p) (is-person(p)  likes(Sally, p)) WRONG . Wrong because  just means one or more.  ! l (  !p) (is-person(p)  likes(Sally, p)) This notation has been proposed, amongst others. l Without special notation, need to use formulas like:  (  p) (is-person(p)  likes(Sally, p)   (  q)(is-person(q)  likes(Sally, q)  q = p) ) A simplification:  (  p)(  q)(is-person(q)  likes(Sally, q)  q = p)

12 Deductive Reasoning in Logic (brief intro) The following slides won’t be used in the Exercises on Wed 19 th November

13 Basic Concepts about Reasoning uReasoning in general is a process of generating new propositions (claims, statements) from existing ones, where the new ones are viewed as following from the old ones in some sense. uSo imagine a “knowledge base” (“proposition base” would have been a better term) where the results of reasoning are being accumulated. l Example: the Working Memory in a production system. uThere are many types of reasoning: deduction, induction, abduction, reasoning by default, reasoning from examples, reasoning by analogy, probabilistic reasoning, …. uAll are studied in AI and are important for practical tasks. u(Traditional) deduction is the most basic and idealistic form …

14 Nature of Deduction u(Traditional) deduction is reasoning where each step taken is the application of a sound and domain- independent rule of inference. l A rule of inference is a mechanism that takes some set of propositions as input and outputs one or more propositions that are viewed as following from the input. u(In the case where each proposition’s truth value is either TRUE or FALSE:) Soundness means that if the propositions inputed to the rule are true then the output propositions are guaranteed to be true. l That is, the rule is truth-preserving.

15 PS Rules are (usually) Not Sound uAlthough productions (= rules in production systems) can in principle be of any type whatsoever, they are usually domain dependent (e.g., are about doors, fridges, hands, …) and unsound (they often merely encode defaults).  l IF in(a, room1)  holds0(a, x) THEN in(x, room1) uFor clarity on following slides I am now going to change rule notation. Instead of the above we will write: l IF-HAVE in(a, room1) AND-HAVE holds0(a, x) THEN-HAVE in(x, room1)

16 Modus Ponens: A Basic Sound (and Domain- Independent) Inference Rule uMP could be expressed as follows:  IF-HAVE A AND-HAVE A  B THEN-HAVE B. with the understanding that A and B are variables that can be bound to propositions in a KB. Such variables are usually called meta-variables to distinguish them from the usual variables that may occur within the propositions. u But the traditional way to express it is:  A, A  B B

17 Some Other Example Rules (in non-traditional IF-THEN form)   uModus tollens (MT): IF-HAVE  B AND-HAVE A  B THEN-HAVE  A. uRules similar to MP and MT but involving the double-implication connective.  uConjunction elimination: IF-HAVE A  B THEN-HAVE A, B.  uConjunction introduction: IF-HAVE A AND-HAVE B THEN-HAVE A  B.  uDisjunction introduction (one case): IF-HAVE A THEN-HAVE A  B.  uCommutativity of conjunction: IF-HAVE A  B THEN-HAVE B  A. uMany other possibilities. uThe above rules all apply to Propositional Logic as well as Predicate Logic, but …..

18 Towards A Rule involving Variable Instantiation u We’d like to be able to go from, say,  (  p) (is-shop(p)  likes(Sally, p)) and, say, is-shop(Gap) to likes(Sally, Gap). uCan do this by first “instantiating” the variable p to get  is-shop(Gap)  likes(Sally, Gap)) and then using MP.


Download ppt "Introduction to AI & AI Principles (Semester 1) WEEK 8 Introduction to AI & AI Principles (Semester 1) WEEK 8 (2008/09) John Barnden Professor of Artificial."

Similar presentations


Ads by Google