Lecture 7: Non-Ground Superposition
Laura Kovács
Unification and Lifting (Recap)
Idea (Robinson 1965; Bachmair & Ganzinger 1990). Represent an infinite number of ground inferences by a single non-ground inference.
- For we work with non-ground clauses.
- We generalize “same” ground atom to unifiability of non-ground atoms.
- We compute only most general unifiers (mgus).
Lifting Lemma for . Let and be clauses that share no variables. If there is a ground inference
then there exists a substitution such that
and .
Similar lifting lemmas hold for every inference in and .
What Should We Lift?
- Ordering .
- Selection function .
- Calculus (thanks to the lifting lemmas).
Most importantly, lifting requires solving equations between terms and atoms, which we do via most general unifiers.
Knuth-Bendix Ordering (Ground Case Recap)
Fix a signature , inducing the term algebra , together with:
- A total ordering on (the precedence);
- A weight function .
For a ground term its weight is
The Knuth-Bendix ordering compares ground terms as follows: iff
- (by weight); or
- and one of the following holds:
- (by precedence);
- and, for some , and (lexicographically, left-to-right).
Note. Weight functions are not arbitrary—they must be compatible with .
Weight Functions: Ground Case
A weight function satisfies:
- for every constant ;
- If for a unary function , then for all (so is the greatest symbol in the precedence).
Weight Functions: Non-Ground Case
For non-ground terms extend to variables: , where denotes the variables. We require:
- for all variables , with ;
- for every constant ;
- If for a unary function , then for all .
Consequently, at most one unary function can have weight . Given a term and variable , we write for the number of occurrences of in .
Knuth-Bendix Ordering (Non-Ground Case)
Let be as above. For terms and ,
- if for every variable and (by weight); or
- for every , , and one of the following holds:
- and for some ;
- , , and (by precedence);
- , , and for some we have and (lexicographically).
Selection Functions and Lifting
If, for some grounding substitution , the literal is selected in , then is selected in .
Therefore, if the ground selection function is well-behaved, the lifted non-ground function is well-behaved as well.
Non-Ground Superposition
Superposition:where
- is an mgu of and ;
- is not a variable;
- ;
- .
- The ordering is partial, hence conditions such as .
- These conditions are checked a posteriori (after the rule fires); still, if then , which helps prune some inferences a priori.
Equality Resolution and Equality Factoring
Equality Resolution.where is an mgu of and .
Equality Factoring.where is an mgu of and , , , and .
Non-Ground Binary Resolution
- Binary resolution: where is an mgu of and .
- Positive factoring: where is an mgu of and .
- Negative factoring: where is an mgu of and .
Exercise
Consider the clause set
where is a predicate, a function, variables, and a constant.
Give a refutation in the non-ground binary resolution system . For every derived clause, specify the premises, the inference rule, and the mgu used.
Checking Redundancy
Assume the current search space contains no redundant clauses.
A redundant clause can appear only when a new child (the conclusion of an inference) is added.
We perform two kinds of redundancy checks after each inference under a fair strategy:
- The child itself is redundant.
- The child makes an existing clause redundant.
We use some fair strategy and perform these checks after every
inference that generates a new clause.
In fact, one can do better in some of the cases.
Subsumption (Non-Ground)
A clause subsumes a clause if for some substitution .
Subsumption and Redundancy: If contains different clauses and such that subsumes , then is redundant in and may be removed.
Exercise
Let be a unary predicate, a unary function, variables, and a constant.
Consider the clauses , , and .
(a) Does subsume ?
(b) Does subsume ?
Demodulation (Non-Ground)
Demodulation replaces instances of equalities by simpler terms:
where , , and .
Equivalently,
with and .
General Redundancy (Non-Ground)
A clause is redundant with respect to if is redundant with respect to , where and are the sets of ground instances of and .
It suffices to find a substitution such that, for any ground instance of :
- , and
- is a logical consequence of .
Generating vs. Simplifying Inferences
An inference
is simplifying if at least one premise becomes redundant after is added; we say is simplified into . Otherwise the inference is generating.
Note. Deciding whether an inference is simplifying is undecidable (and so are several related checks).
Key principles.- Apply simplifying inferences eagerly; apply generating inferences lazily.
- Checking for simplifying inferences must pay off—in practice, it must be cheap.
Redundancy Checking Workflow
Whenever a new clause is added:
- Retention test: Is redundant?
- Forward simplification: Can be simplified using existing clauses?
- Backward simplification: Does simplify or eliminate older clauses?
Examples of Redundancy Tests
-
Retention:
- Tautology checking.
- Subsumption.
-
Simplification:
- Demodulation (forward/backward).
- Subsumption resolution: whenever some substitution satisfies .
Cost of Redundancy Criteria
- Tautology checking is based on congruence closure.
- Subsumption and subsumption resolution are NP-complete.
Observations
- There may be chains (repeated applications) of forward simplifications;
- after such a chain, another retention test should be run.
- Backward simplification is often expensive.
- In practice, the retention test may include extra heuristics which may sacrifice completeness (e.g., dropping overly heavy clauses).