Presentation is loading. Please wait.

Presentation is loading. Please wait.

Knowledge Representation III First-Order Logic

Similar presentations


Presentation on theme: "Knowledge Representation III First-Order Logic"— Presentation transcript:

1 Knowledge Representation III First-Order Logic
CSE 473

2 Why Not Propositional Logic?
“All monkeys are fuzzy” Propositional logic requires: fuzzy1, fuzzy2, …, fuzzyN Why? Lack of structure in/between atoms. What we’d like is a way to talk about objects and groups of objects, and to define relationships between them. First-order logic (aka “predicate logic”) © D. Weld, D. Fox

3 FOL Definitions Constants: a,b, dog33. Variables: X, Y.
Name a specific object. Variables: X, Y. Refer to an object without naming it. Functions: dad-of Mapping from objects to objects. Terms: dad-of(dog33) Refer to objects Relations: in, hungry. State relationships between objects. Atomic Sentences: in(dad-of(dog33), food6) Can be true or false Correspond to propositional symbols P, Q © D. Weld, D. Fox

4 More Definitions Logical connectives: and, or, not, => Quantifiers:
 Forall  There exists Examples George is brown Monkeys are curious There is a curious monkey Brown(George) m: Monkey(m)  Curious(m) m: Monkey(m) ^ Curious(m) © D. Weld, D. Fox

5 Quantifier / Connective Interaction
M(x) == “x is a monkey” C(x) == “x is curious” x: M(x)  C(x) x: M(x) C(x) x: M(x)  C(x) x: M(x) C(x) “Everything is a curious monkey” “All monkeys are curious” “There exists a curious monkey” “There exists an object that is either a curious monkey, or not a monkey at all” © Daniel S. Weld

6 Nested Quantifiers: Order matters!
x y P(x,y)  y x P(x,y) Examples Every dog has a tail Every dog shares a tail! ? d t has(d,t) t d has(d,t) Someone is loved by everyone x y loves(y, x) © D. Weld, D. Fox

7 Semantics Semantics: what the arrangement of symbols means in the world Propositional logic Basic elements are variables (references to facts) Possible worlds: mappings from variables to T/F First-order logic Basic elements are terms (references to objects) Possible worlds: mappings from terms to real- world elements. © Daniel S. Weld

8 Models Depiction of one possible model © D. Weld, D. Fox

9 Interpretations=Mappings syntactic tokens  model elements
Depiction of one possible interpretation, assuming Constants: Functions: Relations: Richard John LegOf(p) On(x,y) King(p) © D. Weld, D. Fox

10 Interpretations=Mappings syntactic tokens  model elements
Another interpretation, same assumptions Constants: Functions: Relations: Richard John LegOf(p) On(x,y) King(p) © D. Weld, D. Fox

11 Satisfiability, Validity, & Entailment
S is valid if it is true in all interpretations S is satisfiable if it is true in some interp S is unsatisfiable if it is false all interps S1 entails S2 if forall interps where S1 is true, S2 is also true |= © D. Weld, D. Fox

12 First-Order Wumpus World
Objects Squares, wumpuses, agents, gold, pits, stinkiness, breezes Relations Square topology (adjacency), Pits/breezes, Wumpus/stinkiness © D. Weld, D. Fox

13 Wumpus World: Squares Square topology relations?
Each square as an object: Square1,1, Square1,2, …, Square3,4, Square4,4 Square topology relations? Adjacent(Square1,1, Square2,1) Adjacent(Square3,4, Square4,4) Better: Squares as lists: [1, 1], [1,2], …, [4, 4] Square topology relations: x, y, a, b: Adjacent([x, y], [a, b])  [a, b] Є {[x+1, y], [x-1, y], [x, y+1], [x, y-1]} © D. Weld, D. Fox

14 Wumpus World: Pits Each pit as an object: Problem?
Pit1,1, Pit1,2, …, Pit3,4, Pit4,4 Problem? Not all squares have pits List only the pits we have: Pit3,1, Pit3,3, Pit4,4 Problem? No reason to distinguish pits. Complicates inference. Better: pit as unary predicate Pit(x) Pit([3,1]); Pit([3,3]); Pit([4,4]) will be true © D. Weld, D. Fox

15 Wumpus World: Breezes Represent breezes like pits,
as unary predicates: Breezy(x) “Squares next to pits are breezy”: x, y, a, b: (Pit([x, y]) ^ Adjacent([x, y], [a, b]))  Breezy([a, b]) © D. Weld, D. Fox


Download ppt "Knowledge Representation III First-Order Logic"

Similar presentations


Ads by Google