To use the checker, you must have the Python language installed on your computer. If you have a Mac, you already have Python; if you have installed Cygwin on Windows, you already have Python. Many Windows machines already have Python as well. (See the end of this note to learn about installing Python.)
Within the cis301 folder, you will find a folder, Checker, that holds the proof checker, two folders of example programs to check (Ex and Exw), and README and DOC files.
The simplest way to start the checker is to enter (open) the Checker folder and double-click on Check.py. (You can do this if Check.py is displayed with an S-like or snake-like icon, which stands for Python programs.) Double-clicking starts the checker, which will ask you for the filename to check. (Note: if Check.py is not displayed with the snake icon, it likely means that you must install Python. Please skip to the bottom of this note to learn how.)
When you start Check.py, you will see a window appear on your display, asking which file you wish to check. You can use any of the examples in the folder Exw (or Ex) to try. Here is a sample dialog, where some person named ``schmidt'' installed the checker and asked it to analyze the program, Exw/while.py:
+------- | Command-line usage: python Check.py [-args] FILENAME.py where args can be any or all of v : verbose mode: insert deduced asserts as comments in output a : include all possible asserts in proof output as premises x : generate output file for execution d : display internal data structures for debugging Entering interactive mode. (Press Enter to quit.) Current path is C:\Documents and Settings\schmidt\cis301 Type filename (relative to current path) to check: Exw/while.py Type options (any or none of vaxnd): v ... the analysis will be displayed here and also saved in two files ... | Press Enter to repeat with this file; Press q to quit: +------The analysis creates, whileA.html an html-formatted, multi-color version of whileA.py that you can view in your web browser. (If you want the output as an executable python file, use the "x" option above.)
For repeated use of the checker, you should make a shortcut icon and place it on your Desktop:
While you are developing and checking a program, you can use an edit window to type your program and a web browser to view the results. You can also repeat the analysis on the same file over and over; this is useful for developing a program and its correctness proof in stages.
You should study the README.txt file that is included within the cis301 folder for advice about where to make a folder that holds the programs you write and check. There is also a beginner's guide you should read before you write any programs/proofs of your own.
Unix and Linux like using a command window to edit and run programs. You can also do this with a Windows machine.
Try opening a command window and typing python. If you get the ``not found'' message, please read the web page, Using Python from a command window to learn how to set the Path variable on a Windows machine. (If you are using Linux, update the PATH variable within your startup script, e.g., .bashrc, so that it includes the path to the folder where python is installed).
Once you have the Path variable set, you can use the checker like this: cd to cis301, and type this at the command line:
python Checker/Check.pyThis starts the session. If you prefer to use command-line arguments, you may do so, like this:
python Checker/Check.py -v Ex/while.pyThen, by pressing the up-arrow key on your keyboard, you can repeat the analysis over and over....
It is a bit of a nuisance to always start from the cis301 folder and always type the python Checker/Check.py part. If you are a Unix/Linux user, you can write an alias command like this one and place it in your startup script (.bashrc):
alias run301='python /home/Myname/Mystuff/cis301/Checker/Check.py'where /home/Myname/Mystuff/cis301/Checker/Check.py is the complete path to the checker. Then, you can start the checker from the command window like this:
run301 -v Ex/while.py
To see if your computer has Python installed, you can try these tricks:
In your My Documents folder (or Desktop), use Notepad to make a file named Hello.py and place in the file the single line,
raw_input("hello")Then, try double clicking on the file's icon to start the program. If it starts and prints hello, you have python installed correctly on your machine.
Or, from the Start menu, use Search to search all files and folders for the file, python.exe. If the search command finds it, it will show you where.
If Python is installed correctly, you will see the directory path to it.
Important: your computer must have Python 2.4 or newer up to but not including Python 3.0.
If you must install Python, you will find it easy: Go to http://www.activestate.com/Products/ActivePython, click on ``Active Python 2.6 Download Now'', then fill in your name and address in the dialog box that appears, then download and install Python Version 2.6. Try your implementation by using Notepad to make a file named Hello.py and place in the file the single line,
raw_input("hello")Then, try double clicking on the file's icon to start the program. If it starts and prints hello, you are good to go. (Or, try starting the program from a command window, like this: python Hello.py)