Lisp representation:
(1 -2)
(2 -8)
(-5 -4 3)
(5)
(4 -2 -6)
(-8 -7 6 -10)
(6 -10)
(end)
Prolog representation:
[1,-2].
[2,-8].
[-5,-4,3].
[5].
[4,-2,-6].
[-8,-7,6,-10].
[6,-10].
[end].
What your program should provide
If you use Prolog or Scheme we provide sample files
(tabsat.pl and
tabsat.cl
respectively) which already have the code necessary for
reading a set of clauses from a file. These two files define a top-level
procedure called tabSat whose only argument is the name of a file
containing a set of clauses.
Procedure tabSat reads the clauses in the file and calls
solve_tab_sat while passing the corresponding set of clauses as a
list of clauses. It is this procedure solve_tab_sat
that you have to implement by modifying the sample file.
solve_tab_sat takes a list of clauses in the corresponding form and
prints `YES' if such clauses are satisfiable, or `NO'
otherwise.
Notice that you do not need to program by yourself the top-level predicate
tabSat as it is already implemented. Given a file containing a set
of clauses, you should be able to test your Scheme program as follows:
(tabSat "<filename>")}. Similarly, in Prolog the command will look
as follows: tabSat(<filename>). Notice also that you will have to
write extra code to perform your statistical experiments so as to support or
refute the easy-hard-easy pattern for the tableau method. Such code will
include a procedure for generating random sets of clauses and it will use
procedure solve_tab_sat to test the satisfiability of those sets.
Finally, if you are using Java or C, your program itself should be named
tabSat and it should take as its only argument the name of the file
where it should read the set of clauses. As there is no sample file provided
for these programming languages, you are responsible for programming both the
task of reading the clauses from a file as well as solving the satisfiability
problem. A call to your program should have the following form:
tabSat <filename>.
Submitting your assignment
You should submit an electronic copy of your code to
jabaier /AT/ cs /DOT/ toronto.edu as an attachment file.
You should submit a printed copy of your experimental results and
your program with the rest of your paper assignment.
Note that code received after the due date will count as a late
assignment. Recall that your program documentation should include
the exact command used for compiling/running your program. It should
also indicate which machine (CSLab or CDF) your code runs on.
No matter what platform you choose, remember that your program
has to run error-free in CDF or CSLab. So, if you worked elsewhere, we
recommend you test your program on either of these machines well before
the due date of the assignment.