Documentation

Cslib.Languages.CombinatoryLogic.PartrecToSKI

Partial Recursive → SKI-computable (Nat.Partrec) #

This file translates Nat.Partrec.Code to SKI terms and proves the translation correct, showing that every partial recursive function is SKI-computable in the sense of SKI.Computes (from Cslib.Languages.CombinatoryLogic.Computable).

Main definitions #

Main results #

Helper terms for Code.prec and Code.rfind' #

Step function for primitive recursion: λ a cn prev. tg ⬝ (NatPair ⬝ a ⬝ (NatPair ⬝ (Pred ⬝ cn) ⬝ prev)) Variables: &0 = a, &1 = cn, &2 = prev

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    SKI term for the primitive recursion step function.

    Equations
    Instances For
      theorem Cslib.SKI.precStep_def (tg a cn prev : SKI) :
      Relation.ReflTransGen Red (((tg.PrecStep.app a).app cn).app prev) (tg.app ((NatPair.app a).app ((NatPair.app (Pred.app cn)).app prev)))

      Full primitive recursion translation: λ n. Rec (tf (left n)) (PrecStep tg (left n)) (right n)

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Cslib.SKI.PrecTrans (tf tg : SKI) :

        SKI term for primitive recursion via Rec with pair/unpair plumbing.

        Equations
        Instances For

          Unbounded search translation: λ n. RFindAbove ⬝ (NatUnpairRight ⬝ n) ⬝ (B ⬝ tf ⬝ (NatPair ⬝ (NatUnpairLeft ⬝ n)))

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            SKI term for unbounded search (μ-recursion).

            Equations
            Instances For

              Translation from Nat.Partrec.Code to SKI #

              Correctness proofs #

              Main correctness theorem: Code.toSKI correctly computes Code.eval.

              Main result #

              Every partial recursive function on ℕ is SKI-computable.