Complete this lab and the Problem set by 5:00pm September 12, 2005
Many of the assignments in this course will require you to use
a Mac or a PC, either in a lab on campus or your own. We will use the
Mac lab in 128 Searles for our problem sessions, but all the public labs that
are open in the evenings and weekends will also have Haskell available.
Here's how to start Haskell for editing or running a program on a Mac:
(a) A Unix "Shell" where you can run Haskell programs: select Macintosh HD -> Applications -> Utilities -> Terminal
(b) A text editor where you can edit Haskell programs: select Macintosh HD -> Applications -> TextEdit
> module Asst1 where
--------------------------------------------
Using Haskell to Explore Propositional Logic
Allen Tucker
January 2004
--------------------------------------------Propositional logic is supported in Haskell, but some of the notation for operators and variables is different from your text. The logical operators for conjunction (^), disjunction (v), and negation (') in your text are written in Haskell as &&, ||, and not, respectively. Moreover, logical variables are written in Haskell in lower case, rather than in upper. So the following logical expression in your text:
P ^ Q v R'
is written in Haskell as
p && q || not R
In later assignments, you can follow these same steps to start a Haskell lab session. The rest of the work in the lab will be self-explanatory - just follow the text in the right-hand window. The labs are designed to supplement the Problem set (see below), and in many cases they will provide useful tools for solving problems from your book.
The Problem set for Assignment 1 is a separate document. You may print it on paper or just leave it open on your screen. Your written answers to the questions in the Problem set can be done either by hand or by typing and printing a new document using TextEdit. Later in the semester, there will be advantages to using TextEdit for problem solving.
When you are finished in the lab, be sure to save your work (e.g., by e-mailing it to yourself).
Finally, be sure to log out from your computer. This will ensure that your work will not be accessed by someone else who uses that computer after you leave.
Completing the above steps on a PC is almost identical, except for the following:
You may download and install a free copy of Haskell on your own computer by visiting the Web site http://www.haskell.org/hugs/. The Haskell home page http://www.haskell.org is a source of lots of information, such as tutorials and other goodies. You may want to visit this page during the semester, but for the time being you should not need additional resources.