know ledge representation using first order logic know
play

Know ledge Representation using First-Order Logic Know ledge - PowerPoint PPT Presentation

Know ledge Representation using First-Order Logic Know ledge Representation using First Order Logic ( Part I I ) Reading: R&N Chapters 8, 9 Outline Review: KB |= S is equivalent to |= (KB S) So what does {} |= S mean?


  1. Know ledge Representation using First-Order Logic Know ledge Representation using First Order Logic ( Part I I ) Reading: R&N Chapters 8, 9

  2. Outline • Review: KB |= S is equivalent to |= (KB  S) – So what does {} |= S mean? • • Review: Follows Entails Derives Review: Follows, Entails, Derives – Follows: “Is it the case?” – Entails: “Is it true?” – Derives: “Is it provable?” p • Review: FOL syntax • Finish FOL Semantics, FOL examples , p • Inference in FOL • Next Tuesday (1 June) is Review/Catch-up; Homework#7 is due • Next Thursday (3 June) NO CLASS; I’m reviewing grants for NIH • Next Friday (4 June) PROJECT REPORTS & CODE is due Next Friday (4 June) PROJECT REPORTS & CODE is due • Following Thursday (10 June) FINAL EXAM; 1:30-3:30pm

  3. Review : KB | = S m eans | = ( KB  S) • KB |= S is read “KB entails S.” – Means “S is true in every world (model) in which KB is true.” – Means “In the world S follows from KB ” Means In the world, S follows from KB. • KB |= S is equivalent to |= (KB  S) – Means “(KB  S) is true in every world (i.e., is valid).” ( ) y ( , ) • And so: {} |= S is equivalent to |= ({}  S) • So what does ({}  S) mean? – Means “True implies S.” – Means “S is valid.” – In Horn form, means “S is a fact.” p. 256 (3 rd ed.; p. 281, 2 nd ed.) • Why does {} mean True here, but False in resolution proofs?

  4. Review : ( True  S) m eans “S is a fact.” • By convention, – The null conjunct is “syntactic sugar” for True. – The null disjunct is “syntactic sugar” for False The null disjunct is syntactic sugar for False. – Each is assigned the truth value of its identity element. • For conjuncts, True is the identity: (A  True)  A • For disjuncts, False is the identity: (A  False)  A • A KB is the conjunction of all of its sentences. – So in the expression: {} |= S • We see that {} is the null conjunct and means True. – The expression means “S is true in every world where True is true.” • I.e., “S is valid.” – Better way to think of it: {} does not exclude any worlds (models) – Better way to think of it: {} does not exclude any worlds (models). • In Conjunctive Normal Form each clause is a disjunct. – So in, say, KB = { {P Q} {  Q R} {} {X Y  Z} } So in, say, KB { {P Q} {  Q R} {} {X Y  Z} } • We see that {} is the null disjunct and means False.

  5. Side Trip: Functions AND, OR, and null values ( Note: These are “syntactic sugar” in logic.) function AND( arglist ) returns a truth-value return ANDOR( arglist, True) return ANDOR( arglist, True) function OR( arglist ) returns a truth-value function OR( arglist ) returns a truth value return ANDOR( arglist, False) function ANDOR( arglist, nullvalue ) returns a truth-value /* nullvalue is the identity element for the caller. */ if ( arglist = {}) if ( arglist {}) then return nullvalue if ( FIRST( arglist ) = NOT( nullvalue ) ) then return NOT( nullvalue ) then return NOT( nullvalue ) return ANDOR( REST( arglist ) )

  6. Review : Schem atic for Follow s, Entails, and Derives Derives Sentences Inference Sentence If KB is true in the real world, then any sentence  entailed by KB and any sentence  derived from KB by a sound inference procedure is also true in the real world.

  7. Schem atic Exam ple: Follow s, Entails, and Derives “Mary is Sue’s sister and Amy is Sue’s daughter.” “Mary is Derives Amy’s aunt.” Inference “An aunt is a sister I Is it provable? it bl ? of a parent.” “Mary is Sue’s sister and “Mary is Mary is Amy is Sue s daughter. Amy is Sue’s daughter ” E t il Entails Amy’s aunt.” Representation “An aunt is a sister Is it true? of a parent.” Sister Mary Sue Mary Follows World Daughter g Aunt Is it the case? Amy Amy

  8. Review : Models ( and in FOL, I nterpretations) • Models are formal worlds in which truth can be evaluated • We say m is a model of a sentence α if α is true in m • • M( α ) is the set of all models of α M( α ) is the set of all models of α • Then KB ╞ α iff M(KB)  M( α ) – E.g. KB, = “Mary is Sue’s sister E.g. KB, Mary is Sue s sister and Amy is Sue’s daughter.” – α = “Mary is Amy’s aunt.” • Thi k f KB Think of KB and α as constraints, d t i t and of models m as possible states. • M(KB) are the solutions to KB and M( α ) the solutions to α and M( α ) the solutions to α . • Then, KB ╞ α , i.e., ╞ (KB  a) , when all solutions to KB are also solutions to α .

  9. Review : W um pus m odels • KB = all possible wumpus-worlds consistent with the observations and the “physics” of the Wumpus world.

  10. Review : W um pus m odels α 1 = "[1,2] is safe", KB ╞ α 1 , proved by model checking. Every model that makes KB true also makes α 1 true.

  11. Review : Syntax of FOL: Basic elem ents • Constants KingJohn, 2, UCI,... • • Predicates Brother > Predicates Brother, >,... • Functions Sqrt, LeftLegOf,... • Variables x, y, a, b,... • Connectives C ti  ,  ,  ,  ,  • Equality = • Quantifiers  , 

  12. Syntax of FOL: Basic syntax elem ents are sym bols • Constant Symbols: – Stand for objects in the world. • E.g., KingJohn, 2, UCI, ... • Predicate Symbols – Stand for relations (maps a tuple of objects to a truth-value ) • E.g., Brother(Richard, John), greater_than(3,2), ... – P(x, y) is usually read as “x is P of y.” • E.g., Mother(Ann, Sue) is usually “Ann is Mother of Sue.” • Function Symbols – Stand for functions (maps a tuple of objects to an object ) • E.g., Sqrt(3), LeftLegOf(John), ... E g Sqrt(3) LeftLegOf(John) • Model (world) = set of domain objects, relations, functions • I nterpretation maps symbols onto the model (world) b l t th d l ( ld) I nte p etation – Very many interpretations are possible for each KB and world! – Job of the KB is to rule out models inconsistent with our knowledge.

  13. Syntax of FOL: Term s • Term = logical expression that refers to an object • • There are tw o kinds of term s: There are tw o kinds of term s: – Constant Sym bols stand for (or name) objects: • E.g., KingJohn, 2, UCI, Wumpus, ... E.g., KingJohn, 2, UCI, Wumpus, ... – Function Sym bols map tuples of objects to an object: • E.g., LeftLeg(KingJohn), Mother(Mary), Sqrt(x) • This is nothing but a complicated kind of name – No “subroutine” call, no “return value”

  14. Syntax of FOL: Atom ic Sentences • Atom ic Sentences state facts (logical truth values). – An atom ic sentence is a Predicate symbol, optionally followed by a parenthesized list of any argument terms – E.g., Married( Father(Richard), Mother(John) ) – An atom ic sentence asserts that some relationship (some An atom ic sentence asserts that some relationship (some predicate) holds among the objects that are its arguments. • An Atom ic Sentence is true in a given model if the An Atom ic Sentence is true in a given model if the relation referred to by the predicate symbol holds among the objects (terms) referred to by the arguments.

  15. Syntax of FOL: Connectives & Com plex Sentences • Com plex Sentences are formed in the same way, and are formed using the same logical connectives and are formed using the same logical connectives, as we already know from propositional logic • • The Logical Connectives : The Logical Connectives : –  biconditional –  implication –  and –  or –  negation • Sem antics for these logical connectives are the same as Sem antics for these logical connectives are the same as we already know from propositional logic.

  16. Syntax of FOL: Variables • Variables range over objects in the world. • A variable is like a term because it represents an object. • • A variable may be used wherever a term may be used. A variable may be used wherever a term may be used – Variables may be arguments to functions and predicates. • (A term w ith NO variables is called a ground term .) ( ) g • (A variable not bound by a quantifier is called free .)

  17. Syntax of FOL: Logical Quantifiers • There are two Logical Quantifiers: – Universal:  x P(x) means “For all x, P(x).” • The “upside-down A” reminds you of “ALL.” h “ d d ” d f “ ” – Existential:  x P(x) means “There exists x such that, P(x).” • The “upside-down E” reminds you of “EXISTS.” • Syntactic “sugar” --- we really only need one quantifier. –  x P(x)   x  P(x) –  x P(x)   x  P(x) – You can ALWAYS convert one quantifier to the other. You can ALWAYS convert one quantifier to the other • RULES:    and    • RULE: To move negation “in” across a quantifier, change the quantifier to “the other quantifier” and negate the predicate on “the other side.” –  x P(x)   x  P(x)  P( )  P( ) –  x P(x)   x  P(x)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend