Documentation

Cslib.Computability.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 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
    instance instReprSKI :
    Equations

    Application $x y ↦ xy$

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

      Apply a term to a list of terms

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

        Reduction relations between SKI terms #

        inductive SKI.Red :
        SKISKIProp

        Single-step reduction of SKI terms

        Instances For

          Notation for single-step reduction

          Equations
          Instances For
            def SKI.MRed :
            SKISKIProp

            Multi-step reduction of SKI terms

            Equations
            Instances For

              Notation for multi-step reduction (by analogy with the Kleene star)

              Equations
              Instances For
                theorem SKI.MRed.refl (a : SKI) :
                a.MRed a
                theorem SKI.MRed.single {a b : SKI} (h : a.Red b) :
                a.MRed b
                theorem SKI.MRed.S (x y z : SKI) :
                (((SKI.S.app x).app y).app z).MRed ((x.app z).app (y.app z))
                theorem SKI.MRed.K (x y : SKI) :
                ((SKI.K.app x).app y).MRed x
                theorem SKI.MRed.I (x : SKI) :
                (SKI.I.app x).MRed x
                theorem SKI.MRed.head {a a' : SKI} (b : SKI) (h : a.MRed a') :
                (a.app b).MRed (a'.app b)
                theorem SKI.MRed.tail (a : SKI) {b b' : SKI} (h : b.MRed b') :
                (a.app b).MRed (a.app b')
                theorem SKI.parallel_mRed {a a' b b' : SKI} (ha : a.MRed a') (hb : b.MRed b') :
                (a.app b).MRed (a'.app b')
                theorem SKI.parallel_red {a a' b b' : SKI} (ha : a.Red a') (hb : b.Red b') :
                (a.app b).MRed (a'.app b')

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

                Equations
                Instances For
                  theorem SKI.commonReduct_of_single {a b : SKI} (h : a.MRed b) :