COT 3420 --- Logic for Computer
COT 3420 - Logic for Computer Science
Homework Assignment 3
Due Monday, February 24
Let b : array[0..n-1] of integer, where n ³ 0.
Recall that if i and j are two integers satisfying
0 £ i £ j+1 £ n, then the array section b[i..j] consists of b[i], b[i+1], ¼, b[j].
Note that the section is empty if i = j+1.
Translate the following sentences into predicates.
Some values (i.e. at least one) in b[i..j] are zero.
b[i..j] contains at least two zeros.
Not all zeros of b[0..n-1] are in b[i..j].
Every value in b[i..j] is also in b[j+1..n-1].
In the following predicate, draw an arrow from each bound identifier to
the quantifier where it is bound, and mark the other identifiers as free.
Let fool (p,t) stand for "you can fool person p at time t".
Translate the following sentences into predicates.
(If the English version is ambiguous, give more than one translation.)
You can fool some of the people all of the time.
You can fool all of the people some of the time.
You can't fool all of the people all of the time.
Perform the following textual substitution:
("i : m £ i < n : b[i] < 3*x)[x : = x+i]
File translated from
T_{E}X
by
T_{T}H,
version 3.30. On 12 Feb 2003, 14:12.