1 / 14

CS182 Intelligent Machines: Reasoning, Actions and Plans

CS182 Intelligent Machines: Reasoning, Actions and Plans. Section 5. Propositional Logic: Conversion to CNF (1). CNF (Conjunctive Normal Form): A conjunction of clauses, where a clause is a disjunction of literals (A∨ B∨C) ∧(D∨E) ∧… ∧(X∨Y) ∧Z Convert the following sentence into CNF:

caroun
Download Presentation

CS182 Intelligent Machines: Reasoning, Actions and Plans

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. CS182 Intelligent Machines: Reasoning, Actions and Plans Section 5

  2. Propositional Logic: Conversion to CNF (1) • CNF (Conjunctive Normal Form): A conjunction of clauses, where a clause is a disjunction of literals (A∨ B∨C)∧(D∨E)∧…∧(X∨Y)∧Z • Convert the following sentence into CNF: (X∧Y)∧(Z∨¬(¬X∨(Z∧Y)))C

  3. Propositional Logic: Conversion to CNF (2) • Rules you might want to use: • De Morgan: “Pushing” negation into parentheses ¬(A∧B)=¬A∨¬B ¬(A∨B)=¬A∧¬B • Distributivity: A∧(B∨C)=(A∧B)∨(A∧C) A∨(B∧C)=(A∨B)∧(A∨C) • Implication elimination: Get around the “” AB = ¬A∨B

  4. Propositional Logic: Conversion to CNF (3) (X∧Y)∧(Z∨¬(¬X∨(Z∧Y)))C = ¬((X∧Y)∧(Z∨¬(¬X∨(Z∧Y))))C [Implication elimination] = (¬(X∧Y)∨¬(Z∨¬(¬X∨(Z∧Y))))∨C [De Morgan] = ((¬X∨¬Y)∨¬(Z∨¬(¬X∨(Z∧Y))))∨C [De Morgan] = ((¬X∨¬Y)∨(¬Z∧(¬X∨(Z∧Y))))∨C [De Morgan] = ((¬X∨¬Y)∨(¬Z∧ ((¬X∨Z)∧(¬X∨Y))))∨C [Distributivity] = ((¬X∨¬Y∨¬Z)∧(¬X∨¬Y∨¬X∨Z)∧(¬X∨¬Y∨¬X∨Y))∨C [Distributivity] = (¬X∨¬Y∨¬Z∨C)∧(¬X∨¬Y∨¬X∨Z∨C)∧(¬X∨¬Y∨¬X∨Y ∨C)[Distributivity]

  5. First-order Logic: Representing Facts(1) Are the following representations correct? • No man is both a butcher and a vegetarian. • What this really means? Anything in this world is a male butcher who is not a vegetarian. • What is the correct representation? []

  6. First-order Logic: Representing Facts(2) • The only vegetarian butchers are woman [] • What this really means? Anything in the world is a female vegetarian butcher. • What is the correct representation? []

  7. First-order Logic: Representing Facts(3) How to represent the following facts? • All men who are not butchers like some vegetarian. [) ()] • No man likes any woman who is a vegetarian butcher. ]

  8. First Order Logic: Functions (1) Representing facts in Map Coloring problems • Predicates? • Country(x), Borders(x,y) • Functions? • Map-Color(x) US is colored blue, and borders with Canada. Represent these facts and what they imply about Canada’s color: • Country(Canada) • Country(US) • Borders(US, Canada) • Map-Color(US) = Blue • (Country(Canada) ∧ Country(US) ∧ Borders(US, Canada) ∧ Map-Color(US)= Blue) ⇒ ¬(Map-Color(Canada)=Blue)

  9. First Order Logic: Functions (2) • No two adjacent countries have the same map color • Which of the following is correct? ∀x, y Country(x)∧Country(y)∧Borders(x, y)∧¬(Map-Color(x) = Map-Color(y)) This means that all things in the world are countries that border each other and have different colors! ∀x, y (Country(x)∧Country(y)∧Borders(x, y)) ⇒ Map-Color(x = y) This is not valid since Map-Color(x=y) is syntactically wrong.

  10. First Order Logic: Functions (3) ∀x, y (Country(x)∧Country(y)∧Borders(x, y)) ⇒ ¬(Map-Color(x) = Map-Color(y)). Yay! ∀x, y ¬Country(x)∨¬Country(y)∨¬Borders(x, y)∨ ¬(Map-Color(x) = Map-Color(y)). Yay! (equivalent to above) ¬∃x∃y(Country(x)∧Country(y)∧Borders(x, y)∧(Map-Color(x) = Map-Color(y))). Yay! (equivalent to above)

  11. Predicates or Functions? • A person born in the UK, each of whose parents is a UK citizen or a UK resident, is a UK citizen by birth. ∀x Person(x)∧Born(x,UK)∧(∀y Parent(y, x) ⇒ ((∃r Citizen(y,UK,r))∨Resident(y,UK))) ⇒ Citizen(x,UK,Birth). ∀x∃ ∃Person(x)∧Born(x,UK)∧(Citizen(Father(x),UK,)∨ Resident(Father(x),UK)) )∧(Citizen(Mother(x),UK,)∨ Resident(Mother(x),UK))⇒Citizen(x,UK,Birth). • A person born outside the UK, one of whose parents is a UK citizen by birth, is a UK citizen by descent. ∀x Person(x)∧Born(x,UK)∧(∃y Parent(y, x)∧Citizen(y,UK,Birth)) ⇒ Citizen(x,UK,Descent). ∀x Person(x)∧Born(x,UK)∧(Citizen(Father(x),UK,Birth)∨Citizen(Mother(x),UK,Birth))⇒Citizen(x,UK,Descent).

  12. Representing Facts in FOL – Hard Mode (1) For each of the following sentences, first define the predicates and functions required, then write the sentence: • There is an agent who sells policies only to people who are not insured. ∃x Agent(x) ∧∀y, z (Policy(y) ∧ Sells(x, y, z)) ⇒ (Person(z)∧Insured(z)) • There is a barber who shaves all men in town who do not shave themselves. ∃x ∀y Barber(x) ∧ Man(y) ∧ Shaves(y, y) ⇒ Shaves(x, y)

  13. Representing Facts in FOL – Hard Mode (2) • TFs can be clear to some of the students all of the time, and they can be clear to all of the students some of the time, but they can't be clear to all of the students all of the time. ∀ x TF(x) ⇒ (∃ y ∀t Student(y) ∧ Clear(x, y, t)) ∧ (∃ t ∀y Student(y) ⇒ Clear (x, y, t)) ∧ (∀ t ∀y Student (y) ⇒ Clear(x, y, t))

  14. Bonus: Monty Python Logic • http://www.youtube.com/watch?v=GpMjakNhZTc

More Related