Documentation

LeanSce.SCE.UnitChains

Correctness of finite chains of independently compiled units. An import-free unit is compiled under the empty context and joined by non-dependent merge. An importing unit is a sandboxed functor, also compiled under the empty context, whose imports are supplied by the preceding chain. No unit is re-elaborated under the accumulated exports.

inductive UnitChain :
Nat → SCE.Exp → SCE.Typ → Core.Exp → Prop

A nonempty chain of n units, with source composition S, accumulated exports I, and assembled core term L, using ordinary single-import linking. Only imports must be unambiguous; unrelated duplicate exports are permitted. The exports of an import-free unit may themselves include functors.

Instances For
    theorem unit_chain_elaboration {n : Nat} {S : SCE.Exp} {I : SCE.Typ} {L : Core.Exp} (hchain : UnitChain n S I L) :

    Assembling independently compiled units gives exactly the elaboration of their source composition.

    theorem unit_chain_typed {n : Nat} {S : SCE.Exp} {I : SCE.Typ} {L : Core.Exp} (hchain : UnitChain n S I L) :

    The assembled chain is well typed at its accumulated export type.

    theorem unit_chain_correctness {n : Nat} {S v : SCE.Exp} {I : SCE.Typ} {L : Core.Exp} (hchain : UnitChain n S I L) (heval : S_Sem.BStep SCE.Exp.unit S v) :

    Evaluation correctness for the whole chain, including import-free steps.

    inductive UnitChainN :
    Nat → SCE.Exp → SCE.Typ → Core.Exp → Prop

    The corresponding chain construction with linkall: an importing unit declares an interface D satisfied by the accumulated exports.

    Instances For
      theorem unit_chain_n_elaboration {n : Nat} {S : SCE.Exp} {I : SCE.Typ} {L : Core.Exp} (hchain : UnitChainN n S I L) :

      The multi-import assembly is exactly the elaboration of its source chain.

      theorem unit_chain_n_typed {n : Nat} {S : SCE.Exp} {I : SCE.Typ} {L : Core.Exp} (hchain : UnitChainN n S I L) :

      The assembled multi-import chain has its accumulated export type.

      theorem unit_chain_n_correctness {n : Nat} {S v : SCE.Exp} {I : SCE.Typ} {L : Core.Exp} (hchain : UnitChainN n S I L) (heval : S_Sem.BStep SCE.Exp.unit S v) :

      Evaluation correctness for the whole multi-import chain.