Superposition

Superposition is a paramodulation-like inference rule, with constraints based on orderings on the terms and equality literals. Equality resolution and equality factoring are combined with superposition to form a complete inference system for pure equality problems - problems expressed using only equality. Superposition+ER+EF is used in conjunction with other inference rules. For example, superposition+ER+EF combined with resolution forms a refutation complete system (in which there is no need to resolve on equality literals). The resolution can be ordered using the superposition ordering for literal selection, so that in each parent of every inference only the largest literals are used.

Let T1 = T2 represent also T2 = T1. Then ...
T1 = T2 | C| + L[TT] | D|
T1θ ≡ TTθ
(T1 = T2)θ is not smaller than any literal in (T1 = T2 | C|
T1θ is not smaller than T2θ in the term ordering
is not smaller than any literal in (L | D|
» (L[T2] | C| | D|

The effect of the ordering constraints is to use literals in the from clause (which must be equality literals) that are not known to be smaller than any other literal in the clause, the side of that equality literal that is not known to be smaller than the other side, to paramodulate into literals of the into clause that are not known to be smaller than any other literal in the clause. The literals in the resultant clause are smaller than the selected literals in its parent. As the ordering is well founded, this cannot go on for ever.

Example
a = f(X,b) | p(Y,X) + q(g(f(b,Z)),c) | q(Z,Z)
T1 is f(X,b)
T2 is a
C| is p(Y,X)
L is q(g(f(b,Z)),c)
TT is f(b,Z)
D| is q(Z,Z)
θ is {X/b, Z/b}
It must be the case that: a = f(b,b) is not smaller than p(Y,b)
f(b,b) is not smaller than a
q(g(f(b,b)),c) is not smaller than q(b,b)
» q(g(a),c) | p(Y,b) | q(b,b)

If L is an (in)equality literal, then a tighter constraint may be imposed. Let ·= mean = or !=, i.e., T1 ·= T2 means any of T1 = T2, T2 = T1, T1 != T2, T2 != T1. Then ...

T1 = T2 | C| + T3[TT] ·= T4 | D|
T1θ ≡ TTθ
(T1 = T2)θ is not smaller than any literal in (T1 = T2 | C|
T1θ is not smaller than T2θ in the term ordering
(T3 ·= T4)θ is not smaller than any literal in (T3 ·= T4 | D|
T3θ is not smaller than T4θ in the term ordering
» (T3[T2] ·= T4 | C| | D|

Example
a = f(X,b) | p(Y,X) + g(f(b,Z)) != c | q(Z,Z)
T1 is f(X,b)
T2 is a

C| is p(Y,X)
T3 is g(f(b,Z))
T4 is c
TT is f(b,Z)
D| is q(Z,Z)
θ is {X/b, Z/b}
It must be the case that: a = f(b,b) is not smaller than p(Y,b)
f(b,b) is not smaller than a
g(f(b,b)) != c is not smaller than q(b,b)
g(f(b,b)) is not smaller than c
» g(a) != c | p(Y,b) | q(b,b)

Equality Resolution and Equality Factoring

T1 != T2 | C| + Equality resolution
T1θ ≡ T2θ
(T1 != T2)θ is not smaller than any literal in (T1 != T2 | C|
» C|θ
Example
g(f(a)) != g(Y) | f(X) = c | p(f(Y),g(X)) + Equality resolution
T1 is g(f(a))
T2 is g(Y)
C| is f(X) = c | p(f(Y),g(X))
θ is {Y/f(a)}
It must be the case that: g(f(a)) != g(f(a)) is not smaller than f(X) = c
g(f(a)) != g(f(a)) is not smaller than p(f(f(a)),g(X))
» f(X) = c | p(f(f(a)),g(X))

T1 = T2 | T3 = T4 | C| + Equality factoring
T1θ ≡ T3θ
(T1 = T2)θ is not smaller than any literal in (T1 = T2 | T3 = T4 | C|
» (T2 != T4 | T1 = T2 | C|

Example
b = f(a) | f(X) = c | p(X,d) + Equality factoring
T1 is f(a)
T2 is b
T3 is f(X)
T4 is c
C| is p(X,d)
θ is {X/a}
It must be the case that: b = f(a) is not smaller than f(a) = c
b = f(a) is not smaller than p(a,d)
» b != c | f(a) = b | p(a,d)


Term and Literal Ordering

Superposition requires a ground completable reduction ordering on the terms. Superposition can also use a ground completable simplification ordering, which is even stronger. Knuth-Bendix Ordering provides a suitable term ordering. Additionally, superposition requires an ordering on the literals of clauses, with some special cases:

A literal ordering extends a term ordering to literals, and must also be stable under substitution and renaming. An example of a literal ordering that can be used with superposition is bag ordering: Given two bags, B1 and B2, discard pairs of identical elements taken one from each bag, to produce B1' and B2'. Then B1 > B2 if for each X2 in B2' there exists a X1 in B1' such that X1 > X2 (by KBO for terms, by bag ordering for nested bags). Note that any X1 can be used for multiple X2s.

Literals are compared by bag-comparing representative bags:

Example
S = { even(sum(two_sq,b)),
      two_sq = four,
      ~zero(X) | diff(four,X) = sum(four,X),
      zero(b),
      ~even(diff(two_sq,b)) }
ρ: even > zero > = > sum > diff > four > two_sq > b

ω(even) 5
ω(zero) 5
ω(=) 3
ω(sum) 4
ω(diff) 3
ω(four) 4
ω(two_sq) 3
ω(b) 3
ω(X) 1

~zero(X) {{zero(X),zero(X)}}
diff(four,X) = sum(four,X) {{diff(four,X)},{sum(four,X)}}
 
diff(four,X) > zero(X)
... therefore ...
{diff(four,X)} > {zero(X),zero(X)}
... therefore ...
{{diff(four,X)},{sum(four,X)}} > {{zero(X),zero(X)}}
... therefore ...
diff(four,X) = sum(four,X) > ~zero(X)
Therefore that literal is used, and sum(four,X) must be the chosen term for superposition.

Example using Ordered Resolution and Superposition
S = { even(sum(two_sq,b)),                     [15]
      two_sq = four,                           [10]
      ~zero(X) | diff(four,X) = sum(four,X),   [26]
      zero(b),                                 [8]
      ~even(diff(two_sq,b)) }                  [14]

ρ : = > even > zero > = > sum > diff > four > two_sq > b

ω(even) 5
ω(zero) 5
ω(=) 3
ω(sum) 4
ω(diff) 3
ω(four) 4
ω(two_sq) 3
ω(b) 2
ω(X) 1

zero(b) is the ChosenClause
two_sq = four is the ChosenClause
~even(diff(two_sq,b)) is the ChosenClause
even(sum(two_sq,b)) is the ChosenClause
~zero(X) | diff(four,X) = sum(four,X) is the ChosenClause
+ two_sq = four » ~zero(X) | diff(four,X) = sum(two_sq,X) [25]
~zero(X) | diff(four,X) = sum(two_sq,X) is the ChosenClause
+ even(sum(two_sq,b)) » ~zero(b) | even(diff(four,b)) [19]
~zero(b) | even(diff(four,b)) is the ChosenClause
+ two_sq = four » ~zero(X) | even(diff(two_sq,b)) [19]
~zero(b) | even(diff(two_sq,b)) is the ChosenClause
+ ~even(diff(two_sq,b)) » ~zero(b) [7]
~zero(b) is the ChosenClause
+ zero(b) » FALSE

An optional preordering can be imposed, that all positive literals are smaller than negative literals, and then do bag ordering after that. (Try the above example with this added constraint.)

Example
S = { ~mother(C,M) | husband_of(M) = father_of(C)]).
      mother(geoff,maggie),
      bob = husband_of(maggie),
      father_of(geoff) != bob }


Pure Equality Problems

Example
S = { a = f(X) | b = f(b),    [15]
      f(b) = c,               [8]
      a != c                  [6]
      b != c }                [6]
ρ : alphabetic
ω : non-variables → 2; variables → 1.

a != c is the ChosenClause
b != c is the ChosenClause
f(b) = c is the ChosenClause
a = f(X) | b = f(b) is the ChosenClause
+ Equality factoring »
COMPLETE THIS

Practical Notes:


Transforming Not Pure Equality Problems

Problems that use predicates other than =/2 and !=/2 can be converted to pure equality, so that they can be solved using superposition plus equality resolution and factoring. A positive literal L is converted to L = true, and a negative literal M is converted to M != true. In this manner all predicate symbols become function symbols. In the use of the inference rules it is necessary to ensure that no variable becomes instantiated to (what was previously) an atom, or to the new special constant true. Clauses containing true = true are tautologies and can be discarded.

For the KBO, true is mapped to something less than all other symbols and greater than the mapping of the variables.

Example
S = { even(sum(two_sq,b)),
      two_sq = four,
      ~zero(X) | diff(four,X) = sum(four,X),
      zero(b),
      ~even(diff(two_sq,b)) }

... gets converted to ...

S = { even(sum(two_sq,b)) = true,                    [20]
      two_sq = four,                                 [10]
      zero(X) != true | diff(four,X) = sum(four,X),  [31]
      zero(b) = true,                                [13]
      even(diff(two_sq,b)) != true }                 [19]
ρ: even > zero > = > sum > diff > four > two_sq > b > true

ω(even) 5
ω(zero) 5
ω(=) 3
ω(sum) 4
ω(diff) 3
ω(four) 4
ω(two_sq) 3
ω(b) 3
ω(true) 2
ω(X) 1
two_sq = four is the ChosenClause
+ two_sq = four

Example
S = { ~mother(C,M) | husband_of(M) = father_of(C)]).
      mother(geoff,maggie),
      bob = husband_of(maggie),
      father_of(geoff) != bob }


Exam Style Questions

  1. List all the possible superposition and ordered resolution results of the following two clauses. Use KBO bag ordering with predicates and functions weighted 2, variables weighted 1, and alphabetic symbol ordering.
    ~p(X,Y) | ~q(Y) | f(X) = g(c,Y)
    p(f(a),g(Z,b)) | q(Z) | g(c,c) = c