Logic

The logic for Stroscot is based on a two-sided linear logic sequent calculus.

Jumbo connectives

  Γ,AijBik,Δ    Γ𝕁i(AiBi),Δ   (𝕁R)  ΓjAij,ΔjΘk,BikΛk    Γ,Θ,𝕁i(AiBi)Δ,Λ   (𝕁Li)
  ΘjAij,ΛjΓk,BikΔk    Γ,Θ𝕁+i(AiBi),Δ,Λ   (𝕁R+i)  Γ,AijBik,Δ    Γ,𝕁+i(AiBi)Δ   (𝕁L+)

Common connectives

All of the standard operators 01⊕⊗⊤⊥&⅋⊸⧟ in linear logic can be expressed using 𝕁+ and 𝕁. We use our notation for them.

Operator

Girard Notation

Name

Type

F

0

False (Zero)

𝕁+[]

1

1

One

𝕁+[(#s,[][])]

AB

AB

Plus (coproduct, or)

𝕁+[(#l,[A][]),(#r,[B][])]

AB

AB

Times (tensor product)

𝕁+[(#s,[A,B][])]

An

Tensor power

𝕁+[(#s,[A,,A]n[])]

¬+A

A

Positive Negation

𝕁+[(#s,[][A])]

A

A

Up shift

𝕁+[(#s,[A][])]

T

True (Top)

𝕁[]

Bottom (contradiction)

𝕁[(#s,[][])]

AB

A&B

With (product, and)

𝕁[(#l,[][A]),(#r,[][B])]

AB

AB

Par (“unless”, classical or, parallel product, dual of tensor)

𝕁[(#s,[][A,B])]

An

Par power

𝕁[(#s,[][A,,A]n)]

AB

AB

Lollipop (implication, internal hom)

𝕁[(#f,[A][B])]

AB

AB

Equivalence

𝕁[(#l,[A][B]),(#r,[B][A])]

¬A

A

Negative Negation

𝕁[(#s,[A][])]

A

A

Down shift

𝕁[(#s,[][A])]

The negations and shifts have identical derivation rules for each polarity, so we write ¬A and A unless there is a need for the distinction.

The specific derivation rules can be derived from the jumbo connective rules and the above definitions. For ease of reference, here are the derivation rules for the common connectives:

N/A (FR)      Γ,FΔ   (FL)      ΓT,Δ   (TR)N/A (TL)      1   (1R)  ΓΔ    Γ,1Δ   (1L)  ΓΔ    Γ,Δ   (R)         (L)  ΓAi,Δ    ΓA1A2,Δ   (iR)  Γ,AΔΓ,BΔ    Γ,ABΔ   (L)  ΓA,ΔΓB,Δ    ΓAB,Δ   (R)  Γ,AiΔ    Γ,A1A2Δ   (iL)  ΓA,ΔΘB,Λ    Γ,ΘAB,Λ,Δ   (R)  Γ,A,BΔ    Γ,ABΔ   (L)  ΓA,B,Δ    ΓAB,Δ   (R)  Γ,AΔΘ,BΛ    Γ,Θ,ABΛ,Δ   (L)  Γ1A,Δ1ΓnA,Δn    Γ1,,ΓnAn,Δ1,,Δn   (nR)  Γ,A,,AnΔ    Γ,AnΔ   (nL)  ΓA,,An,Δ    ΓAn,Δ   (nR)  Γ1,AΔ1Γn,AΔn    Γ1,,Γn,AnΔ1,,Δn   (nL)  Γ,AΔ    Γ¬A,Δ   (¬R)  ΓA,Δ    Γ,¬AΔ   (¬L)  ΓA,Δ    ΓA,Δ   (R)  Γ,AΔ    Γ,AΔ   (L)  Γ,AB,Δ    ΓAB,Δ   (R)  ΓA,ΔΘ,BΛ    Γ,Θ,ABΛ,Δ   (L)  Γ,AB,ΔΓ,BA,Δ    ΓAB,Δ   (R)  ΓA,ΔΘ,BΛ    Γ,ABΔ   (L)  ΓB,ΔΘ,AΛ    Γ,ABΔ   (L)

Programming types

We can also write some types common from programming:

Operator

Name

Type

Bool

Booleans

𝕁+[(#F,[][]),(#T,[][])]

Int

32-bit integers

𝕁+[(#231,[][]),,(#0,[][]),,(#2311,[][])]

LA

Linked list of A

𝕁+[(#nil,[][]),(#cons,[A,LA][])]

ArrA

Arbitrarily-sized tuple of A

𝕁+[(#0,[][]),(#1,[A][]),(#2,[A,A][]),]

In general 𝕁+ can represent any algebraic data type.

Exponentials

Promotion

  !+ΓiA,!Δi    !+Γi!+A,!Δi   (!+R)  !+Γi,A!Δi    !+Γi,!A!Δi   (!L)

Dereliction

  Γ,AΔ    Γ,!+AΔ   (!+d)  ΓA,Δ    Γ!A,Δ   (!d)

Weakening

  ΓΔ    Γ,!+AΔ   (!+w)  ΓΔ    Γ!A,Δ   (!w)

Contraction

  Γ,!+A,!+A,Δ    Γ,!+AΔ   (!+cn)  Γ!A,!A,,Δ    Γ!A,Δ   (!cn)

Admissible rules

The following rules are derivable from the four rules above.

Weak promotion, implied by promotion and dereliction:

  ΓA,Δ    !+Γ!+A,!Δ   (!+weak)  Γ,AΔ    !+Γ,!A!Δ   (!weak)

Digging is simply the theorems !+!+A!+a and !!A!a, but we present the sequent forms for completeness. It is implied by promotion and dereliction.

  Γ,!+!+AΔ    Γ,!+AΔ   (!+dig)  Γ!!A,Δ    Γ!A,Δ   (!dig)

Weak promotion and digging together imply promotion.

Absorption is implied by contraction and dereliction:

  Γ,A,!+AΔ    Γ,!+AΔ   (!+absorb)  ΓA,!A,Δ    Γ!A,Δ   (!absorb)

Multiplexing is implied by absorption and dereliction:

  Γ,A,,AΔ    Γ,!+AΔ   (!+multiplex)  ΓA,,A,Δ    Γ!A,Δ   (!multiplex)

Structural rules

Exchange

  ΓΔ    σL(Γ)σR(Δ)   (x)

Cut

  ΓA,ΔΘ,AΛ    Γ,ΘΔ,Λ   (cut)

Identity

      AA   (id)

Higher-order logic

Predicates

Terms consist of variables x, literal values v, and applications of terms to terms. Variables quantify over the universal set, smaller domains can be defined by the membership notation in Set theory.

If the term is a predicate (set) then it may be used as an atomic formula. Such an atomic formula t must satisfy the identity rule:

      tt   (id)

Interpreted predicates may be defined using other rules so long as the identity rule is derivable and the rules are consistent.

Substitution

A[xt] stands for the proposition A where all free occurrences of the variables x have been replaced by terms t in the appropriate domains (and bound variables have been renamed to fresh ones when necessary).

  ttΓΔ    Γ[xt]Δ[xt]   (sub)

Quantifiers

For these the variable x must have no free occurrence in Γ or Δ. In code we simply refer to quantifiers Q and write Q+=,Q=.

  ΓA,Δ    Γx.A,Δ   (R)  ttΓ,A[xt]Δ    Γ,x.AΔ   (L)  ttΓA[xt],Δ    Γx.A,Δ   (R)  Γ,AΔ    Γ,x.AΔ   (L)

Definitions

If we define some notation A=defB, then this means adding a pair of rules to our logic:

  ΓB,Δ    ΓA,Δ   (defR)  Γ,BΔ    Γ,AΔ   (defL)

The notation and rules are valid only if there is a finite proof of the identity sequent BB.

Infinite proof structures

These have “use” and “def” rules (“def” is short for definition). The use is a “hole” that plugs in the derivation tree from the definition. The type of the use rule can performs a substitution on the free variables of the type of the assignment.

  X    Γ[xt]Δ[xt]   (Use)  ΓΔ    X=   (Def)

Set theory

We define t{xA}=defA[xt]. Here the elements t of the sets are propositions; e.g. we can prove {xx}. Usually the variables in set theory range over sets. Hence we introduce new variables xS which range over sets. Since all sets S are of the form {xXS} these can be translated as follows:

xS=def{xXS}{xSX}=def{XSX}{xX}Y=defXYxS.X=defX.X{xSX}{xSY}=defXY

So for example tS{xSxSxS} expands to T{XX{xX}}

We can also define set-builder notation {a1,,an}={xx=a1x=an}.

We define

a!B=!+(aB)[P(x)xAQ(x)]=[!+(xA),P(x)Q(x)]xA.P(x)=x.(!+(xA)P(x))xA.P(x)=x.(!+(xA)P(x))

We can prove the axiom schema of comprehension y.x.xyϕ for all formulas ϕ with free variable x.

Equality

Equality on sets is defined as follows:

A=B=defx.(xAxB).

We can easily prove that this equality is an equivalence relation:

A=AA=BB=AA=B,B=CA=C

For substitution, we can prove !(A=B),ϕϕ[A/B] for any specific proposition ϕ.