This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSE 541  Logic in Computer Science Solutions for Selected problems on Predicate Logic Exercises from Huth and Ryan, Logic in Computer Science , 2nd ed. Exercise 2.1.3 . We use the predicates, InBox ( x ): x is in the box Red ( x ): x is red Animal ( x ): x is an animal Cat ( x ): x is a cat Dog ( x ): x is a dog Boy ( x ): x is a boy P rize ( x ): x is a prize W on ( x, y ): x won y to formalize the following sentences. a. All red things are in the box. ∀ x ( Red ( x ) → InBox ( x )) b. Only red things are in the box. ∀ x ( InBox ( x ) → Red ( x )) c. No animal is both a cat and a dog. ¬∃ x ( Animal ( x ) ∧ ( Cat ( x ) ∧ Dog ( x ))) or ∀ x ( Animal ( x ) → ( ¬ Cat ( x ) ∨ ¬ Dog ( x ))) d. Every prize was won by a boy. ∀ x [ P rize ( x ) → ∃ y ( Boy ( y ) ∧ W on ( y, x ))] e. A boy won every prize. ∃ y [ Boy ( y ) ∧ ∀ x ( P rize ( x ) → W on ( y, x ))] Exercise 2.1.4 . Let F ( x, y ) mean that x is the father of y ; M ( x, y ), that x is the mother of y ; H ( x, y ), that x is the husband of y ; S ( x, y ), that x is the sister of y ; and B ( x, y ), that x is the brother of y . We use these predicate symbols to translate the following sentences into predicate logic. a. Everybody has a mother. ∀ x ∃ yM ( y, x ) b. Everybody has a father and a mother. ∀ x [( ∃ yF ( y, x )) ∧ ( ∃ zM ( z, x ))] or, equivalently, ∀ x ∃ y ∃ z ( F ( y, x ) ∧ M ( z, x )) c. Whoever has a mother has a father. ∀ x [( ∃ yM ( y, x )) → ( ∃ zF ( z, x ))] d. Ed is a grandfather. ∃ x ∃ y ( F ( Ed, y ) ∧ ( F ( y, x ) ∨ M ( y, x ))) e. All fathers are parents. ∀ x [ ∃ yF ( x, y ) → ∃ z ( F ( x, z ) ∨ M ( x, z ))] f. All husbands are spouses. ∀ x [ ∃ yH ( x, y ) → ∃ z ( H ( x, z ) ∨ H ( z, x ))] Note that x is the wife of y means that y is the husband of x . g. No uncle is an aunt. According to Webster’s Collegiate Dictionary, an uncle is (i) the brother of one’s father or mother or (ii) the husband of one’s aunt; where an aunt is either the sister of one’s father or mother or else the wife of one’s uncle....
View
Full Document
 Spring '09
 fhfh
 Natural Numbers, Firstorder logic, P M

Click to edit the document details