SE 500 Fall 2022
HW #8: Repeat: Textual Substitution in Quantifications and Formalizing Predicates
Due: 4:15pm, Wednesday, November 16


1. Making use of this definition, show (in step-by-step fashion) the result of carrying out the following textual substitutions:

(a) (★i | j ≤ i < k : b.(k+i-j))[i := i+1]
(b) (★i | j ≤ i < k : b.(k+i-j))[j := j-1]
(c) (★i | j ≤ i < k : b.(k+i-j))[k := 2*k]
(d) (★i | j ≤ i < k : b.(k+i-j))[k := 2*i]
(e) (★i | j ≤ i < k : (★j | 0 ≤ j < i : b.(k+i-j)))[j := j-1]
(f) (★i | j ≤ i < k : (★j | 0 ≤ j < i : b.(k+i-j)))[k := k+j]


2. Let Person be a type whose "universe" is the set of all persons. Consider these three predicates:

Translate each of the following statements into an expression in predicate logic, using the predicates D, S, and L.

(a) Some people who eat spinach also own a dog.

(b) Everyone who owns a dog likes someone other than (her/him)self.

(c) There is a person who does not like anyone who eats spinach.

(d) There is a dog owner who likes everyone who both owns a dog and does not eat spinach.

(e) Everyone who both eats spinach and doesn't own a dog doesn't like anyone who owns a dog.

(f) If everyone likes (her/him)self, then everyone either owns a dog or eats spinach.

(g) If no one both owns a dog and eats spinach, then everyone dislikes all spinach-eaters.