1 / 38

CS3243: Introduction to Artificial Intelligence

This chapter outlines the importance, syntax, and semantics of First-Order Logic (FOL) in Artificial Intelligence. It covers using FOL, knowledge engineering in FOL, and provides examples of models and quantification.

tracis
Download Presentation

CS3243: Introduction to Artificial Intelligence

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. CS3243: Introduction to Artificial Intelligence Semester 2, 2017/2018

  2. First-Order Logic (FOL) AIMA Chapter 8

  3. Outline • Why FOL? • Syntax and semantics of FOL • Using FOL • Wumpus world in FOL • Knowledge engineering in FOL

  4. Propositional Logic

  5. First-Order Logic • Propositional logic assumes that the world contains facts • First-order logic (like natural language) assumes that the world contains • Objects: people, houses, numbers, colors, baseball games, wars, … • Relations: unary relations or properties such as red, round, prime, …, or more general -ary relations such as brother of, bigger than, part of, comes between, … • Functions: father of, best friend, one more than, plus, …

  6. Syntax of FOL: Basic Elements

  7. Atomic Sentences Functions can be viewed as complex names for constants Term:constant or variable or Atomic sentence: or E.g.,

  8. Complex Sentences Constructed from atomic sentences via connectives E.g.,

  9. Truth in First-Order Logic • Sentences are true in amodel • Model comprises a set of objects (domain elements) and an interpretation • Interpretation specifies referents for • An atomic sentence is true in a given model if the relation referred to by holds among the objectsreferred to by .

  10. Models for FOL: Example 1 Model contains 5 objects, 2 binary relations (black), 3 unary relations (blue), 1 unary function (red) R J

  11. Models for FOL: Example 2 • 2 constant symbols, and , and 1 binary relation symbol • Number of possible models unbounded → Checking entailment by enumeration of all models infeasible • Restricting to ≤ 6 objects produces 137,506,194,466 models

  12. Universal Quantification • e.g., everyone at NUS is smart: • is true in a given model if is true with referring to each possible object in the model • Roughly speaking, it is equivalent to the conjunction of instantiations of

  13. A Common Mistake to Avoid • Typically, is the main connective with • Common mistake: using as the main connective with : What does the above mean?

  14. Existential Quantification e.g., someone at NUS is smart: • is true in a given model if is true with referring to at least one object in the model • Roughly speaking, it is equivalent to the disjunction of instantiations of

  15. Another Common Mistake to Avoid • Typically, is the main connective with • Common mistake: using as the main connective with : What does this mean?

  16. Negation • Negation of is • Negation of is

  17. Equality • is true under a given interpretation iff and refer to the same object • With function: e.g., • With negation: e.g., definition of in terms of :

  18. Interacting with FOL KBs • A Wumpus-world agent is using a FOL and perceives a smell, a breeze, and glitter at : Tell(, Percept([Smell, Breeze, Glitter, None, None], )) Ask(, BestAction()) • Quantified query: does the entail some best action at? Answer: Yes. • AskVars() returns the binding list or substitutions such that • e.g., AskVars(, BestAction()) • Answer: {} ← substitution (binding list)

  19. KB for theWumpusWorld • Perception rule • Process agent’s inputs • “If observed a glitter at time , set ” • Reflex rule • Process agent’s outputs • Above rules yield How would we write the above rule in propositional logic?

  20. KB for the Wumpus World Properties of squares: Squares are breezy near a pit:

  21. Knowledge Engineering in FOL • 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

  22. Optimal Traffic Management • We are approached by the Singapore Police • Want to optimally position traffic cameras in major intersections so as to cover all relevant intersections. • A camera in an intersection also covers adjacent ones. • Please help!

  23. Identify the Task

  24. Assemble Relevant Knowledge • Number of cameras? • How many major intersections? • What roads are relevant?

  25. Decide on Vocabulary • – set of intersections • – is there a road connecting and • - there is a camera in location . • Maximal number of cameras -

  26. Encode General Domain Knowledge • Edges are bidirectional – • Coverage property – • Total coverage – • Is providing total coverage?

  27. Encode the Specific Instance

  28. Pose Queries • Is there a solution using cameras? • Will a specific solution work?

  29. Debug Database • …

  30. Packet Dropoff • We are approached by a Waste Disposal Service • Want to optimally collect garbage from various locations. • Don’t want to visit same location twice

  31. Identify the Task

  32. Assemble Relevant Knowledge • Pickup locations • Routes

  33. Decide on Vocabulary • – set of locations • – is there a road connecting and • : we move from to . • Start location:

  34. Encode General Domain Knowledge • : there is an edge between and . • Start location is unique: • Can only travel on edges:

  35. Encode the Specific Instance

  36. Pose Queries • Is there a solution covering all vertices exactly once? • Will a specific solution work?

  37. Debug Database • …

  38. Summary • First-order logic: • objects and relations are semantic primitives • syntax: constants, functions, predicates, equality, quantifiers • Increased expressive power over propositional logic: sufficient to define many non-trivial problems

More Related