Note: All assignments done for this course must be your own work. You may not colloborate with anyone (whether they are in the class or not) on assignments, though you are encouraged to consult with the instructor as you work on them.

**Running SMV:**
I believe I have compiled SMV for each architecture available on
owlnet (/home/comp408/bin/smv is a script that will determine the
architecture of the machine you are using and run the appropriate
binary). However, if you run into problems executing SMV on some
owlnet machine, please send me mail telling me which machine and I'll
compile a new binary. It definitely works on great-grey and ural.
Also, I have left the SMV distribution in
/home/comp408/SMV/smv.tar.gz. It's free software, so you are welcome
to install it on your home machine if you so choose. However, be
warned that as the assignments get more complex, you will need a lot
of memory (64 MB minimum) to run the verifications.

** Running PVS: ** Use the command runpvs from
comp408/bin (I used this name since pvs is also the name of another
utility on the system). This will start up an emacs session in
no-windows mode in your current window.

PVS documentation

- Exercises in CTL (do these by
class on Friday, January 17)
- Verifying Simple Hardware Circuits in SMV
(handed out in class on Friday, Jan 17. Due in class Wednesday, Jan 22)
- Verifying Simple Protocols in SMV
(handed out in class on Wendesday, Jan 22. Due in my mailbox by 5pm
on Friday, Jan 31)
- BDD Exercises (handed out in
class on Wednesday, Jan 29. Due in class on Wednesday, Jan 5)
- Verifying a Systolic Array
Element (handed out in class on Wednesday, Jan 29. Installments
due in class on Wednesdays, Jan 5, Jan 12, and Jan 19)
- Reading and short paper on the first part of "Automatic
Verification of Finite-State Concurrent Systems Using Temporal Logic
Specifications" by Clarke, Emerson, and Sistla. To be discussed in
class on Wednesday, Feb 12
- Specify and verify the single pulser in PVS. Due in class,
Wednesday, February 26.
- Simple abstraction in PVS. In ~comp408/Assignments/4 you will
find a file called adder.pvs. This file defines an implementation of
an n-bit adder and gives a behavioral specification in terms of
natural numbers. The correctness theorem is stated with respect to an
abstraction function vec2num that maps bit vectors to numbers. For
this assignment, add a definition for vec2num to adder.pvs and verify
the theorem adder_correct. You should not make any changes to the
file other than adding the definition of vec2num.
Some hints/reminders that you may well find useful in doing this assignment:

- All recursive function definitions require a MEASURE statement that indicates an expression that moves closer to the base case on each iteration.
- You can get type information about an expression using command (typepred "expr").
- If you want to do induction on a range of numbers with an upper bound (call this bound UB), the command to issue to PVS is (induct "variable name" line-number "below_induction[UB]").
- If you have an equality of the form "a = b" on the true side at line n, you can replace occurrences of "a" in line k using command (replace n k). If you want to replace occurrences of "b", the command is (replace n k rl) --- type rl literally, it stands for "right to left".
- You can introduce a lemma into the sequent using command (lemma "lemma name"). For this proof, you will almost definitely want to use the lemma called "expt_plus", which is pre-defined in PVS. This lemma states that n ^ (i + j) = n ^ i * n ^ j.

You should submit this assignment via a dump file by email. Due by class on Wednesday, March 19.