Understanding First-Order Logic: Models and Usage

Slide Note
Embed
Share

Explore the fundamentals of First-Order Logic, including quantifiers, free and bound variables, nested quantifiers, connections between logic statements, and the concept of equality. Discover how to construct models for First-Order Logic sentences and grasp essential concepts such as scopes of quantifiers and De Morgan's rules.


Uploaded on Oct 04, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. FOL Models and Usage Outline I. Quantifiers II. Model for FOL III. Assertions & queries in FOL IV. Natural numbers & sets * Figures are from the textbook site unless a source is specifically cited.

  2. I. Scope of a Quantifier Quantifiers and have the lowest precedence. ? ? ? ? ? ? (? ? ? ? ) scope of ? ? ? ? ? ? ?(?,?) ? ? ? ?,? scope of scope of ? (? ? (? ? ? (? ?,? (? ? ? ?,? )))) Each of and quantifies the remaining scope of the innermost pair of parentheses containing it. ? scope of * In symbolic logic, and have the highest precedence.

  3. Free and Bound Variables A variable occurrence is bound in a formula if it is quantified. A variable occurrence is free in a formula if it is not quantified. ? Father(?,?) Male(?) ? is bound while ? is free. ?,?,?,?,? are all bound ? ? ? ? ? ?(?,?,?,?,?) ?,? are bound while ? is free. ? ? (?(?) ?(?,?(?),?)) different bound variable Free and bound variables can have the same name. ? ? ( ? ? ? ) ?(?) ? ? ? ?(?) free bound same free variable

  4. Nested Quantifiers ? ? Student ? Course(y) Enrolled(?,?) ? ? Brother ?,? Sibiling(?,?) Order matters for quantifiers of different types: ? ? Loves ?,? ? ? Loves ?,? // Everybody (?) loves somebody (?) // There is someone (?) whom everyone (?) loves. but not for those of the same type and appearing next to each other: ? ? Loves ?,? ? ? Loves ?,? ? ? (Brother ?,? Sibiling(?,?)) ? ? (Brother ?,? Sibiling(?,?))

  5. Connections Between and Through ? Likes ?,Parsnips ? Likes ?,Parsnips ? Likes ?,Icecream ? Likes ?,Icecream De Morgan s rules still apply: ? ?(?) ? ?(?) ? ? ? ? ?(?) Move negation inward, flipping the quantifiers: ? ? ? ? ? ?(?,?,?,?,?) ? ? ? ? ? ?(?,?,?,?,?) ? ? ? ? ? ?(?,?,?,?,?) ? ? ? ? ? ?(?,?,?,?,?) ? ? ? ? ? ?(?,?,?,?,?) ? ? ? ? ? ?(?,?,?,?,?)

  6. Equality It states that two terms refer to the same object. Father(Zeus)= Cronus Father(Cronus)= Uranus The symbol can also be used to state that two terms are not the same object. // Zeus has exactly two brothers // (? Poseidon and ? Hades, or ? Hades and ? Poseidon) // Zeus has at least // two brothers. ? ? Brother(?, Zeus) Brother(?, Zeus) ? = ? ( ? Brother(?,Zeus) (? = ?) (? = ?)) // Zeus no other brothers besides ?, ?.

  7. II. Model for First-Order Logic Sentences are true with respect to a model ?. The model ? contains objects (called domain elements) and interpretations of symbols. constant symbols objects in domain ? predicate symbols relations function symbols functional relations Each predicate ?(?1, ,??) is mapped to a relation, which is a set of ?-tuples over ?. Each function ?(?1, ,??) is mapped to a function from ?? to ? {?}, where ? is some invisible object.

  8. Model Example Model for the family relationships of the Greek gods (incomplete). Ares Father(Zeus, Hermes) Mother(Hera, Ares) Mother(Aphrodite, Harmonia) Father(Zeus, Athena) Hades Zeus Aphrodite Hera Demeter Harmonia ApolloPoseidon Dionysus Hermes Persephone Athena predicates Artemis Hephaestus Weapon(Zeus)// Thunderbolt Weapon(Apollo)// BowAndArrows domain ? Carry(Hermes)// Flute Carry(Aphrodite)// Apple functions

  9. Truth in First-Order Logic A predicate ? ?1, ,?? is true if the objects referred to by the terms ?1, ,?? are in the relation referred to by the predicate. ?1= ?2 is true if the two terms ?1 and ?2 refer to the same object. The semantics of sentences formed with logical connectives are identical to those in propositional logic. Quantifiers allow us to express properties of a collection of objects instead of enumerating them by name. (universal): for all (existential): there exists

  10. Truths with Quantifications ? ? ? is true in a model ? iff ?(?)is true with ?assuming every object in the model true (in every model) ? Father(?,?) Male(?) true (in every model) ? Ellipse(?) Circle ? ? ? ? is true in a model ? iff ?(?)is true with ?assuming some object in the model. true (in a model that includes all the people in the world) ? Likes ?,sushi false (in the model of Greek mythology) ? Mother(?, Ares) Mother(?, Harmonia)

  11. III. Using FOL Knowledge engineering represents information about the world in a form that can be utilized by a computer to solve complex tasks such as: medical diagnosis dialog in a natural language etc. Knowledge representation (logical rules, semantic nets, frames, etc.) Automated reasoning (inference engines, theorem provers, etc.) A domain is some part of the world about which we wish to express some knowledge.

  12. Assertions and Queries in FOL Add sentences, called assertions, to a KB using TELL. TELL(KB, Likes(John, Icecream)) TELL(KB, Father(Zeus, Athena)) TELL(KB, ? ? Brother ?,? Sibiling(?,?)) Ask the KB questions using ASK. ASK(KB, Likes(John, Icecream)) Query: question asked Any query is entailed by the KB should be answered affirmatively.

  13. Substitution Suppose another KB has the following predicates: Bird(Swan), Bird(Crane), Bird(Parrot), Quantified query ASK(KB, ?Bird(?)) returns true To know what values of ? make the sentence true ASKVARS(KB, Bird(?)) The query returns {?/ Swan}, {?/ Crane}, and {?/ Parrot} substitution or binding list

  14. The Kinship Domain Kinship relations are represented by binary predicates. // One s mother is the person s female parent. ?,?Mother ? = ? Female(?) Parent(?,?) // One s husband is the person s male spouse. ?, Husband ,? Male( ) Spouse( ,?) // Parent and child are inverse relations. Axioms ?,?Parent ?,? Child(?,?) // A grand parent is a parent of one s parent ?,?GrandParent ?,? ?(Parent(?,?) Parent(?,?)) // A sibling is another child of one s parent ?,?Sibling ?,? ? ? ?(Parent(?,?) Parent(?,?)) These are definitions in the form of ?,? ?(?,?) and built upon a basic set of predicates Child, Male, Female, etc.

  15. Axioms and Theorems Axioms in a domain are logical sentences that are taken to be true without being derived. Theorems are logical sentences entailed by axioms. ?,?Sibling ?,? Sibling(?,?) // entailed by // ?,?Sibling ?,? ? ? ?(Parent(?,?) Parent(?,?)) ASK(KB, ?,?Sibling ?,? Sibling(?,?)) should return true. Some axioms are not definitions. ? Person ? // no clear way to define Some predicates have no complete definitions. ? Person ? ? Person ? // partial specification of // properties

  16. IV. Domain of Natural Numbers Describe the theory of natural numbers using merely: one constant symbol, 0 one function symbol, ? (successor) one predicate, NatNum Recursive definition: NatNum(0) ? NatNum(?) NatNum(?(?)) Axioms to constrain the successor function: ?0 ?(?) ?,?? ? ?(?) ?(?)

  17. Defining Addition Syntactic sugar: an extension to the standard syntax that does not change the semantics but improves readability. ? NatNum ? + 0,? = ? prefix notation Use infix notation for readability. ? NatNum ? 0 + ? = ? infix notation ?,? NatNum ? NatNum ? +(? ? ,?) = ?(+ ?,? ) Write ?(?) as ? + 1. ?,? NatNum ? NatNum ? ? + 1 + ? = ? + ? + 1 Syntactic sugar: ? ? according to syntax

  18. Domain of Sets Syntatic sugar: {} for the empty set One unary predicate, Set Binary predicate, e.g., ? ?(? is a member of set ?) Binary predicate, e.g., ?1 ?2 (set ?1 is a subset of set ?2) Binary functions, (intersection), (union), Add ?1 ?2 ?1 ?2 Add(?,?) the set resulting from add element ? to set ?

  19. Eight Axioms for Sets A set is either an empty set or made by adding something to a set. ? Set ? (? = {}) ( ?,?0Set ?0 ? = Add ?,?0) The empty set has no elements added to it. // equivalently, no way to decompose {} // into a smaller set and an element ?,? Add ?,? = {} Adding an element already in the set has no effect. ?,? ? ? ? = Add ?,? The only members of a set are the added elements. ?,? ? ? ?,?2 (? = Add ?,?2 (? = ? ? ?2)) // expressed recursively must be true at some recursion level

  20. Set Axioms (contd) Subset relationship ?1,?2 ?1 ?2 ( ? ? ?1 ? ?2) Set equality ?1,?2 ?1= ?2 (?1 ?2 ?2 ?1) Intersection ?,?1,?2 ? ?1 ?2 (? ?1 ? ?2) Union ?,?1,?2 ? ?1 ?2 (? ?1 ? ?2)

  21. Equality Axiomatize equality: write down sentences about equality in theKB. One for each basic axioms. // reflexive ? ? = ? // symmetric ?, ? ? = ? ? = ? // transitive ?, ?, ? ? = ? ? = ? ? =? One for each predicate. ?, ? ? = ? (?1(?) ?1(?)) One for each function. ?, ? ? = ? (?1 ? = ?1(?))

Related


More Related Content