• No results found

Assertions: Backward Application

When applying an inference in the backward direction, all conclusions of the inference need to be instantiated. These conclusions are then replaced by some new subgoals resulting from the application of the inference. Internally, the application of an inference is reduced to a sequence of resolution replacement rules in the Core calculus. As this application intuitively consumes some parts of the free task tree, the multiplicities of the involved quantifiers of the inference are additionally increased, such that the inference can

be applied several times. Finally, the consumed part is removed from the indexed formula tree using weakening. To get an intuitive understanding of the underlying operations, let us illustrate the induced resolution replacement rules by means of an example.

Example 6.4.1. We have already seen in Example 6.3.7 how the inference Trans- ⊂ can be instantiated by unifying the conclusion with the subformula f (Ker(f, G))⊂ G and the first premise with the subformula f (A) ⊂ f(B). Applying the inference reduces the task

A ⊂ B ⇒ f(A) ⊂ f(B) ⊢ Auto(f, G) ⇒ f(ker(f, G)) ⊂ G (6.56) in one step to

A ⊂ B ⇒ (f(A) ⊂ f(B)) ⊢ Auto(f, G) ⇒ (Ker(f, G) ⊂ B ∧ f(B) ⊂ G) (6.57) which can be proved immediately using the definitions of Auto and Ker, instantiating B with G.

The modified task (6.57) is obtained by the application of two resolution replacement rules, each of which is induced by an instantiated premise/conclusion. More precisely, we consider the two node positions of the free variable task tree corresponding to the inference node and the task node of the instantiated formal argument. For the conclusion, this pair consists of the inference node (U ⊂ W ) and the task node f(ker(f, G)) ⊂ G. The require- ments of Definition 6.3.5 guarantee that this indeed induces a resolution replacement rule, which allows the replacement of the task node with the conditions of the conclusion node of the inference:

U ⊂ W− → h(U ⊂ V ∧ V ⊂ W )+i (6.58)

which is composed of the two premises and equals β(U ⊂ V+, V ⊂ W+) (c.f. Theorem

6.2.5). Under the instantiation, the rule becomes

(f (Ker(f, G))⊂ G)+→ h(f(Ker(f, G)) ⊂ V ∧ V ⊂ G)+i (6.59) Similarly, the instantiated premise induces a resolution replacement rule. However, for backward inferences, the resolution replacement rule belonging to the conclusion of the inference is applied first, as indicated in the subsequent picture by ➀:

α β β U ⊂ V+ V ⊂ W+ (U ⊂ W )− α β A⊂ B f (A)⊂ f(B)− α Auto(f, G)− f (Ker(f, G))⊂ G+ ➀

To enable the application of the resolution replacement rule, the involved labels must be equal. Therefore, we have to apply the substitution σ before applying the resolution re- placement rule. Afterwards, the replacement can be carried out and results in the following free variable task tree:

α I α β ker(f, G)⊂ B+ f (ker(f, G))⊂ f(B)− α Auto(f, G)− β f (ker(f, G))⊂ f(B)+ f (B)⊂ G+

As shown above, all premise nodes of the inference have been transferred to the task part of the free variable task tree. More precisely, it is possible to define a mapping ζP

that identifies for each premise of the inference a substructure of the replaced conclusion: In the figure above, f (ker(f, G)) ⊂ f(B) corresponds to the first premise, and f(B) ⊂ G corresponds to the second premise. The next step, indicated by ➁, consists of the application of the resolution replacement rule induced by the instantiated premise. The replacement takes place between the task position of the premise, i.e., paiT

I(l), and the

transferred premise node, i.e., ζP(I(l)), as indicated below:

α I α β ker(f, G)⊂ B+ f (ker(f, G)) ⊂ f(B)− α Auto(f, G)− β f (ker(f, G)) ⊂ f(B)+ f (B)⊂ G+ ➁ ζP(I(p1))

This already produces the overall result of the inference application, namely the task (6.57), which corresponds to the following task tree:

α I α β ker(f, G) ⊂ B+ f (ker(f, G))⊂ f(B)− α Auto(f, G)− β ker(f, G)⊂ B+ f (B)⊂ G+

As some of the free variables of the inference tree have been instantiated, the inference tree is of no further use and is removed by the application of the weakening rule (see Definition 5.2.17 for details).

The process depicted above can be generalized to arbitrary inferences, for which it works as follows:

2. Apply the resolution replacement rule to the conclusion of the inference, i.e., the replacement rule between the nodes

I(c), paiT

I(c) (6.60)

where paiT

I(c) is replaced.

3. For each instantiated premise p apply its induced resolution replacement rule, i.e., the replacement rule between the nodes

paiTI(p), ζP(I(p)) (6.61)

where ζP(I(p)) is replaced.

4. Weaken the formula to clean the task tree.

Notice that the recipe above involves only a single conclusion, while we have defined inferences more generally to also support multiple conclusions. However, as we will show below, it is sufficient to consider a single conclusion, because it is possible to reduce the multi-conclusion case to the single-conclusion case. To that end, we consider an inference with two conclusions c1 and c2, and a task with corresponding formulas c′1 and c′2 which

are possibly embedded in some other β-related nodes ˜c1, . . . , ˜cn:

α A β ˜ c1 β c′ 1 β ˜ c2 β c′ 2 ˜c3

The idea is to use commutativity of ∧ to transform the goal as indicated above and to replace both conclusions simultaneously. On the free variable task tree, the commutativity of ∧ corresponds to a permutation of β-nodes:

Theorem 6.4.2. Let Q be a free variable indexed formula tree of the form β(C1, . . . , CN).

Then Q is provable iff the permutation Q′ = β(π(C

1. . . , CN)) is provable.

Proof. Clear, as this kind of permutation does not change the set of paths.

For an arbitrary number of conclusions, the result follows inductively. Therefore, we subsequently assume only a single conclusion C of inferences in the subsequent presenta- tion. We then proceed in three steps: First, we define the overall effect of the backward application of a paiT

I. We then show how the result is modeled by a sequence of resolution

replacement rules. Finally, we show that the adaptations of the windows yield a consistent proof state.

To be able to define the proof state transformation for an arbitrary PAI, it is convenient to describe the proof obligation induced by a single premise, independent of whether it has been instantiated or not. In the first case, conditions may arise due to conditions induced by the replacement rule application. As replacement rules induced by instantiated premises are applied after the replacement rule induced by the conclusion, these conditions are between two task positions of the current task, namely the modified conclusion and the task position of the premise.

Definition 6.4.3 (Premise Conditions). Let w1, . . . , wn ⊢ wn+1, . . . , wm be a task, let π+

be a task position with positive polarity, and let π− be a task position with negative polarity

that is α-related to π+ via some node R. Then the conditions of πwith respect to π+,

denoted by POBP(π−, π+), are the formulas corresponding to the labels of nodes between

π− and R that are β-related to π+ and maximal with respect to ≺.

Example 6.4.4. The premise conditions of f (A) ⊂ f(B) with respect to the goal f (ker(f, G))⊂ G in task (6.48) are h(A ⊂ B)+i.

If a premise is not instantiated, the proof obligation is due to the induced replacement rule of the conclusion and consists of the premise formula modified by the inference substitution σ. Putting both observations together, we are able to characterize the new proof obligation of a single premise with respect to a task and an inference as follows: Definition 6.4.5 (Backward Inference Conditions). Let I be an inference with premise labels p1, . . . , pn, T be a task, and paiTI be a partial argument instantiation with respect to

I and T . Let ζP :L → S(R) be the mapping which identifies for each premise its position

in the task tree1. For each label l denoting a premise, the conditions of l are defined as

follows:

POBbw(l) =

  

Label(I(l))σ if paiT

I(l) =⊥

β(POBP(paiTI(l), ζP(I(l))) otherwise

(6.62) The overall conditions of the paiT

I are then given by n

^

i=1

POBbw(pi) (6.63)

Note that the inference conditions for the instantiated premises can be statically de- termined from the task T . However, in contrast to the Core proof theory they obey a locality property, as they are determined by only inspecting the window containing the corresponding position, whereas in the case of Core they are determined by the node c that governs the connectable nodes.

Definition 6.4.6 (Backward Inference Rule Application). Let I be an inference, T be a task of the task tree (S, f ), and paiT

I be a backward PAI with respect to I and T . The

effect of applying the PAI consists of replacing the conclusion paiT

I(c) by (6.63), i.e.,

S|paiT

I(c)←(S′,f′) (6.64) where S′ denotes the substructure for (6.63), and fis defined as follows:

• If paiT

I(c) is a succedent formula, i.e., there is a n∈ dom(f) with f(n) = paiTI(c)

– if |P rems(I)| = 1 and Hyps(p1)6= ∅

f′(n) :=       

ζP(paiTI(p) for exactly one n∈ dom(f′)

ζP(paiTI(h)) for each hyp h and for exactly one n∈ dom(f′)

undefined otherwise

(6.65)

1

The mapping is induced by the application of the resolution replacement rule induced by the conclu- sion

– otherwise

f′(n) = paiTI(c) (6.66)

for exactly one n∈ dom(f′).

• Otherwise f′(n) undefined for all n ∈ dom(f).

The replacement defined above replaces the goal by new subgoals and adapts the windows of the free variable task tree. During this process, there are several design choices of how to add new windows. We found it convenient to make the goal structure as small as possible. That is, instead of introducing a new goal A ⇒ B, we introduce a new hypothesis (new window) for A, and a new goal B (another window). Note that this corresponds to some kind of proof normalization in ND by the application of ⇒I rules.

However, this is only possible if the modified subformula is the maximal formula of the window that contains it, i.e., a top-level subgoal in the task representation.

Example 6.4.7. Consider the inference [x∈ U]

... x∈ V

U ⊂ V Def⊂ (6.67)

and the task

⊢ A ∩ B ⊂ B ∩ A (6.68)

Applying the inference (6.67) transforms the task into

x∈ A ∩ B ⊢ x ∈ B ∩ A (6.69)

as the goal is at top-level. In contrast, the same inference applied to

⊢ A ∩ B ⊂ B ∩ A ∧ B ∩ A ⊂ A ∩ B (6.70)

is transformed to

⊢ (x ∈ A ∩ B ⇒ x ∈ B ∩ A) ∧ B ∩ A ⊂ A ∩ B (6.71)

We show subsequently that the effect of paiT

I can be modeled by a sequence of res-

olution replacement rules. However, before proving the main theorem, we state some intermediate lemmas.

Lemma 6.4.8. Let I be an inference with premises p1, . . . , pn, T be a task and paiTI be a

backward PAI. The conclusion replacement rule induced by paiT

I is admissible and results

in the modified task

paiTI(c)→ n

^

i=1

Label(I(pi))σ (6.72)

Proof. Recall that I(c) denotes the node corresponding to the conclusion of the infer- ence, and that paiT

I(c) denotes the node corresponding to the node of the task (see Defini-

tion (6.3.5)). ThenI(c) has negative polarity and paiT

I(c) has positive polarity. Moreover,

both positions are α-related via the root node r of the free variable indexed formula tree. This induces an admissible resolution replacement rule

where R1, . . . , Rn are the nodes that are below r and β-related to I(c). Moreover,

Label(I(c))σ = Label(paiTI(c))σ (6.74)

thereforeI(c) and paiT

I(c) are connectable. To determine the concrete form of R1, . . . , Rn,

by Lemma 6.1.14 it is sufficient to consider the inference tree corresponding to the assertion representing the inferenceI to determine R1, . . . , Rn. By Theorem 6.2.5, all Ricorrespond

to a single premise or a conjunction of premises and have positive polarity. β-insertion therefore results in replacing the subtree of paiT

I(c) by the subtree with label

  ^ p∈P rems(I) Label(I(p))  σ∧ true+ (6.75)

which can be simplified by means of the simplification rule (see Definition (5.2.19)) to

^

p∈P rems(I)

Label(I(p))σ (6.76)

After applying the resolution replacement rule induced by the conclusion, the replaced conclusion is of the form (6.76). In particular, for each premise of the inference we can identify a corresponding position in the task tree, which we denote by ζP(I(p)). We

subsequently apply all induced premise resolution replacement rules, that is, resolution replacement rules between the following positions:

paiTI(p), ζP(I(p)) (6.77)

This results in (6.64) of Definition 6.4.6.

Lemma 6.4.9. All induced premise resolution replacement rules are admissible. Applica- tion of all induced premise resolution replacement rules transforms (6.76) to the conditions of (6.63).

Proof. We show by induction on the number |inst(P )| of instantiated premises that the application of all induced resolution replacement rules transforms (6.76) to the conjunction of all proof obligations, i.e.,

^

p∈P rems(I)

Label(I(p) → ^

p∈P rems(I)

POBbw(p) (6.78)

Let us first note that none of the premise positions is destroyed by the application of previous replacement rule, as the task positions are not overlapping due to condition (iii) of Definition (6.3.5).

Base Case: If|inst(P )| = 0, then POBbw(p) = Label(I(p)) and (6.76) has already the

desired form.

Step Case: Let us now assume that |inst(P )| = n. Let P1, . . . , Pn−1 denote the first

n− 1 instantiated premises. By induction hypothesis,

^

p∈P rems(I)

Label(I(p)) = ^

p∈P rems(I)\p′

Label(I(p)) ∧ Label(I(p′)) (6.79)

= ^

p∈P rems(I)\p′

p′ induces an admissible resolution replacement rule ζ

P(I(p′))→ hR1, . . . , Rni which

can be applied to the node ζP(I(p′)). This is because ζP(I(p′)) and paiTI(p′) have

opposite polarity and their labels are equal under the substitution σ. Moreover, they are α-related: If they are contained in the same window, this is ensured by Definition (6.3.5) and the conditions are the β-related formulas. Otherwise, they are α-related by the Definition (6.1.8) of a sequent. Therefore, ζP(I(p′)) and paiTI(p′)

are connectable. The conditions of the replacement rule arePOBP(I(p′), paiTI(p′)).

Therefore the application of the rule results in

POBP(I(p′), paiTI(p′))∧ true (6.81)

which can be simplified by means of the simplification rule (see Definition (5.2.19)) to

POBP(I(p′), paiTI(p′)) (6.82)

Lemma 6.4.10. The modified task proof state is consistent.

Proof. We have to show that the modified task is still a sequent. There are two cases to consider, depending on whether the replaced conclusion formula is a sequent formula or not.

Case 1: If the replaced conclusion is not a sequent formula, the substructures do not change during the application. As the task proof state was consistent before the application of the rule, the sequential property does also hold after the replacement of the substructure.

Case 2: If the replaced conclusion is a sequent formula, f′ is constructed according to (6.65)/(6.66), respectively.

In both situations, the new windows are spanning for paiT

I(c). Therefore, the combination

of f ,f′ is spanning. Moreover, as all new windows are α-related to each other, the task state is sequential.

Theorem 6.4.11 (Correctness of Backward Rule Application). Let I be an inference, T be a task and paiT

I be a backward PAI. Then paiTI is admissible in the Core calculus.

Moreover, the resulting proof state is consistent.

Proof. By Lemma (6.4.8), Lemma (6.4.9), and Lemma (6.4.10)

Discussion: We have shown that how assertion applications can conveniently modeled within the Core framework by a sequence of resolution replacement rules. Due to the imposed structure of the indexed task tree, the effect of the transformation can be deter- mined locally by analyzing the inference and the task only. However, there is the question of whether the particular choice of this sequence is optimal with respect to the size of the induced proof obligations. This is because each instantiated formal argument of the inference induces two resolution replacement rules. In particular, we could also apply the resolution replacement rules induced by the premises first (from right to left) – intuitively this would correspond to a specialization of the inference –, and then apply the resolution replacement rule induced by the instantiated conclusion.

In the case that all premises are instantiated in other windows than the conclusion, both transformation yield the same result. This illustrates that our mechanism removes

some of the redundancy of the search space. In the case that a premise is matched inside the window of a conclusion, we can show that the proof obligations introduced by our method are smaller than in the second possibility mentioned above. Intuitively, this is because we only have to collect once the expensive proof obligations arising from the conclusion resolution replacement rule that connects the inference part and the task part. To see that this is advantageous, consider the following task, where the formula Q is used as premise for the goal R:

⊢ P+ Q⇒ R+ + (6.83)

Applying the premise resolution rule first induces a proof obligation¬P , which is omitted in our case.

6.4.1

Generation of New Premises and Task Splitting

So far, the proof state is always represented by a single task together with its context. This is in contrast to the standard sequent calculus, where the so-called β-rules, such as R,

introduce several goals that need to be solved simultaneously2. While our formulation

does not require such a splitting, we want to be able to model this situation within our approach, as it might have advantages for the interactive setting: When splitting a composed goal, the individual subgoals are smaller than the composed goal, and their contexts can locally be modified. Such a situation is in particular beneficial in the case that both subgoals do not share meta-variables. In this case, both goals can be solved independently from each other. Let us consider a simple example:

Example 6.4.12. The application of set extensionality to the task

A∪ B = B ∪ A (6.84)

results in the new task

⊢ A ∪ B ⊂ B ∪ A ∧ B ∪ A ⊂ A ∪ B (6.85)

However, it would be desirable to obtain two tasks instead:

⊢ A ∪ B ⊂ B ∪ A (6.86)

⊢ B ∪ A ⊂ A ∪ B (6.87)

Within our framework, the main difference between (6.85) and (6.86) is that the window structure covering (6.85) is replaced by two window structures resulting in the two tasks shown in (6.86). It is this replacement which introduces a new sequent.

However, when performing this operation, we have to guarantee that each sequent satisfies the required properties of Definition 6.1.8 and that the sequents are sequential (see Definition 6.1.10). Particularly, in the presence of assumptions, subsequent operations might be necessary, as replacing a single window for a formula A∧ B by two windows for A, respectively B, introduces two windows that are β-related to each other, contradicting the requirement of Definition 6.1.8.

The above problem can be solved by reallocating certain nodes in the free task tree, as shown below:

2

∗ β β1 β2 ~ α −→ α ∗ β1 ~α ∗ β2 ~α

This corresponds exactly to the application of Sch¨utte’s decomposition rule (see Section 5.2.7), which is admissible in the Core calculus. Of course, for n subgoals, resulting from n premises, we can apply the Sch¨utte rule n− 1 times. Note that the rule also copies all the windows in the appropriate manner in order to obtain the two new sequents.

Definition 6.4.13 (Backward Inference Rule Application, Splitting). Let I be an infer- ence with n premises, T be a task of the task tree (S, f ), and paiT

I be a PAI with respect

to I and T , where k premises are instantiated. The effect of applying the PAI consists of replacing the task by n new subtasks T′

1, . . . , Tn′, where each subtask has the form

T|paiT

I(c)←POBbw(pi) (6.88) Theorem 6.4.14. The backward application splitting rule is sound. The proof state re- sulting from the application of the backward splitting rule is consistent.

Proof. As Theorem (6.4.11), then apply Sch¨utte’s decomposition rule n− 1 times.