Last Update: 28 March 2005
Note: |
In this project, you will write programs that could have passed the CS
department's old graduate-level AI
Qualifying Exam questions on logic :-)
As described in the syllabus, your final report should be a conference-style paper containing your annotated code and commented sample runs either as appendices or incorporated into the body of the report.
Using your favorite programming language, write a fully-commented algorithm (e.g., a Lisp function) that takes a well-formed formula of first-order logic as input and that returns an equivalent sentence in clause form.
Suggestion 1: You should choose an input notation for wffs that is convenient for the programming language that you are using. E.g., for Lisp,
(^ P Q)
might be more convenient than:
You do not need to write a parser (i.e., a compiler) that converts our text's FOL notation for wffs into yours. All you need to do is write a program that converts your notation into clause form.
Suggestion 2: When you rename variables so that variables bound by different quantifiers have unique names, you can use rewrite rules of the following form:
where theare quantifiers (either the same or different), # is either
or
, the
are variables such that `
'
`
', and `
' represents a sentence containing 0 or more occurrences of `
'. An example would be:
More precisely, your algorithm should take a pair of
sentences as input and either return a most general unifier (MGU) for
them, if they are unifiable, or else
return a message such as ``NOT UNIFIABLE''.
(Again, you may assume that
the notation can be understood as: (f x (g x)),
if you prefer using Lispish notation.)
Write a resolution + unification + refutation theorem prover for first-order predicate logic.
To do this, you will need to incorporate the two previous parts of the project into a fully-commented theorem prover that uses a resolution algorithm with a refutation strategy. You may either write such an algorithm from scratch (recommended, but difficult) or adapt one that you find elsewhere. If you choose the latter option, please keep the following in mind:
There are several strategies for selecting two target clauses to resolve. Instead of implementing one or more of these strategies, your program can ask the user to input two clauses for resolution (i.e., this aspect of resolution need not be automated). This interaction can take place with each pass through the algorithm.
Since this part of the project relies on a working implementation of the clause-form converter and unification algorithm (from parts 1 and 2, you should test those implementations thoroughly before you implement this part. If you find that you are getting stuck on one of the first two parts (and only if you are getting stuck), you should ``hand code'' the clause form inputs or unified results for this part. In general, you should ``hand code'' anything in your automated theorem prover that you are unable to automate.
This part is inspired by an example in Moore 1982: 429; in your report, explain the relationship between Moore's example and this problem: Using resolution, show that the following set of clauses is inconsistent. Assume that a, b, and c are individual constants, and that x and y are variables:
DUE: AT THE BEGINNING OF LECTURE, FRIDAY, APRIL
![]() |