use -q comp105You may want to put this command in your .cshrc or your .profile. The -q option is needed to prevent use from spraying text onto standard output, which may interfere with with scp, ssh, git, and rsync.
You can find an impcore interpreter in /comp/105/bin; if you have run use as suggested above you should be able to run it just by typing
ledit impcoreThe ledit command gives you the ability to retrieve and edit previous lines of input; see its man page.
Note that you can run the contents of a file through the interpreter by typing impcore < file. You can eliminate unwanted prompts by running impcore -q < file. You may find it useful to create some test cases in a file mytests; you can then check your work by typing
cat solution.imp mytests | impcore -qDon't include test cases in the solution.imp file you submit. NEEDS A NOTE ON ELIMINATING ERRORS BY
< solution.imp impcore -q > /dev/null
You may find it more convenient to keep solutions in separate files as you develop them. If so, we recommend that you do so and combine them in the end with cat. For example,
cat s2 s3 s4 s5 s6 s7 > solution.imp
;; ;; Problem N ;;
git clone linux.cs.tufts.edu:/comp/105/book-codeor if that doesn't work, from a lab or linux machine, try
git clone /comp/105/book-codeYou can find the source code from Chapter 2 in subdirectory bare/impcore or commented/impcore. The bare version, which we recommend, contains just the C code from the book, with simple comments identifying page numbers. The commented version, which you may use if you like, includes part of the book text as commentary.
diff -r bare/impcore bare/impcore-with-localsYou may wish to try the -u or -y options with diff
In the directory bare/impcore-with-locals, you can build and interpreter by typing make, but when you run the interpreter, it will halt with an assertion failure. You'll need to change the interpreter to add local variables:
For these exercises you will turn in three files: 1.pdf (or 1.txt), theory.pdf, and 13.imp. For file theory.pdf, you will probably find it easiest to write your answers on paper and scan it. Please see the note about how to organize your answers.
Include your answer as part of file theory.pdf.
Include your answer as part of file theory.pdf.
Include your answer in file theory.pdf.
Metatheoretic proofs are probably unfamiliar, so you may want to look at some sample cases we have provided to help you. Also, to relieve some of the tedium (which is very common in programming-language proofs), we suggest that you allow your proof for the AddApply case to stand in for all other cases involving primitive operators. We also suggest that you simplify by leaving out the global environment xi.