Documentation

MeTTaIL.Semantics.Relation

inductive MeTTaIL.Reduces (p : Presentation) :
ASTASTProp

One-step reduction induced by a presentation's rewrites.

Instances For

    The premises of a rewrite hold under the current bindings, extending them with each premise's target binding (the reduct of its source).

    Instances For
      inductive MeTTaIL.ReducesMany (p : Presentation) :
      ASTASTProp

      Many-step reduction: the reflexive-transitive closure of Reduces.

      Instances For
        theorem MeTTaIL.ReducesMany.single {p : Presentation} {t t' : AST} (h : Reduces p t t') :

        A single reduction is a one-step reduction sequence.

        theorem MeTTaIL.ReducesMany.trans {p : Presentation} {t u v : AST} (h₁ : ReducesMany p t u) (h₂ : ReducesMany p u v) :

        Many-step reduction is transitive.

        theorem MeTTaIL.reduces_base (p : Presentation) (rd : RewriteDecl) (lhs rhs t : AST) (bnds : List (String × AST)) (hmem : rd p.rewrites) (hrw : rd.rw = Rewrite.base lhs rhs) (hmatch : lhs.matchPat t [] = some bnds) :
        Reduces p t (AST.inst bnds rhs)

        A base rewrite (no premises) whose left-hand side matches t reduces t to the instantiated right-hand side.

        theorem MeTTaIL.reduces_of_applyBaseRewrite (p : Presentation) (rd : RewriteDecl) (t t' : AST) (hmem : rd p.rewrites) (h : applyBaseRewrite rd t = some t') :
        Reduces p t t'

        The executable matcher is sound for the reduction relation: every reduct that applyBaseRewrite produces from a rewrite of p is a genuine one-step reduction.