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.