Documentation

StrataDDM.AST

@[reducible, inline]
Equations
Instances For
    Instances For
      Equations
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Equations
            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  structure StrataDDM.SyntaxCatF (α : Type) :

                  Denotes a fully specified syntax category in the Strata dialect.

                  Instances For
                    partial def StrataDDM.instBEqSyntaxCatF.beq {α✝ : Type} [BEq α✝] :
                    SyntaxCatF α✝SyntaxCatF α✝Bool
                    @[implicit_reducible]
                    instance StrataDDM.instBEqSyntaxCatF {α✝ : Type} [BEq α✝] :
                    BEq (SyntaxCatF α✝)
                    Equations
                    @[implicit_reducible]
                    instance StrataDDM.instReprSyntaxCatF {α✝ : Type} [Repr α✝] :
                    Equations
                    partial def StrataDDM.instReprSyntaxCatF.repr {α✝ : Type} [Repr α✝] :
                    SyntaxCatF α✝NatStd.Format
                    def StrataDDM.SyntaxCatF.atom {α : Type} (ann : α) (ident : QualifiedIdent) :
                    Equations
                    Instances For

                      Return true if this corresponds to builtin category Init.Type

                      Equations
                      Instances For
                        Equations
                        • =
                        Instances For
                          @[reducible, inline]

                          This refers to a value introduced in the program.

                          Equations
                          Instances For
                            inductive StrataDDM.TypeExprF (α : Type) :

                            An expression that denotes a type.

                            Instances For
                              partial def StrataDDM.instBEqTypeExprF.beq {α✝ : Type} [BEq α✝] :
                              TypeExprF α✝TypeExprF α✝Bool
                              @[implicit_reducible]
                              instance StrataDDM.instBEqTypeExprF {α✝ : Type} [BEq α✝] :
                              BEq (TypeExprF α✝)
                              Equations
                              @[implicit_reducible]
                              instance StrataDDM.instReprTypeExprF {α✝ : Type} [Repr α✝] :
                              Repr (TypeExprF α✝)
                              Equations
                              partial def StrataDDM.instReprTypeExprF.repr {α✝ : Type} [Repr α✝] :
                              TypeExprF α✝NatStd.Format

                              An anonymous type placeholder.

                              Equations
                              Instances For
                                def StrataDDM.TypeExprF.mkFunType {α : Type} (n : α) (bindings : Array (String × TypeExprF α)) (res : TypeExprF α) :
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[irreducible]
                                  def StrataDDM.TypeExprF.incIndices {α : Type} (tp : TypeExprF α) (count : Nat) :
                                  Equations
                                  Instances For
                                    @[irreducible]
                                    def StrataDDM.TypeExprF.hasUnboundVar {α : Type} (bindingCount : Nat := 0) :

                                    Return true if type expression has a bound variable.

                                    Equations
                                    Instances For

                                      Return true if type expression has no free variables.

                                      Equations
                                      Instances For
                                        @[irreducible]
                                        def StrataDDM.TypeExprF.instTypeM {m : TypeType u_1} {α : Type} [Monad m] (d : TypeExprF α) (bindings : αNatm (TypeExprF α)) :
                                        m (TypeExprF α)

                                        Applies a transformation to each bound variable in a type expression.

                                        Free type alias variables bound to alias

                                        Equations
                                        Instances For
                                          @[irreducible, specialize #[]]
                                          def StrataDDM.TypeExprF.mapAnnM {α β : Type} {m : TypeType u_1} [Monad m] (t : TypeExprF α) (f : αm β) :
                                          m (TypeExprF β)

                                          Monadic map over all annotations in a type expression.

                                          Equations
                                          Instances For
                                            @[specialize #[]]
                                            def StrataDDM.TypeExprF.mapAnn {α β : Type} (t : TypeExprF α) (f : αβ) :

                                            Map over all annotations in a type expression.

                                            Equations
                                            Instances For

                                              Separator format for sequence formatting

                                              Instances For
                                                Equations
                                                Instances For

                                                  Returns true if the category name is a parametric (single-argument) built-in category: any separator format or Init.Option.

                                                  Equations
                                                  Instances For
                                                    inductive StrataDDM.ExprF (α : Type) :
                                                    • bvar {α : Type} (ann : α) (idx : Nat) : ExprF α

                                                      A bound variable reference (de Bruijn index).

                                                      If this is a function, then the arguments are always value-level; type arguments are omitted.

                                                    • fvar {α : Type} (ann : α) (idx : FreeVarIndex) : ExprF α

                                                      A free variable reference.

                                                      If this is a function, then the arguments are always value-level; type arguments are omitted.

                                                    • fn {α : Type} (ann : α) (ident : QualifiedIdent) : ExprF α

                                                      A named dialect function.

                                                    • app {α : Type} (ann : α) (e : ExprF α) (a : ArgF α) : ExprF α

                                                      Function application.

                                                    Instances For
                                                      partial def StrataDDM.instReprArgF.repr_3 {α✝ : Type} [Repr α✝] :
                                                      ArgF α✝NatStd.Format
                                                      partial def StrataDDM.instReprArgF.repr_1 {α✝ : Type} [Repr α✝] :
                                                      ExprF α✝NatStd.Format
                                                      partial def StrataDDM.instReprOperationF.repr_2 {α✝ : Type} [Repr α✝] :
                                                      OperationF α✝NatStd.Format
                                                      partial def StrataDDM.instReprArgF.repr_2 {α✝ : Type} [Repr α✝] :
                                                      OperationF α✝NatStd.Format
                                                      partial def StrataDDM.instReprExprF.repr_3 {α✝ : Type} [Repr α✝] :
                                                      ArgF α✝NatStd.Format
                                                      @[implicit_reducible]
                                                      instance StrataDDM.instReprOperationF {α✝ : Type} [Repr α✝] :
                                                      Equations
                                                      @[implicit_reducible]
                                                      instance StrataDDM.instReprArgF {α✝ : Type} [Repr α✝] :
                                                      Repr (ArgF α✝)
                                                      Equations
                                                      partial def StrataDDM.instReprOperationF.repr_3 {α✝ : Type} [Repr α✝] :
                                                      ArgF α✝NatStd.Format
                                                      @[implicit_reducible]
                                                      instance StrataDDM.instReprExprF {α✝ : Type} [Repr α✝] :
                                                      Repr (ExprF α✝)
                                                      Equations
                                                      partial def StrataDDM.instReprExprF.repr_1 {α✝ : Type} [Repr α✝] :
                                                      ExprF α✝NatStd.Format
                                                      partial def StrataDDM.instReprOperationF.repr_1 {α✝ : Type} [Repr α✝] :
                                                      ExprF α✝NatStd.Format
                                                      partial def StrataDDM.instReprExprF.repr_2 {α✝ : Type} [Repr α✝] :
                                                      OperationF α✝NatStd.Format
                                                      structure StrataDDM.OperationF (α : Type) :
                                                      Instances For
                                                        inductive StrataDDM.ArgF (α : Type) :
                                                        Instances For
                                                          def StrataDDM.ExprF.ann {α : Type} :
                                                          ExprF αα
                                                          Equations
                                                          Instances For
                                                            def StrataDDM.ExprF.flatten {α : Type} (e : ExprF α) (prev : List (ArgF α) := []) :
                                                            ExprF α × List (ArgF α)

                                                            Flattens a curried application expression into its head and list of arguments. For example, ((f a) b) c becomes (f, [a, b, c]).

                                                            Equations
                                                            Instances For
                                                              @[irreducible, specialize #[]]
                                                              def StrataDDM.SyntaxCatF.mapAnnM {α β : Type} {m : TypeType u_1} [Monad m] (c : SyntaxCatF α) (f : αm β) :
                                                              m (SyntaxCatF β)

                                                              Monadic map over all annotations in a syntax category.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                @[specialize #[]]
                                                                def StrataDDM.SyntaxCatF.mapAnn {α β : Type} (c : SyntaxCatF α) (f : αβ) :

                                                                Map over all annotations in a syntax category.

                                                                Equations
                                                                Instances For
                                                                  @[irreducible, specialize #[]]
                                                                  def StrataDDM.ExprF.mapAnnM {α β : Type} {m : TypeType u_1} [Monad m] (e : ExprF α) (f : αm β) :
                                                                  m (ExprF β)

                                                                  Monadic map over all annotations in an expression.

                                                                  Equations
                                                                  Instances For
                                                                    @[irreducible, specialize #[]]
                                                                    def StrataDDM.ArgF.mapAnnM {α β : Type} {m : TypeType u_1} [Monad m] (a : ArgF α) (f : αm β) :
                                                                    m (ArgF β)

                                                                    Monadic map over all annotations in an argument.

                                                                    Equations
                                                                    Instances For
                                                                      @[irreducible, specialize #[]]
                                                                      def StrataDDM.OperationF.mapAnnM {α β : Type} {m : TypeType u_1} [Monad m] (op : OperationF α) (f : αm β) :
                                                                      m (OperationF β)

                                                                      Map a monadic function over all annotations in an operation.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        @[specialize #[]]
                                                                        def StrataDDM.ExprF.mapAnn {α β : Type} (e : ExprF α) (f : αβ) :

                                                                        Map a pure function over all annotations in an expression.

                                                                        Equations
                                                                        Instances For
                                                                          @[specialize #[]]
                                                                          def StrataDDM.ArgF.mapAnn {α β : Type} (a : ArgF α) (f : αβ) :
                                                                          ArgF β

                                                                          Map a pure function over all annotations in an argument.

                                                                          Equations
                                                                          Instances For
                                                                            @[specialize #[]]
                                                                            def StrataDDM.OperationF.mapAnn {α β : Type} (op : OperationF α) (f : αβ) :

                                                                            Map a pure function over all annotations in an operation.

                                                                            Equations
                                                                            Instances For
                                                                              @[reducible, inline]
                                                                              Equations
                                                                              Instances For
                                                                                @[reducible, inline]
                                                                                Equations
                                                                                Instances For
                                                                                  @[implicit_reducible]
                                                                                  instance StrataDDM.instBEqExprF {α : Type} [BEq α] :
                                                                                  BEq (ExprF α)
                                                                                  Equations
                                                                                  @[implicit_reducible]
                                                                                  instance StrataDDM.instBEqArgF {α : Type} [BEq α] :
                                                                                  BEq (ArgF α)
                                                                                  Equations
                                                                                  Instances For
                                                                                    Equations
                                                                                    Instances For
                                                                                      Equations
                                                                                      Instances For
                                                                                        Equations
                                                                                        • One or more equations did not get rendered due to their size.
                                                                                        Instances For

                                                                                          Create scope using deBrujin index of environment.

                                                                                          Equations
                                                                                          Instances For
                                                                                            Instances For
                                                                                              def StrataDDM.instDecidableEqMetadata.decEq (x✝ x✝¹ : Metadata) :
                                                                                              Decidable (x✝ = x✝¹)
                                                                                              Equations
                                                                                              Instances For
                                                                                                Equations
                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                Instances For
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      @[implicit_reducible]
                                                                                                      Equations
                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                      @[implicit_reducible]
                                                                                                      Equations
                                                                                                      • One or more equations did not get rendered due to their size.

                                                                                                      Returns the typeParams index if @[scopeTVar] is present. Converts .type bindings from typeParams into .tvar bindings for constructor elaboration.

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

                                                                                                        Returns the name index if @[declareTVar] is present. Used for operations that introduce a type variable (creates .tvar binding in result context).

                                                                                                        Equations
                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                        Instances For
                                                                                                          def StrataDDM.Metadata.resultLevel (varCount : Nat) (metadata : Metadata) :
                                                                                                          Except String (Option (Fin varCount))

                                                                                                          Returns the index of the value in the binding for the given variable of the scope to use.

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

                                                                                                            Returns the argument index from @[preRegisterTypes] metadata, if present.

                                                                                                            Equations
                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                            Instances For
                                                                                                              def StrataDDM.Metadata.preRegisterTypesLevel (varCount : Nat) (metadata : Metadata) :
                                                                                                              Except String (Option (Fin varCount))

                                                                                                              Returns the level for @[preRegisterTypes] metadata, if present.

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

                                                                                                                Returns the argument index from @[preRegisterFunctions] metadata, if present.

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

                                                                                                                  Returns the level for @[preRegisterFunctions] metadata, if present.

                                                                                                                  Equations
                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                  Instances For
                                                                                                                    @[reducible, inline]
                                                                                                                    Equations
                                                                                                                    Instances For

                                                                                                                      PreTypes are partially resolved types that may depend on values applied to other arguments. These need to be resolved to generate types.

                                                                                                                      Instances For

                                                                                                                        Return annotation on pretype.

                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          Equations
                                                                                                                          Instances For

                                                                                                                            Precedence of an explicit function call f(..).

                                                                                                                            This specifically addresses the priority between f and the open paren.

                                                                                                                            Equations
                                                                                                                            Instances For

                                                                                                                              Precedence of the empty application operator f x in expressions and types.

                                                                                                                              Equations
                                                                                                                              Instances For

                                                                                                                                Precedence of the arrow operator t -> u in types.

                                                                                                                                Equations
                                                                                                                                Instances For

                                                                                                                                  A token in a syntax definition.

                                                                                                                                  Instances For

                                                                                                                                    Syntax definition for an operator or function.

                                                                                                                                    • std (atoms : Array SyntaxDefAtom) (prec : Nat) : SyntaxDef

                                                                                                                                      Standard syntax with explicit atoms and precedence.

                                                                                                                                    • passthrough : SyntaxDef

                                                                                                                                      Single-argument syntax that inherits the argument's precedence.

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

                                                                                                                                        Creates syntax of the form name(arg1, ..., argn).

                                                                                                                                        If n is 0, then this is just name.

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

                                                                                                                                                  This is the type information for an operator or function declaration.

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

                                                                                                                                                      Return true if this corresponds to builtin category Init.Type

                                                                                                                                                      Equations
                                                                                                                                                      Instances For

                                                                                                                                                        An argument declaration in an operator or function.

                                                                                                                                                        Instances For
                                                                                                                                                          Equations
                                                                                                                                                          Instances For
                                                                                                                                                            Equations
                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                            Instances For
                                                                                                                                                              Instances For
                                                                                                                                                                Equations
                                                                                                                                                                Instances For
                                                                                                                                                                  Equations
                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                  Instances For
                                                                                                                                                                    Equations
                                                                                                                                                                    Instances For
                                                                                                                                                                      def StrataDDM.ArgDecls.foldl {α : Type u_1} (a : ArgDecls) (f : αArgDeclα) (init : α) :
                                                                                                                                                                      α
                                                                                                                                                                      Equations
                                                                                                                                                                      Instances For
                                                                                                                                                                        def StrataDDM.ArgDecls.argScopeLevel (argDecls : ArgDecls) (level : Fin argDecls.size) :
                                                                                                                                                                        Except String (Option (Fin level))

                                                                                                                                                                        Returns the index of the value in the binding for the given variable of the scope to use.

                                                                                                                                                                        Equations
                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                        Instances For
                                                                                                                                                                          def StrataDDM.ArgDecls.argScopeTVarLevel (argDecls : ArgDecls) (level : Fin argDecls.size) :
                                                                                                                                                                          Except String (Option (Fin level))

                                                                                                                                                                          Returns the typeParams level if @[scopeTVar] is present.

                                                                                                                                                                          Equations
                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                          Instances For
                                                                                                                                                                            structure StrataDDM.ValueBindingSpec (argDecls : ArgDecls) :

                                                                                                                                                                            Indices for introducing a new expression or operation.

                                                                                                                                                                            Instances For
                                                                                                                                                                              Equations
                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                              Instances For
                                                                                                                                                                                structure StrataDDM.TypeBindingSpec (argDecls : ArgDecls) :

                                                                                                                                                                                Indices for introducing a new type binding.

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

                                                                                                                                                                                    Datatype Type Building Functions #

                                                                                                                                                                                    def StrataDDM.resolveTypeRef (ref : TypeRef) (datatypeType : TypeExpr) (fieldType : Option TypeExpr := none) (dialectName : String) :

                                                                                                                                                                                    Resolve a type reference to a concrete TypeExpr. A type reference is either a datatype, field type (within perField/perConstructor scope), or a built-in (e.g. "bool")

                                                                                                                                                                                    Equations
                                                                                                                                                                                    Instances For

                                                                                                                                                                                      Information about a single constructor in a datatype.

                                                                                                                                                                                      Instances For
                                                                                                                                                                                        Equations
                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                        Instances For
                                                                                                                                                                                          def StrataDDM.mkDatatypeTypeRef (ann : SourceRange) (datatypeIndex : FreeVarIndex) (typeParams : Array String) :

                                                                                                                                                                                          Build a TypeExpr reference to the datatype with type parameters, using .fvar for the datatype's GlobalContext index and .tvar for type parameters.

                                                                                                                                                                                          Equations
                                                                                                                                                                                          Instances For
                                                                                                                                                                                            def StrataDDM.mkConstructorType (ann : SourceRange) (datatypeType : TypeExpr) (fields : Array (String × TypeExpr)) :

                                                                                                                                                                                            Build an arrow type from field types to the datatype type. E.g. for cons, creates a -> List a -> List a.

                                                                                                                                                                                            Equations
                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                            Instances For
                                                                                                                                                                                              def StrataDDM.buildFunctionType (template : FunctionTemplate) (datatypeType : TypeExpr) (fieldType : Option TypeExpr) (dialectName : String) :

                                                                                                                                                                                              Build a function type from parameter types and return type. Returns an arrow type: param1 -> param2 -> ... -> returnType

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

                                                                                                                                                                                                Specification for datatype declarations. Includes indices for extracting datatype information and optional function templates.

                                                                                                                                                                                                Instances For
                                                                                                                                                                                                  Equations
                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                    structure StrataDDM.TvarBindingSpec (argDecls : ArgDecls) :

                                                                                                                                                                                                    Specification for declaring a single type variable. Creates a .tvar binding in the result context.

                                                                                                                                                                                                    • nameIndex : DebruijnIndex argDecls.size

                                                                                                                                                                                                      deBrujin index of the identifier to become a type variable

                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                      Equations
                                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                        inductive StrataDDM.BindingSpec (argDecls : ArgDecls) :
                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                          @[implicit_reducible]
                                                                                                                                                                                                          instance StrataDDM.instReprBindingSpec {argDecls✝ : ArgDecls} :
                                                                                                                                                                                                          Repr (BindingSpec argDecls✝)
                                                                                                                                                                                                          Equations
                                                                                                                                                                                                          def StrataDDM.instReprBindingSpec.repr {argDecls✝ : ArgDecls} :
                                                                                                                                                                                                          BindingSpec argDecls✝NatStd.Format
                                                                                                                                                                                                          Equations
                                                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                            Equations
                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                              def StrataDDM.parseNewBindings! (md : Metadata) (argDecls : ArgDecls) :
                                                                                                                                                                                                              Array (BindingSpec argDecls)
                                                                                                                                                                                                              Equations
                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                      structure StrataDDM.Ann (Base α : Type) :
                                                                                                                                                                                                                      • ann : α
                                                                                                                                                                                                                      • val : Base
                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                        def StrataDDM.instBEqAnn.beq {Base✝ α✝ : Type} [BEq Base✝] [BEq α✝] :
                                                                                                                                                                                                                        Ann Base✝ α✝Ann Base✝ α✝Bool
                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                          @[implicit_reducible]
                                                                                                                                                                                                                          instance StrataDDM.instBEqAnn {Base✝ α✝ : Type} [BEq Base✝] [BEq α✝] :
                                                                                                                                                                                                                          BEq (Ann Base✝ α✝)
                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                          def StrataDDM.instDecidableEqAnn.decEq {Base✝ α✝ : Type} [DecidableEq Base✝] [DecidableEq α✝] (x✝ x✝¹ : Ann Base✝ α✝) :
                                                                                                                                                                                                                          Decidable (x✝ = x✝¹)
                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                            @[implicit_reducible]
                                                                                                                                                                                                                            instance StrataDDM.instDecidableEqAnn {Base✝ α✝ : Type} [DecidableEq Base✝] [DecidableEq α✝] :
                                                                                                                                                                                                                            DecidableEq (Ann Base✝ α✝)
                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            @[implicit_reducible]
                                                                                                                                                                                                                            instance StrataDDM.instInhabitedAnn {a✝ : Type} [Inhabited a✝] {a✝¹ : Type} [Inhabited a✝¹] :
                                                                                                                                                                                                                            Inhabited (Ann a✝ a✝¹)
                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            def StrataDDM.instInhabitedAnn.default {a✝ : Type} [Inhabited a✝] {a✝¹ : Type} [Inhabited a✝¹] :
                                                                                                                                                                                                                            Ann a✝ a✝¹
                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                              def StrataDDM.instReprAnn.repr {Base✝ α✝ : Type} [Repr Base✝] [Repr α✝] :
                                                                                                                                                                                                                              Ann Base✝ α✝NatStd.Format
                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                @[implicit_reducible]
                                                                                                                                                                                                                                instance StrataDDM.instReprAnn {Base✝ α✝ : Type} [Repr Base✝] [Repr α✝] :
                                                                                                                                                                                                                                Repr (Ann Base✝ α✝)
                                                                                                                                                                                                                                Equations

                                                                                                                                                                                                                                A declaration of an algebraic data type.

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

                                                                                                                                                                                                                                      Operator declaration

                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                            @[reducible, inline]
                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                                                Declaration of a metadata tag in a dialect.

                                                                                                                                                                                                                                                                Metadata has an optional argument that must have the specified type.

                                                                                                                                                                                                                                                                N.B. We may want to further restrict where metadata can appear.

                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                      inductive StrataDDM.Decl :
                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                        @[implicit_reducible]
                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                          structure StrataDDM.Collection (α : Type) :
                                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                                            @[implicit_reducible]
                                                                                                                                                                                                                                                                            instance StrataDDM.Collection.instForInOfMonad {m : Type u_1 → Type u_2} {α : Type} [Monad m] :
                                                                                                                                                                                                                                                                            ForIn m (Collection α) α
                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                            def StrataDDM.Collection.fold {α : Type} {β : Type u_1} (f : βαβ) (init : β) (c : Collection α) :
                                                                                                                                                                                                                                                                            β
                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                @[implicit_reducible]
                                                                                                                                                                                                                                                                                instance StrataDDM.Collection.instGetElem?StringMem {α : Type} :
                                                                                                                                                                                                                                                                                GetElem? (Collection α) String α fun (c : Collection α) (nm : String) => nm c
                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                • One or more equations did not get rendered due to their size.

                                                                                                                                                                                                                                                                                A dialect definition.

                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                  @[implicit_reducible]
                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                    @[implicit_reducible]
                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                    opaque StrataDDM.DialectMap.insert (m : DialectMap) (d : Dialect) (_d_new : ¬d.name m) (d_imports_ok : (d.imports.all fun (x : DialectName) => decide (x m)) = true) :

                                                                                                                                                                                                                                                                                                    This inserts a new dialect into the dialect map.

                                                                                                                                                                                                                                                                                                    This requires propositions to ensure we do not change the semantics of dialects and imports are already in dialect.

                                                                                                                                                                                                                                                                                                    This inserts a dialect in to the dialect map.

                                                                                                                                                                                                                                                                                                    It panics if a dialect with the same name is already in the map or if the dialect imports a dialect not already in the map.

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

                                                                                                                                                                                                                                                                                                        Return dialects in map.

                                                                                                                                                                                                                                                                                                        Note that no specific ordering is made on dialects returned.

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

                                                                                                                                                                                                                                                                                                            Return set of all dialects that are imported by dialect.

                                                                                                                                                                                                                                                                                                            This includes transitive imports.

                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                                                                                                                              Look up an operation's metadata in the dialect. Returns the OpDecl if found, or none if the operation is not in the dialect.

                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                              Instances For
                                                                                                                                                                                                                                                                                                                partial def StrataDDM.foldOverArgBindingSpecs {α : Type} {β : Type u_1} (m : DialectMap) (f : βα(argDecls : ArgDecls) → BindingSpec argDeclsVector (ArgF α) argDecls.sizeβ) (init : β) (a : ArgF α) :
                                                                                                                                                                                                                                                                                                                β

                                                                                                                                                                                                                                                                                                                Recursively folds over all binding specifications declared within an argument. Used to collect type bindings, value bindings, and other declarations that appear nested within operation arguments.

                                                                                                                                                                                                                                                                                                                partial def StrataDDM.OperationF.foldBindingSpecs {α : Type} {β : Type u_1} (m : DialectMap) (f : βα{argDecls : ArgDecls} → BindingSpec argDeclsVector (ArgF α) argDecls.sizeβ) (init : β) (op : OperationF α) :
                                                                                                                                                                                                                                                                                                                β

                                                                                                                                                                                                                                                                                                                Invoke a function f over each of the declaration specifications for an operator.

                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                                    partial def StrataDDM.resolveBindingIndices {argDecls : ArgDecls} (m : DialectMap) (src : SourceRange) (b : BindingSpec argDecls) (args : Vector Arg argDecls.size) :

                                                                                                                                                                                                                                                                                                                    Resolves a binding spec into a global kind.

                                                                                                                                                                                                                                                                                                                    Annotation-based Constructor Info Extraction #

                                                                                                                                                                                                                                                                                                                    The following functions implement constructor info extraction using @[constructor(name, fields)] and @[field(name, tp)] annotations.

                                                                                                                                                                                                                                                                                                                    The annotation-based approach:

                                                                                                                                                                                                                                                                                                                    1. Looks up the operation in the dialect's operation declarations
                                                                                                                                                                                                                                                                                                                    2. Checks if the operation has the appropriate metadata annotation
                                                                                                                                                                                                                                                                                                                    3. Uses the indices from the annotation to extract the relevant arguments
                                                                                                                                                                                                                                                                                                                    @[irreducible]

                                                                                                                                                                                                                                                                                                                    This function traverses a constructor list AST node and extracts structured information about each constructor, including its name and fields using the dialect annotations @[constructor], @[constructorListAtom], @[constructorListPush].

                                                                                                                                                                                                                                                                                                                    Example: For { None(), Some(value: T) }, returns:

                                                                                                                                                                                                                                                                                                                    #[
                                                                                                                                                                                                                                                                                                                      { name := "None", fields := #[] },
                                                                                                                                                                                                                                                                                                                      { name := "Some", fields := #[("value", <TypeExpr for T>)] }
                                                                                                                                                                                                                                                                                                                    ]
                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                    Instances For

                                                                                                                                                                                                                                                                                                                      Typing environment created from declarations in an environment.

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

                                                                                                                                                                                                                                                                                                                          Define a symbol. Caller must prove v ∉ ctx.

                                                                                                                                                                                                                                                                                                                          Equations
                                                                                                                                                                                                                                                                                                                          Instances For

                                                                                                                                                                                                                                                                                                                            Define a symbol if not already present. No-op if already defined.

                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                            Instances For

                                                                                                                                                                                                                                                                                                                              Define a symbol, with behavior controlled by preRegistered:

                                                                                                                                                                                                                                                                                                                              • preRegistered = true: the name is expected to already exist (was pre-registered). Returns the context unchanged, or an error if missing.
                                                                                                                                                                                                                                                                                                                              • preRegistered = false: the name must be fresh. Defines it, or returns an error if already present.
                                                                                                                                                                                                                                                                                                                              Equations
                                                                                                                                                                                                                                                                                                                              Instances For

                                                                                                                                                                                                                                                                                                                                Return the index of the variable with the given name.

                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                Instances For
                                                                                                                                                                                                                                                                                                                                  Equations
                                                                                                                                                                                                                                                                                                                                  • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                  Instances For
                                                                                                                                                                                                                                                                                                                                    def StrataDDM.GlobalContext.expandFunctionTemplates (dialectName : String) (src : SourceRange) (datatypeName : String) (datatypeType : TypeExpr) (constructorInfo : Array ConstructorInfo) (templates : Array FunctionTemplate) (gctx : GlobalContext) :

                                                                                                                                                                                                                                                                                                                                    Register constructor signatures and expand function templates for a datatype, returning the updated GlobalContext and any error messages.

                                                                                                                                                                                                                                                                                                                                    dialectName is the dialect that owns the @[declareDatatype]-annotated operator. It is used to qualify builtin type references in templates (e.g., .builtin "bool" resolves to ⟨dialectName, "bool"⟩).

                                                                                                                                                                                                                                                                                                                                    Equations
                                                                                                                                                                                                                                                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                    Instances For
                                                                                                                                                                                                                                                                                                                                      Equations
                                                                                                                                                                                                                                                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                      Instances For
                                                                                                                                                                                                                                                                                                                                        Equations
                                                                                                                                                                                                                                                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                        Instances For
                                                                                                                                                                                                                                                                                                                                          Instances For
                                                                                                                                                                                                                                                                                                                                            @[implicit_reducible]
                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                            Equations
                                                                                                                                                                                                                                                                                                                                            • One or more equations did not get rendered due to their size.
                                                                                                                                                                                                                                                                                                                                            Instances For
                                                                                                                                                                                                                                                                                                                                              def StrataDDM.Program.create (dialects : DialectMap) (dialect : DialectName) (commands : Array Operation) :

                                                                                                                                                                                                                                                                                                                                              This creates a program. It is added in addition to Program.mk to simplify the ToExpr Program instance.

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

                                                                                                                                                                                                                                                                                                                                                This tactic, added to the decreasing_trivial toolbox, proves that sizeOf a < sizeOf as when a ∈ as, which is useful for well founded recursions over a nested inductive like inductive T | mk : List T → T.

                                                                                                                                                                                                                                                                                                                                                Equations
                                                                                                                                                                                                                                                                                                                                                Instances For