Documentation

Cslib.Languages.CombinatoryLogic.Defs

SKI Combinatory Logic #

This file defines the syntax and operational semantics (reduction rules) of combinatory logic, using the SKI basis.

Main definitions #

Notation #

References #

The setup of SKI combinatory logic is standard, see for example:

inductive Cslib.SKI :

An SKI expression is built from the primitive combinators S, K and I, and application.

  • S : SKI

    S-combinator, with semantics $λxyz.xz(yz)

  • K : SKI

    K-combinator, with semantics $λxy.x$

  • I : SKI

    I-combinator, with semantics $λx.x$

  • app : SKISKISKI

    Application $x y ↦ xy$

Instances For
    Equations
    Instances For

      Application $x y ↦ xy$

      Equations
      Instances For
        def Cslib.SKI.applyList (f : SKI) (xs : List SKI) :

        Apply a term to a list of terms

        Equations
        Instances For
          theorem Cslib.SKI.applyList_concat (f : SKI) (ys : List SKI) (z : SKI) :
          f.applyList (ys ++ [z]) = (f.applyList ys).app z

          The size of an SKI term is its number of combinators.

          Equations
          Instances For

            Reduction relations between SKI terms #

            inductive Cslib.SKI.Red :
            SKISKIProp

            Single-step reduction of SKI terms

            Instances For
              theorem Cslib.SKI.Red.ne {x y : SKI} :
              RedSKI.Red x yx y
              theorem Cslib.SKI.MRed.S (x y z : SKI) :
              RedSKI.MRed (((SKI.S.app x).app y).app z) ((x.app z).app (y.app z))
              theorem Cslib.SKI.MRed.K (x y : SKI) :
              RedSKI.MRed ((SKI.K.app x).app y) x
              theorem Cslib.SKI.MRed.head {a a' : SKI} (b : SKI) (h : RedSKI.MRed a a') :
              RedSKI.MRed (a.app b) (a'.app b)
              theorem Cslib.SKI.MRed.tail (a : SKI) {b b' : SKI} (h : RedSKI.MRed b b') :
              RedSKI.MRed (a.app b) (a.app b')
              theorem Cslib.SKI.parallel_mRed {a a' b b' : SKI} (ha : RedSKI.MRed a a') (hb : RedSKI.MRed b b') :
              RedSKI.MRed (a.app b) (a'.app b')
              theorem Cslib.SKI.parallel_red {a a' b b' : SKI} (ha : RedSKI.Red a a') (hb : RedSKI.Red b b') :
              RedSKI.MRed (a.app b) (a'.app b')

              Express that two terms have a reduce to a common term.

              Equations
              Instances For
                theorem Cslib.SKI.commonReduct_head {x x' : SKI} (y : SKI) :
                x.CommonReduct x'(x.app y).CommonReduct (x'.app y)
                theorem Cslib.SKI.commonReduct_tail (x : SKI) {y y' : SKI} :
                y.CommonReduct y'(x.app y).CommonReduct (x.app y')