university of trento
play

University of Trento Logica & Linguaggio 12/03/12 1 Animal - PDF document

University of Trento Logica & Linguaggio 12/03/12 1 Animal problem Consider the following problem 1. The only animals in this house are cats. 2. Every animal that loves to look at the moon is suitable for a pet. 3. When I detest an


  1. University of Trento Logica & Linguaggio 12/03/12 1 Animal problem Consider the following problem 1. The only animals in this house are cats. 2. Every animal that loves to look at the moon is suitable for a pet. 3. When I detest an animal, I avoid it. 4. All animals that don’t prowl at night are carnivorous. 5. No cat fails to kill mice. 6. No animals ever take to me, except the ones in this house. 7. Kangaroos are not suitable for pets. 8. All animals that are carnivorous kill mice. 9. I detest animals that do not take to me. 10. Animals that prowl at night always love to look at the moon. Is it true that I always avoid kangaroo? (a) Represent the facts above as FOL sentences and formalize the problem. Remember to give the keys of your formalization and add the extra information you might need in order to answer the question. (b) Give the proof of your answer by means of tableaux.

  2. 2 Coloring Problem Given a map of adjacent regions and a set of colors, determine whether an assignment of colors to regions is possible (exists) such that no two adjacent regions have the same color. Axiomatize this problem in first-order logic for the following map and three colors: +----------------+ | | | | | reg4 | | reg1 | | | +---------+ | | | +------+--+ | | | reg3 | | reg2 | | | | | +---------+------+ 3 Alpha town Consider the following situations: (a) In the Alpha town there were a barber man and a man that the barber shaved. However, any barber man of Alpha shaved all and only the men of Alpha who did not shave themselves. Formalize the problem, and show that the resulting set of formulae is unsatisfiable. (b) In the Alpha town there were a barber man and a man that the barber shaved. However, any barber man of Alpha shaved all the men of Alpha who did not shave themselves. Formalize the problem, and show that the resulting set of formulae is satisfiable.

  3. 4 Solution: Animal Problem Animal ( x ): “x is an animal” Cat ( x ): “x is a cat” Inhouse ( x ): “x is in this house” Detest ( x, y ): “x detests y” Avoid ( x, y ): “x avoids y” Take ( x, y ): “x takes to y” Kan ( x ): “x is a kangaroo” ∀ x. ( Animal ( x ) ∧ Inhouse ( x )) → Cat ( x ) [1.] ∀ x. Detest ( r, x ) → Avoid ( r, x ) [3.] ∀ x. ( Animal ( x ) ∧ ¬ Inhouse ( x )) → ¬ Take ( x, r ) [6.] ∀ x. ( Animal ( x ) ∧ ¬ Take ( x, r )) → Detest ( r, x ) [9.] ∀ x. Kan ( x ) → Animal ( x ) [extra] ∀ x. Cat ( x ) ↔ ¬ Kan ( x ) [extra] ¬ ( ∀ x. Kan ( x ) → Avoid ( r, x )) [negation of Con.]

  4. 5 Solution: Coloring Problem Graph Coloring Problem • Reflexivity of edges : ∀ x. ∀ y. ( Con ( x, y ) ↔ Con ( y, x )) • Coloring of nodes : ∀ x. (( Blue ( x ) ∨ Green ( x )) ∨ Red ( x )) • Uniqueness of colors per node : ∀ x. ( Blue ( x ) ↔ ( ¬ Green ( x ) ∧ ¬ Red ( x ))) • Irriflexivity of relation : ∀ x. ¬ Con ( x, x ) Secondly, we have to add the given constraints: the coloring function has to be such that no two connected vertices have the same color: • Constraint : ∀ x. ∀ y. ( Con ( x, y ) → (( Blue ( x ) ↔ ¬ Blue ( y )) ∧ ( Red ( x ) ↔ ¬ Red ( y )) ∧ ( Green ( x ) ↔ ¬ Green ( y )))) Finally, we have to describe the domain. Con ( reg 1 , reg 2 ) Con ( reg 1 , reg 3 ) Con ( reg 1 , reg 4 ) Con ( reg 2 , reg 3 ) Con ( reg 3 , reg 4 ) ¬ Con ( reg 2 , reg 4 ) ∀ x. ∀ y. ( Con ( x, y ) → ((((( x = reg 1 ) ∨ ( x = reg 2 )) ∨ ( x = reg 3 )) ∨ ( x = reg 4 )) ∧ (((( y = reg 1 ) ∨ ( y = reg 2 ))( y = reg 3 )) ∨ ( y = reg 4 )))) Alternatively, we could treat the colors as object using the language below: • Object := blue, green, red, reg 1 , reg 2 , reg 3 , reg 4 • Relation := Color ( x, y ) , Con ( x, y ) With this language, we can formalize the problem as follows: • Reflexivity of edges : ∀ x. ∀ y. ( Con ( x, y ) ↔ Con ( y, x )) • Coloring of nodes : ∀ x. (( Color ( x, blue ) ∨ Color ( x, green )) ∨ Color ( x, red )) • Uniqueness of colors : ( blue � = green ) ∧ ( blue � = red ) ∧ ( green � = red ) • Irriflexivity of relation : ∀ x. ¬ Con ( x, x ) The constraint is reduced to the simple formula below. • Constraint : ∀ x. ∀ y. ( Con ( x, y ) → ¬∃ z. ( Color ( x, z ) ∧ Color ( y, z ))) Finally, we have to describe the domain as we did above. 6 Solution: Alpha town (a) {∃ x ( B ( x ) ∧ ∃ yS ( x, y )) , ∀ x ( B ( x ) → ∀ y ( ¬ S ( y, y, ) ↔ S ( x, y ))) } (b) {∃ x ( B ( x ) ∧ ∃ yS ( x, y )) , ∀ x ( B ( x ) → ∀ y ( ¬ S ( y, y, ) → S ( x, y ))) }

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend