(Please do this project in groups.)
The goal of this project is for you to encode the problem of searching for an causal explanation (that is consistent with one’s prior knowledge and perceptual observations) into the problem of generating a logical model (that satisfies a conjunction of constraints). More concretely, your job is to
-
write a program that generates a family of constraint satisfaction problems that vary in complexity but arise from the same domain (such as the edge labeling problem for a family of line drawings, or the coherence requirement for a sequence of human interactions);
-
use a solver such as Mace4 or MiniSAT to search for solutions to this family of problems, debugging your program along the way;
-
report on the solutions found by the solver, how much time and memory it took, and whether these results match your expectations.
As an extension of the second project, the third project can be thought of as searching for a sample whose probability is greater than zero in a model whose structure among variables is more sophisticated.
Here are some practical hints:
-
If you use a SAT solver such as MiniSAT, it probably expects its input in DIMACS CNF format. For example, in class we saw the alarm and burglar problem expressed in DIMACS CNF format.
-
To enumerate all solutions rather than see only the first one, add the solutions you already have as negative constraints. For example, after we saw that “
1 2 0
” (i.e., alarm = burglar = true) is a solution to the above problem, we added a constraint and found that no other solution exists. -
The text format for specifying constraints to Mace4 is relatively intuitive. For example, I’ve expressed the problem of labeling the Penrose triangle.
- A variable name is a consecutive string of letters and/or numbers.
- The symbols “
&
”, “|
”, and “-
” stand for “and”, “or”, and “not”. - Put a period after each constraint. If you have multiple constraints, they are effectively conjoined (“and”ed together).
-
Mace4 provides both a graphical user interface (easy to try out) and a command-line tool (easy to invoke automatically).
- In the graphical user interface, put your constraints in the “Assumptions” box (not the “Goals” box) under the “Formulas” tab, then click “Start” under “Model/Counterexample Search” (not under “Proof Search”).
- For the command-line tool, put your constraints between
“
formulas(assumptions).
” and “end_of_list.
” in the input file. - In the output from Mace4, “
[0]
” means false and “[1]
” means true.
This project description is surely incomplete. Please ask questions and express concerns about it.