CS486����������������������� Applied Logic����������������������� Final Assignment����������������������� DueThurs, May 3, 2001

����������������������� ����������������������� ����������������������� ����������������������� ����������������������� �����������������������

 

Reading:�������� Please read Stewart & Tall, p. 172-182, Chapter 13.

 

Exercises:

 

1.      Write a careful proof of the stamps theorem from lecture, showing explicit use of these rules:induction on integers, recursive definition (reduce),
L, R, "L, "R, arith, and equality.

 

The equality rules include those for hd, tl and cons such as

hd(a.t)=a,tl(a.t)=tand l[ ](hd(l).tl(l)=l).

 

2.      Write a program to compute the function specified by stamps.

 

3.      Sketch a proof of this conjecture:

 

Define xis_onl����������� =����������� if x=[] then 0;

else if x=hd(l) then 1;

���������� else xis_ontl(l).

Show "l:list."i:int. (1ilength(l)(index(i,l) is_on l)=1

 

4.      Discuss the issue of how logic can help in specifying programming tasks and how careful proof helps prevent errors in program design.

`