Knowledge Representation using First-Order Logic

Slides:



Advertisements
Similar presentations
First-Order Logic Chapter 8.
Advertisements

Knowledge Representation using First-Order Logic CS 271: Fall 2007 Instructor: Padhraic Smyth.
Predicate Logic Second Term Fourth Year (10 CS) 1.
Russell and Norvig Chapter 7
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
10 주 강의 First-order Logic. Limitation of propositional logic A very limited ontology  to need to the representation power  first-order logic.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
LOGICAL AGENTS Yılmaz KILIÇASLAN. Definitions Logical agents are those that can:  form representations of the world,  use a process of inference to.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Knowledge Representation using First-Order Logic (Part III) This lecture: R&N Chapters 8, 9 Next lecture: Chapter 13; Chapter (Please read lecture.
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.
CE An introduction to Artificial Intelligence CE Chapter 8: First Order Logic Ramin Halavati In which we notice that.
A toy world for logical exploration The Wumpus example.
First-Order Logic Knowledge Representation Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read:
Artificial Intelligence Building Knowledge Base Chapter 8.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part A Knowledge Representation and Reasoning.
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
1 First-Order Logic Chapter 8. 2 Why FOL? –How do you say “All students are smart?” –Some students work hard –Hardworking students have good marks –If.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Predicate Logic.
Knowledge Representation using First-Order Logic 부산대학교 전자전기컴퓨터공학과 인공지능연구실 김민호
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.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 17, 2012.
CS 666 AI P. T. Chung First-Order Logic First-Order Logic Chapter 8.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Wumpus World 1 Wumpus and 1 pile of gold in a pit-filled cave Starts in [1,1] facing right - Random cave Percepts: [smell, breeze, gold, bump, scream]
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.
5/16/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 12, 5/16/2005 University of Washington, Department of Electrical Engineering Spring.
1 First Order Logic CS 171/271 (Chapter 8) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
Lecture 8-2CS250: Intro to AI/Lisp What do you mean, “What do I mean?” Lecture 8-2 November 18 th, 1999 CS250.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 7 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
1 Knowledge Representation Logic and Inference Propositional Logic Vumpus World Knowledge Representation Logic and Inference Propositional Logic Vumpus.
First-Order Logic Knowledge Representation
First-Order Logic Chapter 8.
First-Order Logic.
First-Order Logic Chapter 8.
Artificial Intelligence First Order Logic
Notes 8: Predicate logic and inference
EA C461 – Artificial Intelligence Logical Agent
First-Order Logic Knowledge Representation
First-Order Logic Knowledge Representation
First-Order Logic Knowledge Representation
First-Order Logic Chapter 8.
Logical Agents Chapter 7.
First-Order Logic Chapter 8.
Artificial Intelligence: Agents and First-Order Logic
Introduction to Artificial Intelligence
Artificial Intelligence
Artificial Intelligence: Logic agents
Class #9– Thursday, September 29
First-Order Logic Chapter 8.
Knowledge Representation using First-Order Logic (Part III)
First-Order Logic Knowledge Representation
Knowledge Representation I (Propositional Logic)
First-Order Logic Chapter 8.
First-Order Logic Chapter 8.
CMSC 471 Fall 2011 Class #10 Tuesday, October 4 Knowledge-Based Agents
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Knowledge Representation using First-Order Logic

Domain Domain is a section of the knowledge representation. - The Kinship domain - Mathematical sets - Assertions and queries in first order logic - The Wumpus World

Kinship domain

Kinship domain(family relationship) It consists of Object – People Unary Predicates - Male and Female Binary Predicates - Parent,Brother,Sister Functions – Father, Mother Relations – Brotherhood, sisterhood.

Examples The kinship domain: Brothers are siblings x,y Brother(x,y) => Sibling(x,y) Male and female are disjoint categories x, Male(x)  ¬Female(x) Parent and child are inverse relations p,c Parent(p,c)  Child(c,p)

Mathematical sets

Mathematical set representation Constant – Empty set (s = {}) Predicate – Member and subset (s1  s2) Functions – Intersection(  ) and union ( ) Example: Two sets are equal if and only if each is a subset of the other. s1,s2 (s1=s2) (subset(s1,s2)  subset(s2,s1)) Other eg: x,s1,s2 x  (s1  s2)  (x  s1  x  s2) x,s1,s2 x  (s1  s2)  (x  s1  x  s2)

Assertions and Queries in first-order logic

Assertions Sentences are added to a knowledge base using TELL are called assertions. We want to TELL things to the KB, e.g. TELL(KB, King(John)) TELL(KB,  x king(x) => Person(x)) John is a king and that king is a person.

Queries Questions are asked to the knowledge base using ASK called as queries or goals. We also want to ASK things to the KB, ASK(KB, ) returns true by substituting john to a x.

Wumpus world

Agent Architectures Reflex agents: Classify their percept and act accordingly. Model based agents: Construct an internal representation of the world and use it to act. Goal based agent : Form goals and try to achieve them.

FOL Version of Wumpus World Typical percept sentence: Percept([Stench,Breeze,Glitter,None,None],3) In this sentence: Percept - predicate Stench, Breeze and glitter – Constants 3 – Integer to represent time Actions: Turn Right), Turn Left), Forward, Shoot, Grab, Release, Climb

Cont.., To determine best action, construct query:  a BestAction(a,5) ASK solves this query and returns {a/Grab} Agent program then calls TELL to record the action which was taken to update the KB.

Percept sequences 1. Synchronic sentences (same time). - sentences dealing with time. 2. Diachronic sentences (across time). - agent needs to know how to combine information about its previous location to current location.

Two kinds of synchronic rules 1.Diagnostic rules 2.Casual rules

Deducing hidden properties Squares are breezy near a pit: Diagnostic rule---infer cause from effect s Breezy(s)   r Adjacent(r,s)  Pit(r) Causal rule---infer effect from cause r Pit(r)  [s Adjacent(r,s)  Breezy(s)]

Knowledge engineering in FOL

Steps Identify the task Assemble the relevant knowledge Decide on a vocabulary of predicates, functions, and constants Encode general knowledge about the domain Encode a description of the specific problem instance Pose queries to the inference procedure and get answers Debug the knowledge base

The electronic circuits domain One-bit full adder Possible queries: - does the circuit function properly? - what gates are connected to the first input terminal? - what would happen if one of the gates is broken? and so on

The electronic circuits domain Identify the task Does the circuit actually add properly? Assemble the relevant knowledge Composed of wires and gates; Types of gates (AND, OR, XOR, NOT) Two input terminals and one output terminal

3. Decide on a vocabulary Alternatives: Type(X1) = XOR (function) Type(X1, XOR) (binary predicate) XOR(X1) (unary predicate) It can be represented by either binary predicate or individual type.

4. Encode general knowledge of the domain 1.If two terminals are connected, then they have the same signal. t1,t2 Connected(t1, t2)  Signal(t1) = Signal(t2) 2.The signal at every terminal is either 1 or 0 (but not both) t Signal(t) = 1  Signal(t) = 0 1 ≠ 0

3. Connected is a commutative predicate. t1,t2 Connected(t1, t2)  Connected(t2, t1) 4. An OR gate’s output is 1 if and only if any of its input is 1. g Type(g) = OR  Signal(Out(1,g)) = 1  n Signal(In(n,g)) = 1

5. An AND gate’s output is 0 if and only if any of its input is 0. g Type(g) = AND  Signal(Out(1,g)) = 0  n Signal(In(n,g)) = 0 6. An XOR gate’s output is 1 if and only if any of its inputs are different: g Type(g) = XOR Signal(Out(1,g)) = 1  Signal(In(1,g)) ≠ Signal(In(2,g))

Signal(Out(1,g)) ≠ Signal(In(1,g)) 7. An XOR gate’s output is 1 if and only if any of its inputs are different: g Type(g) = NOT  Signal(Out(1,g)) ≠ Signal(In(1,g))

5. Encode the specific problem instance First we categorize the gates: Type(X1) = XOR Type(X2) = XOR Type(A1) = AND Type(A2) = AND Type(O1) = OR Then show the connections between them:

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))

6. Pose queries to the inference procedure and get answers For the given query the inference procedure operate on the problem specific facts and derive the answers.

What are the possible sets of values of all the terminals for the adder circuit? i1,i2,i3,o1,o2 Signal(In(1,C1)) = 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 For the given query, if the result is not a user expected one then KB is updated with relevant axioms. The KB is checked with different constraints.eg:prove any output for the circuit i.e.,0 or 1.