Back to Browse

FMSE (FORMAL METHOD IN SOFTWARE ENGINEERING) PART5

152 views
May 15, 2022
10:00

#FMSE (FORMAL METHOD IN SOFTWARE ENGINEERING) PART5 #More Answers for Practice in Logic More Answers for Practice in Logic and HW 1 This is an expanded version showing additional right and wrong answers. I. Practice in 1st-order predicate logic – with answers. 1. Mary loves everyone. [assuming D contains only humans] ∀x love (Mary, x) Note: No further parentheses are needed here, and according to the syntax on the handout, no further parentheses are possible. But “extra parentheses” are in general considered acceptable, and if you find them helpful, I have no objection. So I would also count as correct any of the following: ∀x (love (Mary, x)), (∀x love (Mary, x)), (∀x (love (Mary, x))) 2. Mary loves everyone. [assuming D contains both humans and non-humans, so we need to be explicit about ‘everyone’ as ‘every person’] ∀x (person(x) → love (Mary, x)) A wrong answer: ∀x (person(x) & love (Mary, x)) This says that everything in the universe is a person and loves Mary. 3. No one talks. [assume D contains only humans unless specified otherwise.] ¬∃x talk(x) or equivalently, ∀x¬talk(x) 4. Everyone loves himself. ∀x love (x, x) 5. Everyone loves everyone. ∀x∀y love (x, y) 6. Everyone loves everyone except himself. (= Everyone loves everyone else.) ∀x∀y(¬ x = y → love (x, y)) or ∀x∀y( x ≠ y → love (x, y)) Or maybe it should be this, which is not equivalent to the pair above: ∀x∀y(¬ x = y ↔️ love (x, y)) or ∀x∀y( x ≠ y ↔️ love (x, y)) The first pair allows an individual to also love himself; the second pair doesn’t. 7. Every student smiles. ∀x (student(x) → smile( x)) 8. Every student except George smiles. ∀x ((student(x) & x ≠ George) → smile( x)) That formula allows the possibility that George smiles too; if we want to exclude it (this depends on what you believe about except; there are subtle differences and perhaps some indeterminacy among except, besides, other than and their nearest equivalents in other languages), then it should be the following, or something equivalent to it: ∀x ((student(x) → (x ≠ George ↔️ smile( x))) 9. Everyone walks or talks. ∀x (walk (x) ∨ talk (x)) 10. Every student walks or talks. More Answers for Practice in Logic and HW 1.doc Ling 310 Feb 27, 2006 2 ∀x (student(x) → (walk (x) ∨ talk (x))) 11. Every student who walks talks. ∀x ((student(x) & walk (x)) → talk (x))) or ∀x (student(x) → (walk (x) → talk (x))) 12. Every student who loves Mary is happy. ∀x ((student(x) & love (x, Mary)) → happy (x))) 13. Every boy who loves Mary hates every boy who Mary loves. ∀x((boy(x) & love (x, Mary)) → ∀y((boy(y) & love(Mary, y))→ hate (x,y))) 14. Every boy who loves Mary hates every other boy who Mary loves. (So if John loves Mary and Mary loves John, sentence 13 requires that John hates himself, but sentence 14 doesn’t require that.) ∀x((boy(x) & love (x, Mary)) → ∀y((boy(y) & love(Mary, y) & y ≠ x) →hate (x,y)))

Download

0 formats

No download links available.

FMSE (FORMAL METHOD IN SOFTWARE ENGINEERING) PART5 | NatokHD