



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




This problem set is on automatic theorem proving using the semantic tableaux method. For this problem set you will implement the semantic tableaux method that was presented in class and use your procedure to prove a number of simple theorems. This handout assumes that you are familiar with the algorithm presented in class. Refer to the lecture slides for lecture 17 if necessary.
Problem 1: You are to write a nondeterministic procedure (a-model-of Σ) that attempts to find a model for the list of formulas Σ using the semantic tableaux method. You are then to write a procedure (semantic-tableaux-entails? Σ Φ) that returns #t if it can prove that Σ |= Φ and #f otherwise. You have at your disposal all of the procedures described later on in this handout.
Problem 2: You are to use your theorem prover to solve the following word problem, taken from Genesereth and Nilsson (1987, p. 93).
If a course is easy, some students are happy. If a course has a final, no students are happy. [.. .] Show that if a course has a final, the course is not easy.
First, you must formulate it as an entailment relation Σ |= Φ in first-order logic. Then, to interface with the GUI you must write a procedure theorem1 of no arguments that calls (try-to-prove Σ Φ). One you have done this you can call up the GUI by evaluating (p9). Then click on Theorem 1 to have the GUI call your theorem1 procedure. As your implementation of the semantic tableaux procedure operates you will see the updated Γ and model in the display pane. If your procedure successfully determines that the entailment relation holds it will terminate by displaying the message “Proved”. Otherwise it will display the message “Not proved”.
The proof may go by too quickly for you to follow on the screen. You can click on Pause which will toggle single step mode. In single step mode, the GUI will pause after each iteration of the outer loop of the semantic tableaux procedure. Press the space bar to step the prover through the proof. You can also press q to quit or r to leave single step mode and run the proof through to the end.
Updating the display slows the prover down considerably. You can use the display update to help you debug your implementation. When you are confident that it works, you can toggle display update by clicking on Display so that your proofs will run much faster.
Problem 3: Formulate the following word problem, also taken from Genesereth and Nilsson (1987, p. 93), as an entailment relation in first-order logic and solve it using your semantic tableaux procedure.
Victor has been murdered, and Arthur, Bertram, and Carleton are suspects. Arthur says he did not do it. He says that Bertram was the victim’s friend but that Carleton hated the victim. Bertram says he was out of town the day of the murder, and besides, he didn’t even know the guy. Carleton says he is innocent and he saw Arthur and Bertram with the victim just before the murder. Assuming that everyone—except possibly for the murder—is telling the truth, [.. .] solve the crime.
This may require formulating several entailment relations Σ |= Φ some of which can be proved and others of which cannot. The GUI allows you to write seven procedures theorem2a through theorem2g and to call these procedures by clicking on Theorem 2a through Theorem 2g. You can use these procedures however you like to solve this problem.
This problem set consists solely of writing code. You are to write the procedures a-model-of and semantic-tableaux-entails? as per the specifications in this handout along with any other procedures that you
deem necessary. You must also formulate the requisite Σ and Φ for problems 2 and 3, embodied in the procedures theorem1, theorem2a,.. ., theorem2g and use your procedures with the GUI to prove those theorems or show that they are not provable. Your grade will be based, in part, on the ability of your code to solve the above problems.
Good luck and have fun!
display? [Variable]
Either #t or #f controlling whether or not gamma and model are interactively redisplayed as they change during the tableaux proof process. This variable can be toggled by clicking on Display?.
gamma [Variable]
A list of formulas constituting Γ, the queue of formulas that remain to be processed.
model [Variable]
A list of literals, i.e. true and negated atomic formulas constituting the model constructed for the set of formulas initially placed in gamma.
constant-symbol-counter [Variable]
The index of the last constant symbol created by make-constant-symbol. Each constant symbol created by make-constant-symbol will have a unique print name, i.e. C0, C1,...
Returns the negation of the formula Φ.
add-to-model! Φ [Procedure]
Fails if the model contains the negation of the formula Φ. Otherwise, adds Φ to the model by local side effect if it does not already contain Φ. If display? is #t then the model is redisplayed both now and again when the local side effect is undone upon backtracking.
a-ground-term-in Φ [Procedure]
Nondeterministically returns a ground term or subterm that appears in Φ.
a-ground-term [Procedure]
Nondeterministically returns a ground term or subterm that appears in some formula in either gamma or the model.
ground-terms [Procedure]
Returns the set of all ground terms and subterms that appear in some formula in either gamma or the model. This set will not contain duplicates.
make-constant-symbol [Procedure]
Returns a new constant symbol guaranteed to be distinct from (i.e. not eq? to) all other symbols.
substitute x y Φ [Procedure]
Returns a new copy of the formula Φ with all free occurrences of the variable x replaced with the term y. I.e. this computes Φ[x 7 → y].
try-to-prove Σ Φ [Procedure]
Σ must be a list of formulas while Φ must be a formula. Tries to prove that Σ |= Φ. This routine simply calls (semantic-tableaux-entails? Σ Φ), a procedure which you must write, and then updates the display.
p9 [Procedure]
Starts up the GUI for problem set 9.
Genesereth, M. R., & Nilsson, N. J. (1987). Logical Foundations of Artificial Intelligence. San Mateo, CA: Morgan Kaufmann.