COT 3420 --- Logic for Computer COT 3420 - Logic for Computer Science
Homework Assignment 3
Due Monday, February 24
  1. 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.
    1. Some values (i.e. at least one) in b[i..j] are zero.

    2. b[i..j] contains at least two zeros.

    3. Not all zeros of b[0..n-1] are in b[i..j].

    4. Every value in b[i..j] is also in b[j+1..n-1].



  2. 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.
    ($j : 0 j < n : ("i : 0 i < j+1 :($j : : f(i) = 2*j)))


  3. 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.)
    1. You can fool some of the people all of the time.

    2. You can fool all of the people some of the time.

    3. You can't fool all of the people all of the time.



  4. Perform the following textual substitution:
    ("i : m i < n : b[i] < 3*x)[x : = x+i]





File translated from TEX by TTH, version 3.30.
On 12 Feb 2003, 14:12.