Sunteți pe pagina 1din 4

ATP MACHINE

zlem Ceren ahin, Gne Sucu, Deniz Can Yldrm


Middle East Technical University,
Computer Engineering Department
CENG 561 Artificial Intelligence

Introduction
In this project we try to implement an automated theorem
proving system (a.k.a. ATP machine). The field of ATP is
derived from automatic reasoning and mathematical logic
and a usual ATP system is supposed to deal with the development of computer programs which proves that some
statement is a logical consequence of a set of statements.
These systems have great significance since they are able to
solve extremely difficult problems in reasonable amount of
time.
Our approach is designing an ATP machine by using resolution technique which uses the proof by contradiction method. It basically applies resolution rules iteratively until the
propositional formula is determined as satisfiable or not.
Our system is able to get the propositional formula and convert it to clauses by using resolution rules which are
I(implications out), N(negations in), D(Distribute OR over
AND) and O(Operators out). And the resolving process
which is reaching the empty set from the clauses found
above is also ready. The results and comments will be stated
in the following chapters.

Related Work
As a starting point, we analyzed the implementation of Boyers
theorem prover, source code of this project can be found in
github. At the beginning of the project we have downloaded the
Boyers theorem prover, and run it to understand the basic steps
of the execution.
During our analysis, we noticed that Boyer has defined a unification and resolution algorithm using sequents to prove/disprove
the theorems. The difference between Boyers approach and ours
is that we prefer to use Resolution method with clauses in this
project.
Boyers project gets the input, parses it to identify formulas, variables, axioms, etc. and directly give them to the prove/disprove
process by using sequents. In contrast, we get the input, parse it,
preprocess the input to get clauses from input, and finally
prove/disprove.

Problem Definition and Algorithm


Task Definition
Our program takes a propositional formula as an input,
gives input to INDO methods to get clauses and then uses
these clauses obtained by previous steps to prove or disprove the propositional formula given as input. The output
will be the statement that says it is provable or not.
In the first part of the project, we start with applying the
INDO process, described above, to the given input. As a
result of this, clauses become ready for the resolving step.
In that part, we combine two clauses with a positive literal
and its negation which ends up with a new clause consisting of all literals except for these resolved ones. Until we
reach an empty set or certain iteration depth, this process is
always repeated.
Final output of the program says the statement is proved
if we have an empty set at the end of resolving process;
otherwise, the statement is disproved.
This problem can be very challenging since the formulas to
be proved are sometimes too complex. By this automated
theorem prover, this problem becomes a simplified task.

Algorithm Definition
Basically the following steps are applied respectively. After each step we will show the example.
First we get the goal formula as input, parse the formula into a list form and negate it. By doing so it
will be ready to go into the resolution algorithm. By
doing this we can show that the negated goal is unsatisfiable or not.
goal:

negated goal:

After negating the goal we now apply the "Implications out" procedure.

and it disproves every disprovable example which we have


tried so far.

Results
Then apply the "Negations in" procedure.

In the first part, the results of the given example described


above were shown below:
Goal phrase is also the input of our program. And the
output was the result of "Operators out" procedure.

After that we apply "Distribute OR over AND".

Then we apply "Operators out" procedure and get the


clauses.
Using the result of the "Operators out" procedure, we
extract the clauses and initiate the resolving process and
the final result is shown in the figure below. Since there is
no resolving literal exist in the clauses, the algorithm concludes that "Statement is not proved.
Now we move to another example since in the current
one the clauses are not resolvable. Assume that after the
"Operators out" part we have the following clauses:
1) { p, q }
premise
2) { p, r } premise
3) { p }
premise
4) { r }
premise
As you can see using 2 and we get the clause { r }
since p and -p resolve each other.
5) { r }
2,3
Finally using 4 and 5 we get the empty clause.
6) { }
4,5

Experimental Evaluation
Methodology
In proving part, our approach to select the pairs of clauses
to be resolved is that just checking the first clause with
remaining clauses then checking second clause with the
other clauses until to the end of the clause list.
After completing the algorithm, we make experiments
by running lots of examples on our system. The performance of ATP Machine is quite well, it reaches a conclusion in very little time and outputs are shown on the screen.
Also it is clear that our system proves every provable input

In this example above we have shown that the formula is


not provable.
In the next example we have processed a provable formula result of which is shown below:

Similar to the above examples, the resolution examples


with stories can be turned into logical formulation and
evaluated by the algorithm. For example,
1. for the story below:
Given the following hypotheses
If it rains, Joe brings his umbrella (r -> u)
If Joe has an umbrella, he doesn't get wet (u -> NOT w)
If it doesn't rain, Joe doesn't get wet (NOT r -> NOT w)
Prove that Joe doesn't get wet (NOT w)
2. logical formulation and CNF steps are below:

3. resolution steps and final decision:

Discussions

4. if we try to prove Joe gets wet with same story,


algorithm wont be able to prove it:

The advantage of our approach is that performing the resolution techniques to propositional logic formulas ends up
successfully. This is valid for not only simple clauses but
also complex ones. It does not matter whether the formula
is provable or not. In our system it always creates the
clauses successfully and also proves or disproves the formulas with high accuracy (if there were no iteration limit it
would prove or disprove with 100% accuracy. The disadvantage of iteration limit is discussed in the last paragraph
of this subsection.)
The main disadvantage of our method is in the selecting
pair of clauses to be resolved. In this part, even if there is
no pair of literals in the clauses to be resolved, we are
checking the clauses. This increases the time complexity,
in other words, steps of resolving process are subject to
increase.
Additionally, since there is certain iteration limit, there
is small possibility that the true statement could not be
proved. However, this is a common problem of the automated theorem proving systems that have to face with.

Conclusion
In this project, we implemented resolution approach to
prove/disprove the propositional formulas. For the first
stage of the algorithm, we negate the goal and apply INDO
methods to the negated goal formula and get the clausal
form. After that, we employed the resolving process to
reach a conclusion. In the end, we reach an empty set if the
given formula is provable. On the contrary, if the formula
is not provable, then either we reach an iteration limit or
cannot reach the empty set within the iteration limit.

Future Work
We completed the proof of propositional logic formulas by
using the resolution refutation technique. As a feature
work, this approach can be extended for the First Order
Logic formulas. In order to accomplish that, the unification
algorithm, S (Standardizing variables) and E (Existential
out) procedures should be implemented.

References
R. S. Boyer & J. S. Moore: The sharing of structure in theoremproving programs, in Machine Intelligence 7, D. Mitichie, editor,
Elsevier (1972), pp. 101-116.
https://github.com/boyers/theorem_prover

S-ar putea să vă placă și