Documentation

MeTTaIL.Semantics.Reduce

First-order matching of a pattern against a term, threading the variable bindings. A pattern variable matches any subterm (and must match consistently if it recurs); constructors match structurally; everything else matches only itself.

Equations
Instances For

    Match a list of patterns against a list of terms, pointwise.

    Equations
    Instances For
      def MeTTaIL.AST.subst1 (v : DottedPath) (repl : AST) :
      ASTAST

      Substitute repl for the variable v in a term. The Subst node's own variable is not a binder in the term tree (binders live in the grammar, not the AST), so this is plain replacement.

      Equations
      Instances For

        Substitute through a list of terms.

        Equations
        Instances For
          def MeTTaIL.AST.inst (bnds : List (String × AST)) :
          ASTAST

          Instantiate a term with variable bindings, resolving any Subst node. For Subst body repl w, if the pattern variable w is bound to a term variable, substitution targets that variable's path (the bound name); otherwise it targets w directly.

          Equations
          Instances For

            Instantiate a list of terms.

            Equations
            Instances For

              Apply a base rewrite (one with no premises) to a term: match its left-hand side, then instantiate its right-hand side. Returns none if the rewrite has premises or does not match.

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

                The base-rewrite reducts of a term in a presentation: every result of applying a premise-free rewrite whose left-hand side matches at the top level.

                Equations
                Instances For