- Assigned:
- January 30, 2001.
- Due:
- February 6, 2001, at the start of class.
- Credit:
- 20 points.
- (4 points)
Using the predicate symbols shown and appropriate quantifiers,
write each English-language statement as a predicate wff.
(The domain is the whole world.)
W(x) is ``x is a positive integer.''
P(x) is ``x is prime.''
G(x, y) is ``x > = y.''
- Some positive integers are prime.
- Not all positive integers are prime.
- For every positive integer n, there is another positive
integer m such that m is prime and m > = n.
- There is a largest prime.
- (5 points)
Do problem 12 on p. 57 of the textbook.
- (5 points)
Do problem 16 on p. 57 of the textbook.
- (6 points)
Verify the correctness of the following program segment
to compute
z = | x + y|, the absolute value of x + y.
(Hints: You must first write a postcondition.
Example 44 may be helpful in formulating a good one.
You may also want to do some of the problems in Homework 5
before attempting this problem.)
z = x + y
if z > = 0 then
z = z
else
z = - z
end if
Berna Massingill
2001-01-31