alphaFeedback

WorksComputer Science

Natural Deduction Derivations as Directed Acyclic Proof Graphs

AI contributions
Not recorded for this paper
View details

Abstract

In conventional natural deduction, a proof of a proposition is a derivation tree constructed out of inference rules with some number of premises and a conclusion judgement. For propositional logic, in contrast to the other connectives, the rule for disjunction elimination of A∨BA \vee B involves concluding with an auxiliary formula C from A⊢CA \vdash C and B⊢CB \vdash C. Not only is this asymmetry unsightly, it also introduces the need for commuting conversions across disjunction eliminations to transform between proof derivations that are morally equivalent but not βηβη-equivalent. To resolve the asymmetry, Jean-Yves Girard suggests a disjunction elimination rule with multiple conclusions A and B, but claims that "we have no way of bringing them back together". In this work, we pursue Girard's proposal using the key insight that proof derivations need not be trees, but may be directed acyclic graphs (DAGs) in general. Derivation rules are represented as nodes, premises as incoming edges, and conclusions as outgoing edges. Treating derivations as DAGs permits using the alternate rule by ensuring that the subderivations pointed at by each conclusion eventually join up at a new concluding node. Commuting conversions can then be formulated in terms of interactions with this join node. We explore ways to design a proof graph language with reduction and commutation rules such that proof simplification retains its concluding judgements, i.e. type preservation. In particular, we examine two styles of reduction rules: a local style, which only requires looking at the relevant subgraph of a whole proof but necessitates a number of extraneous constructs to satisfy type preservation; and a global style, which doesn't require all the extraneous constructs but necessitates looking at the entire proof graph as a whole.

Introduction

In conventional natural deduction, a proof of a proposition is a derivation tree constructed out of inference rules with some number of premises and a conclusion judgement. For instance, the following are the usual rules for conjunctions and disjunctions.

Γ⊢AΓ⊢BΓ⊢A∧B∧iΓ⊢A1∧A2Γ⊢Ak∧ekΓ⊢AkΓ⊢A1∨A2∨ikΓ⊢A∨BΓ,A⊢CΓ,B⊢CΓ⊢C∨e\begin{aligned} \frac{\Gamma\vdash A \qquad\Gamma\vdash B}{\Gamma\vdash A \land B}\land i \qquad \frac{\Gamma\vdash A_1 \land A_2}{\Gamma\vdash A_k}\land e_k \\ \frac{\Gamma\vdash A_k}{\Gamma\vdash A_1 \lor A_2}\lor i_k \qquad \frac{\Gamma\vdash A \lor B \qquad\Gamma,A \vdash C \qquad\Gamma,B \vdash C}{\Gamma\vdash C}\lor e \end{aligned}

In contrast to the other rules, the disjunction elimination rule has an asymmetry to it because it involves some formula CC unrelated to either of the subformulae involved in the disjunction. Aside from its aesthetics, involvement of a tertiary propositional also complicates proof simplification. Consider taking the first conjunct resulting from a disjunction elimination.

⊢C∨DC⊢A∧BD⊢A∧B⊢A∧B⊢B∧e1∨e\frac{\vdash C \lor D \qquad C \vdash A \land B \qquad D \vdash A \land B}{\frac{\vdash A \land B}{\vdash B}\land e_1}\lor e

From a computational point of view, this is taking the first projection of a pair of AA and BB returned by a conditional expression branching on CC or DD. Therefore, it ought to be morally equivalent to take the projections in each of the branches instead.

C∨DC⊢A∧BC⊢B∧e1D⊢A∧BD⊢B∧e1⊢B∨e\frac{C \lor D \qquad\frac{C \vdash A \land B}{C \vdash B}\land e_1 \qquad\frac{D \vdash A \land B}{D \vdash B}\land e_1}{\vdash B}\lor e

Doing this commuting conversion and pushing the projection into the branches is desirable, since it could lead to further proof simplification if the branches were to be conjunction literals. In terms of the simply typed lambda calculus, such a commutation corresponds to the following syntactic transformation:

(case⁡  cd  of⁡  inl⁡  c⇒f∣inr⁡  d⇒g)  a(\operatorname{case}\; cd\;\operatorname{of}\;\operatorname{inl}\;c \Rightarrow f \mid\operatorname{inr}\;d \Rightarrow g)\;a
case⁡  cd  of⁡  inl⁡  c⇒(f  a)∣inr⁡  d⇒(g  a)\operatorname{case}\;cd\;\operatorname{of}\;\operatorname{inl}\;c \Rightarrow(f\;a) \mid\operatorname{inr}\;d \Rightarrow(g\;a)

Sadly, these two derivations aren’t β\beta-equivalent, and commuting conversions are typically treated as compiler passes rather than bona fide β\beta-reductions, since doing them naïvely may result in excessive code duplication and requires special handling.

To resolve the asymmetry of disjunction elimination, Girard [1] suggests a rule with multiple conclusions, but claims that “we have no way of bringing them back together”.

Γ⊢A∨BΓ⊢AΓ⊢B  ∨e′\frac{\Gamma\vdash A \lor B}{\Gamma\vdash A \quad\Gamma\vdash B}\;\lor e'

In this project, we pursue his proposal using the key insight that proof derivations need not be trees, but may be directed acyclic graphs (DAGs) in general. Derivation rules are represented as nodes, premises as incoming edges, and conclusions as outgoing edges. Treating derivations as DAGs permits using the alternate rule by ensuring that the subderivations pointed at by each conclusion eventually join up at a new concluding node. Commuting conversions can then be formulated in terms of interactions with this join node, which also acts as a join point from a computational perspective.

The primary goal of this project is to design a proof graph language with reduction rules such that proof simplification retains its concluding judgements, i.e. type preservation. These reduction rules should also encompass the various possible commuting conversions.

Typing Rules as Labelled Graph Nodes

A typing rule consists of a rule name and the typing judgements that make up its premises and conclusions. We represent a rule graphically as a named node with incoming edges labelled by its premises and outgoing edges labelled by its conclusions. A complete derivation is constructed by connecting rule nodes along matching typing edges. We assume to not be dealing with cyclic proofs, and so our derivations are directed acyclic graphs. The rules for some basic connectives we keep unmodified are given in Figure 1.

Typing rules for conjunction, true, false, implication, and disjunction introduction

Figure 1. Typing rules — conjunction, true, false, implication, disjunction introduction

The disjunction elimination rule proposed by Girard would then have multiple outgoing conclusion edges. However, these edges do not represent independent conclusions—it would be wrong to conclude Γ⊢A\Gamma\vdash A out of Γ⊢A∨B\Gamma\vdash A \lor B.

Instead, we introduce a new join node ⊕\oplus, which joins up the two branches of deductions out of eliminating a disjunction. To track which branch of which disjunction a path of deduction is in, we use a control context Θ\Theta containing declarations x:kx : k. A disjunction elimination labelled by xx concludes with judgements whose control contexts are extended by x:1x : 1 and x:2x : 2 respectively, and a join node labelled by xx may only join two premises from different branches. Just as the usual Barendregt convention assumes each variable of →i[u]\to i[u] to be distinct, we also assume each variable of ∨e[x]\lor e[x] to be distinct. Finally, a terminal node ∙\bullet completes a proof derivation by requiring an empty control context, representing that all paths have been handled. These new nodes and rules are given in Figure 2; we consider the latter two to be structural, as they aren’t associated with a particular logical connective.

Typing rules for disjunction elimination, join, and terminal

Figure 2. Typing rules — disjunction elimination, join, terminal

For now, the rules in Figure 1 are updated by inserting an arbitrary control context Θ\Theta everywhere. However, doing so will permit joining nonexistent branches, such as in the example of Figure 3.

A pathological proof graph with a join node and terminal node

Figure 3. A pathological example

There are two options for ruling out such pathological derivations: requiring empty control contexts in leaf nodes [u][u] and ⊤i\top i, or requiring that there exists a ∨e[x]\lor e[x] node whenever there is a ⊕[x]\oplus[x] node somewhere in the derivation. The former would require alternate mechanisms for weakening the control context when needed in sensible ways that rule out the above pathology. The latter may be considered a global restriction, since it relies on examining the entire proof graph (which may be disconnected!), in contrast to the former as a local restriction that propagates via typing. Later in § 3.2, we revisit looking at proof graphs locally vs. globally in the context of β\beta-reductions to pick the corresponding option.

As a simple example of a well-typed proof graph nontrivially involving disjunctions and joins, the below is a closed proof of commutativity of disjunction, A∨B→B∨AA \lor B \to B \lor A. It would be equivalent to the lambda term λx. case⁡ x of⁡ inl⁡ a⇒inr⁡ a ∣ inr⁡ b⇒inl⁡ a\lambda x.\ \operatorname{case}\ x\ \operatorname{of}\ \operatorname{inl}\ a \Rightarrow\operatorname{inr}\ a\ |\ \operatorname{inr}\ b \Rightarrow\operatorname{inl}\ a.

Proof graph for commutativity of disjunction

Figure 4.

Computation on Proof Graphs

From the perspective of proof derivations, a computation is a transformation from one derivation to another. In tree-based natural deduction, a reduction rule identifies a pattern of premises, rules, and a conclusion as a subtree, and transforms it into a different subtree with the same premises and conclusion. Correspondingly, in a proof graph, a reduction rule identifies a subgraph of nodes and their incoming and outgoing edges, and transforms it into a different subgraph with the same incoming and outgoing edges (although the edges internal to the subgraph may change). We present them in small-step form, transforming a graph one piece at a time.

While laying out the various reduction rules for proof graphs, we will find the need to further extend our language of nodes with more structural rules even before considering how disjunctions and join behave. Two of these arise from looking at β\beta-reduction of conjunctions and implications (§ 3.1). For β\beta-reduction of disjunctions, we consider either a local reduction style (§ 3.2.1), which introduces another three structural nodes, or a global reduction style (§ 3.2.2), which requires only one new node at the expense of compositionality.

Holes and Forks

The first reduction rule we consider is the reduction of conjunction elimination. From a computational perspective, a conjunction is a pair, its elimination a projection, and the reduction rule projecting the corresponding component. The left-hand side of the reduction rule in Figure 4 identifies a subgraph with a conjunction introduction as a premise to an elimination, with two conjuncts as incoming edges to the subgraph and the projection as the outgoing edge.

Reduction rule for conjunction elimination

Figure 4 (PDF p. 5). Reduction rule for conjunction elimination

To distinguish where those edges come from and go to, we use dashed nodes to represent rules outside of this subgraph in the rest of the whole graph. While all edges of nodes inside the subgraph are illustrated, the nodes outside of the subgraph may have other incoming and outgoing edges irrelevant to the reduction.

As expected, the right-hand side links the kkth conjunct to the outgoing projection. But deleting the introduction and elimination nodes leaves a dangling incoming edge from the other conjunct! Since the other conjunct isn’t used, we link it to a new hole node ∘\circ representing a subgraph that may now be discarded. A proof graph ending in a hole does not mean we have a proof of the hole’s typing judgement: its control context need not be empty, and so is not a valid proof, since there may be unhandled branches in the path leading up to the hole.

Next, we consider the reduction of implication elimination. From a computational point of view, an implication is a function, its elimination an application, and the reduction rule substituting for each variable node. In the left-hand side of the reduction rule in Figure 5, G\mathcal{G} represents the subgraph that comprises the body of the function introduced by →i[u]\to i[u]. This subgraph consists of all nodes that can reach →i[u]\to i[u], so that the nn variable nodes represent all uses of the variable uu. (It then has no other incoming edges, but may have other irrelevant outgoing edges.)

Reduction rule for implication elimination

Figure 5. Reduction rule for implication elimination

If R0\mathcal{R}_0 were the root of a tree, then that tree can be copied wholesale nn times and linked to G\mathcal{G} in place of each [u][u], each copy weakened by Γ1,…,Γn\Gamma_1,\ldots,\Gamma_n respectively. Unfortunately, R0\mathcal{R}_0 could be, for instance, a disjunction elimination with another outgoing edge for its second branch (ignoring issues of control context weakening, which we deal with in the next two sections). This prevents it both from being copied directly and from being weakened, it being unclear how that second branch ought to be handled.

Therefore, in the right-hand side of the reduction, we use a new fork node \fork that at once multiplicates a conclusion and also weakens each typing context independently. The fork node acts as a delayed substitution, permitting G\mathcal{G} to use the function argument nn times without fear of being blocked by a disjunction elimination.

The hole and fork nodes themselves have reduction rules: hole nodes swallow single-conclusion nodes, while fork nodes copy single-conclusion nodes. Both are blocked by the double-conclusion disjunction elimination node. The general form of their reduction rules for two-premise nodes are given in Figure 6 and Figure 7. Correspondingly, for one-premise nodes, there is only one hole or fork on the right-hand side. A zero-premise node such as ⊤i\top_i linked to a hole is discarded entirely (i.e. reduces to the empty graph), while a zero-premise node linked to a fork with nn conclusions is simply multiplicated nn times. There are two special cases (Figure 8): when a fork links to a hole, that multiplicate is simply discarded, and when a fork links to another fork, they are combined into one single fork.

Reduction rule schema for holes

Figure 6. Reduction rule schema for holes

Reduction rule schema for forks

Figure 7. Reduction rule schema for forks

Special reduction rules for forks

Figure 8. Special reduction rules for forks

With the fork node, it becomes possible to multiplicate the branches of a disjunction elimination nn times, then join pairs of branches together using nn join nodes. A disjunction elimination with control variable xx is analogous to an implication introduction introducing a variable in the typing context, and join nodes with xx are analogous to variable nodes that may be used as many times as desired (so long as those uses are well typed).

Reducing Disjunction Elimination

A disjunction elimination of a left or right disjunct reduces to the disjunct linked to the left or right branch, respectively, dropping the other branch. The information of which branch is taken must then be propagated to all join nodes, which reduces by selecting the correct branch.

A local reduction strategy identifies a fixed pattern of nodes to reduce. Therefore, reducing a disjunction is a separate step from reducing a join, since there may be an arbitrary number of nodes between a disjunction elimination node and a join node. Propagating which branch is taken or dropped requires additional structural nodes to carry the information from disjunction to join node step by step.

In contrast, a global reduction strategy looks at the entire proof graph as a whole, including all of its disconnected components. In a single step, it identifies a disjunction to reduce, along with all of its join nodes, linking the taken branch and unlinking the dropped branch from both ends. Such reductions aren’t contextually closed, since linking the left- and right-hand sides of the reduction to an outer piece of graph may miss reducing join nodes in that piece.

We examine these two approaches separately in the subsections to follow. As a running example, we consider the desired evaluation in Figure 9, which must always reduce from the left-hand side to the right in some number of steps under both strategies. The key feature of this example is that the actual disjunct R0\mathcal{R}_0 is discarded, but which branch is taken dictates which premise of R1,R2\mathcal{R}_1, \mathcal{R}_2 gets linked to the conclusion R\mathcal{R}.

Example evaluation of a disjunction elimination

Figure 9. Example evaluation of a disjunction elimination

Local Reduction

A reduction occurs when a disjunction introduction is a premise to an elimination, shown on the left-hand side of Figure 10 (ignoring the annotation on the new declaration in the control context for now). Since the kkth disjunct is introduced, we expect R0\mathcal{R}_0 to be linked to Rk\mathcal{R}_k. However, doing so directly would require weakening the control context of R0\mathcal{R}_0 by x:kx : k; recall also that to rule out the pathological example in Figure 3 locally, we prohibit implicit control weakening via arbitrary control contexts in leaf nodes.

Local reduction rule for disjunction elimination

Figure 10. Local reduction rule for disjunction elimination

Therefore, on the right-hand side of the reduction, the disjunct is linked to the kkth conclusion via an explicit take node tk, which indicates that the kkth branch is taken by carrying the disjunct as a premise and explicitly weakens the control context by x:kx : k. Conversely, we link a drop node dr to the branch that isn’t taken; it acts as a placeholder that will eventually be consumed by a hole node. While their types don’t change, each un annotation does change to signal that more information was gained.

Unfortunately, by introducing nodes that extend the control context, we have reïntroduced the pathology! Figure 11 gives seemingly well-typed derivations of proofs nonsensically stating that the branches being joined are both taken or both dropped.

Pathological examples with take and drop

Figure 11. Pathological examples with take and drop

Thankfully, control declarations can only come from three distinct nodes: disjunction elimination nodes, take nodes, and drop nodes. Consequently, a branch must either be known to be taken or dropped, or not yet known. This information can be propagated to join nodes by annotating control declarations with one of three annotations δ\delta: un for unknown branches, tk for taken branches, and dr for dropped branches.

Then pathologies are ruled out by restricting in the typing rule what kinds of branches may be joined. The relevant annotated typing rules are listed in Figure 12. In particular, a join node may only join branches where both are unknown (since if one is known to be taken or dropped, then the other must necessarily also be known), or where exactly one branch is taken and the other dropped. These join conditions make typing the pathologies of Figure 11 impossible.

Typing rules for disjunction elimination, join, take, and drop

Figure 12. Typing rules — disjunction elimination, join, take, drop

A join node then reduces when it encounters a take node, linking the taken premise to its conclusion and discarding the dropped branch into a hole. The rule in Figure 13 illustrates taking the first branch, with a dropped first branch and a taken second branch reducing similarly.

Reduction rule for join, first branch

Figure 13. Reduction rule for join (first branch)

Take nodes reach join nodes by themselves reducing when they are premises to other nodes, propagating past those nodes if they aren’t join nodes of the same control variable. When all

premises are take nodes, they move downwards into the conclusions. Figure 14 shows the general form of this reduction.

Reduction rule schema for take

Figure 14. Reduction rule schema for take

Now we are finally ready to revisit the example from Figure 9. In particular, we first look at just the beginning of the first branch, reproduced in Figure 15 with annotations. Since R1\mathcal{R}_1’s outgoing edge has a control context containing x:unkx : {}^{\mathrm{un}}k, there must have been an explicit weakening in its premises.

A subgraph of the left-hand side of Figure 9

Figure 15. A subgraph of the left-hand side of Figure 9

Yet there is no way to weaken with a declaration annotated by un\mathrm{un}; it cannot be weakened by a take node, either, as whether the branch is taken is yet unknown. Moreover, if the conjunction elimination is reduced to the first conjunct, the first branch of the disjunction elimination gets linked to a hole, breaking the link that propagates branching information downwards. If the first branch ends up being the taken branch, then the take node would disappear into the hole.

The third and final new node we introduce to resolve this issue is a merge node whose purpose is the retain the link that propagates an annotation. A merge node weakens its primary premise with a control declaration from the control context of its secondary premise; it therefore reduces when the secondary premise is a take node by linking the primary premise with a take node and discarding the secondary premise. It has no reduction rule for drop nodes in Figure 16, since dropped branches will eventually be consumed by a hole from below.

Typing and reduction rules for merge

Figure 16. Typing and reduction rules for merge

Merge nodes then need to be inserted into the left-hand side of Figure 9 for the proof graph to be well typed. The updated graph is shown in Figure 17, additionally using forks to duplicate branches so that one duplicate propagates branching information to a merge node while the other is a conjunct as before. We leave as exercise to verify that this graph indeed reduces to the desired right-hand side along all reduction paths. In particular, if the conjunction eliminations are reduced first, then the merge node retains the link from the disjunction elimination to the join; if the disjunction elimination reduces first, then one of the merge nodes reduces when encountered by a take node. Additionally, each step preserves well-typedness, up to the un annotations updating to either a tk or dr annotation along the way.

A well-typed, annotated proof graph for local reduction control

Figure 17. A well-typed, annotated variant of Figure 9 for local reduction control declaration, but marks the branch as being dead. Retaining the control declaration allows that path to be consumed by a hole node, while marking the branch as dead prevents them from being used as premises to join nodes and from reintroducing the pathological drop example from Figure 11. This is the only new node we need.

At this point, a whopping six (!) new structural nodes have been introduced: joins, forks, and holes from the previous section, and now takes, drops, and merges to handle local reduction correctly. Three new annotations have also been added on top of control declarations: un, tk, and dr. The need for this machinery just to reduce disjunctions is rather unsatisfying, especially since take and drop nodes are transient nodes for reduction that one wouldn’t write as part of a proof, and merge nodes have no real purpose other than to retain static information during typing. In the next subsection, we instead turn to a global reduction strategy, which avoids needing all of this new machinery.

Global Reduction

Permitting ourselves to examine the entire proof graph makes reduction more straightforward to express: when reducing a disjunction elimination, simultaneously find all join nodes and reduce them too. Then there is no longer any need to propagate branch information. Figure 18 illustrates this reduction rule for one join node. This is still a small-step reduction, despite looking at an arbitrarily large piece of graph.

Global reduction rule for disjunction elimination and join

Figure 18. Global reduction rule for disjunction elimination and join

When linking to and from taken branches, the control declaration is therefore removed from the context. To handle dropped branches, we introduce a dead node ▪, which doesn’t remove the

The entire proof graph is also examined globally during type checking to ensure that there is always exactly one ∨e[x]\vee e[x] node somewhere if there are ⊕[x]\oplus[x] nodes anywhere. Then the original pathological example from Figure 3 is ill typed because it’s missing a corresponding disjunction elimination node that indicates which branch to take, not because leaf nodes may arbitrarily weaken the control context.

The proof graph is permitted to be disconnected. Such situations arise when a disjunction is used to dictate which branch is taken but its payload is useless, such as ⊤∨⊤\top\vee\top representing the booleans. For instance, in left-hand side of the example from Figure 9, if the conjunction eliminations in each branch are reduced first, the outgoing edges of the disjunction elimination gets linked to hole nodes, while the conjuncts get linked to the join node. Further reduction of the disjunction elimination followed by some hole node reductions yield the right-hand side as desired.

Commuting Conversions

Commuting conversions are reduction rules that permute (and sometimes duplicate) nodes surrounding structural nodes to unblock potential β\beta-reductions. We have in fact already seen some: the reduction rules for take nodes in Figure 14 are commuting conversions. If a take node has an incoming edge from a conjunction introduction and an outgoing edge to a conjunction elimination, the take node commutes with the conjunction elimination, which allows the conjunction to reduce.

Generally, structural nodes need to commute with elimination nodes, moving the structural ones down and the elimination ones up. This corresponds to pushing elimination forms deeper into terms, such as in the case expression example from § 1. (To distinguish commuting conversions from reduction rules in general, we use χ\chi in place of β\beta.)

(case⁡  cd  of⁡  inl⁡  c⇒f∣inr⁡  d⇒g)  a⇝χcase⁡  cd  of⁡  inl⁡  c⇒(f  a)∣inr⁡  d⇒(g  a)(\operatorname{case}\; cd\; \operatorname{of}\; \operatorname{inl}\; c \Rightarrow f \mid\operatorname{inr}\; d \Rightarrow g)\;a \mathrel{\overset{\chi}{\rightsquigarrow}} \operatorname{case}\; cd\; \operatorname{of}\; \operatorname{inl}\; c \Rightarrow(f\;a) \mid\operatorname{inr}\; d \Rightarrow(g\;a)

There are then three commuting conversions to consider: join nodes need to commute with conjunction elimination, implication elimination, and disjunction elimination. (There is no need to commute with false elimination as they don’t reduce.) For local reduction of disjunction elimination, there would also be commuting conversions involving merge nodes, but they are convoluted and not particularly interesting, and we see shortly that there are problems with commuting conversions and local reduction even before reaching merge nodes.

Commuting conjunction elimination is fairly straightforward, since it only has one premise. Because join nodes have two premises, the conjunction elimination is duplicated within both branches after commutation in Figure 19.

Commuting conversion for join and conjunction elimination

Figure 19. Commuting conversion for join and conjunction elimination

Implication elimination only needs to commute with join nodes in the implication premise, not the argument premise, which may unblock a reduction if a join branch is an immediate implication introduction. This also duplicates the implication elimination, which then requires two uses of the argument, so it gets forked on the right-hand side of Figure 20.

Commuting conversion for join and implication elimination

Figure 20. Commuting conversion for join and implication elimination

On the right-hand side, R3\mathcal{R}_3’s control context is Θ\Theta, but the new implication eliminations require their duplicate arguments’ control contexts to be extended by x:1x : 1 and x:2x : 2, respectively. In the global reduction setting, the typing rule for fork nodes needs to be generalized so that they may also weaken the control context. (Correspondingly, the variable nodes’ control contexts in Figure 5 may then be weakened by Θ1,…,Θn\Theta_1, \ldots, \Theta_n.) In the local reduction setting, additional merge and fork nodes are inserted to do this weakening.

The story of commuting disjunction elimination is more complicated. In the local reduction setting, we may only look locally at a single join node linked to a single disjunction elimination node. If we try to commute them and duplicate the disjunction elimination nodes across the branches, as illustrated in Figure 21, it becomes unclear how to combine the resulting four total branches back together. The xx branches cannot be joined immediately because the y1y_1 and y2y_2 branches haven’t yet been handled. Even if join nodes were permitted to skip over other branches, we are still left with two different control variables y1,y2y_1,y_2 rather than the one yy that R3\mathcal{R}_3 and R4\mathcal{R}_4 are expecting. It doesn’t really make sense to join the xx branches first, either; this commutation is analogous to commuting a case-of-case expression,

Local commutation rule for disjunction elimination

Figure 21. Local commutation rule for disjunction elimination (incomplete)

case⁡(case⁡x of⁡ inl⁡ u1⇒a∣inr⁡ u2⇒b) of⁡ inl⁡ v1⇒c∣inr⁡ v2⇒d\operatorname{case}(\operatorname{case} x\ \operatorname{of}\ \operatorname{inl}\ u_1 \Rightarrow a\mid\operatorname{inr}\ u_2 \Rightarrow b)\ \operatorname{of}\ \operatorname{inl}\ v_1 \Rightarrow c\mid\operatorname{inr}\ v_2 \Rightarrow d

⇝ case⁡x of⁡ inl⁡ u1⇒(case⁡a of⁡ inl⁡ v1⇒c∣inr⁡ v2⇒d)\rightsquigarrow\ \operatorname{case} x\ \operatorname{of}\ \operatorname{inl}\ u_1 \Rightarrow(\operatorname{case} a\ \operatorname{of}\ \operatorname{inl}\ v_1 \Rightarrow c\mid\operatorname{inr}\ v_2 \Rightarrow d)

∣inr⁡ u2⇒(case⁡b of⁡ inl⁡ v1⇒c∣inr⁡ v2⇒d),\qquad\qquad\qquad\qquad\mid\operatorname{inr}\ u_2 \Rightarrow(\operatorname{case} b\ \operatorname{of}\ \operatorname{inl}\ v_1 \Rightarrow c\mid\operatorname{inr}\ v_2 \Rightarrow d),

where the entire xx disjunction is moved outwards and doesn’t get handled midway through the inner case expressions.

In the global reduction setting, commuting disjunction elimination more closely resembles commuting a case-of-case expression, since we may find an entire subgraph containing a disjunction elimination and its corresponding join and commute that subgraph wholesale, which is what

Figure 22 illustrates. Nevertheless, it remains unclear whether it would be possible to do so if the subgraph were disconnected between ∨e[y]\vee e[y] and ⊕[y]\oplus[y], or if there were multiple ⊕[y]\oplus[y] nodes.

Global commutation rule for disjunction elimination

Figure 22. Global commutation rule for disjunction elimination

Open Problems

In this work, we set out to design a proof language that accommodates Girard’s disjunction elimination rule with multiple conclusions by using derivations in the form of DAGs, guided by the computational behaviour we expect from simplifying proofs. During this process, we introduce three structural nodes (join ⊕[x]\oplus[x], hole ∘\circ, fork ⋏\curlywedge), and explore two ways of reducing disjunctions:

  • A local strategy, whose reduction rules always examine a fixed number of nodes in a subgraph but require three additional structural nodes (take tkk[x]\mathrm{tk}_k[x], drop drk[x]\mathrm{dr}_k[x], merge ⊗[x]\otimes[x]); and

  • A global strategy, which only requires one additional structural node (dead ■[x]\blacksquare[x]), but involves typing and reduction rules that may examine an arbitrary number of nodes in the entire graph.

One of our goals was to have commuting conversions naturally arise as reduction rules for structural nodes. The results are incomplete: we have no solution for a local rule for commuting disjunction eliminations with join nodes, and only a specialized global rule for this commuting conversion. With the profusion of additional structural nodes and typing annotations, this may be the final nail in the coffin for a local reduction strategy, while a solution may lie in pushing the global reduction strategy further. Nevertheless, there are a number of outstanding technical issues that need handling:

  1. Context weakening has been expressed throughout as extending the end of a context for simplicity, but for full generality, a fork node should be able to weaken in arbitrary locations in

the context, e.g. from Γ1,Γ2\Gamma_1,\Gamma_2 to Γ1,u:A,Γ2\Gamma_1,u:A,\Gamma_2 and from Θ1,Θ2\Theta_1,\Theta_2 to Θ1,x:k,Θ2\Theta_1,x:k,\Theta_2, but with arbitrarily many variables. We don’t anticipate any issues with this generalization, but expressing it formally is complicated. It would be easier to use de Bruijn indexing, where a multivariable weakening is a monotonic simultaneous renaming operation on contexts.

  1. While the implication reduction rule in Figure 5 may be generalized to account for control context weakening, as was mentioned in § 4, it’s also possible for the control context of an ancestor of the implication introduction to have fewer declarations if that node is a disjunction elimination. When eliminating such an implication, the substituted argument would somehow need to be strengthened instead. Whether such a proof graph can actually be constructed and well typed is unclear.

  1. We don’t know yet whether well-typed proof DAGs remain acyclic after reduction. In particular, when reducing an implication in Figure 5, we don’t know whether typing rules out paths from the function body subgraph G\mathcal{G} to the argument’s root node R0\mathcal{R}_0. Because substitution replaces the variable nodes of G\mathcal{G} by links from R0\mathcal{R}_0, the existence of paths from G\mathcal{G} to R0\mathcal{R}_0 would yield a cycle. Since cyclic proof graphs might reduce perpetually, proving that reduction preserves acyclicity may be as difficult as proving strong normalization.

  1. If we were to pursue the local reduction strategy, it must be noted that reducing disjunction eliminations changes the typing judgement on outgoing conclusions edges, since un annotations transform into tk or dr annotations. A type preservation lemma statement would need to account for this narrowing of the control context, although the top-level theorem on type preservation of incoming terminal edges would not, since their control contexts must be empty.

Once a proof graph language is designed with all issues resolved, the immediate future work is to formally prove type preservation of reduction. (Presumably it would use the global strategy.) For all reductions except for disjunction eliminations, it likely holds by inspection of their typing judgement edge labels.

For the disjunction-and-join reduction in Figure 18, proving type preservation requires showing that control declarations x:kx:k may be replaced by x:■x:\blacksquare or removed entirely without affecting well-typedness. Such a proof would likely require some form of induction, but as opposed to proof trees where induction hypotheses apply to subtrees, it seems unclear how an induction principle would work on subgraphs; this may require a foray into the graph rewriting literature.

Beyond type preservation, there are a number of natural properties and extensions to consider:

  • Confluence (or the diamond property) of reduction, and (weak or strong) normalization of multistep reduction with respect to some normal proof graph form;

  • Type-preserving compilation from proof trees to proof graphs to show that proof graphs haven’t lost expressivity of natural deduction, and from proof graphs to proof trees to show that proof graphs aren’t unexpectedly able to prove more propositions; and

  • Extending from propositional logic to predicate logic with existentials, which may have alternate elimination forms just like disjunctions.

References

A Grammar

u,v::=⟨typing context variables⟩u,v ::= \langle\text{typing context variables}\rangle
x,y::=⟨control context variables⟩x,y ::= \langle\text{control context variables}\rangle
A,B,C,D::=⊤∣⊥∣A→B∣A∧B∣A∨BA,B,C,D ::= \top\mid\bot\mid A \to B \mid A \land B \mid A \lor B
Γ::=∅∣Γ,u:Ak::=1∣2\Gamma::= \varnothing\mid\Gamma,u:A \qquad k ::= 1 \mid2
Θ::=ε∣Θ,x:k∣Θ,x:kδ∣Θ,x:■δ::=un∣tk∣dr\Theta::= \varepsilon\mid\Theta,x:k \mid\Theta,x:\overset{\delta}{k} \mid\Theta,x:\blacksquare \qquad \delta::= \mathrm{un}\mid\mathrm{tk}\mid\mathrm{dr}
R::=⊤i∣⊥e∣→i[u]∣→e∣∧i∣∧ek∣∨ik∣∨e[x]G::=⟨subgraph⟩\mathcal{R} ::= \top_i \mid\bot_e \mid\to_i[u] \mid\to_e \mid\land_i \mid\land e_k \mid\lor i_k \mid\lor e[x] \qquad \mathcal{G} ::= \langle\text{subgraph}\rangle
R::=∙∣∘∣∩∣⊕[x]∣⊗[x]∣tkk[x]∣drk[x]∣■[x]\mathcal{R} ::= \mathord{\bullet} \mid\mathord{\circ} \mid\mathord{\cap} \mid\oplus[x] \mid\otimes[x] \mid\mathrm{tk}_k[x] \mid\mathrm{dr}_k[x] \mid\blacksquare[x]

B Typing Rule Inventory

Γ;Θ⊢A1Γ;Θ⊢A2Γ;Θ⊢A1∧A2∧iΓ;Θ⊢A1∧A2Γ;Θ⊢Ak∧ek\frac{\Gamma;\Theta\vdash A_1 \qquad\Gamma;\Theta\vdash A_2} {\Gamma;\Theta\vdash A_1\land A_2} \quad\land_i \qquad \frac{\Gamma;\Theta\vdash A_1\land A_2} {\Gamma;\Theta\vdash A_k} \quad\land e_k
Γ;Θ⊢⊤Γ;Θ⊢⊤iΓ;Θ⊢⊥Γ;Θ⊢⊥e\frac{\Gamma;\Theta\vdash\top} {\Gamma;\Theta\vdash\top_i} \qquad \frac{\Gamma;\Theta\vdash\bot} {\Gamma;\Theta\vdash\bot_e}
Γ;Θ⊢A→BΓ;Θ⊢AΓ;Θ⊢B→e\frac{\Gamma;\Theta\vdash A\to B \qquad\Gamma;\Theta\vdash A} {\Gamma;\Theta\vdash B} \quad\to_e
Γ,u:A;Θ⊢BΓ;Θ⊢A→B→i[u]\frac{\Gamma,u:A;\Theta\vdash B} {\Gamma;\Theta\vdash A\to B} \quad\to_i[u]
Γ;Θ⊢AΓ;Θ⊢A[u] (where u:A∈Γ)\frac{\Gamma;\Theta\vdash A} {\Gamma;\Theta\vdash A} \quad[u]\ \text{(where }u:A\in\Gamma\text{)}
Γ;Θ⊢AkΓ;Θ⊢A1∨A2∨ik\frac{\Gamma;\Theta\vdash A_k} {\Gamma;\Theta\vdash A_1\lor A_2} \quad\lor i_k
Γ;Θ⊢A1∨A2Γ;Θ,x:1⊢AΓ;Θ,x:2⊢BΓ;Θ⊢C∨e[x]\frac{\Gamma;\Theta\vdash A_1\lor A_2 \qquad \Gamma;\Theta,x:1\vdash A \qquad \Gamma;\Theta,x:2\vdash B} {\Gamma;\Theta\vdash C} \quad\lor e[x]
Γ;Θ,x:1⊢AΓ;Θ,x:2⊢BΓ;Θ⊢C⊕[x]\frac{\Gamma;\Theta,x:1\vdash A \qquad \Gamma;\Theta,x:2\vdash B} {\Gamma;\Theta\vdash C} \quad\oplus[x]
Γ;ε⊢AΓ;Θ⊢A∙Γ;Θ⊢AΓ;Θ⊢A∘\frac{\Gamma;\varepsilon\vdash A} {\Gamma;\Theta\vdash A} \quad\mathord{\bullet} \qquad \frac{\Gamma;\Theta\vdash A} {\Gamma;\Theta\vdash A} \quad\mathord{\circ}
Γ;Θ⊢AΓ,Γ1;Θ,Θ1⊢A⋯Γ,Γn;Θ,Θn⊢A∩Γ;Θ,x:■⊢AΓ;Θ⊢A■[x]Γ;Θ,x:drk⊢AkΓ;Θ⊢Akdrk[x]Γ;Θ,x:tkk⊢AkΓ;Θ⊢Aktkk[x]Γ;Θ⊢A∨BΓ;Θ,x:un 1⊢AΓ;Θ,x:un 2⊢BΓ;Θ⊢C∨e[x]Γ;Θ,x:δ1 1⊢CΓ;Θ,x:δ2 2⊢CΓ;Θ⊢C⊕[x](where (δ1,δ2)∈{(un,un),(tk,dr),(dr,tk)})Γ;Θ⊢AΓ;Θ,x:k⊢BΓ;Θ,x:δ k⊢A⊗[x]\begin{aligned} &\frac{\Gamma;\Theta\vdash A}{\Gamma,\Gamma_1;\Theta,\Theta_1\vdash A\qquad\cdots\qquad\Gamma,\Gamma_n;\Theta,\Theta_n\vdash A} \\ &\hspace{5em}\cap\\[1em] &\frac{\Gamma;\Theta,x:\blacksquare\vdash A}{\Gamma;\Theta\vdash A} \qquad\blacksquare[x] \\[1em] &\frac{\Gamma;\Theta,x:\mathrm{dr}_{k}\vdash A_k}{\Gamma;\Theta\vdash A_k} \qquad\mathrm{dr}_{k}[x] \\[1em] &\frac{\Gamma;\Theta,x:\mathrm{tk}_{k}\vdash A_k}{\Gamma;\Theta\vdash A_k} \qquad\mathrm{tk}_{k}[x] \\[1em] &\frac{\Gamma;\Theta\vdash A\lor B\qquad\Gamma;\Theta,x:\mathrm{un}\ 1\vdash A\qquad\Gamma;\Theta,x:\mathrm{un}\ 2\vdash B}{\Gamma;\Theta\vdash C} \qquad\lor e[x] \\[1em] &\frac{\Gamma;\Theta,x:\delta_1\ 1\vdash C\qquad\Gamma;\Theta,x:\delta_2\ 2\vdash C}{\Gamma;\Theta\vdash C} \qquad\oplus[x] \\ &\hspace{5em}(\text{where }(\delta_1,\delta_2)\in\{(\mathrm{un},\mathrm{un}),(\mathrm{tk},\mathrm{dr}),(\mathrm{dr},\mathrm{tk})\}) \\[1em] &\frac{\Gamma;\Theta\vdash A\qquad\Gamma;\Theta,x:k\vdash B}{\Gamma;\Theta,x:\delta\ k\vdash A} \qquad\otimes[x] \end{aligned}

References

  1. [1]Girard, Jean-Yves. 1989. Proofs and Types. Translated by Paul Taylor and Yves Lafont. Cambridge University Press.

Paper details

vlnc:W_zm8usghj
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 8

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents