A Symmetric Lambda-Calculus Corresponding to the Negation-Free Bilateral Natural Deduction
aa r X i v : . [ c s . L O ] J a n A Symmetric Lambda-Calculus Corresponding tothe Negation-Free Bilateral Natural Deduction
Tatsuya Abe
Software Technology and Artificial Intelligence Research Laboratory, Chiba Institute ofTechnology, 2-17-1 Tsudanuma, Narashino, Chiba, 275-0016, [email protected]
Daisuke Kimura
Department of Information Science, Toho University, 2-2-1 Miyama, Funabashi, Chiba, 274-8510,[email protected]
Abstract
Filinski constructed a symmetric lambda-calculus consisting of expressions and continuations whichare symmetric, and functions which have duality. In his calculus, functions can be encoded toexpressions and continuations using primitive operators. That is, the duality of functions is notderived in the calculus but adopted as a principle of the calculus. In this paper, we propose a simplesymmetric lambda-calculus corresponding to the negation-free natural deduction based bilateralismin proof-theoretic semantics. In our calculus, continuation types are represented as not negationsof formulae but formulae with negative polarity. Function types are represented as the implicationand but-not connectives in intuitionistic and paraconsistent logics, respectively. Our calculus is notonly simple but also powerful as it includes a call-value calculus corresponding to the call-by-valuedual calculus invented by Wadler. We show that mutual transformations between expressions andcontinuations are definable in our calculus to justify the duality of functions. We also show thatevery typable function has dual types. Thus, the duality of function is derived from bilateralism.
Theory of computation → Logic; Theory of computation → Typetheory
Keywords and phrases symmetric lambda-calculus, formulae-as-types, duality, bilateralism, naturaldeduction, proof-theoretic semantics, but-not connective, continuation, call-by-value
Acknowledgements
The author thanks Yosuke Fukuda, Tasuku Hiraishi, Kentaro Kikuchi, andTakeshi Tsukada for the fruitful discussions, which clarified contributions of the present paper.
A function of the type A → A from expressions of the type A to expressions of the type A can be regarded as a function from continuations of the type A to continuations of thetype A . This property of functions is called duality .Filinski constructed a symmetric λ -calculus based on the duality of functions [12, 13].His calculus consists of expressions E , continuations C , and functions F . Expressions andcontinuations are symmetric. Functions are neutral, that is, functions can be encoded toexpressions and continuations like p F q and x F y , respectively. Expressions and continuationscan be decoded to functions by operators E and C . The operators p · q , x · y , · , and · are primitive since the duality of functions is adopted as a principle of his calculus.The duality allows the call-with-current-continuation operator (call/cc) to have a type(( A → A ) → A ) → A . In a traditional interpretation of function types, the type meansthat call/cc takes an expression of the type ( A → A ) → A and returns an expression ofthe type A . However, in the symmetric λ -calculus, call/cc takes a continuation of the type A and becomes a function of the type ( A → A ) → A , which takes an expression of thetype A → A and returns an expression of the type A . A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction
The duality of functions seems to be one of the most significant reasons that it is possiblefor the symmetric λ -calculus to have the provability of classical logic, because the type(( A → A ) → A ) → A corresponds to the Peirce formula on the formulae-as-typesnotion [4, 22], which strengthens the λ -calculus corresponding to the minimal logic havingthe provability of classical logic [21].In this paper, we justify the duality of functions in the symmetric λ -calculus using bilateralism in proof-theoretic semantics. In proof-theoretic semantics there exists an ideathat meanings of logical connectives are given by the contexts in which the logical connectivesoccur. In this idea, a meaning of a logical connective is considered to be defined by itsintroduction rule of a natural deduction and its elimination rule is naturally determined tobe in harmony with the introduction rule.Rumfitt suggested that the original natural deduction invented by Gentzen [15, 16] isnot harmonious, and constructed a natural deduction based on bilateralism [32]. Within thenotion of bilateralism, provability is not defined for a plain formula A but a formula withpolarity + A and − A . Provability of + A means that A is accepted, and provability of − A means that A is rejected. The traditional formulation for which provability of A means that A is accepted is based on the notion of unilateralism rather than bilateralism. Bilateralismdoes not permit anything neutral and forces everything to have either positive or negativepolarity. Rumfitt showed that a natural deduction of classical logic that is constructed onunilateralism can be reconstructed on bilateralism.In this paper, we construct a symmetric λ -calculus corresponding to the negation-freebilateral natural deduction. A distinguishing aspect of our calculus is that we adopt the but-not connective as a constructor for functions between continuations. Another distinguishingaspect is that reductio ad absurdum is a construction of a configuration also known as acommand. In our calculus, continuations and commands are first-class citizens.Our bilateral λ -calculus contains a computationally consistent call-by-value calculus.The calculus corresponds to the sub-calculus of the call-by-value dual calculus inventedby Wadler [38, 39] obtained by adding the but-not connective and removing the negationconnective. The equivalence is formally obtained by giving mutual translations betweenthese calculi. In other words, the translation provides a strong relationship between a bi-lateral natural deduction and a sequent calculus including proofs on the formulae-as-typesnotion.The translations clarify a significant difference between the bilateral natural deductionand the sequent calculus. The negation of the dual calculus is not involutive, that is, ¬ ¬ A isnot isomorphic to A . Although the dual calculus also has the involutive duality as the meta-level operation that comes from the left-hand-side and right-hand-side duality of the classicalsequent-calculus framework, there exists no inference rule to operate the involutive dualityin the calculus. In the bilateral λ -calculus, the negation is represented using inversions ofpolarities, and is involutive by definition.A symmetric λ -calculus which was constructed by Lovas and Crary is the only similarcalculus based on bilateralism [25]. However, they adopted the negation connective ¬ as aprimitive logical connective, and function type → is defined as syntactic sugar. In Lovasand Crary’s calculus it is necessary to use reductio ad absurdum, although it is generallyeasy to define functions between expressions. This means that it is not easy to define asub-calculus corresponding to the minimal logic. Our calculus does not include the negationconnective. Our work claims that the negation connective is not necessary but negativepolarity is sufficient to define a symmetric λ -calculus based on bilateralism.Using our calculus, we justify the duality which Filinski adopted as a principle in con- atsuya Abe and Daisuke Kimura 3 A ¬ A ( ⊥ -I) ⊥ ⊥ ( ⊥ -E) A [ A ]... ⊥ ( ¬ -I) ¬ A [ ¬ A ]... ⊥ ( ¬ -E) A [ A ]... A ( → -I) A → A A → A A ( → -E) A A A ( ∧ -I) A ∧ A A ∧ A ( ∧ -E ) A A ∧ A ( ∧ -E ) A A ( ∨ -I ) A ∨ A A ( ∨ -I ) A ∨ A A ∨ A [ A ]... A [ A ]... A ( ∨ -E) A Figure 1
Natural deduction ND prop . structing his calculus. Specifically, the encodings to expressions and continuations are defin-able in our calculus. More correctly, mutual transformations between expressions and con-tinuations of function types are definable in our calculus. We also show that every typablefunction has dual types about expressions and continuations. We clarify that bilateralismnaturally raises the duality of functions.Finally, we note that one of our goals is to construct a simple and powerful calculus inwhich the duality of functions is definable. We do not intend to clarify anything unknownin classical logic by assigning λ -terms to proofs, as seen in existing work in structural prooftheory. Actually, our calculus is a sub-calculus of a natural extension of the dual calculus.The remainder of this paper is organized as follows: In Section 2, we introduce bilateralnatural deductions. In Section 3, we add proofs to nodes in derivation trees. In Section 4,we construct a symmetric λ -calculus corresponding to the negation-free bilateral naturaldeduction. In Section 5, we justify the duality of functions using our calculus. In Section 6,we discuss related work to clarify the contributions of this paper. In Section 7, we concludethe paper by identifying future research directions. In this section, we introduce bilateralism , which was proposed by Rumfitt [32], and define afew variants of Rumfitt’s bilateral natural deduction.The set of formulae is defined as follows:(formulae) A ::= o | ( ¬ A ) | ( A → A ) | ( A ∧ A ) | ( A ∨ A )where o ranges over propositional variables. We note that ⊥ is not contained by the set offormulae. The connective power of ¬ is stronger than that of ∧ , ∨ , and → . The connectivepowers of ∧ and ∨ are stronger than that of → . We omit parentheses when the contextrenders them obvious.We recall the natural deduction invented by Gentzen [15, 16] and consider its proposi-tional fragment ND prop , as shown in Figure 1. At each inference rule, formulae or ⊥ abovea line are assumptions and a formula or ⊥ below a line is a conclusion. A derivation is atree that has exactly one root. Symbol ... denotes a transitive connection between a leaf and A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction a node, and [ A ] means that A is discharged from assumptions in a standard manner. Rules( ⊥ -E) and ( ¬ -E) are also known as explosion and reductio ad absurdum , respectively. Ajudgment is defined as Γ ⊢ A or Γ ⊢ ⊥ , where Γ is a multiset of formulae.There exists an idea that meanings of logical connectives are defined by their introduc-tion rules and their elimination rules should be defined in harmony with their introductionrules in proof-theoretic semantics. Rumfitt attempted to justify logical connectives and in-ference rules using a notion of harmony which was proposed by Dummett [8]. We considera logical connective tonk which was proposed by Prior [29]. Its introduction rule ( tonk -I)and elimination rule ( tonk -E) are as follows: A ( tonk -I) A tonk A A tonk A ( tonk -E) A .A pair of contiguous introduction and elimination rules is called harmonious if the residueafter removing the pair is also a derivation. Such a procedure is called normalization . In thissection, we let denote the normalization procedure. The pair of ( tonk -I) and ( tonk -E) isnot harmonious because the right-hand side of the following relation is not a derivation: A ( tonk -I) A tonk A ( tonk -E) A A A .Rumfitt suggested that ND prop also does not enjoy the harmony condition and proposeda notion of bilateralism to construct a harmonious natural deduction.Bilateralism is based on two notions of acceptance and rejection of formulae. They arealso called verification and falsification , respectively, by Wansing [41, 42]. Formulae A with polarity are defined as + A and − A . A derivation of root + A means that A is accepted. Aderivation of root − A means that A is rejected.Let A be a formula with polarity. Conjugates (+ A ) ∗ and ( − A ) ∗ are defined as − A and+ A , respectively.Rumfitt adopted (Non-contradiction) and (Reductio) which are called coordination prin-ciples and defined inference rules of logical connectives, as shown in Figure 2, which arenaturally derived from the standard boolean semantics. In this paper, we call this logic abilateral natural deduction Bi-ND prop .ND prop is based on the notion of unilateralism rather than bilateralism. A derivationof root A in ND prop means that A is accepted. There exists the following relation betweenND prop and Bi-ND prop : ◮ Theorem 2.1 (Rumfitt [32]) . For any n ≥ , A , . . . , A n − ⊢ A is provable in ND prop ifand only if + A , . . . , + A n − ⊢ + A is provable in Bi-ND prop .Remark. It is controversial that explosion and reductio ad absurdum are regarded as elimi-nation rules of the logical connectives ⊥ and ¬ , respectively. Rumfitt’s bilateralism is alsocriticized in a paper [24]. That is, bilateralism is called a work in progress. However, thesubject of this paper is not a justification of bilateralism in proof-theoretic semantics.The natural deduction Bi-ND prop is not symmetric. We extend the language by addinga logical connective ← :(formulae) A ::= o | ( ¬ A ) | ( A → A ) | ( A ← A ) | ( A ∧ A ) | ( A ∨ A ) . We will use the logical connective as function types of continuations in the following.The connective ← is called the but-not connective because A ← A is logically equivalentto A ∧ ¬ A in classical logic. The but-not connective is also written as pseudo-difference atsuya Abe and Daisuke Kimura 5 A A ∗ (Non-contradiction) ⊥ [ A ]... ⊥ (Reductio) A ∗ − A ( ¬ -I + )+ ¬ A + ¬ A ( ¬ -E + ) − A [+ A ]...+ A ( → -I + )+ A → A + A → A + A ( → -E + )+ A + A + A ( ∧ -I + )+ A ∧ A + A ∧ A ( ∧ -E +0 )+ A + A ∧ A ( ∧ -E +1 )+ A + A ( ∨ -I +0 )+ A ∨ A + A ( ∨ -I +1 )+ A ∨ A + A ∨ A [+ A ]... A [+ A ]... A ( ∨ -E + ) A + A ( ¬ -I − ) − ¬ A − ¬ A ( ¬ -E − )+ A + A − A ( → -I − ) − A → A − A → A ( → -E − )+ A − A → A ( → -E − ) − A − A ( ∧ -I − ) − A ∧ A − A ( ∧ -I − ) − A ∧ A − A ∧ A [ − A ]... A [ − A ]... A ( ∧ -E − ) A− A − A ( ∨ -I − ) − A ∨ A − A ∨ A ( ∨ -E − ) − A − A ∨ A ( ∨ -E − ) − A Figure 2
Rumfitt’s natural deduction Bi-ND prop . · − [19, 37], subtraction − [30], difference − [3], and co-implication − < [20, 42]. The but-not connective is a primitive connective in paraconsistent logic, whereas → is a primitiveconnective in intuitionistic logic because A → A is not logically equivalent to ¬ A ∨ A in intuitionistic logic. In paraconsistent logic, sequent calculus consists of sequents Γ ⊢ ∆ ,where Γ is empty or a singleton formula, whereas intuitionistic logic can be defined bysequents Γ ⊢ ∆ , where ∆ is empty or a singleton formula.We define a natural deduction Bi-ND ← prop by adding inference rules, as shown in Figure 3.The connectives → and ← are symmetrically located in Bi-ND ← prop as follows: ◮ Proposition 2.2. + A → A ⊢ − A ← A , − A → A ⊢ + A ← A , + A ← A ⊢− A → A , and − A ← A ⊢ + A → A are provable in Bi-ND ← prop . Proof.
See Appendix B. ◭ Let L and L be languages such that L ⊆ L , and S and S be logics on the languages L and L , respectively. We define S as an extension of S if any formula ϕ that is provablein S is also provable in S . We define that an extension S of S is conservative if anyformula ϕ on the language L that is provable in S is also provable in S . ◮ Proposition 2.3.
Bi-ND ← prop is a conservative extension of Bi-ND prop . A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction + A − A ( ← -I + )+ A ← A + A ← A ( ← -E +0 )+ A + A ← A ( ← -E +1 ) − A [ − A ]... − A ( ← -I − ) − A ← A − A ← A − A ( ← -E − ) − A Figure 3
Inference rules for ← . Proof.
It is obvious because Bi-ND prop is complete to the standard two-value semantics,and Bi-ND ← prop is sound to the semantics. ◭ Bi-ND prop and Bi-ND ← prop include sub-logics as follows: ◮ Proposition 2.4. 1.
The inference rules ( ∧ - I − ) , ( ∧ - I − ) , ( ∧ - E − ) , ( ∨ - I + ) , ( ∨ - E +0 ) , and ( ∨ - E +1 ) are derivable in Bi-ND prop , and The inference rules ( → - I − ) , ( → - E − ) , ( → - E − ) , ( ← - I + ) , ( ← - E +0 ) , and ( ← - E +1 ) arederivable in Bi-ND ← prop . Proof.
See Appendix B. ◭ In this section, we introduce derivation trees with proofs in their nodes to mediate betweennatural deductions and λ -calculi introduced in Sections 2 and 4, respectively.We add proofs to polarized formulae in the ¬ -free fragment of Bi-ND ← prop , that is,the (Non-contradiction), (Reductio), ( → -I + ), ( → -E + ), ( ∧ -I + ), ( ∧ -E +0 ), ( ∧ -E +1 ), ( ∨ -I − ),( ∨ -E − ), ( ∨ -E − ), ( ← -I + ), ( ← -E +0 ), ( ← -E +1 ), ( ← -I − ), and ( ← -E − ) fragment, to constructa symmetric λ -calculus. We note that the other inference rules are derivable by Proposi-tion 2.4.We assume a set of proof variables . We write α for a proof variable. We define thatnodes t : + A and t : − A in the natural deduction respectively denote that t is a proof foracceptance and rejection of A . We also define that a node T : ⊥ in the natural deductiondenotes that T is a proof for contradiction.Node λα.t : + A → A denotes that λα.t is a proof for acceptance of A → A if α is a proof variable for acceptance of A and t is a proof for acceptance of A . Node λα.t : − A ← A denotes that λα.t is a proof for acceptance of A → A if α is a proofvariable for acceptance of A and t is a proof for acceptance of A .Node t t : + A denotes that t t is a proof for acceptance of A if t is a proof foracceptance of A → A and t is a proof for acceptance of A . Node t t : − A denotes that t t is a proof for rejection of A if t is a proof for rejection of A ← A and t is a prooffor rejection of A .Node ( t , t ) : + A ∧ A denotes that ( t , t ) is a proof for acceptance of A ∧ A if t isa proof for acceptance of A and t is a proof for acceptance of A . Node ( t , t ) : − A ∨ A denotes that ( t , t ) is a proof for rejection of A ∨ A if t is a proof for rejection of A and t is a proof for rejection of A .Node π ( t ) : + A denotes that π ( t ) is a proof for acceptance of A if t is a proof foracceptance of A ∧ A . Node π ( t ) : − A denotes that π ( t ) is a proof for rejection of A if t is a proof for rejection of A ∨ A . Nodes π ( t ) : + A and π ( t ) : − A are similar. atsuya Abe and Daisuke Kimura 7 (proofs) t ::= c | α | λα.t | tt | ( t, t ) | π ( t ) | π ( t ) | µα.T T ::= h t | t i Figure 4
Proofs of the negation-free natural deduction. (types) A ::= o | ( A → A ) | ( A ← A ) | ( A ∧ A ) | ( A ∨ A )(expressions) E ::= cst o | x A | λ x A . E | EE | ( E , E ) | π ( E ) | π ( E ) | µa A .N (continuations) C ::= • o | a A | λa A . C | CC | ( C , C ) | π ( C ) | π ( C ) | µ x A .N (commands) N ::= h E | C i (syntactical objects) D ::= E | C | N Figure 5
The bilateral lambda-calculus BLC.
Node h t | t i : ⊥ denotes that h t | t i is a proof of contradiction if t is a proof foracceptance of A and t is a proof for rejection of A .Node µα.T : + A denotes that µα.T is a proof for acceptance of A if α is a proof variablefor rejection of A and T is a proof of contradiction. Node µα.T : − A denotes that µα.T isa proof for rejection of A if α is a proof variable for acceptance of A and T is a proof ofcontradiction.We formally define the set of proofs in a Curry-style bilateral λ -calculus, as shown inFigure 4 where c ranges over constants for adding logical axioms.Let Γ be a set of nodes. Judgment Γ ⊢ t : + A denotes that t is a proof for acceptanceof A under Γ . Judgment Γ ⊢ t : − A denotes that t is a proof for rejection of A under Γ .Judgment Γ ⊢ T : ⊥ denotes that T is a proof for contradiction under Γ . In this section, we construct a Church-style symmetric λ -calculus based on bilateralism anddefine a call-by-value sub-calculus. We respectively call proofs for acceptance and rejection expressions and continuations . Wedistinguish proof variables for acceptance from those for rejection. We construct an alterna-tive symmetric λ -calculus called a bilateral λ -calculus (BLC).We define types, polarized types, expressions, continuations, commands, and syntacticalobjects as shown in Figure 5.Expression cst o denotes a constant. Expression x A denotes an expression variable. Ex-pression λ x A . E denotes a λ -abstraction of expression E by x A . Expression E E denotes anapplication of function E to expression E . Expression ( E , E ) denotes a pair of expressions E and E . Expressions π ( E ) and π ( E ) are projections.Continuations are defined symmetrically to expressions. Continuation • o denotes theunique constant denoting a continuation of o . By the definition based on bilateralism, thecalculus is involutive on the notion of polarities. A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction Γ ⊢ + E : A Γ ⊢ − C : A (Non-contradiction) Γ ⊢ o h E | C i Π ; Σ, a : A ⊢ o N (Reductio + ) Π ; Σ ⊢ + µa A .N : A (Constant + ) Γ ⊢ + cst o : o (Identity + ) Γ, x A : A ⊢ + x A : AΠ, x : A ; Σ ⊢ + E : A ( → -I + ) Π ; Σ ⊢ + λ x A . E : A → A Γ ⊢ + E : A → A Γ ⊢ + E : A ( → -E + ) Γ ⊢ + E E : A Γ ⊢ + E : A Γ ⊢ + E : A ( ∧ -I + ) Γ ⊢ + ( E , E ) : A ∧ A Γ ⊢ + E : A ∧ A ( ∧ -E +0 ) Γ ⊢ + π ( E ) : A Γ ⊢ + E : A ∧ A ( ∧ -E +1 ) Γ ⊢ + π ( E ) : A Π ; Σ, x : A ⊢ o N (Reductio − ) Π ; Σ ⊢ − µ x A .N : A (Constant − ) Γ ⊢ − • o : o (Identity − ) Γ, a A : A ⊢ − a A : AΠ ; Σ, a : A ⊢ − C : A ( ← -I − ) Π ; Σ ⊢ − λa A . C : A ← A Γ ⊢ − C : A ← A Γ ⊢ − C : A ( ← -E − ) Γ ⊢ − C C : A Γ ⊢ − C : A Γ ⊢ − C : A ( ∨ -I − ) Γ ⊢ − ( C , C ) : A ∨ A Γ ⊢ − C : A ∨ A ( ∨ -E − ) Γ ⊢ − π ( C ) : A Γ ⊢ − C : A ∨ A ( ∨ -E − ) Γ ⊢ − π ( C ) : A Figure 6
A type system of BLC.
Commands are first-class citizens. A command can be abstracted by expression variable x A or continuation variable a A . Command N abstracted by a A is expression µa A .N . Acommand abstracted by x A is continuation µ x A .N . A similar idea can be seen in ¯ λµ ˜ µ -calculus which was proposed by Curien and Herbelin [3].Expressions, continuations, and commands are called syntactical objects.We assume that the connective powers of applications are stronger than those of λ -abstractions. We omit superscripts that denote types when the context renders them obvi-ous.Figure 6 shows the type system of BLC consisting of judgments Γ ⊢ + E : A , Γ ⊢ − C : A ,and Γ ⊢ o N , where type environments Γ are defined as follows:(type environments) Γ ::= Π ; Σ Π ::= ∅ | Π, x : A Σ ::= ∅ | Σ, a : A .
Judgments Π ; Σ ⊢ + E : A , Π ; Σ ⊢ − C : A , and Π ; Σ ⊢ o N correspond to { + A | A ∈ Π } , { − A | A ∈ Σ } ⊢ + A , { + A | A ∈ Π } , { − A | A ∈ Σ } ⊢ − A , and { + A | A ∈ Π } , { − A | A ∈ Σ } ⊢ ⊥ , respectivelyThe type system contains rules about commands. Rule (Non-contradiction) defines acommand from an expression and a continuation. Additionally, even if a command occurs ina derivation, the derivation does not necessarily end and may be continued by (Reductio + ) or(Reductio − ). The other inference rules about expressions are defined in a standard manner.The inference rules about continuations are defined symmetrically to expressions. atsuya Abe and Daisuke Kimura 9 (values) V ::= cst | x | λ x . E | ( V, V ) | π ( V ) | π ( V ) | µa. h V | π ( a ) i | µa. h V | π ( a ) i (contexts) E ::= {−} | E E | V E | ( E , E ) | ( V, E ) | π ( E ) | π ( E ) . Figure 7
Values and contexts of CbV-BLC.
Substitutions [ E / x ] and [ C /a ] (denoted by θ ) are inductively defined in a standardcomponent-wise and capture-avoiding manner. We write fev( E ) and fev( C ) for free expres-sion variables in E and C , respectively. We also write fcv( E ) and fcv( C ) for free continuationvariables in E and C , respectively.The bilateral λ -calculus is well designed. The so-called weakening holds as follows: ◮ Proposition 4.1. 1. Π ; Σ ⊢ + E : A implies Π, x : A ; Σ ⊢ + E : A and Π ; Σ, a : A ⊢ + E : A , Π ; Σ ⊢ − C : A implies Π, x : A ; Σ ⊢ − C : A and Π ; Σ, a : A ⊢ − C : A , and Π ; Σ ⊢ o N implies Π, x : A ; Σ ⊢ o N and Π ; Σ, a : A ⊢ o N . Proof.
By induction on derivation. ◭ The substitution lemma definitely holds as follows: ◮ Lemma 4.2. 1.
Assume Π, x : A ; Σ ⊢ + E ′ : A and Π ; Σ ⊢ + E : A . Then, Π ; Σ ⊢ + [ E / x ] E ′ : A holds. Assume Π, x : A ; Σ ⊢ − C : A and Π ; Σ ⊢ + E : A . Then, Π ; Σ ⊢ − [ E / x ] C : A holds. Assume Π, x : A ; Σ ⊢ o N and Π ; Σ ⊢ + E : A . Then, Π ; Σ ⊢ o [ E / x ] N holds. Assume Π ; Σ, a : A ⊢ + E : A and Π ; Σ ⊢ − C : A . Then, Π ; Σ ⊢ + [ C /a ] E : A holds. Assume Π ; Σ, a : A ⊢ − C ′ : A and Π ; Σ ⊢ − C : A . Then, Π ; Σ ⊢ − [ C /a ] C ′ : A holds. Assume Π ; Σ, a : A ⊢ o N and Π ; Σ ⊢ − C : A . Then, Π ; Σ ⊢ o [ C /a ] N holds. Proof.
By induction on derivation. ◭ The bilateral λ -calculus enjoys the type uniqueness property, that is, every expressionand continuation has a unique positive and negative type, respectively, as follows: ◮ Proposition 4.3. 1. If Γ ⊢ + E : A and Γ ⊢ + E : A , then A and A are the same. If Γ ⊢ − C : A and Γ ⊢ − C : A , then A and A are the same. Proof.
The proposition holds immediately from the definition of the type system. ◭ CbV-BLC
We define a call-by-value bilateral λ -calculus CbV-BLC. Types, expressions, continuations,commands, and typing rules are the same as those of BLC. The values and the call-by-valueevaluation contexts for expressions of CbV-BLC are defined as shown in Figure 7.An evaluation context E is a expression with a hole {−} . The expression obtained byfilling the hole of E with an expression E is denoted by E{ E } . The equations of CbV-BLCare shown in Figure 8.Although careful readers will wonder why π ( V ) and π ( V ) are values, they can oftenbe seen in λ -calculi based on categorical semantics (cf. Definition 7.7 in Selinger’s paper [33]and Figure 2 in Wadler’s paper [39]). We also note that µa. h V | π ( a ) i and µa. h V | π ( a ) i ( λ x . E ) V = v [ V / x ] E λ x .V x = v V if x fev( V ) π (( V , V )) = v V π (( V , V )) = v V ( π ( V ) , π ( V )) = v Vµa. h E | a i = v E if a fcv( E ) ( λa. C ) C = v [ C /a ] C λa. C a = v C if a fcv( C ) π (( C , C )) = v C π (( C , C )) = v C ( π ( C ) , π ( C )) = v C µ x . h x | C i = v C if x fev( C ) h V | µ x .N i = v [ V / x ] N h µa.N | C i = v [ C /a ] N hE{ E } | C i = v h E | µ x . hE{ x } | C ii if x is fresh Figure 8
The equations of CbV-BLC. (types) A ::= χ | ( A ∧ A ) | ( A ∨ A ) | ( ¬ A )(terms) M ::= x | h M, M i | h M i inl | h M i inr | [ K ] not | ( S ) .α (coterms) K ::= α | [ K, K ] | fst [ K ] | snd [ K ] | not h M i | x. ( S )(statements) S ::= M • K (syntactical objects) O ::= M | K | S Figure 9
The syntax of the dual calculus. are values for A ∨ B , namely, they mean the left and the right injections of V , respectively.We can define case expressions using pairs of continuations as follows:inl( E ) ≡ µa. h E | π ( a ) i inr( E ) ≡ µa. h E | π ( a ) i case( E , x . E , x . E ) ≡ µa. h E | ( µ x . h E | a i , µ x . h E | a i ) i Γ ⊢ + E : A Γ ⊢ + inl( E ) : A ∨ A Γ ⊢ + E : A Γ ⊢ + inr( E ) : A ∨ A Π ; Σ ⊢ + E : A ∨ A Π, x : A ; Σ ⊢ + E : A Π, x : A ; Σ ⊢ + E : AΠ ; Σ ⊢ + case( E , x . E , x . E ) : A h case(inl( V ) , x . E , x . E ) | C i≡ h µa. h µa . h V | π ( a ) i | ( µ x . h E | a i , µ x . h E | a i ) i | C i = v h µa . h V | π ( a ) i | ( µ x . h E | C i , µ x . h E | C i ) i = v h V | π (( µ x . h E | C i , µ x . h E | C i )) i = v h V | µ x . h E | C ii = v h [ V / x ] E | C i . The calculus CbV-BLC is CbV-DC →← which is a sub-calculus of an extension with thebut-not connective of the call-by-value dual calculus by Wadler [39]. Types, terms, coterms,statements, and syntactical objects are shown in Figure 9. A key difference from BLC is thatthe dual calculus adopts ¬ as a primitive connective and function types are syntactic sugar.See Wadler’s papers [39] or Appendix A for the details. We can define a translation fromCbV-BLC. Consequently, the consistency of our call-by-value calculus is obtained from theconsistency of the call-by-value dual calculus. Specifically, we can obtain the following: atsuya Abe and Daisuke Kimura 11 ◮ Theorem 4.4.
There exist translations ( − ) ♯ from CbV-BLC into CbV-DC →← and ( − ) ♭ from CbV-DC →← into CbV-BLC, which satisfy: D = v D implies ( D ) ♯ = dcv ( D ) ♯ , O = dcv O implies ( O ) ♭ = v ( O ) ♭ , (( D ) ♯ ) ♭ = v D holds, and (( O ) ♭ ) ♯ = dcv O holds.where = dcv is the equality relation of CbV-DC →← . Proof.
See Appendix A. ◭ The theorem reasons about the call-by-value variant of BLC via the call-by-value dualcalculus. Furthermore, the theorem shows that the but-not type A ← B in the call-by-valuedual calculus is considered as the function type for continuations. The theorem also revealsthe difference between the dual calculus, whose negation type ¬ A is not involutive, andBLC, whose polarities + A and − A are involutive.The negation type of the dual calculus can appear anywhere in a type. The negationtype enables encoding of a coterm, say K , of type A to a term [ K ] not of type ¬ A , andhandling of the encoded coterms as a part of terms. For instance, [[ K , K ]] not of type ¬ ( A ∨ A ) is a term which encodes the pair of coterms K and K , and functions, such as λx . [ x . ( x • not hh x i inl i )] not of type ¬ ( A ∨ A ) → ¬ A that handles such terms, aredefinable in the dual calculus. The expressive power of BLC is strictly weaker than thedual calculus, since BLC does not permit defining such functions. The theorem also raisesa question whether BLC offers an adequate theoretical framework for expressing practicalcontrol operators. We conjecture that the polarities of BLC are enough for this purpose.This is future work. In this section, we reason about the duality of functions in Filinski’s symmetric λ -calculususing the bilateral λ -calculus. A function of the type A → A from expressions of the type A to expressions of the type A can be regarded as a function from continuations of the type A to continuations of thetype A , and vice versa. This property of functions is called the duality of functions.Filinski adopted the duality as a principle and constructed a symmetric λ -calculus [12,13]. The symmetric λ -calculus consists of functions F , expressions E , and continuations C .Functions consist of λ -abstractions of expressions, decodings of expressions, λ -abstractionsof continuations, and decodings of continuations as follows:(functions) F A A ::= X A ⇒ E A | E [ A → A ] | Y A ⇐ C A | C [ A ← A ] . Let A → A be a function type. Filinski defined a function type [ A → A ] for anexpression, which denotes an exponential object A A in categorical semantics, where A and A are objects that correspond to types A and A . We note that A × A → A isbijective to A → A A in categorical semantics. Similarly, Filinski defined a function type[ A ← A ] for a continuation, which denotes a coexponential object A A , and A → A + A is bijective to A A → A . Expressions and continuations consist of constants, variables, applications of functions,and encodings of functions as follows:(expressions) E o ::= cst o | x o | F Ao E A E [ A → A ] ::= x [ A → A ] | F A [ A → A ] E A | p F A A q (continuations) C o ::= • o | a o | F oA C A C [ A ← A ] ::= a [ A ← A ] | F [ A ← A ] A C A | x F A A y . We note that the encodings and decodings are defined to be primitive operators becausethe duality is adopted as a principle.We explain commands in Filinski’s symmetric λ -calculus, which is a triple called a con-figuration : ⊢ E : + A ⊢ F : A → A ⊢ C : ¬ A ⊢ h E | F | C i for the symmetric λ -calculus where ⊢ E : + A and ⊢ C : ¬ A for expression E of type A and continuation C of type A , respectively. The notation was introduced by Ueda andAsai [36]. A difference from commands in the bilateral λ -calculus is that configurations arenot pairs consisting of expressions and continuations, but triples. Another difference is thatany configuration cannot be abstracted by expression or continuation variables. One otherdifference is that the continuation types are represented using the negation connective inFilinski’s calculus.We can see that the configuration notion is also based on the duality principle. If F isregarded as a function from expressions of the type A to expressions of the type A , then F is applied to E and an expression of the type A that is consistent with C of the type A is generated. Similarly, if F is regarded as a function from continuations of the type A tocontinuations of the type A , then F is applied to C and a continuation of the type A thatis consistent with E of the type A is generated. The configuration notion includes bothcases. Let us see how the duality occurs in the bilateral λ -calculus. The bilateral λ -calculus doesnot permit anything neutral that is neither expression nor continuation. Even if we wantto define a neutral function, we must decide whether the type of the function is either+ A → A or − A ← A . If we define a function between expressions which is applied to acontinuation, then the function cannot be as-is applied to the continuation, and vice versa.However, we can define encodings x E y = λa.µ x . h Ex | a i and p C q = λ x .µa. h x | C a i tocontinuations and expressions in the bilateral λ -calculus, respectively, and the encodings aremutual transformations as follows: ◮ Theorem 5.1.
The following inferences are derivable: Γ ⊢ + E : A → A Γ ⊢ − x E y : A ← A Γ ⊢ − C : A ← A Γ ⊢ + p C q : A → A . Proof.
See Appendix B. ◭ The mutual transformations enjoy the following property: ◮ Theorem 5.2. 1. h p C q V | C i = v h V | C C i holds, h V | x E y C i = v h E V | C i holds, h px E yq V | C i = v h E V | C i holds, and h V | xp C qy C i = v h V | C C i holds. atsuya Abe and Daisuke Kimura 13 Proof.
The first and second statements hold immediately from the definition of , p C q ,and x E y as follows: h p C q V | C i ≡ h ( λ x .µa. h x | C a i ) V | C i = v h µa. h V | C a i | C i = v h V | C C ih V | x E y C i ≡ h V | ( λa.µ x . h Ex | a i ) C i = v h V | µ x . h Ex | C ii = v h E V | C i . The third and fourth statements hold from the the first and second statements. ◭ Theorems 5.1 and 5.2 ensure that we can always recover to define functions betweenexpressions (and continuations) from functions between continuations (resp. expressions)using the mutual transformations. Thus, we confirm that the duality of functions is derivedfrom definability of the mutual transformations in the bilateral λ -calculus. We also provide an alternative justification of the duality using derivation trees with proofsin their nodes introduced in Section 3.We define a polarization , which is a function from proof variables and proof constantsto expression or continuation variables with types and expression or continuation constants,respectively. A polarization for proofs is defined by p ( λα.t ) = λp ( α ) .p ( t ) p ( t t ) = p ( t ) p ( t ) p (( t , t )) = ( p ( t ) , p ( t )) p ( π ( t )) = π ( p ( t )) p ( π ( t )) = π ( p ( t )) p ( µα.T ) = µp ( α ) .p ( T ) p ( h t | t i ) = h p ( t ) | p ( t ) i . Let V be a set of proof variables. We define p ( V ) as the concatenation of the positivetype environments and the negative type environments of V by p .Polarizations p and p ′ are equivalent iffor any proof variable α , p ( α ) and p ′ ( α ) have the same polarity, andfor any proof variables α and α ′ , p ( α ) ≡ p ( α ′ ) implies p ′ ( α ) ≡ p ′ ( α ′ ), vice versa. ◮ Proposition 5.3.
Assume that p and p ′ are equivalent. Then, p ( V ) ⊢ + p ( t ) : A implies p ′ ( V ) ⊢ + p ′ ( t ) : A p ( V ) ⊢ − p ( t ) : A implies p ′ ( V ) ⊢ − p ′ ( t ) : A , and p ( V ) ⊢ o p ( t ) implies p ′ ( V ) ⊢ o p ′ ( t ) . A polarization p is a conjugate of a polarization p ′ if for any variable α , if p ( α ) is anexpression variable, then p ′ ( α ) is a continuation variable, and vice versa.A derivation tree denoting a function has two proofs for acceptance and rejection asfollows: ◮ Theorem 5.4. 1. p ( V ) ⊢ + p ( t ) : A implies that there exists a conjugate p ′ of p such that p ′ ( V ) ⊢ − p ′ ( t ) : A , p ( V ) ⊢ − p ( t ) : A implies that there exists a conjugate p ′ of p such that p ′ ( V ) ⊢ + p ′ ( t ) : A ,and p ( V ) ⊢ o p ( t ) implies that there exists a conjugate p ′ of p such that p ′ ( V ) ⊢ o p ′ ( t ) . Proof.
By induction on derivation. We note that Proposition 5.3 ensures differences betweenequivalent polarizations can be ignored. ◭ Careful readers might think thatno distinction of expression variables and continuation variables in derivation trees withproofs is better, andBLC, which distinguishes expressions and continuations and requires the mutual trans-formations, is unnecessarily delicate.However, BLC and the mutual transformations have an advantage in cases that functionsand arguments have common variables. For example, a function λα .µα . h α | α i cannot beapplied to an argument α under any assumption because the function and argument musthave converse polarities to each other. Because the mutual transformations, which have novariable, can respectively transform functions between expressions and continuations to thosebetween continuations and expressions in BLC, p λa .µ x . h x | a i q x of the type + A → A can be applied to x of the type + A where λa .µ x . h x | a i has the type − A ← A . In this section, we discuss related work from three viewpoints of symmetric λ -calculi on theformulae-as-types and approaches in structural proof theory. The first symmetric λ -calculus was proposed by Filinski [12, 13]. Filinski described functionsbetween continuations as follows: “We can therefore equivalently view a function f : A → B as a continuation accepting a pair consisting of an A -type value and a B -accepting continu-ation. Such a pair will be called the context of a function application, and its type writtenas [ B ← A ] ” . In our observation on bilateralism, his intuition is not only computation-ally but also proof-theoretic semantically reasonable. The underlying idea in defining ourcalculus is that Filinski’s [ A ← A ] is regarded as − A ← A . We elaborate his idea inproof-theoretic semantics and carefully use Rumfitt’s polarities and the but-not connective,instead of simply using the negation connective as Filinski did.A symmetric λ -calculus proposed by Barbanera and Berardi was invented to extractprograms from classical logic proofs. Their calculus contains the involutive negation A ⊥ for each type A and has symmetric application similar to commands in BLC. The essentialdifference between their calculus and BLC is polarity , that is, the polarized type − ( A ∨ B )in BLC corresponds to ( A ∨ B ) ⊥ , which is identified with A ⊥ ∧ B ⊥ in their calculus. Thislack of polarity information makes it difficult to reason about functions of Filinski’s calculus.A calculus which was proposed by Lovas and Crary is the only symmetric λ -calculusthat corresponds to classical logic in which expressions and continuations are symmetric onthe bilateralism [25]. They defined λ -terms similar to those of the dual calculus which wasdefined by Wadler [38], and did not analyze the duality of functions in Filinski’s symmetric λ -calculus. They also did not adopt the implication → but the negation connective ¬ as aprimitive type constructor. An expression of function type A → A has type ¬ ( A ∧ ¬ A ).Therefore, it is necessary to use an inference rule that corresponds to reductio ad absurdum inclassical logic just to define λ -abstractions and applications of expressions in the simply typed λ -calculus, unlike ours. We also show that the negative polarity is suitable for representingcontinuations rather than the negation connective on the notion of bilateralism.Ueda and Asai investigated Filinski’s symmetric λ -calculus, and provided an explicitdefinition of commands by writing ¬ A for a continuation type A [36]. However, they did not atsuya Abe and Daisuke Kimura 15 attempt to reason about the neutrality of functions in the symmetric λ -calculus. Also, theuse of the negation connective to represent continuations is not reasonable as we have shownin the present paper. Actually, they also used the negation connective at only the outermost position of formulae. This operator of formulae should not be the negation connective butthe negative polarity on bilateralism.Curien and Herbelin’s ¯ λµ ˜ µ -calculus [3] corresponds to Gentzen’s sequent calculus LK aswell as the dual calculus. This symmetric infrastructure, namely the duality of LK, exhibitsthe duality between continuations and programs. Its symmetricity corresponds to that of thepolarities in BLC and to that of types A and ¬ A in Ueda and Asai’s calculus. The calculibased on LK naturally contain the (not involutive) negation type, which provides a moreexpressive power than BLC, as noted in Section 4.2. This observation raises an interestingquestion: What is the role of the negation type in practical programming languages? Girard and Parigot constructed calculi corresponding to classical logic [18, 28] and analyzedclassical logic proof-theoretically. Girard also invented linear logic [17], which is very usefulfor analyzing classical logic. Danos et al. confirmed that classical logic has well behavedfragments using the positive and negative polarities [5, 6]. The calculi invented through theirapproaches are larger than or incomparable to ours because their motivations are differentfrom ours. A goal of our work is not to analyze classical logic but to construct a minimalcalculus to justify the duality of functions and the computations that delimited continuationsraise. Although analyzing negations is a topic of great interest in proof theory [27, 14, 26,2, 7, 10, 9, 1, 31, 23, 11], we investigated the negation-free fragment of bilateral naturaldeduction.Dual intuitionistic logic, which is symmetric to intuitionistic logic, is well known instructural proof theory [19, 37, 34]. A combined logic of intuitionistic and dual intuitionisticlogics is classical logic. Whereas most of the logics are based on sequent calculi, Wansingconstructed a natural deduction that can perform verification and falsification that corre-sponds to proving + A and − A , respectively, in our calculus [42]. However, a series of hisworks analyzed refutation , which is a proof for falsification in the context of studying variousnegations as seen in structural proof theory [40, 41, 42]. This is different from the objec-tive in the present paper. He also neither provided a λ -calculus based on bilateralism nordescribed computational aspects, such as continuation controls. Tranchini also constructeda natural deduction of dual intuitionistic logic [35]. Our calculus seems to correspond to anegation-free fragment of his natural deduction. In this paper, we proposed a symmetric λ -calculus called the bilateral λ -calculus with thebut-not connective based on bilateralism in proof-theoretic semantics. The formulae-as-types notion was extended to consider Rumfitt’s reductio, which corresponds to reductioad absurdum as a µ -abstraction of a first-class command in our calculus. Its call-by-valuecalculus can be defined as a sub-calculus of Wadler’s call-by-value dual calculus. We showedthat the duality of functions is derived from definability of the mutual transformationsbetween expressions and continuations in the bilateral λ -calculus. We also showed thatevery typable function has dual types.In this paper, we have provided a method to justify a few notions in the theory of λ -calculi on bilateralism. The bilateral analysis in this paper targets the duality of functions in Filinski’s symmetric λ -calculus. Bilateral analyses of asymmetric calculi constitute ourfuture work.The call-by-value variant of BLC corresponds to a sub-calculus of the call-by-value dualcalculus with the but-not connective. It is also future work to clarify what practical usesare derived from the difference between BLC and the dual calculus. atsuya Abe and Daisuke Kimura 17 References Arnon Avron. Negation: Two points of view. In
What is Negation? , Applied Logic Series,pages 3–22. 1999. Keith L. Clark. Negation as failure. In
Logic and Data Bases , pages 293–322. Plenum Press,1978. Pierre-Louis Curien and Hugo Herbelin. The duality of computation. In
Proc. ICFP , pages233–243, 2000. Haskell. B. Curry. Functionality in combinatory logic. In
Proc. the National Academy ofSciences of USA , volume 20, pages 584–590, 1934. Vincent Danos, Jean-Baptiste Joinet, and Harold Schellinx. LKQ and LKT: Sequent calculifor second order logic based upon dual linear decompositions of classical implication. In
Proceedings of the Workshop on Advances in Linear Logic , pages 211–224, 1995. Vincent Danos, Jean-Baptiste Joinet, and Harold Schellinx. A new deconstructive logic:Linear logic.
Journal of Symbolic Logic , 62(3):755–807, 1997. Kosta Do˘sen. Negative modal operators in intuitionistic logic.
Publications de l’InstitutMathématique , 35(49):3–14, 1984. Michael Dummett.
The Logical Basis of Metaphysics . Duckworth, 1991. Michael Dummett.
The Seas of Language . Oxford University Press, 1996. Jon Michael Dunn. Star and perp: Two treatments of negation.
Philisophical Perspectives ,5:331–357, 1993. Jon Michael Dunn and Chunlai Zhou. Negation in the context of gaggle theory.
Studia Logica ,80(2–3):235–264, 2005. Andrzej Filinski. Declarative continuations: An investigation of duality in programminglanguage semantics. In
Proc. CTCS , volume 389 of
LNCS , pages 224–249, 1989. Andrzej Filinski. Declarative continuations and categorical duality. Master’s thesis, DIKUComputer Science Department, University of Copenhagen, 1989. Peter T. Geach. Assertion.
The Philosophical Review , 74:449–465, 1965. Gerhard Karl Erich Gentzen. Untersuchungen über das logische schließen.
MathematischeZeitschrift , 39:176–210, 1934. Gerhard Karl Erich Gentzen. Untersuchungen über das logische schließen.
MathematischeZeitschrift , 39:405–431, 1935. Jean-Yves Girard. Linear logic.
Theoretical Computer Science , 50:1–102, 1987. Jean-Yves Girard. A new constructive logic: classic logic.
Mathematical Structures in Com-puter Science , 1(3):255–296, 1991. Nicolas D. Goodman. The logic of contradiction.
Zeitschrift für mathematische Logik undGrundlagen der Mathematik , 27:119–126, 1981. Rajeev Goré, Linda Postniece, and Alwen Tiu. Cut-elimination and proof-search for bi-intuitionistic logic using nested sequents. In
Advances in Modal Logic , pages 43–66, 2008. Timothy G. Griffin. A formulae-as-types notion of control. In
Proc. POPL , pages 47–58,1990. William. A. Howard. The formulae-as-types notion of construction. In
Essays on CombinatoryLogic, Lambda Calculus, and Formalism , pages 479–490. Academic Press, 1980. Lloyd Humberstone. The revival of rejective negation.
Journal of Philosophical Logic ,29(4):331–381, 2000. Nils Kürbis. Some comments on ian rumfitt’s bilateralism.
Journal of Philosophical Logic ,45(6):623–644, 2016. William Lovas and Karl Crary. Structural normalization for classical natural deduction.Manuscript, 2006. URL: . Storrs McCall. Contrariety.
Notre Dame Journal of Formal Logic , 8:121–138, 1967. David Nelson. Constructible falsity.
Journal of Symbolic Logic , 14(2):16–26, 1949. Michel Parigot. λµ -calculus: An algorithmic interpretation of classical natural deduction. In Proc. LPAR , volume 624 of
LNAI , pages 190–201, 1992. Arthur N. Prior. The runabout inference-ticket.
Analysis , 21(2):38–39, 1960. Greg Restall. Extending intuitionistic logic with subtraction, 1997. Greg Restall.
An Introduction to Substructural Logics . Routledge, 2000. Ian Rumfitt. “Yes” and “no”.
Mind , 109(477):781–823, 2000. Peter Selinger. Control categories and duality: On the categorical semantics of the lambda-mucalculus.
Mathematical Structures in Computer Science , 11(2):207–260, 2001. Yaroslav Shramko. Dual intuitionistic logic and a variety of negations: The logic of scientificresearch.
Studia Logica , 80(2–3):347–367, 2005. Luca Tranchini. Natural deduction for dual-intuitionistic logic.
Studia Logica , 100(3):631–648,2012. Yayoi Ueda and Kenichi Asai. Reinvestigation of symmetric lambda calculus. In
Proc. the4th DIKU-IST Joint Workshop on Foundations of Software , pages 10–26, 2011. Igor Urbas. Dual-intuitionistic logic.
Notre Dame Journal of Formal Logic , 37(3):440–451,1996. Philip Wadler. Call-by-value is dual to call-by-name. In
Proc. ICFP , pages 189–201, 2003. Philip Wadler. Call-by-value is dual to call-by-name, reloaded. In
Proc. RTA , volume 3467of
LNCS , pages 185–203, 2005. Heinrich Wansing. Connexive modal logic. In
Proc. AIML , pages 367–383, 2004. Heinrich Wansing. Proofs, disproofs, and their duals.
Advances in Modal Logic , 8:483–505,2010. Heinrich Wansing. Falsification, natural deduction and bi-intuitionistic logic.
Journal of Logicand Compututation , 26(1):425–450, 2016. atsuya Abe and Daisuke Kimura 19 (types) A ::= χ | ( A ∧ A ) | ( A ∨ A ) | ( ¬ A )(terms) M ::= x | h M, M i | h M i inl | h M i inr | [ K ] not | ( S ) .α (coterms) K ::= α | [ K, K ] | fst [ K ] | snd [ K ] | not h M i | x. ( S )(statements) S ::= M • K (syntactical objects) O ::= M | K | S Figure 10
The syntax of the dual calculus.
A The Call-by-Value Calculus of The Bilateral Lambda-Calculus
We introduce a call-by-value strategy to BLC and define a computationally consistent call-by-value calculus, which is equivalent to a sub-calculus of the call-by-value dual calculus byWadler [39] without negation. Consequently, the consistency of our call-by-value calculus isobtained from the consistency of the call-by-value dual calculus.
A.1 The Call-by-Value Dual Calculus
CbV-DC →← This subsection compares CbV-BLC with dual calculus invented by Wadler [38, 39], whichcorresponds to the classical sequent calculus on the notion of formulae-as-types. The call-by-value calculus of the dual calculus is known as a well established and computationallyconsistent system because it has the so-called
CPS-semantics [38] and is equivalent to thecall-by-value λµ -calculus [39]. We will show that our CbV-BLC is equivalent to a sub-calculus of the call-by-value dual calculus by giving an isomorphism between them.We first recall the dual calculus. Suppose that countable sets of type variables, termvariables, and coterm variables are given. Let χ , x , and α range over type variables, termvariables, and coterm variables, respectively. Types, terms, coterms, statements, and syn-tactical objects are summarized in Figure 10. Substitution [ M/x ] O of x in an expression O for M is defined in a standard component-wise and capture-avoiding manner. Similarly,substitution [ K/α ] O is also defined.A judgment has the form of Γ ⊢ ∆ | M : A , Γ | S ⊢ ∆ , or K : A | Γ ⊢ ∆ , where Γ is atype environment for terms that is a finite set of the form x : A and ∆ is a type environmentfor coterms that is a finite set of the form α : A . Figure 11 shows the inference rules.We then recall the call-by-value calculus of the dual calculus. The values and the call-by-value evaluation contexts are defined as follows:(values) W ::= x | h W, W i | h W i inl | h W i inr | [ K ] not | ( W • fst [ α ]) .α | ( W • snd [ α ]) .α (contexts) F ::= {−} | hF , M i | h W, Fi | hFi inl | hFi inr
Figure 12 presents the call-by-value equation = dcv of the dual calculus. In the call-by-value dual calculus, the implication type A → A with its term λx.M , coterm M @ K canbe defined as A → A ≡ ¬ ( A ∧ ¬ A ) λx.M ≡ [ x ′ . ( x ′ • fst [ x. ( x ′ • snd [ not h M i ])])] not M @ K ≡ not hh M, [ K ] not ii by using ∧ , ∨ , and ¬ as follows: Γ ⊢ ∆ | M : A K : A | Γ ⊢ ∆Γ | M • K ⊢ ∆Γ, x : A ⊢ ∆ | x : A α : A | Γ ⊢ ∆, α : AΓ ⊢ ∆ | M : A Γ ⊢ ∆ | M : A Γ ⊢ ∆ | h M , M i : A ∧ A K : A | Γ ⊢ ∆ fst [ K ] : A ∧ A | Γ ⊢ ∆ K : A | Γ ⊢ ∆ snd [ K ] : A ∧ A | Γ ⊢ ∆Γ ⊢ ∆ | M : A Γ ⊢ ∆ | h M i inl : A ∨ A Γ ⊢ ∆ | M : A Γ ⊢ ∆ | h M i inr : A ∨ A K : A | Γ ⊢ ∆ K : A | Γ ⊢ ∆ [ K , K ] : A ∨ A | Γ ⊢ ∆K : A | Γ ⊢ ∆Γ ⊢ ∆ | [ K ] not : ¬ A Γ ⊢ ∆ | M : A not h M i : ¬ A | Γ ⊢ ∆Γ | S ⊢ ∆, α : AΓ ⊢ ∆ | ( S ) .α : A x : A, Γ | S ⊢ ∆x. ( S ) : A | Γ ⊢ ∆ Figure 11
The inference rules of the dual calculus. ◮ Proposition A.1.
The following inferences are derivable:
Γ, x : A ⊢ ∆ | M : A Γ ⊢ ∆ | λx.M : A → A Γ ⊢ ∆ | M : A K : A | Γ ⊢ ∆M @ K : A → A | Γ ⊢ ∆ .Also, λx.M is a value and the following equations hold: ( β → ) ( λx.M ) • ( M @ K ) = dcv M • x. ( M • K )( η → ) W = dcv λx. (( W • ( x @ α )) .α ) . Proof.
The inference part is shown immediately by the definition of λx.M and M @ K . Theterm λx.M is a value, since it has the form [ K ] not . The equation ( β → ) is shown by thecase analysis of M .(a) If M is not a value, then the claim is obtained by using ( ν ∧ ):( λx.M ) • ( M @ K ) ≡ [ x ′ . ( x ′ • fst [ x. ( x ′ • snd [ not h M i ])])] not • not hh M , [ K ] not ii = dcv h M , [ K ] not i • x ′ . ( x ′ • fst [ x. ( x ′ • snd [ not h M i ])])= dcv M • x ′′ . ( h x ′′ , [ K ] not i • x ′ . ( x ′ • fst [ x. ( x ′ • snd [ not h M i ])]))= dcv M • x ′′ . ( h x ′′ , [ K ] not i • fst [ x. ( h x ′′ , [ K ] not i • snd [ not h M i ])])= dcv M • x ′′ . ( x ′′ • x. ([ K ] not • not h M i ))= dcv M • x. ([ K ] not • not h M i )= dcv M • x. ( M • K ) . atsuya Abe and Daisuke Kimura 21 ( β ∧ ) h W , W i • fst [ K ] = dcv W • K ( β ∧ ) h W , W i • snd [ K ] = dcv W • K ( β ∨ ) h W i inl • [ K , K ] = dcv W • K ( β ∨ ) h W i inr • [ K , K ] = dcv W • K ( β ¬ ) [ K ] not • not h M i = dcv M • K ( βR ) W • x. ( S ) = dcv [ W/x ] S ( βL ) ( S ) .α • K = dcv [ K/α ] S ( ηR ) M = dcv ( M • α ) .α if α is fresh( ηL ) K = dcv x. ( x • K ) if x is fresh( η ∧ ) W = dcv h ( W • fst [ α ]) .α, ( W • snd [ α ]) .α i if α is fresh( η ∨ ) K = dcv [ x. ( h x i inl • K ) , x. ( h x i inr • K )] if x is fresh( η ¬ ) W = dcv [ x. ( W • not h x i )] not if x is fresh( ζ ) F{ M } • K = dcv M • x. ( F{ x } • K ) if x is fresh Figure 12
The equations of the call-by-value dual calculus. (b) If M is a value (say W ), then( λx.M ) • ( W @ K ) ≡ [ x ′ . ( x ′ • fst [ x. ( x ′ • snd [ not h M i ])])] not • not hh W, [ K ] not ii = dcv h W, [ K ] not i • x ′ . ( x ′ • fst [ x. ( x ′ • snd [ not h M i ])])= dcv h W, [ K ] not i • fst [ x. ( h W, [ K ] not i • snd [ not h M i ])]= dcv W • x. ([ K ] not • not h M i )= dcv W • x. ( M • K ) . ◭ The but-not type A ← A with its term K $ M , coterm λα.K are also defined as A ← A ≡ A ∧ ¬ A K $ M ≡ h M, [ K ] not i λα.K ≡ x. ( x • snd [ not h ( x • fst [ K ]) .α i ]) . ◮ Proposition A.2.
The following inferences are derivable: Γ ⊢ ∆ | M : A K : A | Γ ⊢ ∆Γ ⊢ ∆ | K $ M : A ← A K : A | Γ ⊢ ∆, α : A λα.K : A ← A | Γ ⊢ ∆ .Also, K $ W is a value and the following equations hold: ( β ← ) ( K $ W ) • ( λα.K ) = dcv ( W • K ) .α • K ( η ← ) K = dcv λα. ( x. (( α @ x ) • K ))( ζ ← ) ( K $ M ) • K = dcv M • x. (( K $ x ) • K ) if x is fresh. Proof.
The inference part is shown immediately by the definition of K $ M and λα.K . Bythe definition, it is immediately checked that a term of the form K $ W is a value. The first equation ( β ← ) is shown as follows:( K $ W ) • ( λα.K ) ≡ h W, [ K ] not i • x. ( x • snd [ not h ( x • fst [ K ]) .α i ])= dcv h W, [ K ] not i • snd [ not h ( h W, [ K ] not i • fst [ K ]) .α i ]= dcv [ K ] not • not h ( W • K ) .α i = dcv ( W • K ) .α • K The second equation ( ζ ← ) is shown with ( ν ∧ ) as follows:( K $ M ) • K ≡ h M, [ K ] not i • K = dcv M • x. ( h x, [ K ] not i • K ) ≡ M • x. (( K $ x ) • K ) ◭ We define a sub-calculus CbV-DC →← of the call-by-value dual calculus that is obtainedby removing the negation type ¬ A and adding the implication and but-not types with theirsyntactical objects, typing rules, and equations as primitives. The calculus CbV-DC →← canbe roughly understood as a sub-calculus of the call-by-value dual calculus that forbids freeoccurrences of the negation connective and allows only the occurrences necessary to definethe implication and the but-not connectives. A.2 Equivalence between
CbV-BLC and
CbV-DC →← We define a translation ( − ) ♯ from CbV-BLC into CbV-DC →← . The translation is designedso that judgments in the bilateral natural deduction are mapped to sequents in the sequentcalculus including proofs.We assume that there exist variables x cst o and covariables α • o of CbV-DC →← for anyconstant expressions cst o and constant continuations • o of CbV-BLC, respectively.Term ( E ) ♯ , coterm ( C ) ♯ , and statement ( N ) ♯ are defined inductively as shown in Fig-ure 13. We show that the translation preserves typability. Let Cons + and Cons − be the setsof constants of the form cst o and • o , respectively. For any X ⊆ fin Cons + and Y ⊆ fin Cons − ,we respectively define( Π ) ♯X = Π ∪ { x cst o : o | cst o ∈ X } and ( Σ ) ♯Y = Σ ∪ { α • o : o | • o ∈ Y } . ◮ Proposition A.3. 1. Π ; Σ ⊢ + E : A implies ( Π ) ♯X ⊢ ( Σ ) ♯Y | ( E ) ♯ : A for any Cons + ( E ) ⊆ X and Cons − ( E ) ⊆ Y , Π ; Σ ⊢ − C : A implies ( C ) ♯ : A | ( Π ) ♯X ⊢ ( Σ ) ♯Y for any Cons + ( C ) ⊆ X and Cons − ( C ) ⊆ Y , and Π ; Σ ⊢ o N implies ( Π ) ♯X | ( N ) ♯ ⊢ ( Σ ) ♯Y for any Cons + ( N ) ⊆ X and Cons − ( N ) ⊆ Y . Proof.
The claims are shown by simultaneous induction on the derivation of the bilateral λ -calculus. ◭◮ Lemma A.4. 1.
E is a value of CbV-BLC if and only if ( E ) ♯ is a value of CbV-DC →← , and ([ V /x ] D ) ♯ ≡ [( V ) ♯ /x ]( D ) ♯ and ([ C /α ] D ) ♯ ≡ [( C ) ♯ /α ]( D ) ♯ . atsuya Abe and Daisuke Kimura 23 ( cst o ) ♯ ≡ x cst o ( x A ) ♯ ≡ x ( λ x A . E ) ♯ ≡ λx. ( E ) ♯ ( E E ) ♯ ≡ (( E ) ♯ • (( E ) ♯ @ α )) .α (( E , E )) ♯ ≡ h ( E ) ♯ , ( E ) ♯ i ( π ( E )) ♯ ≡ (( E ) ♯ • fst [ α ]) .α ( π ( E )) ♯ ≡ (( E ) ♯ • snd [ α ]) .α ( µa A .N ) ♯ ≡ (( N ) ♯ ) .α ( • o ) ♯ ≡ α • o ( a A ) ♯ ≡ α ( λa A . C ) ♯ ≡ λα. ( C ) ♯ ( C C ) ♯ ≡ x. ((( C ) ♯ $ x ) • ( C ) ♯ )(( C , C )) ♯ ≡ [( C ) ♯ , ( C ) ♯ ]( π ( C )) ♯ ≡ x. ( h x i inl • ( C ) ♯ )( π ( C )) ♯ ≡ x. ( h x i inr • ( C ) ♯ )( µ x A .N ) ♯ ≡ x. (( N ) ♯ )( h E | C i ) ♯ ≡ ( E ) ♯ • ( C ) ♯ Figure 13
A translation from CbV-BLC into CbV-DC →← Proof.
The claim (1) can be shown immediately.The former claim of (2) is shown by induction on S . Note that, by (1), ( E ) † is a valueif and only if ([ V /x ] E ) † is a value.The case of S ≡ cst o :([ V /x ] cst o ) † ≡ ( cst o ) † ≡ x cst o ≡ [( V ) † /x ] x cst o ≡ [( V ) † /x ]( cst o ) † The case of S ≡ x A :([ V /x ] x A ) † ≡ ( V ) † ≡ [( V ) † /x ] x ≡ [( V ) † /x ]( x A ) † The case of S ≡ x A , where x A x A :([ V /x ] x A ) † ≡ ( x A ) † ≡ x ≡ [( V ) † /x ] x ≡ [( V ) † /x ]( x A ) † The case of S ≡ π ( E ) is shown by using induction hypothesis.([ V /x ] π ( E )) † ≡ ( π ([ V /x ] E )) † ≡ (([ V /x ] E ) † • x ′ . ( x ′ • fst [ α ])) .α ≡ ([( V ) † /x ]( E ) † • x ′ . ( x ′ • fst [ α ])) .α by induction hypothesis ≡ [( V ) † /x ]((( E ) † • x ′ . ( x ′ • fst [ α ])) .α ) ≡ [( V ) † /x ]( π ( E ))The other cases S ≡ π ( E ), ( E , E ), λ x . E , E E , µa.N , • o , a A , π ( C ), π ( C ), ( C , C ), λa. C , C C , µ x .N , and h E | C i are also shown straightforwardly by using induction hypoth-esis.The latter claim of (2) is shown by induction on S .The case of S ≡ • o :([ C /α ] • o ) † ≡ ( • o ) † ≡ α • o ≡ [( C ) † /α ] α • o ≡ [( C ) † /α ]( • o ) † The case of S ≡ a A :([ C /α ] a A ) † ≡ ( C ) † ≡ [( C ) † /α ] α ≡ [( C ) † /α ]( a A ) † The case of S ≡ a A , where a A a A :([ C /α ] a A ) † ≡ ( a A ) † ≡ a ≡ [( C ) † /α ] a ≡ [( C ) † /α ]( a A ) † The case of S ≡ π ( C ) is shown by using induction hypothesis:([ C /α ] π ( C )) † ≡ ( π ([ C /α ] C )) † ≡ x. ( h x i inl • ([ C /α ] C ) † ) ≡ x. ( h x i inl • [( C ) † /α ]( C ) † ) by induction hypothesis ≡ [( C ) † /α ]( x. ( h x i inl • ( C ) † )) ≡ [( C ) † /α ]( π ( C )) † The other cases S ≡ cst o , x A , π ( E ), π ( E ), ( E , E ), λ x . E , E E , µa.N , π ( C ), ( C , C ), λa. C , C C , µ x .N , and h E | C i are also shown straightforwardly by using induction hypoth-esis. ◭◮ Theorem A.5. D = v D implies ( D ) ♯ = dcv ( D ) ♯ . Proof.
First, we define a coterm K -indexed translation ( − ) ♯K from contexts for expressionsof CbV-BLC into contexts of CbV-DC →← as follows:( {−} ) ♯K ≡ {−} • K ( V E ) ♯K ≡ ( E ) ♯x. (( V ) ♯ • ( x @ K )) ( E E ) ♯K ≡ ( E ) ♯ ( E ) ♯ @ K (( V, E )) ♯K ≡ ( E ) ♯x. ( h ( V ) ♯ ,x i• K ) (( E , E )) ♯K ≡ ( E ) ♯x. ( h x, ( E ) ♯ i• K ) ( π ( E )) ♯K ≡ ( E ) ♯ fst [ K ] ( π ( E )) ♯K ≡ ( E ) ♯ snd [ K ] . Next, we can immediately confirm( E{ E } ) ♯ • K = dcv ( E ) ♯ • x. (( E ) ♯K { x } ) ( ∗ )by induction on E .Finally, the theorem can be shown by the case analysis of = v and Lemma A.4.The case of ( λ x . E ) V = v [ V / x ] E . By using Lemma A.4 (1) and (2), we have(( λ x . E ) V ) ♯ ≡ ( λx. ( E ) ♯ • (( V ) ♯ @ α )) .α = dcv (( V ) ♯ • x. (( E ) ♯ • α )) .α = dcv ([( V ) ♯ / x ]( E ) ♯ • α ) .α ≡ (([ V / x ] E ) ♯ • α ) .α = dcv ([ V / x ] E ) ♯ . The case of λ x .V x = v V . By using Lemma A.4 (1), we have( λ x .V x ) ♯ ≡ λx. ((( V ) ♯ • ( x @ α )) .α ) = dcv ( V ) ♯ . The case of π (( V , V )) = v V . By using Lemma A.4 (1), we have( π (( V , V ))) ♯ ≡ ( h ( V ) ♯ , ( V ) ♯ i • fst [ α ]) .α = dcv (( V ) ♯ • α ) .α = dcv ( V ) ♯ . The case of π (( V , V )) = v V is shown similarly.The case of ( π ( V ) , π ( V )) = v V . By using Lemma A.4 (1), we have(( π ( V ) , π ( V ))) ♯ ≡ h (( V ) ♯ • fst [ α ]) .α, (( V ) ♯ • snd [ α ]) .α i = dcv ( V ) ♯ . The case of µa. h E | a i = v E . We have( µa. h E | a i ) ♯ ≡ (( E ) ♯ • α ) .α = dcv ( E ) ♯ . atsuya Abe and Daisuke Kimura 25 The case of h V | µ x .N i = v [ V / x ] N : By using Lemma A.4 (1) and (2), we have( h V | µ x .N i ) ♯ ≡ ( V ) ♯ • x. (( N ) ♯ ) = dcv [( V ) ♯ /x ]( N ) ♯ ≡ ([ V /x ] N ) ♯ . The case of hE{ E } | C i = v h E | µ x . hE{ x } | C ii . By using ( ∗ ). we have( hE{ E } | C i ) ♯ ≡ ( E{ E } ) ♯ • ( C ) ♯ = dcv ( E ) ♯ • x. (( E ) ♯ ( C ) ♯ { x } )= dcv ( E ) ♯ • x. (( x ) ♯ • x. (( E ) ♯ ( C ) ♯ { x } ))= dcv ( E ) ♯ • x. (( E{ x } ) ♯ • ( C ) ♯ ) ≡ ( h E | µ x . hE{ x } | C ii ) ♯ . The case of ( λa. C ) C = v [ C /a ] C . By using Lemma A.4 (2), we have(( λa. C ) C ) ♯ ≡ x. (( x $ ( C ) ♯ ) • λα. ( C ) ♯ ) = dcv x. (( x • ( C ) ♯ ) .α • ( C ) ♯ )= dcv x. ( x • [( C ) ♯ /α ]( C ) ♯ ) = dcv [( C ) ♯ /α ]( C ) ♯ ≡ ([ C /α ] C ) ♯ . The case of λa. C a = v C . We have( λa. C a ) ♯ ≡ λα. ( x. (( x $ α ) • ( C ) ♯ )) = dcv ( C ) ♯ . The case of π (( C , C )) = v C . We have( π (( C , C ))) ♯ ≡ x. ( h x i inl • [( C ) ♯ , ( C ) ♯ ]) = dcv x. ( x • ( C ) ♯ ) = dcv ( C ) ♯ . The case of π (( C , C )) = v C is also shown similarly.The case of ( π ( C ) , π ( C )) = v C . We have(( π ( C ) , π ( C ))) ♯ ≡ [ x. ( h x i inl • ( C ) ♯ ) , x. ( h x i inr • ( C ) ♯ )] = dcv ( C ) ♯ . The case of µ x . h x | C i = v C . We have( µ x . h x | C i ) ♯ ≡ x. ( x • ( C ) ♯ ) = dcv ( C ) ♯ . The case of h µa.N | C i = v [ C /a ]. By using Lemma A.4 (2), we have( h µa.N | C i ) ♯ ≡ (( N ) ♯ ) .α • ( C ) ♯ = dcv [( C ) ♯ /α ]( N ) ♯ ≡ ([ C /α ] N ) ♯ . ◭ We next define a translation ( − ) ♭ from CbV-DC →← into CbV-BLC. Expression ( M ) ♭ ,continuation ( K ) ♭ , and command ( S ) ♭ for any typable M , K , and S in CbV-DC →← aredefined inductively as shown in Figure 14.We show that this translation preserves typability. Let Γ be −−−−−−→ x cst o ′ : o ′ , −−→ x : A . Then wedefine ( Γ ) ♭ by −−−−→ x : + A . Similarly, we also define ( ∆ ) ♭ . ◮ Proposition A.6. 1. Γ ⊢ ∆ | M : A implies ( Γ ) ♭ ; ( ∆ ) ♭ ⊢ + ( M ) ♭ : A , K : A | Γ ⊢ ∆ implies ( Γ ) ♭ ; ( ∆ ) ♭ ⊢ − ( K ) ♭ : A , and Γ | S ⊢ ∆ implies ( Γ ) ♭ ; ( ∆ ) ♭ ⊢ o ( S ) ♭ . Proof.
The claims can be shown by simultaneous induction on the derivation of judgmentsof CbV-DC →← . ◭ We show that the translation ( − ) ♭ is an inverse of ( − ) ♯ up to = v as follows: ◮ Theorem A.7. 1. (( D ) ♯ ) ♭ = v D holds, and ( x cst o ) ♭ ≡ cst o ( x ) ♭ ≡ x A if x has a type A ( λx.M ) ♭ ≡ λ x A . ( M ) ♭ if λx.M has a type A → A ( K $ M ) ♭ ≡ µa. h ( M ) ♭ | a ( K ) ♭ i ( h E , E i ) ♭ ≡ (( E ) ♭ , ( E ) ♭ )( h M i inl ) ♭ ≡ µa. h ( M ) ♭ | π ( a ) i ( h M i inr ) ♭ ≡ µa. h ( M ) ♭ | π ( a ) i (( S ) .α ) ♭ ≡ µa A . ( S ) ♭ if α : A ( α • o ) ♭ ≡ • o ( α ) ♭ ≡ a A if α has a type A ( λα.K ) ♭ ≡ λa A . ( K ) ♭ if λα.K has a type A ← A ( M @ K ) ♭ ≡ µ x . h x ( M ) ♭ | ( K ) ♭ i ([ K , K ]) ♭ ≡ (( K ) ♭ , ( K ) ♭ )( fst [ K ]) ♭ ≡ x . ( h π ( x ) | ( K ) ♭ i )( snd [ K ]) ♭ ≡ x . ( h π ( x ) | ( K ) ♭ i )( x. ( S )) ♭ ≡ µ x A . ( S ) ♭ if x : A ( M • K ) ♭ ≡ h ( M ) ♭ | ( K ) ♭ i Figure 14
A translation from CbV-DC →← into CbV-BLC. (( O ) ♭ ) ♯ = dcv O holds. Proof. (1) is shown by induction on D . (2) is shown by induction on O . ◭◮ Lemma A.8. 1. M is a value of CbV-DC →← if and only if there exists a value V ofCbV-BLC such that V = v ( M ) ♭ , and ([ W/x ] O ) ♭ ≡ [( W ) ♭ / x ]( O ) ♭ and ([ K/α ] O ) ♭ ≡ [( K ) ♭ /a ]( O ) ♭ . Proof.
The claim (1) is shown immediately. The claims of (2) are shown by induction on O . ◭ For any F (contexts of CbV-DC →← ), we define ( F ) ♭ (contexts for expressions of CbV-BLC)as follows:( {−} ) ♭ ≡ {−} ( K $ F ) ♭ ≡ µa. h ( F ) ♭ | a ( K ) ♭ i ( h W, Fi ) ♭ ≡ (( W ) ♭ , ( F ) ♭ ) ( hF , M i ) ♭ ≡ (( F ) ♭ , ( M ) ♭ )( hFi inl ) ♭ ≡ µa. h ( F ) ♭ | π ( a ) i ( hFi inr ) ♭ ≡ µa. h ( F ) ♭ | π ( a ) i . ◮ Lemma A.9. 1. ( F{ M } ) ♭ = v ( F ) ♭ { ( M ) ♭ } holds, and h ( F ) ♭ { E } | C i = v h E | µ x . h ( F ) ♭ { x } | C ii holds. Proof.
The claims (1) and (2) are shown by induction on F . ◭◮ Theorem A.10. O = dcv O implies ( O ) ♭ = v ( O ) ♭ . Proof.
The claim is shown by the case analysis of = dcv .The case of ( β → ) is shown as follows.(( λx.M ) • ( M @ K )) ♭ ≡ h λ x . ( M ) ♭ | µ x . h x ( M ) ♭ | ( K ) ♭ ii = v h ( λ x . ( M ) ♭ )( M ) ♭ | ( K ) ♭ i = v h ( M ) ♭ | µ x . h ( λ x . ( M ) ♭ ) x | ( K ) ♭ ii = v h ( M ) ♭ | µ x . h ( M ) ♭ | ( K ) ♭ ii≡ ( M • x. ( M • K )) ♭ . atsuya Abe and Daisuke Kimura 27 The case of ( β ← ) is shown as follows.(( K $ M ) • ( λα.K )) ♭ ≡ h µa . h ( M ) ♭ | a ( K ) ♭ i | λa. ( K ) ♭ i = v h ( M ) ♭ | ( λa. ( K ) ♭ )( K ) ♭ i = v h ( M ) ♭ | [( K ) ♭ /a ]( K ) ♭ i≡ [( K ) ♭ /a ] h ( M ) ♭ | ( K ) ♭ i = v h µa. h ( M ) ♭ | ( K ) ♭ i | ( K ) ♭ i≡ (( M • K ) .α • K ) ♭ . The case of ( β ∧ ). By using Lemma A.8 (1), We have( h W , W i • fst [ K ]) ♭ ≡ h (( W ) ♭ , ( W ) ♭ ) | µ x . h π ( x ) | ( K ) ♭ ii = v h π ((( W ) ♭ , ( W ) ♭ )) | ( K ) ♭ i = v h ( W ) ♭ | ( K ) ♭ i ≡ ( W • K ) ♭ . The case of ( β ∧ ) is shown similarly.The case of ( β ∨ ). We have( h W i inl • [ K , K ]) ♭ ≡ h µa. h ( W ) ♭ | π ( a ) i | (( K ) ♭ , ( K ) ♭ ) i = v h ( W ) ♭ | π ((( K ) ♭ , ( K ) ♭ )) i = v h ( W ) ♭ | ( K ) ♭ i ≡ ( W • K ) ♭ . The case of ( β ∨ ) is shown similarly.The case of ( βR ). By using Lemma A.8 (1) and (2), We have( W • x. ( S )) ♭ ≡ h ( W ) ♭ | µ x . ( S ) ♭ i = v [( W ) ♭ / x ]( S ) ♭ ≡ ([ W/x ] S ) ♭ . The case of ( βL ). By using Lemma A.8 (2), We have(( S ) .α • K ) ♭ ≡ h µa. ( S ) ♭ | ( K ) ♭ i = v [( K ) ♭ /a ]( S ) ♭ ≡ ([ K/α ] S ) ♭ . The case of ( η → ) is shown by using Lemma A.8 (1).( λx. (( W • ( x @ α )) .α )) ♭ ≡ λ x .µa. h ( W ) ♭ | µ x . h x x | a ii = v λ x .µa. h ( W ) ♭ x | a i = v λ x . ( W ) ♭ x = v ( W ) ♭ . The case of ( η ← ).( λα. ( x. (( α $ x ) • K ))) ♭ ≡ λa.µ x . h µa . h a a | x i | ( K ) ♭ i = v λa.µ x . h ( K ) ♭ a | x i = v λa. ( K ) ♭ a = v ( K ) ♭ . The case of ( η ∧ ). Note that (( W • fst [ α ]) .α ) ♭ ≡ π (( W ) ♭ ) by Lemma A.8 (1). Hencewe have( h ( W • fst [ α ]) .α, ( W • snd [ α ]) .α i ) ♭ = v ( π (( W ) ♭ ) , π (( W ) ♭ )) = v ( W ) ♭ . The case of ( η ∨ ). Note that ( x. ( h x i inl • K )) ♭ = v π (( K ) ♭ ). Hence we have([ x. ( h x i inl • K ) , x. ( h x i inr • K )]) ♭ = v ( π (( K ) ♭ ) , π (( K ) ♭ )) = v ( K ) ♭ . The cases of ( ηR ) and ( ηL ) are shown immediately.The case of ( ζ ) is shown by using Lemma A.9:( F{ M } • K ) ♭ ≡ h ( F{ M } ) ♭ | ( K ) ♭ i = v h ( F ) ♭ { ( M ) ♭ } | ( K ) ♭ i = v h ( M ) ♭ | µ x . h ( F ) ♭ { x } | ( K ) ♭ ii = v ( M • x. ( F{ x } • K )) ♭ . ◭ The equivalence between CbV-DC →← and CbV-BLC clarifies an essential differencebetween the full dual calculus and the bilateral λ -calculus. The negation of the dual calculusis not involutive, since ¬ ¬ A is not isomorphic to A . The dual calculus actually contains theinvolutive duality not as the object-level negation but as the meta-level operation such as theantecedent and succedent duality of the sequent calculus. On the other hand, the negationis represented using inversions of polarities in the bilateral λ -calculus. By definition, thenegation is involutive. B Proofs
Proof of Proposition 2.2.
The proposition holds as follows:+ A → A [+ A ]+ A [ − A ] ⊥− A − A ← A − A → A + A − A → A − A + A ← A + A ← A + A + A ← A − A − A → A [+ A ] − A ← A [ − A ] − A ⊥ + A + A → A ◭ Proof of Proposition 2.4.
1) It suffices to use (Non-contradiction) and (Reductio) with( ∧ -E +0 ), ( ∧ -E +1 ), ( ∧ -I + ), ( ∨ -E − ), ( ∨ -I − ), and ( ∨ -I − ) as follows: − A i [+ A ∧ A ]+ A i ⊥− A ∧ A − A ∧ A [ − A ]... A [ A ∗ ] ⊥ + A [ − A ]... A [ A ∗ ] ⊥ + A + A ∧ A ⊥A atsuya Abe and Daisuke Kimura 29 + A ∨ A [+ A ]... A [ A ∗ ] ⊥− A [+ A ]... A [ A ∗ ] ⊥− A − A ∨ A ⊥A + A i [ − A ∨ A ] − A i ⊥ + A ∨ A where i = 0 , → -E + ), ( → -I + ), ( ← -E − ), and( ← -I − ) as follows:[+ A → A ] + A + A − A ⊥− A → A − A → A [+ A ] [ − A ] ⊥ + A + A → A ⊥ + A − A → A [+ A ]+ A → A ⊥− A [ − A ← A ] − A − A + A ⊥ + A ← A + A ← A [ − A ] − A ← A ⊥ + A + A ← A [+ A ] [ − A ] ⊥− A − A ← A ⊥− A ◭ Proof of Theorem 5.1.
The proposition holds because the following: Π ′ ; Σ ′ ⊢ + E : A → A Π ′ ; Σ ′ ⊢ + x : A Π ′ ; Σ ′ ⊢ + Ex : A Π ′ ; Σ ′ ⊢ − a : A Π, x : A ; Σ, a : A ⊢ o h Ex | a i Π ; Σ, a : A ⊢ − µ x . h Ex | a i : A Π ⊢ − λa.µ x . h Ex | a i : A ← A Π ′ ; Σ ′ ⊢ + x : A Π ′ ; Σ ′ ⊢ − C : A ← A Π ′ ; Σ ′ ⊢ − a : A Π ′ ; Σ ′ ⊢ − C a : A Π, x : A ; Σ, a : A ⊢ o h x | C a i Π, x : A ; Σ ⊢ + µa. h x | C a i : A Π ; Σ ⊢ + λ x .µa. h x | C a i : A → A are derived where Π ′ and Σ ′ are Π, x : A ; Σ, a : A , respectively., respectively.