First-order Logic Propositional logic (cont…)

Slides:



Advertisements
Similar presentations
Knowledge Representation using First-Order Logic
Advertisements

First-Order Logic Chapter 8.
First-Order Logic.
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
First-Order Logic Chapter 8.
First-Order Logic Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 8 Spring 2004.
First-Order Logic. Limitations of propositional logic Suppose you want to say “All humans are mortal” –In propositional logic, you would need ~6.7 billion.
Logic. Propositional Logic Logic as a Knowledge Representation Language A Logic is a formal language, with precisely defined syntax and semantics, which.
First-Order Logic Chapter 8.
CS 561, Session Midterm format Date: 10/10/2002 from 11:00am – 12:20 pm Location: THH 101 Credits: 35% of overall grade Approx. 4 problems, several.
First-Order Logic Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 8 Spring 2007.
FIRST-ORDER LOGIC FOL or FOPC
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
Predicate Calculus.
Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.
Propositional Logic Agenda: Other forms of inference in propositional logic Basics of First Order Logic (FOL) Vision Final Homework now posted on web site.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 Last time: Logic and Reasoning Knowledge Base (KB): contains a set of sentences expressed using a knowledge representation language TELL: operator to.
Limitation of propositional logic  Propositional logic has very limited expressive power –(unlike natural language) –E.g., cannot say "pits cause breezes.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
1 Knowledge Representation Propositional Logic Vumpus World Knowledge Representation Propositional Logic Vumpus World.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Artificial Intelligence First-Order Logic (FOL). Outline of this Chapter The need for FOL? What is a FOL? Syntax and semantics of FOL Using FOL.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
1 Propositional logic (cont…) 命題論理 Syntax&Semantics of first-order logic 構文論と意味論 Deducing hidden properties Describing actions Propositional logic (cont…)
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 11 Jim Martin.
First-Order Logic Chapter 8 (not 8.1). Outline Why FOL? Why FOL? Syntax and semantics of FOL Syntax and semantics of FOL Using FOL Using FOL Wumpus world.
First-Order Logic. Outline Why FOL? Syntax and semantics of FOL Using FOL Knowledge engineering in FOL.
Lecture 8-1CS250: Intro to AI/Lisp FOPL, Part Deux Lecture 8-1 November 16 th, 1999 CS250.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
1 CS 2710, ISSP 2610 Chapter 8, Part 1 First Order Predicate Calculus FOPC.
1 Knowledge Representation Logic and Inference Propositional Logic Vumpus World Knowledge Representation Logic and Inference Propositional Logic Vumpus.
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
Where is Wumpus Propositional logic (cont…) Reasoning where is wumpus
L7. Logic for knowledge representation
First-Order Logic Chapter 8.
First-Order Logic.
Knowledge Representation using First-Order Logic
Course Instructor: kinza ch
Last time: Logic and Reasoning
Knowledge and reasoning – second part
First-Order Logic Chapter 8.
Artificial Intelligence First Order Logic
EA C461 – Artificial Intelligence Logical Agent
L7. Logic for knowledge representation
First-Order Logic Chapter 8.
Logical Agents Chapter 7.
First-Order Logic Chapter 8.
Artificial Intelligence: Agents and First-Order Logic
Artificial Intelligence
First-Order Logic Chapter 8.
Chapter 8, Part 1 First Order Predicate Calculus FOPC
Knowledge and reasoning – second part
Logical Agents Chapter 7.
First-order Logic Propositional logic (cont…)
Announcements Assignments: HW5 Due Tue 2/26, 10 pm HW6 and P3
First Order Logic.
Knowledge Representation I (Propositional Logic)
First-Order Logic Chapter 8.
First-Order Logic Chapter 8.
Lecture 5-2 February 4th, 1999 CS250
First-Order Logic Chapter 8.
Chapter 8, Part 1 First Order Predicate Calculus FOPC
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

First-order Logic Propositional logic (cont…) Syntax&Semantics of first-order logic Deducing hidden properties Describing actions

The knowledge base Percept sentences: there is no smell in the square [1,1]  S1,1 there is no breeze in the square [1,1]  B1,1 there is no smell in the square [2,1]  S2,1 there is breeze in the square [2,1]   B2,1 there is smell in the square [1,2]  S1,2 there is no breeze in the square [1,2]  B1,2

The knowledge base knowledge sentences: If a square has no smell, then neither the square nor any of its adjacent squares can house a wumpus. R1: S1,1  W1,1  W1,2  W2,1 R2: S2,1  W1,1  W2,1  W2,2  W3,1 If there is smell in [1,2], then there must be a wumpus in [1,2] or in one or more of the neighboring squares. R3: S1,2  W1,3  W1,2  W2,2  W1,1 If a square has no breeze, then neither the square nor any of its adjacent squares can have a pit. R4: B1,1  P1,1  P1,2  P2,1 R5: B1,2  P1,1  P1,2 P2,2  P1,3 If there is breeze in [2,1], then there must be a pit in [2,1] or in one or more of the neighboring squares. R6: B2,1  P3,1  P2,1  P2,2  P1,1

Seven inference rules for propositional Logic Modus Ponens And-Elimination And-Introduction Or-Introduction Double-Negation Elimination Unit Resolution Logic connectives:    ,  i 1  2 … n 1  2 … n 1, 2, …, n 1  2  …  n i        ,     ,       

Problem with propositional logic Too many propositions  too many rules to define a competent agent The world is changing, propositions are changing with time.  do not know how many time-dependent propositions we will need have to go back and rewrite time-dependent version of each rule. The problem with proposition logic is that it only has one representational device: the proposition!!! The solutions to the problem is to introduce other logic first-order logic That can represent objects and relations between objects in addition to propositions.

First-order Logic What is first-order logic? First-order logic contains: Objects: are things with individual identities and properties. e.g., people, houses, computers, numbers, Mike Jason, color, … Properties: are used to distinguish an object from other objects. e.g., tall, western style, multimedia, prime, English, red, … Relations: exist and hold among the objects. e.g., father of, bigger than, made after, equal, student of, … Functions: are relations in which there is only one “value” for a given “input”. e.g., brother of, increment of, forward, one more than, … Almost any fact can be thought of as referring to objects and properties or relations. For example: One plus two equals three. Objects: one, two, three, one plus one; Relations: equals; Function: plus. Squares neighboring the wumpus are smelly. Objects: squares, wumpus; Property: smelly; Relation: neighboring

Syntax of FOL: basic element Constant symbols: refer to the same object in the same interpretation e.g. Mike Jason, 4, A, B, … Predicate symbols: refer to a particular relation in the model. e.g., Brother, >, Function symbols: refer to particular objects without using their names. Some relations are functional, that is, any given object is related to exactly one other object by the relation. (one-one relation) e.g., Cosine, FatherOf, Variables: substitute the name of an objec. e.g., x, y, a, b,… x, Cat(x)  Mammal(x) if x is a cat then x is a mammal. Logic connectives:  (not),  (and),  (or),  (implies), and  (equivalent) Quantifiers:  (universal quantification symbol),  (existential quantification symbol) x, for any x, … x, there is a x, … Equality: = e.g. Father(John) = Henry

Sentences: atomic vs complex Atomic sentences = predicate(term1, term2, …termn) or term1 = term2 Term = function(term1, term2, …termn) or constant or variable E.g., Sister(Muxin, Yanbo) >(height(Muxin), height(Yanbo)) x, >(height(Yanbo), height(x)) Complex sentences: made from atomic sentences using connectives.  (not),  (and),  (or),  (implies), and  (equivalent) E.g., Sibling(Muxin, Yanbo)  Sibling(Yanbo, Muxin) >(Age(Muxin), Age(Yanbo))   >(Age(Muxin), Age(Yanbo) )

Truth in first-order logic Sentences are true with respect to a model and an interpretation. Model contains objects and relations among them. E.g., a model: a family. objects in this model: Robert John, Rose John, Shelly John, Daivd John. relations: Husband(Robert, Rose), Wife(Rose, Robert), Father(Robert, David), …, Sister(Shelly, David), … Interpretation specifies referents for constant symbols -> objects predicate symbols -> relations function symbols -> functional relations An atomic sentence, predicate(term1, term2, …termn), is true iff the objects referred to by term1, term2, …termn are relation referred to by predicate. E.g, Father(Robert, David) is true iff Robert and David are two objects in the family model. Robert is David’s father (relation referred to by predicate Father)

Universal quantification <variables> <sentence> x P is equivalent to the conjunction of instantiations of P E.g., Every student at CIS is smart: x At(x, CIS)  Smart(x) At(Suzuki, CIS)  Smart(x)  At(Abe, CIS)  Smart(x)  At(Honda, CIS)  Smart(x)  … Typically,  is the main connective with . Common mistake: using  as the main connective with . x At(x, CIS)  Smart(x) means Every student is at CIS and every student is smart.

Existential quantification <variables> <sentence>  x P is equivalent to the disjunction of instantiations of P E.g., Someone at CIS is smart:  x At(x, CIS)  Smart(x) At(Suzuki, CIS)  Smart(x)  At(Abe, CIS)  Smart(x)  At(Honda, CIS)  Smart(x)  … Typically,  is the main connective with . Common mistake: using  as the main connective with .  x At(x, CIS)  Smart(x) is true if there is any student who is not at CIS. The uniqueness quantifier ! E.g., ! x King(x) means that there is only one King.

Property 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 E.g.,  x y Knows(x, y) “There is a person who knows everyone in the world” y  x Knows(x, y) “Everyone in the world is known by at least one person” Quantifier duality: each can be expressed using the other. . x Likes(x, iceCream)   x  Likes(x, iceCream) “Everyone likes ice cream” means that “There is no one who does not like ice cream” x Likes(x, carrot)  x  Likes(x, carrot) “Someone likes carrot” means that “Not everyone does not like carrot”

Knowledge base for the Wumpus world Perception: Stench (variable s), Breeze (variable b), Glitter (variable g), Wall (variable u), Scream (variable v) b, g, u, v, t Percept([S, b, g, u, v], t)  Smelly(t) s, g, u, v, t Percept([s, B g, u, v], t)  Breeze(t) s, b, u, v, t Percept([s, b, G, u, v], t)  AtGoldRoom(t) Reflex: t AtGoldRoom(t)  Action(Grab, t) Reflex with internal state: do we have the gold already? t AtGoldRoom(t)  Holding(Gold, t)  Action(Grab, t)

Deducing hidden properties Properties of locations: l, t At(Agent, l, t)  Smell(t)  Smell(l) l, t At(Agent, l, t)  Breeze(t)  Breeze(l) Diagnostic rule – infer cause from effect e. g. Squares are breezy near a pit y Breeze(y)   x Pit(x)  (x=y  Adjacent(x, y)) Causal rule – infer effect from cause x, y Pit(x)  (x=y  Adjacent(x, y))  Breeze(y)

Keeping track of world change Diachronic rules: describe the way in which the world changes. Situation calculus: is one way to represent change in FOL. - Facts holds in situation rather than eternally. e.g. Holding(Gold, Now) rather than just Holding(Gold) Holding(Gold, Now) denotes a situation. where, Now is extra situation argument. - Situations are connected by the Result function Result(a, s). e.g. At(Agent, [1,1], S0)  At(Agent, [1,2], S1) Result(Forward, S0) = S1 p p w g p S0 S1 w g p A A p p

Describing actions Effect axioms – describe changes due to action s AtGoldRoom(s)  Holding(Gold, Result(Grab, s)) x, s Holding(x, Result(Release, s)) Frame axioms – describe non-changes due to action a, x, s Holding(x, s)  (aRelease)  Holding(x, Result(a, s)) Successor-state axioms – combine the effect axioms and the frame axioms P true afterwards  [an action made P true  P true already and no action made P false] a, x, s Holding(x, Result(a, s))  [( (Present(x, s)  a=Grab )  (Holding(x, s)  aRelease) ]

Toward a goal Once the gold is found, the aim now is to return to the start as quickly as possible. Assuming that the agent now is holding “gold ”and has the goal of being at location [1,1].  s Holding(Gold, s)  GoalLocation([1,1], s) The presence of an explicit goal allows the agent to work out a sequence of actions that will achieve the goal.

Quiz. Complete the following truth table according to propositional syntax. ? S1 S2 S1 S1  S2 S1  S2 S1 S2 S1  S2 False True    T T F

deduce 推論する hidden 隠れた property 特性 elimination 削除 introduction 導入 negation 否定 resolution 解決 dependent 従属関係の identity 正体 distinguish 識別する refer to 参照する predicate 述語 variable 変数 substitute 代わりに用いる quantify 〈…の〉量を定める equality 対等 existential 存在に関する complex 複雑 atomic 原子の referent 指示物 conjunction 連結 instantiation 具体例 disjunction 分離 reflex 反応(して行動) internal  内部の causal 原因の diagnostic 診断の diachronic 通時的な calculus 微積分学 axiom 公理