The combination of decisions made for these choices guide the search for a refutation. Given the decisions made, a single resolvant can be generated. Regardless of the search strategy used, some mechanism is required to prevent the same resolution step being repeated. The basis of the ANL Loop (so named, as it was first used in ATP systems developed at Argonne National Laboratory, the most famous of which is now Otter), is to divide the resolvants that can be generated into plys. Each ply contains resolvants that are the same number of resolution steps away from input clauses. Diagramatically, this can be thought of as follows :
where at each iteration one parent is chosen from the cross-hatched area and the other is chosen from the cross-hatched or vertical striped area. The resolvants are put into the blank area, ready for the next iteration. Evidently a duplication free search is being performed.
| Example | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
S1 = { p(b) | r(Y) | p(Y),
~p(S) | p(b),
~p(b),
~r(a),
~r(c) }
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Clearly things can get out-of-hand very quickly. The total number of clauses typically grows exponentially with the number of plys. It is necessary to:
Let CanBeUsed = {}
Let ToBeUsed = Input clauses
While Refutation not found && ToBeUsed not empty
Select the ChosenClause from ToBeUsed
Move the ChosenClause to CanBeUsed
Infer all possible clauses using the ChosenClause and other clauses from CanBeUsed.
Add the inferred clauses to ToBeUsed
Depending on how the ChosenClause is selected from the ToBeUsed set, different search strategies can be implemented.
| Example, using BFS | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
S1 = { p(b) | r(Y) | p(Y),
~p(S) | p(b),
~p(b),
~r(a),
~r(c) }
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example |
|---|
S = { ~n | ~t,
m | q | n,
l | ~m,
l | ~q,
~l | ~p,
r | p | n,
~r | ~l,
t }
|
| Example |
|---|
S = { ~p(b),
p(X) | l(X) | q,
~q | l(Y),
~l(Z) | r(Z),
~r(b) | ~l(T) }
|
The DISCOUNT loop is an alternative flexible algorithm for controlling the generation of inferred clauses. The DISCOUNT loop delays simplifications.
Let CanBeUsed = {}
Let ToBeUsed = Input clauses
While Refutation not found && ToBeUsed not empty
Select the ChosenClause from ToBeUsed
if (ChosenClause is not subsumed by a member of ToBeUsed or CanBeUsed)
Remove all members of CanBeUsed subsumed by the ChosenClause
Move the ChosenClause to CanBeUsed
Infer all possible clauses using the ChosenClause and other clauses from CanBeUsed.
As each clause is inferred do
If the inferred clause is a tautology or pure then
Discard the inferred clause
ElseIf the inferred clause is forward subsumed by any clause in CanBeUsed then
Discard the inferred clause
Else
Add the resolvant to ToBeUsed
S = { ~r(Y) | ~p(Y),
p(b),
r(a),
p(S) | ~p(b) | ~r(S),
r(c) }
Use any selection strategy you want, and number the chosen clause at
each iteration.