1 / 24

First-Order Logic

First-Order Logic. Chapter 8. Pros and cons of propositional logic.  Propositional logic is declarative  Propositional logic allows partial/disjunctive/negated information (unlike most data structures and databases) Propositional logic is compositional :

harlow
Télécharger la présentation

First-Order Logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. First-Order Logic Chapter 8

  2. Pros and cons of propositional logic  Propositional logic is declarative  Propositional logic allows partial/disjunctive/negated information • (unlike most data structures and databases) • Propositional logic is compositional: • meaning of B1,1 P1,2 is derived from meaning of B1,1 and of P1,2  Meaning in propositional logic is context-independent • (unlike natural language, where meaning depends on context)  Propositional logic has very limited expressive power • (unlike natural language) • E.g., cannot say "pits cause breezes in adjacent squares“ • except by writing one sentence for each square

  3. What you should know in Ch. 7 • Pros & Cons of Prop. Logics • Logical connectives rules • Ability to manipulate logic statements into alternate forms • Horn Clauses • Basics of Logical Agents • Boolean logic => circuits • Forward & backward chaining

  4. First-order logic • Whereas propositional logic assumes the world contains facts, • first-order logic (like natural language) assumes the world contains • Objects: people, houses, numbers, colors, baseball games, wars, … • Relations: red, round, prime, brother of, bigger than, part of, comes between, … • Functions: father of, best friend, one more than, plus, …

  5. Logics • Logics are characterized by what they commit to as "primitives".

  6. Syntax of FOL: Basic elements • Constants KingJohn, Richard, 2… • Predicates Brother, >, Father... • Functions Sqrt, King,... • Variables x, y, a, b,... • Connectives , , , ,  • Equality = • Quantifiers , 

  7. Sentences in FOL • What does the following FOL sentence mean? $x[Person(x)Ù"t(Time(t)Þ Fool(x,t))]Ù$t[Time(t)Ù"x(Person(x)ÞFool(x,t))]ÙØ"t,x[Time(t)Ù Person(x)ÞFool(x,t)] • Abraham Lincoln:"If you once forfeit the confidence of your fellow citizens, you can never regain their respect and esteem. It is true that you may fool some of the people all of the time; you can even fool all of the people some of the time, but you can’t fool all of the people all of the time."

  8. FOL: Syntax • FOL fixes problems with PL: • PL doesn’t have variables. FOL does. • Identifying individuals in PL is hard. FOL it’s easy. • PL can't directly express properties of individualsor relations between individuals. FOL can. • Inferencing in PL is fairly easy. In FOL it is more complicated.

  9. FOL: Terms • A term denotes an object in the world. • Constant: JohnPaxton, 2, Bozeman, … • Variable:x, y, a, b, c, … • Function(Term1, …, Termn): Sqrt(9), Distance(Bozeman,Missoula) • is a relation for which there is one answer • maps one or more objects to another single object • can refer to an unnamed object: e.g. Car(Neal) • represents a model/user defined functional relation • A ground term is a term with no variables.

  10. FOL: Atoms • An atom/literal is smallest expressionto which a truth value can be assigned. • Predicate(Term1, …, Termn): Teacher(John, Neal) • maps one or more objects to a truth value • represents a model/user defined truth relation • Term1 = Term2: Car(Neal) = GMC_Truck Car(Neal) = InGarage(Neal) • represents the equality relationwhen two terms refer to the same object • is a predicate in prefix form: =(Term1, Term2)

  11. FOL: Sentences • A sentence represents a fact in the worldthat is assigned a truth value. • atom • complex sentence using connectives: Ù Ú Ø Þ Û Advisor(John,Neal)Þ Student(Neal) ^ Teacher(John) • complex sentence using quantified variables: " $ more in a bit…

  12. FOL: Complex sentences • Complex sentences are made from atomic sentences using connectives S, S1 S2, S1  S2, S1 S2, S1S2, Brother(Richard, John)  Brother(John,Richard) King(Richard) V King(John)  King(Richard) => King(John)

  13. FOL: Models & Interpretation • Sentences are assigned a truth valuewith respect to a model and an interpretation. • The model contains the objectsand the relations among them. • the domain of a model is the set of objects it contains • The interpretation specifieswhat the symbols refer to: • constants symbols refer to objects • predicate symbols refer to truth relations • functional symbols refer to functional relations

  14. Models for FOL: Example

  15. FOL: Universal Quantifiers Universal quantifier: "<variables> <sentence> • Means the sentence holds truefor all values of x in the domain of variable x. • Main connective typically Þforming if-then rules • All humans are mammals.Becomes what in FOL? "x Human(x)Þ Mammal(x) for all x if x is a human then x is a mammal • Mammals must have fur.Becomes what in FOL? "x Mammal(x)Þ HasFur(x) for all x if x is a mammal then x has fur

  16. FOL: Using Univ. Quantifiers "x Human(x)Þ Mammal(x) • Equivalent to conjunction of instantiations of x: (Human(Neal)Þ Mammal(Neal)) Ù(Human(John)Þ Mammal(John)) Ù(Human(22) Þ Mammal(22) ) Ù… • Common mistake is to use Ù as main connective. • results in a blanket statement about everything • Bad example ""x Human(x) ^ Smart(x)"means? • everything is human and a mammal (Human(Neal)Ù Smart(Neal)) Ù(Human(John)Ù Smart(John)) Ù(Human(GMC_TRUCK) Ù Smart(GMC_Truck) ) Ù…

  17. FOL: Existential Quantifiers Existential quantifier: $<variables> <sentence> • Means the sentence holds truefor some value of x in the domain of variable x. • Main connective typically Ù • Some humans are old. $x Human(x)Ù Old(x) there exist an x such that x is a human and x is old • Mammals may have arms. $x Mammal(x)Ù HasArms(x) there exist an x such that x is a mammal and x has arms

  18. FOL: Using Exist. Quantifiers $x Human(x)Ù Old(x) • Equivalent to disjunction of instantiations of x: (Human(Neal)Ù Old(Neal)) Ú(Human(John)Ù Old(John)) Ú(Human(22) Ù Old(22) ) Ú… • Common mistake is to use Þ as main connective. • results in a weak statement • Bad example “$x Human(x)Þ Old(x)” means? • true if there is anything that isn't human (Human(Neal)Þ Old(Neal)) Ú(Human(John)Þ Old(John)) Ú(Human(22) Þ Old(22) ) Ú… 22 not human!

  19. FOL Syntax: Quantifiers • "x "y Likes(x,y)Is what in English? Everyone likes everyone. It’s the active voice. • "y "x Likes(x,y)Is what in English? Everyone is liked by everyone. It’s the passive voice. Do these mean the same thing? • Property of quantifiers: • "x "y is the same as"y "x • $x $y is the same as$y $x • note: $x $ycan be written as$x,y, likewise with "

  20. FOL Syntax: Quantifiers • "x $y Likes(x,y) Is what in English? Everyone likes someone. again the active voice • $y "x Likes(x,y)Is what in English? Someone is liked by everyone. again the passive voice Do these mean the same thing? • Property of quantifiers: • "x $y is not the same as$y "x • $x "y is not the same as"y $x

  21. FOL Syntax: Quantifiers • "x Likes(x,IceCream) Everyone likes ice cream. • Ø$x ØLikes(x,IceCream) No one doesn't like ice cream.It's a double negative! Do these mean the same thing? • Properties of quantifiers: • "x P(x) is the same asØ$x ØP(x) • $x P(x) is the same asØ"x ØP(x) • This is the negation of the application ofde Morgan's law to the fully instantiated sentence.

  22. FOL Syntax: Quantifiers "x Likes(x,IceCream)Everyone likes ice cream. What is the logical negation of this sentence? Not everyone likes ice cream. which is the same as… $x ØLikes(x,IceCream)Someone doesn't like ice cream. • Properties of quantifiers: • "x P(x)when negated is$x ØP(x) • $x P(x)when negated is"x ØP(x) • This is from the application of de Morgan's lawto the fully instantiated sentence.

  23. DeMorgan’s and Quantifiers

  24. Summary • First-order logic: • objects and relations are semantic primitives • syntax: constants, functions, predicates, equality, quantifiers • Increased expressive power: sufficient to define wumpus world more concisely.

More Related