<<

arXiv:2101.12607v1 [cs.LO] 29 Jan 2021 (( ymti abaCluu orsodn to Corresponding Lambda-Calculus Symmetric A asy Abe Tatsuya aeh skd o h rifldsusos hc clarifi which discussions, fruitful the for Tsukada Takeshi ehooy -71Tuaua aahn,Cia 275-0016 Chiba, Narashino, Tsudanuma, 2-17-1 Technology, ucino h type the of function A Acknowledgements Japan h type the A type htcl/ctksa xrsino h ye( type the of expression an takes call/cc that [email protected] a edcddt ucin yoperators by functions to decoded be can eateto nomto cec,Th nvriy 2-2-1 University, Toho Science, Information of Department Kimura Daisuke [email protected] type otnain r ymti.Fntosaenurl hti that neutral, like are and Functions expressions symmetric. are continuations i aclscnit fexpressions of consists calculus His A theory ewrsadphrases and Keywords Classification Subject ACM 2012 otaeTcnlg n rica nelgneRsac L Research Intelligence Artificial and Technology Software Deduction Natural Bilateral Negation-Free the euto,poftertcsmnis u-o connectiv but-not , proof-theoretic deduction, primitive vr yal ucinhsda ye.Tu,tedaiyo f of the du Thus, the types. justify dual to has function calculus typable transf our every mutual in that definable show cal We are call-value continuations a Wadler. includes by invented it calculus as powerful dual also but paraconsist simple and only t intuitionistic Function in connectives polarity. but-not negative and with continuati formulae calculus, but our formulae In of semantics. proof-theoretic calc negation- the in the of to principle a corresponding calc as lambda-calculus adopted symmetric his but calculus In operators. the primitive in duality. derived using have continuations which and functions expressions and symmetric, consist are lambda-calculus symmetric a constructed Filinski Introduction 1 A 0 1 0 iisicntutdasymmetric a constructed Filinski h ult lostecl-ihcretcniuto op call-with-current- the allows duality The a ergre safnto rmcniutoso h type the of continuations from function a as regarded be can n eoe ucino h ye( type the of function a becomes and → A A Abstract 0 0 A hspoet ffntosi called is functions of property This . → A 1 ic h ult ffntosi dpe sa as adopted is functions of duality the since ) 0 A oee,i h symmetric the in However, . → 1 n eun nepeso ftetype the of expression an returns and A 0 ) h uhrtak oueFkd,Tsk iasi etr K Kentaro Hiraishi, Tasuku Fukuda, Yosuke thanks author The → ymti abacluu,frua-stps duality, formulae-as-types, lambda-calculus, symmetric A A 0 0 nataiinlitrrtto ffnto ye,tetyp the types, function of traditional a In . → A 1 hoyo computation of Theory rmepesoso h type the of expressions from p F E q λ continuations , and cluu ae ntedaiyo ucin 1,13]. [12, functions of duality the on based -calculus A λ cluu,cl/ctksacniuto ftetype the of continuation a takes call/cc -calculus, 0 x E F → A duality y and epciey xrsin n continuations and Expressions respectively. , 0 A → 1 ) ,cniuto,call-by-value continuation, e, → A n ois epciey u aclsi not is calculus Our respectively. , ent . ntpsaerpeetda o negations not as represented are types on which continuations and expressions of ing dcnrbtoso h rsn paper. present the of contributions ed h operators The . A → 1 C rentrlddcinbsdbilateralism based deduction natural free brtr,CiaIsiueof Institute Chiba aboratory, uu orsodn otecall-by-value the to corresponding culus hti,tedaiyo ucin snot is functions of duality the is, That A ) ls nti ae,w rps simple a propose we paper, this In ulus. 0 psaerpeetda h implication the as represented are ypes iaa uaah,Cia 274-8510, Chiba, Funabashi, Miyama, Japan , n functions and , principle oi;Ter fcomputation of Theory ; . lt ffntos eas hwthat show also We functions. of ality → nto sdrvdfo bilateralism. from derived is unction 0 hc ae nepeso fthe of expression an takes which , rain ewe xrsin and expressions between ormations ls ucin a eecddto encoded be can functions ulus, A ,fntoscnb noe to encoded be can functions s, rtr(alc)t aeatype a have to (call/cc) erator 0 A n eun nepeso of expression an returns and 0 fhscalculus. his of A oepesoso h type the of expressions to 1 ocniutoso the of continuations to p F · q iaeaim natural bilateralism, xrsin and Expressions . , x · y , · and , kci and ikuchi, means e → Type · are 2 A Symmetric Lambda-Calculus Corresponding to a Bilateral

The duality of functions seems to be one of the most significant reasons that it is possible for the symmetric λ-calculus to have the provability of , because the type ((A0 → A1) → A0) → A0 corresponds to the Peirce formula on the formulae-as-types notion [4, 22], which strengthens the λ-calculus corresponding to the having the 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 idea that meanings of logical connectives are given by the contexts in which the logical connectives occur. In this idea, a meaning of a is considered to be defined by its introduction rule of a natural deduction and its elimination rule is naturally determined to be in harmony with the introduction rule. Rumfitt suggested that the original natural deduction invented by Gentzen [15, 16] is not harmonious, and constructed a natural deduction based on bilateralism [32]. Within the notion of bilateralism, provability is not defined for a plain formula A but a formula with polarity + 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. Bilateralism does not permit anything neutral and forces everything to have either positive or negative polarity. Rumfitt showed that a natural deduction of classical logic that is constructed on unilateralism can be reconstructed on bilateralism. In this paper, we construct a symmetric λ-calculus corresponding to the negation-free bilateral natural deduction. A distinguishing aspect of our calculus is that we adopt the but- not connective as a constructor for functions between continuations. Another distinguishing aspect is that reductio ad absurdum is a construction of a configuration also known as a command. 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 invented by Wadler [38, 39] obtained by adding the but-not connective and removing the negation connective. The equivalence is formally obtained by giving mutual translations between these 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-types notion. The translations clarify a significant difference between the bilateral natural deduction and the sequent calculus. The negation of the dual calculus is not involutive, that is, ¬ ¬ A is not 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 classical sequent-calculus framework, there exists no inference rule to operate the involutive duality in the calculus. In the bilateral λ-calculus, the negation is represented using inversions of polarities, and is involutive by definition. A symmetric λ-calculus which was constructed by Lovas and Crary is the only similar calculus based on bilateralism [25]. However, they adopted the negation connective ¬ as a primitive logical connective, and function type → is defined as syntactic sugar. In Lovas and Crary’s calculus it is necessary to use reductio ad absurdum, although it is generally easy to define functions between expressions. This means that it is not easy to define a sub-calculus corresponding to the minimal logic. Our calculus does not include the negation connective. Our work claims that the negation connective is not necessary but negative polarity 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- Tatsuya Abe and Daisuke Kimura 3

[A] [¬ A] . . . . A ¬ A (⊥-I) ⊥ (⊥-E) ⊥ (¬-I) ⊥ (¬-E) ⊥ A ¬ A A

[A0] . . A1 A0 → A1 A0 A0 A1 A0 ∧ A1 (→-I) (→-E) (∧-I) (∧-E0) A0 → A1 A1 A0 ∧ A1 A0

[A0] [A1] . . . . A0 ∧ A1 A0 A1 A0 ∨ A1 A2 A2 (∧-E1) (∨-I0) (∨-I1) (∨-E) A1 A0 ∨ A1 A0 ∨ A1 A2

Figure 1 Natural deduction NDprop. 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 typable function has dual types about expressions and continuations. We clarify that bilateralism naturally raises the duality of functions. Finally, we note that one of our goals is to construct a simple and powerful calculus in which the duality of functions is definable. We do not intend to clarify anything unknown in classical logic by assigning λ-terms to proofs, as seen in existing work in structural proof theory. Actually, our calculus is a sub-calculus of a natural of the dual calculus. The remainder of this paper is organized as follows: In Section 2, we introduce bilateral natural 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 natural deduction. 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 conclude the paper by identifying future research directions.

2 Bilateral Natural Deductions

In this section, we introduce bilateralism, which was proposed by Rumfitt [32], and define a few 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 of formulae. The connective power of ¬ is stronger than that of ∧, ∨, and →. The connective powers of ∧ and ∨ are stronger than that of →. We omit parentheses when the renders them obvious. We recall the natural deduction invented by Gentzen [15, 16] and consider its proposi- tional fragment NDprop, as shown in Figure 1. At each inference rule, formulae or ⊥ above a line are assumptions and a formula or ⊥ below a line is a conclusion. A derivation is a . tree that has exactly one root. . denotes a transitive connection between a leaf and 4 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. A judgment 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 introduction rules 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 consider a logical connective tonk which was proposed by Prior [29]. Its introduction rule (tonk-I) and elimination rule (tonk-E) are as follows: A A tonk A 0 (tonk-I) 0 1 (tonk-E) . A0 tonk A1 A1 A pair of contiguous introduction and elimination rules is called harmonious if the residue after removing the pair is also a derivation. Such a procedure is called normalization. In this section, we let denote the normalization procedure. The pair of (tonk-I) and (tonk-E) is not harmonious because the right-hand side of the following relation is not a derivation:

A0 (tonk-I) A0 A0 tonk A1 . (tonk-E) A1 A1

Rumfitt suggested that NDprop also does not enjoy the harmony condition and proposed a notion of bilateralism to construct a harmonious natural deduction. Bilateralism is based on two notions of acceptance and rejection of formulae. They are also 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. A derivation 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-) and (Reductio) which are called coordination prin- ciples and defined inference rules of logical connectives, as shown in Figure 2, which are naturally derived from the standard boolean semantics. In this paper, we call this logic a bilateral natural deduction Bi-NDprop. NDprop is based on the notion of unilateralism rather than bilateralism. A derivation of root A in NDprop means that A is accepted. There exists the following relation between NDprop and Bi-NDprop:

2.1 (Rumfitt [32]). For any n ≥ 0, A0,...,An−1 ⊢ A is provable in NDprop + A0,..., + An−1 ⊢ + A is provable in Bi-NDprop. 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 also criticized in a paper [24]. That is, bilateralism is called a work in progress. However, the subject of this paper is not a justification of bilateralism in proof-theoretic semantics. The natural deduction Bi-NDprop is not symmetric. We extend the language by adding a 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 A0 ← A1 is logically equivalent to A0 ∧ ¬ A1 in classical logic. The but-not connective is also written as pseudo-difference Tatsuya Abe and Daisuke Kimura 5

[A] . . A A∗ (Non-contradiction) ⊥ (Reductio) ⊥ A∗

− A + ¬ A + A − ¬ A (¬-I ) (¬-E ) (¬-I−) (¬-E−) + ¬ A + − A + − ¬ A + A

+ A0 − A1 [+ A0] (→-I−) . − A0 → A1 . + A 1 (→-I ) − A0 → A1 + A → A + (→-E−0) 0 1 + A0 + A → A + A 0 1 0 (→-E ) − A0 → A1 + A + (→-E−1) 1 − A1 + A + A 0 1 (∧-I ) − A0 − A1 + A ∧ A + (∧-I−0) (∧-I−1) 0 1 − A0 ∧ A1 − A1 ∧ A1

+ A0 ∧ A1 + A0 ∧ A1 (∧-E+0) (∧-E+1) [− A0] [− A1] + A0 + A1 . . . . − A ∧ A A A + A0 + A1 0 1 (∧-E ) (∨-I+0) (∨-I+1) A − + A0 ∨ A1 + A0 ∨ A1

− A0 − A1 [+ A0] [+ A1] (∨-I−) . . − A0 ∨ A1 . .

+ A0 ∨ A1 A A − A0 ∨ A1 − A0 ∨ A1 (∨-E+) (∨-E−0) (∨-E−1) A − A0 − A1

Figure 2 Rumfitt’s natural deduction Bi-NDprop.

· − [19, 37], subtraction − [30], difference − [3], and co-implication −< [20, 42]. The but- not connective is a primitive connective in , whereas → is a primitive connective in because A0 → A1 is not logically equivalent to ¬ A0 ∨ A1 in intuitionistic logic. In paraconsistent logic, sequent calculus consists of sequents Γ ⊢ ∆, where Γ is empty or a singleton formula, whereas intuitionistic logic can be defined by sequents Γ ⊢ ∆, where ∆ is empty or a singleton formula. ← We define a natural deduction Bi-NDprop by adding inference rules, as shown in Figure 3. ← The connectives → and ← are symmetrically located in Bi-NDprop as follows:

2.2. + A0 → A1 ⊢ − A0 ← A1, − A0 → A1 ⊢ + A0 ← A1, + A0 ← A1 ⊢ ← − A0 → A1, and − A0 ← A1 ⊢ + A0 → A1 are provable in Bi-NDprop. Proof. See Appendix . ◭

Let L0 and L1 be languages such that L0 ⊆ L1, and S0 and S1 be logics on the languages L0 and L1, respectively. We define S1 as an extension of S0 if any formula ϕ that is provable in S0 is also provable in S1. We define that an extension S1 of S0 is conservative if any formula ϕ on the language L0 that is provable in S1 is also provable in S0.

← ◮ Proposition 2.3. Bi-NDprop is a conservative extension of Bi-NDprop. 6 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

+ A0 − A1 + A0 ← A1 + A0 ← A1 (←-I+) (←-E+0) (←-E+1) + A0 ← A1 + A0 − A1

[− A1] . . − A0 − A0 ← A1 − A1 (←-I−) (←-E−) − A0 ← A1 − A0

Figure 3 Inference rules for ←.

Proof. It is obvious because Bi-NDprop is complete to the standard two-value semantics, ← ◭ and Bi-NDprop is sound to the semantics. ← Bi-NDprop and Bi-NDprop include sub-logics as follows:

◮ Proposition 2.4. 1. The inference rules (∧-I−0), (∧-I−1), (∧-E−), (∨-I+), (∨-E+0), and (∨-E+1) are derivable in Bi-NDprop, and 2. The inference rules (→-I−), (→-E−0), (→-E−1), (←-I+), (←-E+0), and (←-E+1) are ← derivable in Bi-NDprop. Proof. See Appendix B. ◭

3 Derivation Trees with Proofs in Their Nodes

In this section, we introduce derivation trees with proofs in their nodes to mediate between natural deductions and λ-calculi introduced in Sections 2 and 4, respectively. ← We add proofs to polarized formulae in the ¬-free fragment of Bi-NDprop, that is, the (Non-contradiction), (Reductio), (→-I+), (→-E+), (∧-I+), (∧-E+0), (∧-E+1), (∨-I−), (∨-E−0), (∨-E−1), (←-I+), (←-E+0), (←-E+1), (←-I−), and (←-E−) fragment, to construct a 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 that nodes t: + A and t: − A in the natural deduction respectively denote that t is a proof for acceptance and rejection of A. We also define that a node T : ⊥ in the natural deduction denotes that T is a proof for contradiction. Node λα.t: + A0 → A1 denotes that λα.t is a proof for acceptance of A0 → A1 if α is a proof variable for acceptance of A0 and t is a proof for acceptance of A1. Node λα.t: − A0 ← A1 denotes that λα.t is a proof for acceptance of A0 → A1 if α is a proof variable for acceptance of A1 and t is a proof for acceptance of A0. Node t0t1 : + A1 denotes that t0t1 is a proof for acceptance of A1 if t0 is a proof for acceptance of A0 → A1 and t1 is a proof for acceptance of A0. Node t0t1 : − A0 denotes that t0t1 is a proof for rejection of A1 if t0 is a proof for rejection of A0 ← A1 and t1 is a proof for rejection of A1. Node (t0,t1): + A0 ∧ A1 denotes that (t0,t1) is a proof for acceptance of A0 ∧ A1 if t0 is a proof for acceptance of A0 and t1 is a proof for acceptance of A1. Node (t0,t1): − A0 ∨ A1 denotes that (t0,t1) is a proof for rejection of A0 ∨ A1 if t0 is a proof for rejection of A0 and t1 is a proof for rejection of A1. Node π0(t): + A0 denotes that π0(t) is a proof for acceptance of A0 if t0 is a proof for acceptance of A0 ∧ A1. Node π0(t0): − A0 denotes that π0(t0) is a proof for rejection of A0 if t0 is a proof for rejection of A0 ∨ A1. Nodes π1(t0): + A1 and π1(t0): − A1 are similar. Tatsuya Abe and Daisuke Kimura 7

(proofs) t ::= c | α | λα.t | tt | (t,t) | π0(t) | π1(t) | µα.T T ::= ht | ti

Figure 4 Proofs of the negation-free natural deduction.

(types) A ::= o | (A → A) | (A ← A) | (A ∧ A) | (A ∨ A) o A A A (expressions) E ::= cst | x | λx .E | EE | (E, E) | π0(E) | π1(E) | µa .N o A A A (continuations) C ::= • | a | λa .C | CC | (C, C) | π0(C) | π1(C) | µx .N (commands) N ::= hE | Ci (syntactical objects) D ::= E | C | N

Figure 5 The bilateral lambda-calculus BLC.

Node ht0 | t1i: ⊥ denotes that ht0 | t1i is a proof of contradiction if t0 is a proof for acceptance of A and t1 is a proof for rejection of A0. Node µα.T : + A denotes that µα.T is a proof for acceptance of A if α is a proof variable for rejection of A and T is a proof of contradiction. Node µα.T : − A denotes that µα.T is a proof for rejection of A if α is a proof variable for acceptance of A and T is a proof of contradiction. We formally define the set of proofs in a Curry-style bilateral λ-calculus, as shown in Figure 4 where c ranges over constants for adding logical . Let Γ be a set of nodes. Judgment Γ ⊢ t: + A denotes that t is a proof for acceptance of 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 Γ .

4 Bilateral Lambda-Calculi

In this section, we construct a Church-style symmetric λ-calculus based on bilateralism and define a call-by-value sub-calculus.

4.1 Definition and Basic Properties

We respectively call proofs for acceptance and rejection expressions and continuations. We distinguish 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 syntactical objects as shown in Figure 5. Expression csto denotes a constant. Expression xA denotes an expression variable. Ex- A A pression λx .E denotes a λ-abstraction of expression E by x . Expression E0E1 denotes an application of function E0 to expression E1. Expression (E0, E1) denotes a pair of expressions E0 and E1. Expressions π0(E) and π1(E) are projections. Continuations are defined symmetrically to expressions. Continuation •o denotes the unique constant denoting a continuation of o. By the definition based on bilateralism, the calculus is involutive on the notion of polarities. 8 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

Γ ⊢ E : A Γ ⊢ C : A + − (Non-contradiction) Γ ⊢ o hE | Ci

Π; Σ,a: A ⊢ o N Π; Σ, x : A ⊢ o N A (Reductio+) A (Reductio−) Π; Σ ⊢+ µa .N : A Π; Σ ⊢− µx .N : A

o (Constant+) o (Constant−) Γ ⊢+ cst : o Γ ⊢− • : o

(Identity ) (Identity ) A A + A A − Γ, x : A ⊢+ x : A Γ,a : A ⊢− a : A

Π, x : A0; Σ ⊢+ E : A1 Π; Σ,a: A1 ⊢− C : A0 (→-I+) (←-I−) A0 A1 Π; Σ ⊢+ λx .E : A0 → A1 Π; Σ ⊢− λa .C : A0 ← A1

Γ ⊢+ E0 : A0 → A1 Γ ⊢+ E1 : A0 Γ ⊢− C0 : A0 ← A1 Γ ⊢− C1 : A1 (→-E+) (←-E−) Γ ⊢+ E0E1 : A1 Γ ⊢− C0C1 : A0

Γ ⊢+ E0 : A0 Γ ⊢+ E1 : A1 Γ ⊢− C0 : A0 Γ ⊢− C1 : A1 (∧-I+) (∨-I−) Γ ⊢+ (E0, E1): A0 ∧ A1 Γ ⊢− (C0, C1): A0 ∨ A1

Γ ⊢+ E : A0 ∧ A1 Γ ⊢− C : A0 ∨ A1 (∧-E+0) (∨-E−0) Γ ⊢+ π0(E): A0 Γ ⊢− π0(C): A0

Γ ⊢+ E : A0 ∧ A1 Γ ⊢− C : A0 ∨ A1 (∧-E+1) (∨-E−1) Γ ⊢+ π1(E): A1 Γ ⊢− π1(C): A1

Figure 6 A type system of BLC.

Commands are first-class citizens. A command can be abstracted by expression variable xA or continuation variable aA. Command N abstracted by aA is expression µaA.N. A command abstracted by xA is continuation µxA.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 ∈ Σ }⊢⊥, respectively The type system contains rules about commands. Rule (Non-contradiction) defines a command from an expression and a continuation. Additionally, even if a command occurs in a 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. Tatsuya Abe and Daisuke Kimura 9

(values) V ::= cst | x | λx.E | (V, V ) | π0(V ) | π1(V ) | µa.hV | π0(a)i | µa.hV | π1(a)i

(contexts) E ::= {−} | EE | V E | (E, E) | (V, E) | π0(E) | π1(E) .

Figure 7 Values and contexts of CbV-BLC.

Substitutions [E/x] and [C/a] (denoted by θ) are inductively defined in a standard component-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 continuation variables in E and C, respectively. The bilateral λ-calculus is well designed. The so-called weakening holds as follows:

◮ Proposition 4.1. 1. Π; Σ ⊢+ E : A0 implies Π, x : A; Σ ⊢+ E : A0 and Π; Σ,a: A ⊢+ E : A0, 2. Π; Σ ⊢− C : A0 implies Π, x : A; Σ ⊢− C : A0 and Π; Σ,a: A ⊢− C : A0, and 3. Π; Σ ⊢ 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 : A0; Σ ⊢+ E : A1 and Π; Σ ⊢+ E : A0. Then, Π; Σ ⊢+ ′ [E/x]E : A1 holds. 2. Assume Π, x : A0; Σ ⊢− C : A1 and Π; Σ ⊢+ E : A0. Then, Π; Σ ⊢− [E/x]C : A1 holds. 3. Assume Π, x : A; Σ ⊢ o N and Π; Σ ⊢+ E : A. Then, Π; Σ ⊢ o [E/x]N holds. 4. Assume Π; Σ,a: A0 ⊢+ E : A1 and Π; Σ ⊢− C : A0. Then, Π; Σ ⊢+ [C/a]E : A1 holds. ′ ′ 5. Assume Π; Σ,a: A0 ⊢− C : A1 and Π; Σ ⊢− C : A0. Then, Π; Σ ⊢− [C/a]C : A1 holds.

6. 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 expression and continuation has a unique positive and negative type, respectively, as follows:

◮ Proposition 4.3. 1. If Γ ⊢+ E : A0 and Γ ⊢+ E : A1, then A0 and A1 are the same. 2. If Γ ⊢− C : A0 and Γ ⊢− C : A1, then A0 and A1 are the same.

Proof. The proposition holds immediately from the definition of the type system. ◭

4.2 The Call-by-Value Lambda-Calculus 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-value evaluation 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 by filling the hole of E with an expression E is denoted by E{E}. The equations of CbV-BLC are shown in Figure 8. Although careful readers will wonder why π0(V ) and π1(V ) are values, they can often be 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.hV | π0(a)i and µa.hV | π1(a)i 10 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

(λx.E)V =v [V/x]E (λa.C0)C1 =v [C1/a]C0

λx.V x =v V if x 6∈ fev(V ) λa.Ca =v C if a 6∈ fcv(C)

π0((V0, V1)) =v V0 π0((C0, C1)) =v C0

π1((V0, V1)) =v V1 π1((C0, C1)) =v C1

(π0(V ), π1(V )) =v V (π0(C), π1(C)) =v C

µa.hE | ai =v E if a 6∈ fcv(E) µx.hx | Ci =v C if x 6∈ fev(C)

hV | µx.Ni =v [V/x]N hµa.N | Ci =v [C/a]N

hE{E} | Ci =v hE | µx.hE{x} | Cii if x is fresh

Figure 8 The equations of CbV-BLC.

(types) A ::= χ | (A ∧ A) | (A ∨ A) | (¬ A) (terms) M ::= x | hM,Mi | hMiinl | hMiinr | [K]not | (S).α (coterms) K ::= α | [K,K] | fst[K] | snd[K] | nothMi | 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.hE | π0(a)i inr(E) ≡ µa.hE | π1(a)i case(E, x0.E0, x1.E1) ≡ µa.hE | (µx0.hE0 | ai, µx1.hE1 | ai)i

Γ ⊢+ E : A0 Γ ⊢+ E : A1

Γ ⊢+ inl(E): A0 ∨ A1 Γ ⊢+ inr(E): A0 ∨ A1

Π; Σ ⊢+ E : A0 ∨ A1 Π, x0 : A0; Σ ⊢+ E0 : A Π, x1 : A1; Σ ⊢+ E1 : A

Π; Σ ⊢+ case(E, x0.E0, x1.E1): A

hcase(inl(V ), x0.E0, x1.E1) | Ci

≡ hµa.hµa2.hV | π0(a2)i | (µx0.hE0 | ai, µx1.hE1 | ai)i | Ci

=v hµa2.hV | π0(a2)i | (µx0.hE0 | Ci, µx1.hE1 | Ci)i

=v hV | π0((µx0.hE0 | Ci, µx1.hE1 | Ci))i =v hV | µx0.hE0 | Cii =v h[V/x0]E0 | Ci .

The calculus CbV-BLC is CbV-DC→← which is a sub-calculus of an extension with the but-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 that the 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 from CbV-BLC. Consequently, the of our call-by-value calculus is obtained from the consistency of the call-by-value dual calculus. Specifically, we can obtain the following: Tatsuya 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: ♯ ♯ D0 =v D1 implies (D0) =dcv (D1) , ♭ ♭ O0 =dcv O1 implies (O0) =v (O1) , ♯ ♭ ((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 dual calculus. Furthermore, the theorem shows that the but-not type A ← B in the call-by-value dual calculus is considered as the function type for continuations. The theorem also reveals the difference between the dual calculus, whose negation type ¬ A is not involutive, and BLC, whose polarities + A and − A are involutive. The negation type of the dual calculus can appear anywhere in a type. The negation type enables encoding of a coterm, say K, of type A to a term [K]not of type ¬ A, and handling of the encoded coterms as a part of terms. For instance, [[K1,K2]]not of type ¬ (A1 ∨ A2) is a term which encodes the pair of coterms K1 and K2, and functions, such as λx2.[x1.(x2 • nothhx1iinli)]not of type ¬ (A1 ∨ A2) → ¬ A1 that handles such terms, are definable in the dual calculus. The expressive power of BLC is strictly weaker than the dual calculus, since BLC does not permit defining such functions. The theorem also raises a question whether BLC offers an adequate theoretical framework for expressing practical control operators. We conjecture that the polarities of BLC are enough for this purpose. This is future work.

5 Justifying the Duality of Functions

In this section, we reason about the duality of functions in Filinski’s symmetric λ-calculus using the bilateral λ-calculus.

5.1 Filinski’s Symmetric Lambda-Calculus

A function of the type A0 → A1 from expressions of the type A0 to expressions of the type A1 can be regarded as a function from continuations of the type A1 to continuations of the type A0, 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, λ-abstractions of continuations, and decodings of continuations as follows:

A0 A0 A0 [A1←A0] (functions) FA1 ::= X ⇒ EA1 | E[A0→A1] | YA1 ⇐ C | C .

Let A0 → A1 be a function type. Filinski defined a function type [A0 → A1] for an A0 expression, which denotes an exponential object A1 in categorical semantics, where A0 and A1 are objects that correspond to types A0 and A1. We note that A2 × A0 → A1 is A0 bijective to A2 → A1 in categorical semantics. Similarly, Filinski defined a function type

[A1 ← A0] for a continuation, which denotes a coexponential object A0A1 , and A0 → A2 +A1 is bijective to A0A1 → A2. 12 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

Expressions and continuations consist of constants, variables, applications of functions, and encodings of functions as follows:

A A p A0q (expressions) Eo ::= csto | xo | Fo EA E[A0→A1] ::= x[A0→A1] | F[A0→A1]EA | FA1 o o o o A [A1←A0] [A1←A0] [A1←A0] A x A0y (continuations) C ::= • | a | FAC C ::= a | FA C | FA1 .

We note that the encodings and decodings are defined to be primitive operators because the duality is adopted as a principle. We explain commands in Filinski’s symmetric λ-calculus, which is a triple called a con- figuration:

⊢ E : + A0 ⊢ F : A0 → A1 ⊢ C : ¬ A1 ⊢ hE | F | Ci

for the symmetric λ-calculus where ⊢ E : + A0 and ⊢ C : ¬ A1 for expression E of type A0 and continuation C of type A1, respectively. The notation was introduced by Ueda and Asai [36]. A difference from commands in the bilateral λ-calculus is that configurations are not pairs consisting of expressions and continuations, but triples. Another difference is that any configuration cannot be abstracted by expression or continuation variables. One other difference is that the continuation types are represented using the negation connective in Filinski’s calculus. We can see that the configuration notion is also based on the duality principle. If F is regarded as a function from expressions of the type A0 to expressions of the type A1, then F is applied to E and an expression of the type A1 that is consistent with C of the type A1 is generated. Similarly, if F is regarded as a function from continuations of the type A1 to continuations of the type A0, then F is applied to C and a continuation of the type A0 that is consistent with E of the type A0 is generated. The configuration notion includes both cases.

5.2 Mutual Transformations between Functions Let us see how the duality occurs in the bilateral λ-calculus. The bilateral λ-calculus does not permit anything neutral that is neither expression nor continuation. Even if we want to define a neutral function, we must decide whether the type of the function is either + A0 → A1 or − A0 ← A1. If we define a function between expressions which is applied to a continuation, then the function cannot be as-is applied to the continuation, and vice versa. However, we can define encodings xEy = λa.µx.hEx | ai and pCq = λx.µa.hx | Cai to continuations and expressions in the bilateral λ-calculus, respectively, and the encodings are mutual transformations as follows:

◮ Theorem 5.1. The following inferences are derivable: Γ ⊢ E : A → A Γ ⊢ C : A ← A + 0 1 − 0 1 . Γ ⊢− xEy: A0 ← A1 Γ ⊢+ pCq: A0 → A1 Proof. See Appendix B. ◭

The mutual transformations enjoy the following property:

◮ Theorem 5.2. 1. hpC0qV | C1i =v hV | C0C1i holds, 2. hV | xEyCi =v hEV | Ci holds, 3. hpxEyqV | Ci =v hEV | Ci holds, and 4. hV | xpC0qyC1i =v hV | C0C1i holds. Tatsuya Abe and Daisuke Kimura 13

Proof. The first and second statements hold immediately from the definition of , pCq, and xEy as follows:

hpC0qV | C1i ≡ h(λx.µa.hx | C0ai)V | C1i =v hµa.hV | C0ai | C1i =v hV | C0C1i

hV | xEyCi ≡ hV | (λa.µx.hEx | ai)Ci =v hV | µx.hEx | Cii =v hEV | Ci .

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 between expressions (and continuations) from functions between continuations (resp. expressions) using the mutual transformations. Thus, we confirm that the duality of functions is derived from definability of the mutual transformations in the bilateral λ-calculus.

5.3 Dual Proofs for Functions

We also provide an alternative justification of the duality using derivation trees with proofs in their nodes introduced in Section 3. We define a polarization, which is a function from proof variables and proof constants to 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(t0t1)= p(t0)p(t1) p((t0,t1)) = (p(t0),p(t1))

p(π0(t)) = π0(p(t)) p(π1(t)) = π1(p(t)) p(µα.T )= µp(α).p(T )

p(ht0 | t1i)= hp(t0) | p(t1)i .

Let V be a set of proof variables. We define p(V ) as the concatenation of the positive type environments and the negative type environments of V by p. Polarizations p and p′ are equivalent if for any proof variable α, p(α) and p′(α) have the same polarity, and for any proof variables α and α′, p(α) ≡ p(α′) implies p′(α) ≡ p′(α′), vice versa.

◮ Proposition 5.3. Assume that p and p′ are equivalent. Then, ′ ′ 1. p(V ) ⊢+ p(t): A implies p (V ) ⊢+ p (t): A ′ ′ 2. p(V ) ⊢− p(t): A implies p (V ) ⊢− p (t): A, and ′ ′ 3. 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 an expression variable, then p′(α) is a continuation variable, and vice versa. A derivation tree denoting a function has two proofs for acceptance and rejection as follows:

′ ◮ 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, ′ ′ ′ 2. p(V ) ⊢− p(t): A implies that there exists a conjugate p of p such that p (V ) ⊢+ p (t): A, and ′ ′ ′ 3. 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 between equivalent polarizations can be ignored. ◭ 14 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

5.4 A Short Remark about the Two Justifications

Careful readers might think that no distinction of expression variables and continuation variables in derivation trees with proofs is better, and BLC, 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 functions and arguments have common variables. For example, a function λα2.µα1.hα0 | α2i cannot be applied to an argument α0 under any assumption because the function and argument must have polarities to each other. Because the mutual transformations, which have no variable, can respectively transform functions between expressions and continuations to those between continuations and expressions in BLC, pλa2.µx1.hx0 | a2iqx0 of the type + A → A can be applied to x0 of the type + A where λa2.µx1.hx0 | a2i has the type − A ← A.

6 Related Work and Discussion

In this section, we discuss related work from three viewpoints of symmetric λ-calculi on the formulae-as-types and approaches in structural proof theory.

6.1 Symmetric Lambda-Calculi

The first symmetric λ-calculus was proposed by Filinski [12, 13]. Filinski described functions between 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 written as [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 our calculus is that Filinski’s [A1 ← A0] is regarded as − A0 ← A1. We elaborate his idea in proof-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 extract programs 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 essential difference 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. This lack 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 λ-calculus that corresponds to classical logic in which expressions and continuations are symmetric on the bilateralism [25]. They defined λ-terms similar to those of the dual calculus which was defined 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 a primitive type constructor. An expression of function type A0 → A1 has type ¬ (A0 ∧ ¬ A1). Therefore, it is necessary to use an inference rule that corresponds to reductio ad absurdum in classical 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 representing continuations rather than the negation connective on the notion of bilateralism. Ueda and Asai investigated Filinski’s symmetric λ-calculus, and provided an explicit definition of commands by writing ¬ A for a continuation type A [36]. However, they did not Tatsuya Abe and Daisuke Kimura 15 attempt to reason about the neutrality of functions in the symmetric λ-calculus. Also, the use of the negation connective to represent continuations is not reasonable as we have shown in 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 but the negative polarity on bilateralism. Curien and Herbelin’s λµ¯ µ˜-calculus [3] corresponds to Gentzen’s sequent calculus LK as well as the dual calculus. This symmetric infrastructure, namely the duality of LK, exhibits the duality between continuations and programs. Its symmetricity corresponds to that of the polarities in BLC and to that of types A and ¬ A in Ueda and Asai’s calculus. The calculi based on LK naturally contain the (not involutive) negation type, which provides a more expressive power than BLC, as noted in Section 4.2. This observation raises an interesting question: What is the role of the negation type in practical programming languages?

6.2 Approaches in Structural Proof Theory Girard and Parigot constructed calculi corresponding to classical logic [18, 28] and analyzed classical logic proof-theoretically. Girard also invented [17], which is very useful for analyzing classical logic. Danos et al. confirmed that classical logic has well behaved fragments using the positive and negative polarities [5, 6]. The calculi invented through their approaches are larger than or incomparable to ours because their motivations are different from ours. A goal of our work is not to analyze classical logic but to construct a minimal calculus to justify the duality of functions and the computations that delimited continuations raise. 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 natural deduction. Dual intuitionistic logic, which is symmetric to intuitionistic logic, is well known in structural proof theory [19, 37, 34]. A combined logic of intuitionistic and dual intuitionistic logics is classical logic. Whereas most of the logics are based on sequent calculi, Wansing constructed 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 his works analyzed refutation, which is a proof for falsification in the context of studying various negations 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 nor described computational aspects, such as continuation controls. Tranchini also constructed a natural deduction of dual intuitionistic logic [35]. Our calculus seems to correspond to a negation-free fragment of his natural deduction.

7 Conclusion and Future Work

In this paper, we proposed a symmetric λ-calculus called the bilateral λ-calculus with the but-not connective based on bilateralism in proof-theoretic semantics. The formulae-as- types notion was extended to consider Rumfitt’s reductio, which corresponds to reductio ad absurdum as a µ-abstraction of a first-class command in our calculus. Its call-by-value calculus can be defined as a sub-calculus of Wadler’s call-by-value dual calculus. We showed that the duality of functions is derived from definability of the mutual transformations between expressions and continuations in the bilateral λ-calculus. We also showed that every 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 16 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

in Filinski’s symmetric λ-calculus. Bilateral analyses of asymmetric calculi constitute our future work. The call-by-value variant of BLC corresponds to a sub-calculus of the call-by-value dual calculus with the but-not connective. It is also future work to clarify what practical uses are derived from the difference between BLC and the dual calculus. Tatsuya Abe and Daisuke Kimura 17

References 1 Arnon Avron. Negation: Two points of view. In What is Negation?, Applied Logic Series, pages 3–22. 1999. 2 Keith L. Clark. Negation as failure. In Logic and Data Bases, pages 293–322. Plenum Press, 1978. 3 Pierre-Louis Curien and Hugo Herbelin. The duality of computation. In Proc. ICFP, pages 233–243, 2000. 4 Haskell. B. Curry. Functionality in combinatory logic. In Proc. the National Academy of Sciences of USA, volume 20, pages 584–590, 1934. 5 Vincent Danos, Jean-Baptiste Joinet, and Harold Schellinx. LKQ and LKT: Sequent calculi for 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. 6 Vincent Danos, Jean-Baptiste Joinet, and Harold Schellinx. A new deconstructive logic: Linear logic. Journal of Symbolic Logic, 62(3):755–807, 1997. 7 Kosta Do˘sen. Negative modal operators in intuitionistic logic. Publications de l’Institut Mathématique, 35(49):3–14, 1984. 8 Michael Dummett. The Logical Basis of Metaphysics. Duckworth, 1991. 9 Michael Dummett. The Seas of Language. Oxford University Press, 1996. 10 Jon Michael Dunn. Star and perp: Two treatments of negation. Philisophical Perspectives, 5:331–357, 1993. 11 Jon Michael Dunn and Chunlai Zhou. Negation in the context of gaggle theory. Studia Logica, 80(2–3):235–264, 2005. 12 Andrzej Filinski. Declarative continuations: An investigation of duality in programming language semantics. In Proc. CTCS, volume 389 of LNCS, pages 224–249, 1989. 13 Andrzej Filinski. Declarative continuations and categorical duality. Master’s thesis, DIKU Science Department, University of Copenhagen, 1989. 14 Peter T. Geach. Assertion. The Philosophical Review, 74:449–465, 1965. 15 Gerhard Karl Erich Gentzen. Untersuchungen über das logische schließen. Mathematische Zeitschrift, 39:176–210, 1934. 16 Gerhard Karl Erich Gentzen. Untersuchungen über das logische schließen. Mathematische Zeitschrift, 39:405–431, 1935. 17 Jean-Yves Girard. Linear logic. Theoretical Computer Science, 50:1–102, 1987. 18 Jean-Yves Girard. A new constructive logic: classic logic. Mathematical Structures in Com- puter Science, 1(3):255–296, 1991. 19 Nicolas D. Goodman. The logic of contradiction. Zeitschrift für mathematische Logik und Grundlagen der Mathematik, 27:119–126, 1981. 20 Rajeev Goré, Linda Postniece, and Alwen Tiu. Cut-elimination and proof-search for bi- intuitionistic logic using nested sequents. In Advances in , pages 43–66, 2008. 21 Timothy G. Griffin. A formulae-as-types notion of control. In Proc. POPL, pages 47–58, 1990. 22 William. A. Howard. The formulae-as-types notion of construction. In Essays on Combinatory Logic, , and Formalism, pages 479–490. Academic Press, 1980. 23 Lloyd Humberstone. The revival of rejective negation. Journal of Philosophical Logic, 29(4):331–381, 2000. 24 Nils Kürbis. Some comments on ian rumfitt’s bilateralism. Journal of Philosophical Logic, 45(6):623–644, 2016. 25 William Lovas and Karl Crary. Structural normalization for classical natural deduction. Manuscript, 2006. URL: http://www.cs.cmu.edu/{~{}}wlovas/papers/clnorm.pdf. 26 Storrs McCall. Contrariety. Notre Dame Journal of Formal Logic, 8:121–138, 1967. 27 David Nelson. Constructible falsity. Journal of Symbolic Logic, 14(2):16–26, 1949. 28 Michel Parigot. λµ-calculus: An algorithmic interpretation of classical natural deduction. In Proc. LPAR, volume 624 of LNAI, pages 190–201, 1992. 18 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

29 Arthur N. Prior. The runabout inference-ticket. Analysis, 21(2):38–39, 1960. 30 Greg Restall. Extending intuitionistic logic with subtraction, 1997. 31 Greg Restall. An Introduction to Substructural Logics. Routledge, 2000. 32 Ian Rumfitt. “Yes” and “no”. Mind, 109(477):781–823, 2000. 33 Peter Selinger. Control categories and duality: On the categorical semantics of the lambda-mu calculus. Mathematical Structures in Computer Science, 11(2):207–260, 2001. 34 Yaroslav Shramko. Dual intuitionistic logic and a variety of negations: The logic of scientific research. Studia Logica, 80(2–3):347–367, 2005. 35 Luca Tranchini. Natural deduction for dual-intuitionistic logic. Studia Logica, 100(3):631–648, 2012. 36 Yayoi Ueda and Kenichi Asai. Reinvestigation of symmetric lambda calculus. In Proc. the 4th DIKU-IST Joint Workshop on Foundations of Software, pages 10–26, 2011. 37 Igor Urbas. Dual-intuitionistic logic. Notre Dame Journal of Formal Logic, 37(3):440–451, 1996. 38 Philip Wadler. Call-by-value is dual to call-by-name. In Proc. ICFP, pages 189–201, 2003. 39 Philip Wadler. Call-by-value is dual to call-by-name, reloaded. In Proc. RTA, volume 3467 of LNCS, pages 185–203, 2005. 40 Heinrich Wansing. Connexive modal logic. In Proc. AIML, pages 367–383, 2004. 41 Heinrich Wansing. Proofs, disproofs, and their duals. Advances in Modal Logic, 8:483–505, 2010. 42 Heinrich Wansing. Falsification, natural deduction and bi-intuitionistic logic. Journal of Logic and Compututation, 26(1):425–450, 2016. Tatsuya Abe and Daisuke Kimura 19

(types) A ::= χ | (A ∧ A) | (A ∨ A) | (¬ A) (terms) M ::= x | hM,Mi | hMiinl | hMiinr | [K]not | (S).α (coterms) K ::= α | [K,K] | fst[K] | snd[K] | nothMi | 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 by Wadler [39] without negation. Consequently, the consistency of our call-by-value calculus is obtained 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], which corresponds 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 computationally consistent system because it has the so-called CPS-semantics [38] and is equivalent to the call-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, term variables, and coterm variables are given. Let χ, x, and α range over type variables, term variables, 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 a type environment for terms that is a finite set of the form x: A and ∆ is a type environment for 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 | hW, W i | hW iinl | hW iinr | [K]not | (W • fst[α]).α | (W • snd[α]).α (contexts) F ::= {−} | hF,Mi | hW, Fi | hFiinl | hFiinr

Figure 12 presents the call-by-value equation =dcv of the dual calculus. In the call-by- value dual calculus, the implication type A0 → A1 with its term λx.M, coterm M @ K can be defined as

′ ′ ′ A0 → A1 ≡ ¬ (A0 ∧ ¬ A1) λx.M ≡ [x .(x • fst[x.(x • snd[nothMi])])]not M @ K ≡ nothhM, [K]notii by using ∧, ∨, and ¬ as follows: 20 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

Γ ⊢ ∆ | M : AK : A | Γ ⊢ ∆ Γ | M • K ⊢ ∆

Γ, x: A ⊢ ∆ | x: A α: A | Γ ⊢ ∆, α: A

Γ ⊢ ∆ | M1 : A1 Γ ⊢ ∆ | M2 : A2

Γ ⊢ ∆ | hM1,M2i: A1 ∧ A2

K : A1 | Γ ⊢ ∆ K : A2 | Γ ⊢ ∆

fst[K]: A1 ∧ A2 | Γ ⊢ ∆ snd[K]: A1 ∧ A2 | Γ ⊢ ∆

Γ ⊢ ∆ | M : A1 Γ ⊢ ∆ | M : A2

Γ ⊢ ∆ | hMiinl: A1 ∨ A2 Γ ⊢ ∆ | hMiinr: A1 ∨ A2

K1 : A1 | Γ ⊢ ∆ K2 : A2 | Γ ⊢ ∆

[K1,K2]: A1 ∨ A2 | Γ ⊢ ∆

K : A | Γ ⊢ ∆ Γ ⊢ ∆ | M : A Γ ⊢ ∆ | [K]not: ¬ A nothMi: ¬ A | Γ ⊢ ∆

Γ | S ⊢ ∆, α: A x: A, Γ | S ⊢ ∆ Γ ⊢ ∆ | (S).α: A x.(S): A | Γ ⊢ ∆

Figure 11 The inference rules of the dual calculus.

◮ Proposition A.1. The following inferences are derivable: Γ, x: A ⊢ ∆ | M : A Γ ⊢ ∆ | M : A K : A | Γ ⊢ ∆ 0 1 0 1 . Γ ⊢ ∆ | λx.M : A0 → A1 M @ K : A0 → A1 | Γ ⊢ ∆ Also, λx.M is a value and the following equations hold:

(β→) (λx.M0) • (M1 @ K)=dcv M1 • x.(M0 • K)

(η→) W =dcv λx.((W • (x @ α)).α) .

Proof. The inference part is shown immediately by the definition of λx.M and M @ K. The term λx.M is a value, since it has the form [K]not. The equation (β→) is shown by the case analysis of M1. (a) If M1 is not a value, then the claim is obtained by using (ν∧0):

(λx.M0) • (M1 @ K) ′ ′ ′ ≡ [x .(x • fst[x.(x • snd[nothM0i])])]not • nothhM1, [K]notii ′ ′ ′ =dcv hM1, [K]noti• x .(x • fst[x.(x • snd[nothM0i])]) ′′ ′′ ′ ′ ′ =dcv M1 • x .(hx , [K]noti• x .(x • fst[x.(x • snd[nothM0i])])) ′′ ′′ ′′ =dcv M1 • x .(hx , [K]noti• fst[x.(hx , [K]noti• snd[nothM0i])]) ′′ ′′ =dcv M1 • x .(x • x.([K]not • nothM0i))

=dcv M1 • x.([K]not • nothM0i)

=dcv M1 • x.(M0 • K) . Tatsuya Abe and Daisuke Kimura 21

(β∧0) hW0, W1i• fst[K]=dcv W0 • K

(β∧1) hW0, W1i• snd[K]=dcv W1 • K

(β∨0) hW iinl • [K0,K1]=dcv W • K0

(β∨1) hW iinr • [K0,K1]=dcv W • K1

(β¬) [K]not • nothMi =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.(hxiinl • K), x.(hxiinr • K)] if x is fresh

(η¬) W =dcv [x.(W • nothxi)]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 M1 is a value (say W ), then

(λx.M0) • (W @ K) ′ ′ ′ ≡ [x .(x • fst[x.(x • snd[nothM0i])])]not • nothhW, [K]notii ′ ′ ′ =dcv hW, [K]noti• x .(x • fst[x.(x • snd[nothM0i])])

=dcv hW, [K]noti• fst[x.(hW, [K]noti• snd[nothM0i])]

=dcv W • x.([K]not • nothM0i)

=dcv W • x.(M0 • K) .

The but-not type A0 ← A1 with its term K $ M, coterm λα.K are also defined as

A0 ← A1 ≡ A0 ∧ ¬ A1 K $ M ≡ hM, [K]noti λα.K ≡ x.(x • snd[noth(x • fst[K]).αi]) .

◮ Proposition A.2. The following inferences are derivable: Γ ⊢ ∆ | M : A K : A | Γ ⊢ ∆ K : A | Γ ⊢ ∆, α: A 0 1 0 1 . Γ ⊢ ∆ | K $ M : A0 ← A1 λα.K : A0 ← A1 | Γ ⊢ ∆ Also, K $ W is a value and the following equations hold:

(β←) (K0 $ W ) • (λα.K1)=dcv (W • K1).α • K0

(η←) K =dcv λα.(x.((α @ x) • K))

(ζ←) (K0 $ M) • K1 =dcv M • x.((K0 $ x) • K1) if x is fresh.

Proof. The inference part is shown immediately by the definition of K $ M and λα.K. By the definition, it is immediately checked that a term of the form K $ W is a value. 22 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

The first equation (β←) is shown as follows:

(K0 $ W ) • (λα.K1) ≡ hW, [K0]noti• x.(x • snd[noth(x • fst[K1]).αi])

=dcv hW, [K0]noti• snd[noth(hW, [K0]noti• fst[K1]).αi]

=dcv [K0]not • noth(W • K1).αi

=dcv (W • K1).α • K0

The second equation (ζ←) is shown with (ν∧0) as follows:

(K0 $ M) • K1 ≡ hM, [K0]noti• K1

=dcv M • x.(hx, [K0]noti• K1)

≡ M • x.((K0 $ x) • K1)

We define a sub-calculus CbV-DC→← of the call-by-value dual calculus that is obtained by removing the negation type ¬ A and adding the implication and but-not types with their syntactical objects, typing rules, and equations as primitives. The calculus CbV-DC→← can be roughly understood as a sub-calculus of the call-by-value dual calculus that forbids free occurrences of the negation connective and allows only the occurrences necessary to define the 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 designed so that judgments in the bilateral natural deduction are mapped to sequents in the sequent calculus including proofs. We assume that there exist variables xcsto and covariables α•o of CbV-DC→← for any constant expressions csto and constant continuations •o of CbV-BLC, respectively. Term (E)♯, coterm (C)♯, and (N)♯ are defined inductively as shown in Fig- ure 13. We show that the translation preserves typability. Let Cons+ and Cons− be the sets o o + − of constants of the form cst and • , respectively. For any X ⊆fin Cons and Y ⊆fin Cons , we respectively define

♯ o ♯ o (Π)X = Π ∪{xcsto : o | cst ∈ X} and (Σ)Y = Σ ∪{α•o : o |• ∈ Y } .

◮ ♯ ♯ ♯ + Proposition A.3. 1. Π; Σ ⊢+ E : A implies (Π)X ⊢ (Σ)Y | (E) : A for any Cons (E) ⊆ X and Cons−(E) ⊆ Y , ♯ ♯ ♯ + − 2. Π; Σ ⊢− C : A implies (C) : A | (Π)X ⊢ (Σ)Y for any Cons (C) ⊆ X and Cons (C) ⊆ Y , and ♯ ♯ ♯ + − 3. Π; Σ ⊢ 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 2. ([V/x]D)♯ ≡ [(V )♯/x](D)♯ and ([C/α]D)♯ ≡ [(C)♯/α](D)♯ . Tatsuya Abe and Daisuke Kimura 23

o ♯ o ♯ (cst ) ≡ xcsto (• ) ≡ α•o (xA)♯ ≡ x (aA)♯ ≡ α (λxA.E)♯ ≡ λx.(E)♯ (λaA.C)♯ ≡ λα.(C)♯ ♯ ♯ ♯ ♯ ♯ ♯ (E0E1) ≡ ((E0) • ((E1) @ α)).α (C0C1) ≡ x.(((C1) $ x) • (C0) ) ♯ ♯ ♯ ♯ ♯ ♯ ((E0, E1)) ≡ h(E0) , (E1) i ((C0, C1)) ≡ [(C0) , (C1) ] ♯ ♯ ♯ ♯ (π0(E)) ≡ ((E) • fst[α]).α (π0(C)) ≡ x.(hxiinl • (C) ) ♯ ♯ ♯ ♯ (π1(E)) ≡ ((E) • snd[α]).α (π1(C)) ≡ x.(hxiinr • (C) ) (µaA.N)♯ ≡ ((N)♯).α (µxA.N)♯ ≡ x.((N)♯)

(hE | Ci)♯ ≡ (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 value if and only if ([V/x]E)† is a value. The case of S ≡ csto:

o † o † † † o † ([V/x]cst ) ≡ (cst ) ≡ xcsto ≡ [(V ) /x]xcsto ≡ [(V ) /x](cst )

The case of S ≡ xA:

([V/x]xA)† ≡ (V )† ≡ [(V )†/x]x ≡ [(V )†/x](xA)†

A0 A A0 The case of S ≡ x0 , where x 6≡ x0 :

A0 † A0 † † † A0 † ([V/x]x0 ) ≡ (x0 ) ≡ x0 ≡ [(V ) /x]x0 ≡ [(V ) /x](x0 )

The case of S ≡ π0(E) is shown by using induction hypothesis.

† † ([V/x]π0(E)) ≡ (π0([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](π0(E))

o A The other cases S ≡ π1(E), (E0, E1), λx.E, E0E1, µa.N, • , a , π0(C), π1(C), (C0, C1), λa.C, C0C1, µx.N, and hE | Ci 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:

o † o † † † o † ([C/α]• ) ≡ (• ) ≡ α•o ≡ [(C) /α]α•o ≡ [(C) /α](• )

The case of S ≡ aA:

([C/α]aA)† ≡ (C)† ≡ [(C)†/α]α ≡ [(C)†/α](aA)† 24 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

A0 A A0 The case of S ≡ a0 , where a 6≡ a0 :

A0 † A0 † † † A0 † ([C/α]a0 ) ≡ (a0 ) ≡ a0 ≡ [(C) /α]a0 ≡ [(C) /α](a0 )

The case of S ≡ π0(C0) is shown by using induction hypothesis:

† † ([C/α]π0(C0)) ≡ (π0([C/α]C0)) † ≡ x.(hxiinl • ([C/α]C0) ) † † ≡ x.(hxiinl • [(C) /α](C0) ) by induction hypothesis † † ≡ [(C) /α](x.(hxiinl • (C0) )) † † ≡ [(C) /α](π0(C0))

o A The other cases S ≡ cst , x , π0(E), π1(E), (E0, E1), λx.E, E0E1, µa.N, π1(C), (C0, C1), λa.C, C0C1, µx.N, and hE | Ci are also shown straightforwardly by using induction hypoth- esis. ◭

♯ ♯ ◮ Theorem A.5. D0 =v D1 implies (D0) =dcv (D1) .

♯ Proof. First, we define a coterm K-indexed translation (−)K from contexts for expressions of CbV-BLC into contexts of CbV-DC→← as follows:

♯ ({−})K ≡ {−}• K ♯ ♯ ♯ ♯ (V E)K ≡ (E)x.((V )♯•(x@K)) (EE)K ≡ (E)(E)♯@K ♯ ♯ ♯ ♯ ((V, E))K ≡ (E)x.(h(V )♯,xi•K) ((E, E))K ≡ (E)x.(hx,(E)♯i•K) ♯ ♯ ♯ ♯ (π0(E))K ≡ (E)fst[K] (π1(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 π0((V0, V1)) =v V0. By using Lemma A.4 (1), we have ♯ ♯ ♯ ♯ ♯ (π0((V0, V1))) ≡ (h(V0) , (V1) i• fst[α]).α =dcv ((V0) • α).α =dcv (V0) .

The case of π1((V0, V1)) =v V1 is shown similarly. The case of (π0(V ), π1(V )) =v V . By using Lemma A.4 (1), we have ♯ ♯ ♯ ♯ ((π0(V ), π1(V ))) ≡ h((V ) • fst[α]).α, ((V ) • snd[α]).αi =dcv (V ) .

The case of µa.hE | ai =v E. We have ♯ ♯ ♯ (µa.hE | ai) ≡ ((E) • α).α =dcv (E) . Tatsuya Abe and Daisuke Kimura 25

The case of hV | µx.Ni =v [V/x]N: By using Lemma A.4 (1) and (2), we have

♯ ♯ ♯ ♯ ♯ ♯ (hV | µx.Ni) ≡ (V ) • x.((N) )=dcv [(V ) /x](N) ≡ ([V/x]N) .

The case of hE{E} | Ci =v hE | µx.hE{x} | Cii. By using (∗). we have

♯ ♯ ♯ ♯ ♯ (hE{E} | Ci) ≡ (E{E}) • (C) =dcv (E) • x.((E)(C)♯ {x}) ♯ ♯ ♯ =dcv (E) • x.((x) • x.((E)(C)♯ {x})) ♯ ♯ ♯ ♯ =dcv (E) • x.((E{x}) • (C) ) ≡ (hE | µx.hE{x} | Cii) .

The case of (λa.C0)C1 =v [C1/a]C0. By using Lemma A.4 (2), we have

♯ ♯ ♯ ♯ ♯ ((λa.C0)C1) ≡ x.((x $ (C1) ) • λα.(C0) )=dcv x.((x • (C0) ).α • (C1) ) ♯ ♯ ♯ ♯ ♯ =dcv x.(x • [(C1) /α](C0) )=dcv [(C1) /α](C0) ≡ ([C1/α]C0) .

The case of λa.Ca =v C. We have

♯ ♯ ♯ (λa.Ca) ≡ λα.(x.((x $ α) • (C) )) =dcv (C) .

The case of π0((C0, C1)) =v C0. We have

♯ ♯ ♯ ♯ ♯ (π0((C0, C1))) ≡ x.(hxiinl • [(C0) , (C1) ]) =dcv x.(x • (C0) )=dcv (C0) .

The case of π1((C0, C1)) =v C1 is also shown similarly. The case of (π0(C), π1(C)) =v C. We have

♯ ♯ ♯ ♯ ((π0(C), π1(C))) ≡ [x.(hxiinl • (C) ), x.(hxiinr • (C) )] =dcv (C) .

The case of µx.hx | Ci =v C. We have

♯ ♯ ♯ (µx.hx | Ci) ≡ x.(x • (C) )=dcv (C) .

The case of hµa.N | Ci =v [C/a]. By using Lemma A.4 (2), we have

♯ ♯ ♯ ♯ ♯ ♯ (hµa.N | Ci) ≡ ((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→← are defined inductively as shown in Figure 14. −−−−−−→ −−→ ′ ′ We show that this translation preserves typability. Let Γ be x o : o , x: A. Then we −−−−→ cst define (Γ )♭ by x: + A. Similarly, we also define (∆)♭.

♭ ♭ ♭ ◮ Proposition A.6. 1. Γ ⊢ ∆ | M : A implies (Γ ) ; (∆) ⊢+ (M) : A, ♭ ♭ ♭ 2. K : A | Γ ⊢ ∆ implies (Γ ) ; (∆) ⊢− (K) : A, and ♭ ♭ ♭ 3. Γ | S ⊢ ∆ implies (Γ ) ; (∆) ⊢ o (S) . Proof. The claims can be shown by simultaneous induction on the derivation of judgments of 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 26 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

♭ o ♭ o (xcsto ) ≡ cst (α•o ) ≡• (x)♭ ≡ xA if x has a type A (α)♭ ≡ aA if α has a type A (λx.M)♭ ≡ λxA.(M)♭ (λα.K)♭ ≡ λaA.(K)♭ if λx.M has a type A → A1 if λα.K has a type A1 ← A (K $ M)♭ ≡ µa.h(M)♭ | a(K)♭i (M @ K)♭ ≡ µx.hx(M)♭ | (K)♭i ♭ ♭ ♭ ♭ ♭ ♭ (hE0, E1i) ≡ ((E0) , (E1) ) ([K0,K1]) ≡ ((K0) , (K1) ) ♭ ♭ ♭ ♭ (hMiinl) ≡ µa.h(M) | π0(a)i (fst[K]) ≡ x.(hπ0(x) | (K) i) ♭ ♭ ♭ ♭ (hMiinr) ≡ µa.h(M) | π1(a)i (snd[K]) ≡ x.(hπ1(x) | (K) i) ((S).α)♭ ≡ µaA.(S)♭ if α: A (x.(S))♭ ≡ µxA.(S)♭ if x: A

(M • K)♭ ≡ h(M)♭ | (K)♭i

Figure 14 A translation from CbV-DC→← into CbV-BLC.

♭ ♯ 2. ((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 of ♭ CbV-BLC such that V =v (M) , and 2. ([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 (hW, Fi)♭ ≡ ((W )♭, (F)♭) (hF,Mi)♭ ≡ ((F)♭, (M)♭) ♭ ♭ ♭ ♭ (hFiinl) ≡ µa.h(F) | π0(a)i (hFiinr) ≡ µa.h(F) | π1(a)i .

♭ ♭ ♭ ◮ Lemma A.9. 1. (F{M}) =v (F) {(M) } holds, and ♭ ♭ 2. h(F) {E} | Ci =v hE | µx.h(F) {x} | Cii holds. Proof. The claims (1) and (2) are shown by induction on F. ◭

♭ ♭ ◮ Theorem A.10. O0 =dcv O1 implies (O0) =v (O1) .

Proof. The claim is shown by the case analysis of =dcv. The case of (β→) is shown as follows.

♭ ♭ ♭ ♭ ((λx.M0) • (M1 @ K)) ≡ hλx.(M0) | µx1.hx1(M1) | (K) ii ♭ ♭ ♭ =v h(λx.(M0) )(M1) | (K) i ♭ ♭ ♭ =v h(M1) | µx.h(λx.(M0) )x | (K) ii ♭ ♭ ♭ =v h(M1) | µx.h(M0) | (K) ii ♭ ≡ (M1 • x.(M0 • K)) . Tatsuya Abe and Daisuke Kimura 27

The case of (β←) is shown as follows.

♭ ♭ ♭ ♭ ((K0 $ M) • (λα.K1)) ≡ hµa1.h(M) | a1(K0) i | λa.(K1) i ♭ ♭ ♭ =v h(M) | (λa.(K1) )(K0) i ♭ ♭ ♭ =v h(M) | [(K0) /a](K1) i ♭ ♭ ♭ ≡ [(K0) /a]h(M) | (K1) i ♭ ♭ ♭ =v hµa.h(M) | (K1) i | (K0) i ♭ ≡ ((M • K1).α • K0) .

The case of (β∧0). By using Lemma A.8 (1), We have

♭ ♭ ♭ ♭ (hW0, W1i• fst[K]) ≡ h((W0) , (W1) ) | µx.hπ0(x) | (K) ii ♭ ♭ ♭ =v hπ0(((W0) , (W1) )) | (K) i ♭ ♭ ♭ =v h(W0) | (K) i≡ (W0 • K) .

The case of (β∧1) is shown similarly. The case of (β∨0). We have

♭ ♭ ♭ ♭ (hW iinl • [K0,K1]) ≡ hµa.h(W ) | π0(a)i | ((K0) , (K1) )i ♭ ♭ ♭ =v h(W ) | π0(((K0) , (K1) ))i ♭ ♭ ♭ =v h(W ) | (K0) i≡ (W • K0) .

The case of (β∨1) 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 ) | µx1.hx1x | aii ♭ ♭ ♭ =v λx.µa.h(W ) x | ai =v λx.(W ) x =v (W ) .

The case of (η←).

♭ ♭ (λα.(x.((α $ x) • K))) ≡ λa.µx.hµa1.ha1a | xi | (K) i ♭ ♭ ♭ =v λa.µx.h(K) a | xi =v λa.(K) a =v (K) .

♭ ♭ The case of (η∧). Note that ((W • fst[α]).α) ≡ π0((W ) ) by Lemma A.8 (1). Hence we have

♭ ♭ ♭ ♭ (h(W • fst[α]).α, (W • snd[α]).αi) =v (π0((W ) ), π1((W ) )) =v (W ) .

♭ ♭ The case of (η∨). Note that (x.(hxiinl • K)) =v π0((K) ). Hence we have

♭ ♭ ♭ ♭ ([x.(hxiinl • K), x.(hxiinr • K)]) =v (π0((K) ), π1((K) )) =v (K) . 28 A Symmetric Lambda-Calculus Corresponding to a Bilateral Natural Deduction

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 difference between the full dual calculus and the bilateral λ-calculus. The negation of the dual calculus is not involutive, since ¬ ¬ A is not isomorphic to A. The dual calculus actually contains the involutive duality not as the object-level negation but as the meta-level operation such as the antecedent and succedent duality of the sequent calculus. On the other hand, the negation is represented using inversions of polarities in the bilateral λ-calculus. By definition, the negation is involutive.

B Proofs

Proof of Proposition 2.2. The proposition holds as follows:

+ A0 → A1 [+ A0] + A1 [− A1] ⊥ − A0 → A1 − A0 → A1 − A0 + A0 − A1 − A0 ← A1 + A0 ← A1

− A0 ← A1 [− A1] [+ A0] − A0 + A0 ← A1 + A0 ← A1 ⊥ + A0 − A1 + A1 − A0 → A1 + A0 → A1

Proof of Proposition 2.4. 1) It suffices to use (Non-contradiction) and (Reductio) with (∧-E+0), (∧-E+1), (∧-I+), (∨-E−), (∨-I−0), and (∨-I−1) as follows:

[− A0] [− A1] . . . . A [A∗] A [A∗] ⊥ ⊥ [+ A0 ∧ A1] + A0 + A1 − Ai + Ai − A0 ∧ A1 + A0 ∧ A1 ⊥ ⊥ − A0 ∧ A1 A Tatsuya Abe and Daisuke Kimura 29

[+ A0] [+ A1] . . . . A [A∗] A [A∗] ⊥ ⊥ − A0 − A1 [− A0 ∨ A1] + A0 ∨ A1 − A0 ∨ A1 + Ai − Ai ⊥ ⊥ A + A0 ∨ A1 where i =0, 1. 2) It suffices to use (Non-contradiction) and (Reductio) with (→-E+), (→-I+), (←-E−), and (←-I−) as follows:

[+ A0] [− A0] ⊥ [+ A0 → A1] + A0 + A1 + A1 − A1 − A0 → A1 + A0 → A1 ⊥ ⊥ − A0 → A1 + A0

[+ A1] [− A0 ← A1] − A1 − A0 → A1 + A0 → A1 − A0 + A0 ⊥ ⊥ − A1 + A0 ← A1

[+ A1] [− A1] ⊥ [− A0] − A0 + A0 ← A1 − A0 ← A1 + A0 ← A1 − A0 ← A1 ⊥ ⊥ + A0 − A1 ◭

Proof of Theorem 5.1. The proposition holds because the following: ′ ′ ′ ′ Π ; Σ ⊢+ E : A0 → A1 Π ; Σ ⊢+ x : A0 ′ ′ ′ ′ Π ; Σ ⊢+ Ex : A1 Π ; Σ ⊢− a: A1

Π, x : A0; Σ,a: A1 ⊢ o hEx | ai

Π; Σ,a: A1 ⊢− µx.hEx | ai: A0

Π ⊢− λa.µx.hEx | ai: A0 ← A1

′ ′ ′ ′ Π ; Σ ⊢− C : A0 ← A1 Π ; Σ ⊢− a: A1 ′ ′ ′ ′ Π ; Σ ⊢+ x : A0 Π ; Σ ⊢− Ca: A0

Π, x : A0; Σ,a: A1 ⊢ o hx | Cai

Π, x : A0; Σ ⊢+ µa.hx | Cai : A1

Π; Σ ⊢+ λx.µa.hx | Cai: A0 → A1 ′ ′ are derived where Π and Σ are Π, x : A0; Σ,a: A1, respectively. ◭