3.3 Proof Theory
3.3.2 General Case — CLP(D)
We address the problems illustrated by example 3.4 by moving to the richer frame- work of constraint logic programming [Jaffar and Lassez, 1987]. By using this frame- work we will be able to define a sound and complete proof calculus that can cope with disjunctive and merely existential information.
Constraint logic programming — CLP(X) — constitutes a family of languages, parametrized by a first order constraint domain axiomatization X. In addition to the ordinary atoms of plain logic programming in CLP(X) there are special atoms — the constraints — that are evaluated against the background constraint theory X. A concise summary of the framework is contained in section 2.2.2.
We instantiate CLP(X) to CLP(D) — constraint logic programming over action domains D — taking as constraint atoms C the special atoms Poss(a, s1, s2) and HOLDS(φ, s).
Disjunctive Substitutions
As illustrated by example 3.4, in the case of non-query-complete domains there need not be unique most general substitutions — in the example we do not know which of the two blocks is on the table. However, we have the disjunctive information that one of the two blocks is on the table — something that leads us to resorting to the notion of (most general) disjunctive substitutions, formally defined as follows: Definition 3.6 (Disjunctive Substitution). A disjunctive substitution is a finite set of substitutions Θ = {θ1, . . . , θn}. Applying the disjunctive substitution Θ to a clause ϕ results in the disjunction W
i=1..nϕθi. Given two disjunctive substitutions Θ1, Θ2 their composition Θ1Θ2 is defined as {θiθj | θi ∈ Θ1 and θj ∈ Θ2}. A disjunctive substitution Θ1 is more general than a disjunctive substitution Θ2if for every θi ∈ Θ1 there exist θj ∈ Θ2 and θ such that θiθ = θj.
To every disjunctive substitution Θ there corresponds a formula in disjunctive normal form consisting only of equality atoms. With a little abuse of notation we will denote this formula as Θ, too; e.g., we treat {{x → Block1}, {x → Block2}} and x = Block1∨ x = Block2 both as the disjunctive answer for example 3.4.
General proof calculi that can compute most general disjunctive answers for ar- bitrary first order theories are, e.g., full resolution with the help of answer liter- als [Green, 1969] or restart model elimination [Baumgartner et al., 1997] — with the caveat of differentiating between terms of sort object and auxiliary Skolem functions.
The General Proof Calculus
In CLP(X), the derivation rule for the constraint atoms C is based on the logical equivalence (wrt. X) of C ∧ σ and σ0, where σ is the constraint store prior to rule application, and σ0 the resulting constraint store. More precisely, it is based on the formula X (C ∧ σ) ≡ σ0. In our case σ0 can be obtained by exploiting the following two logical equivalences:
• If there is a substitution Θ such that D (∀)W
θ∈ΘCθ then we can exploit that
D (C ∧ σ) ≡ ((C ∧ Θ) ∧ σ). (3.1)
• Otherwise we use the weaker fact that
D C ∧ σ ≡ C ∧ σ. (3.2)
For the sake of efficiency the CLP(X) framework is usually augmented by “Solve”- transitions [Fr¨uhwirth and Abdennadher, 2003]. These replace states in a derivation by equivalent simpler ones, foremost by rewriting the constraint store. For example, applying (non-disjunctive) substitutions is a “Solve”-transition, where, e.g., the state < ¬P (x), x = 1 > is rewritten to the equivalent < ¬P (1), > >. Applying disjunctive substitutions is not as straightforward:
Example 3.6. Consider the query ?- ?(on(X,table)), p(X). on top of the dis- junctive action domain D from example 3.4. Further assume that the ALP con- tains the clause p(X) :- ?(on(X,table))., chosen for the sake of illustration. The derivation starts with state
< ¬HOLDS(On(x, Table), S0) ∨ ¬P (x, S0), > > .
After deriving HOLDS(On(x, Table), S0) — using 3.1 — we obtain the state < ¬P (x, S0), (HOLDS(On(x, Table), S0) ∧ Θ) >,
where Θ is the formula x = Block1∨ x = Block2. Next, by applying the substitution Θ to P (x, S0), we obtain
< ¬P (Block1, S0) ∨ ¬P (Block2, S0), HOLDS(On(x, Table), S0) ∧ Θ >, which reduces to
< ¬HOLDS(On(Block1, Table), S0) ∨ ¬HOLDS(On(Block2, Table), S0), HOLDS(On(x, Table), S0) ∧ Θ > .
3.3 Proof Theory
But now we cannot proceed by querying whether
D ∪ P HOLDS(On(Block1, Table), S0) or
D ∪ P HOLDS(On(Block2, Table), S0). However, it is obvious that the query
D ∪ P HOLDS(On(Block1, Table), S0) ∨ HOLDS(On(Block2, Table), S0), admits a successful derivation. But, for simplicity, it would be nice to obtain a proof calculus that operates on single literals. In the example this can be achieved by first splitting the state into a disjunction of substates, one for each of the simple substitutions θ1, θ2 ∈ Θ:
< ¬P (Block1, S0), HOLDS(On(Block1, Table), S0) > ˙
∨ < ¬P (Block2, S0), HOLDS(On(Block2, Table), S0) > . Considering, e.g., the first disjunct we observe that still
D 2 HOLDS(On(Block1, Table), S0);
if, however, we augment the action domain by the corresponding case, we are suc- cessful :
D ∪ {HOLDS(On(Block1, Table), S0)} HOLDS(On(Block1, Table), S0). Generalizing this idea, in our proof calculus we employ reasoning by cases, when- ever we have obtained a disjunctive substitution Θ = {θ1, . . . , θn}: We split the current substates of the derivation into a disjunction of substates, one for each θi, and extend the simple substates from pairs to triples, adding an additional argument ζ for recording the assumed case. Then in each substate < Negative Clause, σ, ζ > special atoms are evaluated against the action domain augmented by the correspond- ing cases: D ∪ {ζ}.
It is crucial to observe that the disjunction of all the newly introduced substates on one level of the derivation tree is equivalent to the original state. In particular the disjunction of all the domain axiomatizations D0 augmented by the respective cases ζ is equivalent to the original D.
A state now is a disjunction of (simple) substates < Negative Clause, σ, ζ >, and the symbol used for denoting disjunctions of substates is ˙∨. A derivation of the query % starts with the simple state < ¬%, >, > >. A derivation is successful if it is ending in ˙W
i=1..n < ⊥, σi, ζi >. The formula W σi is the computed answer. We will define our proof calculus to operate on individual literals in single substates.
Any derived substate that is different from < ⊥, σi, ζi > and to which none of the reduction rules can be applied indicates a failed derivation.
Formally, the proof calculus is given by the rules of inference depicted in figure 3.1. We omit the straightforward rule of inference for program atoms.
Substitution Rule:
< (¬G1∨ . . . ∨ ¬C ∨ . . . ∨ ¬Gn), σ, ζ >
< ˙W
i=1..k< (¬G1∨ . . . ∨ ¬Gn), σ ∧ C ∧ θi, ζ ∧ C ∧ θi>
where D ∪ {ζ} (∀)W
θi∈ΘCθi with most general disjunctive substitution Θ
Constraint Rule:
< (¬G1∨ . . . ∨ ¬C ∨ . . . ∨ ¬Gn), σ, ζ >
< (¬G1∨ . . . ∨ ¬Gn), σ ∧ C, ζ >
if D ∪ {ζ} 2 ¬(∃) σ ∧ C.
Figure 3.1: Rules of Inference for CLP(D)
Piggybacking on the results for the CLP(X) scheme we obtain both soundness and completeness results for CLP(D); for program P, query %, and domain axiomatization D we have:
Theorem 3.1 (Soundness of CLP(D)). If % has a successful derivation with com- puted answer W
i=1..kσi then P ∪ D (∀)Wi=1..kσi ⊃ %.
Theorem 3.2 (Completeness of CLP(D)). If P ∪ D (∀)σ ⊃ G and σ is satisfiable wrt. D, then there are successful derivations for the goal G with computed answers σ1, . . . , σn such that D (∀)(σ ⊃ (σ1∨ . . . ∨ σn)).
Let us illustrate the power of CLP(D) by the following example; it highlights the capability of CLP(D) to infer disjunctive plans:
Example 3.7 (Disjunctive Plans). Assume the initial state is specified by (Holds(On(Block1, Table), S0) ∨ Holds(On(Block2, Table), S0))∧ ¬(∃x)Holds(On(x, Block1), S0) ∧ ¬(∃x)Holds(On(x, Block2), S0)∧ Holds(On(Block3, Table), S0) ∧ ¬(∃x)Holds(On(x, Block3), S0);
so we know that Block1 or Block2 are on the table with no obstructing block on top of them, just as Block3 is. Let the precondition and the effects of moving a block be
3.3 Proof Theory
axiomatized as in example 2.1:
(∀)Poss(Move(block1, x, y), s1, s2) ≡ Holds(On(block1, x), s1) ∧ x 6= y ∧ (¬∃block2)Holds(On(block2, block1), s1) ∧
(¬∃block3)(Holds(On(block3, y), s1) ∨ y = Table) ∧ s2 = Do(Move(block1, x, y), s1)
(∀)Poss(Move(block, x, y), s1, s2) ⊃
[(∀f )(f = On(block, y) ∨ (Holds(f, s1) ∧ f 6= On(block, x))) ≡ Holds(f, s2)]. Consider an ALP goal ?- do(move(X,block3)).. For this we obtain a successful derivation containing two substates, informing us that we can achieve our goal by the disjunctive plan consisting of
• moving Block1 atop Block3, or • moving Block2 atop Block3.
However, it is important to note that this disjunctive plan does not yet tell us which of the two alternatives will succeed. All it does is tell us that we can achieve the goal if we can find out which of the two alternatives actually holds. This issue, and ways around it, will be discussed in more detail below in section 3.6.2.
The Importance of Domain Closure on Actions
Let us next illustrate another peculiarity of the CLP(D) proof calculus:
Example 3.8 (The Universal Plan). Consider the following program, where Phi shall denote the ALP-encoding of an arbitrary planning goal :
succeed :- do(A), ?(Phi).
Via the Constraint Rule of the CLP(D) proof calculus we obtain a successful deriva- tion with constraint store Poss(a, S0, s) ∧ HOLDS(φ, s). This informs us that we can achieve our goal φ if there exists an hitherto unspecified action a such that φ holds after the execution of a.
Of course, such an answer is not very helpful, and the above example clearly indicates the need for a domain closure axiom on actions in D: Let A denote the set of all functions into sort Action in D. Then the following is the desired domain closure axiom on actions:
(∀a, ~x) _ A∈A
a = A(~x). Henceforth, we stipulate that all D contain such an axiom.