Equations
Instances For
Equations
Instances For
Equations
Equations
Instances For
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- i.quote = Lean.Syntax.mkCApp `StrataDDM.QualifiedIdent.mk #[Lean.quote `term i.dialect, Lean.quote `term i.name]
Instances For
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
Denotes a fully specified syntax category in the Strata dialect.
- ann : α
- name : QualifiedIdent
- args : Array (SyntaxCatF α)
Instances For
Equations
Equations
Equations
Instances For
Equations
- StrataDDM.instReprSyntaxCatF = { reprPrec := StrataDDM.instReprSyntaxCatF.repr }
Instances For
This refers to a value introduced in the program.
Equations
Instances For
An expression that denotes a type.
- ident
{α : Type}
(ann : α)
(name : QualifiedIdent)
(args : Array (TypeExprF α))
: TypeExprF α
A dialect defined type.
- bvar
{α : Type}
(ann : α)
(index : Nat)
: TypeExprF α
A bound type variable at the given deBruijn index in the context.
- tvar
{α : Type}
(ann : α)
(name : String)
: TypeExprF α
A polymorphic type variable (universally quantified). Used for polymorphic function type parameters
- fvar
{α : Type}
(ann : α)
(fvar : FreeVarIndex)
(args : Array (TypeExprF α))
: TypeExprF α
A reference to a global variable along with any arguments to ensure it is well-typed.
- arrow
{α : Type}
(ann : α)
(arg res : TypeExprF α)
: TypeExprF α
A function type.
Instances For
Equations
Equations
Instances For
Equations
Equations
- StrataDDM.instReprTypeExprF = { reprPrec := StrataDDM.instReprTypeExprF.repr }
An anonymous type placeholder.
Equations
Instances For
Equations
- (StrataDDM.TypeExprF.ident a a_1 a_2).ann = a
- (StrataDDM.TypeExprF.bvar a a_1).ann = a
- (StrataDDM.TypeExprF.tvar a a_1).ann = a
- (StrataDDM.TypeExprF.fvar a a_1 a_2).ann = a
- (StrataDDM.TypeExprF.arrow a a_1 a_2).ann = a
Instances For
Equations
- One or more equations did not get rendered due to their size.
- (StrataDDM.TypeExprF.bvar n idx).incIndices count = StrataDDM.TypeExprF.bvar n (idx + count)
- (StrataDDM.TypeExprF.tvar n name).incIndices count = StrataDDM.TypeExprF.tvar n name
- (StrataDDM.TypeExprF.arrow n a r).incIndices count = StrataDDM.TypeExprF.arrow n (a.incIndices count) (r.incIndices count)
Instances For
Return true if type expression has a bound variable.
Equations
- One or more equations did not get rendered due to their size.
- StrataDDM.TypeExprF.hasUnboundVar bindingCount (StrataDDM.TypeExprF.bvar n idx) = decide (idx ≥ bindingCount)
- StrataDDM.TypeExprF.hasUnboundVar bindingCount (StrataDDM.TypeExprF.tvar n name) = true
- StrataDDM.TypeExprF.hasUnboundVar bindingCount (StrataDDM.TypeExprF.arrow n a r) = (StrataDDM.TypeExprF.hasUnboundVar bindingCount a || StrataDDM.TypeExprF.hasUnboundVar bindingCount r)
Instances For
Return true if type expression has no free variables.
Equations
Instances For
Applies a transformation to each bound variable in a type expression.
Free type alias variables bound to alias
Equations
- One or more equations did not get rendered due to their size.
- (StrataDDM.TypeExprF.bvar a a_1).instTypeM bindings = bindings a a_1
- (StrataDDM.TypeExprF.tvar a a_1).instTypeM bindings = pure (StrataDDM.TypeExprF.tvar a a_1)
- (StrataDDM.TypeExprF.arrow a a_1 a_2).instTypeM bindings = StrataDDM.TypeExprF.arrow a <$> a_1.instTypeM bindings <*> a_2.instTypeM bindings
Instances For
Monadic map over all annotations in a type expression.
Equations
- One or more equations did not get rendered due to their size.
- (StrataDDM.TypeExprF.bvar a a_1).mapAnnM f = do let __do_lift ← f a pure (StrataDDM.TypeExprF.bvar __do_lift a_1)
- (StrataDDM.TypeExprF.tvar a a_1).mapAnnM f = do let __do_lift ← f a pure (StrataDDM.TypeExprF.tvar __do_lift a_1)
Instances For
Equations
Instances For
Equations
- StrataDDM.instReprSepFormat = { reprPrec := StrataDDM.instReprSepFormat.repr }
Equations
- One or more equations did not get rendered due to their size.
- StrataDDM.instReprSepFormat.repr StrataDDM.SepFormat.none prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "StrataDDM.SepFormat.none")).group prec✝
- StrataDDM.instReprSepFormat.repr StrataDDM.SepFormat.comma prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "StrataDDM.SepFormat.comma")).group prec✝
- StrataDDM.instReprSepFormat.repr StrataDDM.SepFormat.space prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "StrataDDM.SepFormat.space")).group prec✝
Instances For
Equations
Equations
- StrataDDM.instBEqSepFormat.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
- StrataDDM.SepFormat.none.toString = "seq"
- StrataDDM.SepFormat.comma.toString = "commaSepBy"
- StrataDDM.SepFormat.space.toString = "spaceSepBy"
- StrataDDM.SepFormat.spacePrefix.toString = "spacePrefixSepBy"
- StrataDDM.SepFormat.newline.toString = "newlineSepBy"
- StrataDDM.SepFormat.semicolonNewline.toString = "semicolonSepBy"
Instances For
Equations
- StrataDDM.SepFormat.fromCategoryName? { dialect := "Init", name := "Seq" } = some StrataDDM.SepFormat.none
- StrataDDM.SepFormat.fromCategoryName? { dialect := "Init", name := "CommaSepBy" } = some StrataDDM.SepFormat.comma
- StrataDDM.SepFormat.fromCategoryName? { dialect := "Init", name := "SpaceSepBy" } = some StrataDDM.SepFormat.space
- StrataDDM.SepFormat.fromCategoryName? { dialect := "Init", name := "SpacePrefixSepBy" } = some StrataDDM.SepFormat.spacePrefix
- StrataDDM.SepFormat.fromCategoryName? { dialect := "Init", name := "NewlineSepBy" } = some StrataDDM.SepFormat.newline
- StrataDDM.SepFormat.fromCategoryName? { dialect := "Init", name := "SemicolonSepBy" } = some StrataDDM.SepFormat.semicolonNewline
- StrataDDM.SepFormat.fromCategoryName? x✝ = none
Instances For
Returns true if the category name is a parametric (single-argument) built-in category:
any separator format or Init.Option.
Equations
- StrataDDM.SepFormat.isParametricCategory name = ((StrataDDM.SepFormat.fromCategoryName? name).isSome || name == { dialect := "Init", name := "Option" })
Instances For
Equations
- StrataDDM.SepFormat.instToString = { toString := StrataDDM.SepFormat.toString }
- 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
Equations
Equations
Instances For
Instances For
Equations
Equations
Instances For
Equations
Equations
- StrataDDM.instReprArgF = { reprPrec := StrataDDM.instReprArgF.repr_3 }
Equations
- StrataDDM.instReprExprF = { reprPrec := StrataDDM.instReprExprF.repr_1 }
- ann : α
- name : QualifiedIdent
Instances For
- op {α : Type} (o : OperationF α) : ArgF α
- cat {α : Type} (c : SyntaxCatF α) : ArgF α
- expr {α : Type} (e : ExprF α) : ArgF α
- type {α : Type} (e : TypeExprF α) : ArgF α
- ident {α : Type} (ann : α) (i : String) : ArgF α
- num {α : Type} (ann : α) (v : Nat) : ArgF α
- decimal {α : Type} (ann : α) (v : Decimal) : ArgF α
- strlit {α : Type} (ann : α) (i : String) : ArgF α
- bytes {α : Type} (ann : α) (a : ByteArray) : ArgF α
- option {α : Type} (ann : α) (l : Option (ArgF α)) : ArgF α
- seq {α : Type} (ann : α) (sep : SepFormat) (l : Array (ArgF α)) : ArgF α
Instances For
Equations
- (StrataDDM.ExprF.bvar a a_1).ann = a
- (StrataDDM.ExprF.fvar a a_1).ann = a
- (StrataDDM.ExprF.fn a a_1).ann = a
- (StrataDDM.ExprF.app a a_1 a_2).ann = a
Instances For
Equations
- (StrataDDM.ArgF.op o).ann = o.ann
- (StrataDDM.ArgF.cat c).ann = c.ann
- (StrataDDM.ArgF.expr e).ann = e.ann
- (StrataDDM.ArgF.type t).ann = t.ann
- (StrataDDM.ArgF.ident ann i).ann = ann
- (StrataDDM.ArgF.num ann v).ann = ann
- (StrataDDM.ArgF.decimal ann v).ann = ann
- (StrataDDM.ArgF.bytes ann a).ann = ann
- (StrataDDM.ArgF.strlit ann i).ann = ann
- (StrataDDM.ArgF.option ann l).ann = ann
- (StrataDDM.ArgF.seq ann sep l).ann = ann
Instances For
Monadic map over all annotations in a syntax category.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Map over all annotations in a syntax category.
Instances For
Monadic map over all annotations in an expression.
Equations
- (StrataDDM.ExprF.bvar a a_1).mapAnnM f = do let __do_lift ← f a pure (StrataDDM.ExprF.bvar __do_lift a_1)
- (StrataDDM.ExprF.fvar a a_1).mapAnnM f = do let __do_lift ← f a pure (StrataDDM.ExprF.fvar __do_lift a_1)
- (StrataDDM.ExprF.fn a a_1).mapAnnM f = do let __do_lift ← f a pure (StrataDDM.ExprF.fn __do_lift a_1)
- (StrataDDM.ExprF.app a a_1 a_2).mapAnnM f = do let __do_lift ← f a let __do_lift_1 ← a_1.mapAnnM f let __do_lift_2 ← a_2.mapAnnM f pure (StrataDDM.ExprF.app __do_lift __do_lift_1 __do_lift_2)
Instances For
Monadic map over all annotations in an argument.
Equations
- One or more equations did not get rendered due to their size.
- (StrataDDM.ArgF.op o).mapAnnM f = do let __do_lift ← o.mapAnnM f pure (StrataDDM.ArgF.op __do_lift)
- (StrataDDM.ArgF.cat c).mapAnnM f = do let __do_lift ← c.mapAnnM f pure (StrataDDM.ArgF.cat __do_lift)
- (StrataDDM.ArgF.expr e).mapAnnM f = do let __do_lift ← e.mapAnnM f pure (StrataDDM.ArgF.expr __do_lift)
- (StrataDDM.ArgF.type t).mapAnnM f = do let __do_lift ← t.mapAnnM f pure (StrataDDM.ArgF.type __do_lift)
- (StrataDDM.ArgF.ident ann i).mapAnnM f = do let __do_lift ← f ann pure (StrataDDM.ArgF.ident __do_lift i)
- (StrataDDM.ArgF.num ann v).mapAnnM f = do let __do_lift ← f ann pure (StrataDDM.ArgF.num __do_lift v)
- (StrataDDM.ArgF.decimal ann v).mapAnnM f = do let __do_lift ← f ann pure (StrataDDM.ArgF.decimal __do_lift v)
- (StrataDDM.ArgF.strlit ann i).mapAnnM f = do let __do_lift ← f ann pure (StrataDDM.ArgF.strlit __do_lift i)
- (StrataDDM.ArgF.bytes ann b).mapAnnM f = do let __do_lift ← f ann pure (StrataDDM.ArgF.bytes __do_lift b)
- (StrataDDM.ArgF.option ann none).mapAnnM f = do let __do_lift ← f ann pure (StrataDDM.ArgF.option __do_lift none)
- (StrataDDM.ArgF.option ann (some a_2)).mapAnnM f = do let __do_lift ← f ann let __do_lift_1 ← a_2.mapAnnM f pure (StrataDDM.ArgF.option __do_lift (some __do_lift_1))
Instances For
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
Map a pure function over all annotations in an operation.
Instances For
Instances For
Instances For
Instances For
Instances For
Instances For
Equations
Equations
Equations
- bool (e : Bool) : MetadataArg
- catbvar (index : Nat) : MetadataArg
- num (e : Nat) : MetadataArg
- option (a : Option MetadataArg) : MetadataArg
- functionTemplate (t : FunctionTemplate) : MetadataArg
Instances For
Equations
Equations
Equations
Equations
- (StrataDDM.MetadataArg.bool a).instDecidableEq (StrataDDM.MetadataArg.bool a_1) = if p : a = a_1 then isTrue ⋯ else isFalse ⋯
- (StrataDDM.MetadataArg.bool a).instDecidableEq (StrataDDM.MetadataArg.catbvar a_1) = isFalse ⋯
- (StrataDDM.MetadataArg.bool a).instDecidableEq (StrataDDM.MetadataArg.num a_1) = isFalse ⋯
- (StrataDDM.MetadataArg.bool a).instDecidableEq (StrataDDM.MetadataArg.option a_1) = isFalse ⋯
- (StrataDDM.MetadataArg.bool a).instDecidableEq (StrataDDM.MetadataArg.functionTemplate a_1) = isFalse ⋯
- (StrataDDM.MetadataArg.catbvar a).instDecidableEq (StrataDDM.MetadataArg.catbvar y_2) = if p : a = y_2 then isTrue ⋯ else isFalse ⋯
- (StrataDDM.MetadataArg.catbvar a).instDecidableEq (StrataDDM.MetadataArg.bool e) = isFalse ⋯
- (StrataDDM.MetadataArg.catbvar a).instDecidableEq (StrataDDM.MetadataArg.num e) = isFalse ⋯
- (StrataDDM.MetadataArg.catbvar a).instDecidableEq (StrataDDM.MetadataArg.option a_1) = isFalse ⋯
- (StrataDDM.MetadataArg.catbvar a).instDecidableEq (StrataDDM.MetadataArg.functionTemplate t) = isFalse ⋯
- (StrataDDM.MetadataArg.num a).instDecidableEq (StrataDDM.MetadataArg.num y_2) = if p : a = y_2 then isTrue ⋯ else isFalse ⋯
- (StrataDDM.MetadataArg.num a).instDecidableEq (StrataDDM.MetadataArg.bool e) = isFalse ⋯
- (StrataDDM.MetadataArg.num a).instDecidableEq (StrataDDM.MetadataArg.catbvar index) = isFalse ⋯
- (StrataDDM.MetadataArg.num a).instDecidableEq (StrataDDM.MetadataArg.option a_1) = isFalse ⋯
- (StrataDDM.MetadataArg.num a).instDecidableEq (StrataDDM.MetadataArg.functionTemplate t) = isFalse ⋯
- (StrataDDM.MetadataArg.option none).instDecidableEq (StrataDDM.MetadataArg.option none) = isTrue StrataDDM.MetadataArg.instDecidableEq._proof_28✝
- (StrataDDM.MetadataArg.option (some x_2)).instDecidableEq (StrataDDM.MetadataArg.option (some y_3)) = match x_2.instDecidableEq y_3 with | isTrue p => isTrue ⋯ | isFalse p => isFalse ⋯
- (StrataDDM.MetadataArg.option none).instDecidableEq (StrataDDM.MetadataArg.option (some val)) = isFalse ⋯
- (StrataDDM.MetadataArg.option (some val)).instDecidableEq (StrataDDM.MetadataArg.option none) = isFalse ⋯
- (StrataDDM.MetadataArg.option a).instDecidableEq (StrataDDM.MetadataArg.bool e) = isFalse ⋯
- (StrataDDM.MetadataArg.option a).instDecidableEq (StrataDDM.MetadataArg.catbvar index) = isFalse ⋯
- (StrataDDM.MetadataArg.option a).instDecidableEq (StrataDDM.MetadataArg.num e) = isFalse ⋯
- (StrataDDM.MetadataArg.option a).instDecidableEq (StrataDDM.MetadataArg.functionTemplate t) = isFalse ⋯
- (StrataDDM.MetadataArg.functionTemplate a).instDecidableEq (StrataDDM.MetadataArg.functionTemplate y_2) = if p : a = y_2 then isTrue ⋯ else isFalse ⋯
- (StrataDDM.MetadataArg.functionTemplate a).instDecidableEq (StrataDDM.MetadataArg.bool e) = isFalse ⋯
- (StrataDDM.MetadataArg.functionTemplate a).instDecidableEq (StrataDDM.MetadataArg.catbvar index) = isFalse ⋯
- (StrataDDM.MetadataArg.functionTemplate a).instDecidableEq (StrataDDM.MetadataArg.num e) = isFalse ⋯
- (StrataDDM.MetadataArg.functionTemplate a).instDecidableEq (StrataDDM.MetadataArg.option a_1) = isFalse ⋯
Instances For
- ident : QualifiedIdent
- args : Array MetadataArg
Instances For
Equations
Instances For
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Create scope using deBrujin index of environment.
Equations
- StrataDDM.MetadataAttr.scope idx = { ident := StrataDDM.MetadataAttr.scopeName✝, args := #[StrataDDM.MetadataArg.catbvar idx] }
Instances For
Equations
- StrataDDM.instReprMetadata = { reprPrec := StrataDDM.instReprMetadata.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- StrataDDM.Metadata.emptyWithCapacity c = { toArray := Array.emptyWithCapacity c }
Instances For
Instances For
Equations
- StrataDDM.Metadata.instEmptyCollection = { emptyCollection := StrataDDM.Metadata.empty }
Equations
- StrataDDM.Metadata.instInhabited = { default := ∅ }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
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
PreTypes are partially resolved types that may depend on values applied to other arguments. These need to be resolved to generate types.
- ident
(ann : SourceRange)
(name : QualifiedIdent)
(args : Array PreType)
: PreType
A dialect defined type.
- bvar
(ann : SourceRange)
(index : Nat)
: PreType
A bound type variable at the given deBruijn index in the context. Used for type alias parameters
- tvar
(ann : SourceRange)
(name : String)
: PreType
A polymorphic type variable (universally quantified). Used for polymorphic function type parameters
- arrow
(ann : SourceRange)
(arg res : PreType)
: PreType
A function type.
- funMacro
(ann : SourceRange)
(bindingsIndex : Nat)
(res : PreType)
: PreType
A function created from a reference to bindings and a result type.
Instances For
Equations
Equations
Equations
- StrataDDM.instReprPreType = { reprPrec := StrataDDM.instReprPreType.repr }
Return annotation on pretype.
Equations
- (StrataDDM.PreType.ident a a_1 a_2).ann = a
- (StrataDDM.PreType.bvar a a_1).ann = a
- (StrataDDM.PreType.tvar a a_1).ann = a
- (StrataDDM.PreType.arrow a a_1 a_2).ann = a
- (StrataDDM.PreType.funMacro a a_1 a_2).ann = a
Instances For
Precedence of an explicit function call f(..).
This specifically addresses the priority between f and the open paren.
Equations
- StrataDDM.callPrec = 200
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.
- ident
(level prec : Nat)
: SyntaxDefAtom
Argument reference. Parenthesizes when the argument's precedence is ≤
prec;prec = 0disables parenthesization. - str
(lit : String)
: SyntaxDefAtom
Literal string token.
- indent
(n : Nat)
(args : Array SyntaxDefAtom)
: SyntaxDefAtom
Indented block of tokens.
Instances For
Equations
Equations
Equations
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
Instances For
Equations
Equations
- StrataDDM.instReprSyntaxDef = { reprPrec := StrataDDM.instReprSyntaxDef.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- StrataDDM.SyntaxDef.ofList atoms prec = StrataDDM.SyntaxDef.std atoms.toArray prec
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- StrataDDM.DebruijnIndex.ofNat a = { val := a % n, isLt := ⋯ }
Instances For
This is the type information for an operator or function declaration.
- type
(tp : PreType)
: ArgDeclKind
Variable is an expression with the given type.
- cat
(k : SyntaxCat)
: ArgDeclKind
Variable belongs to the particular category
Instances For
Equations
Instances For
Equations
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- (StrataDDM.ArgDeclKind.type a).categoryOf = StrataDDM.SyntaxCatF.atom a.ann { dialect := "Init", name := "Expr" }
- (StrataDDM.ArgDeclKind.cat a).categoryOf = a
Instances For
Return true if this corresponds to builtin category Init.Type
Equations
Instances For
An argument declaration in an operator or function.
- ident : Var
- kind : ArgDeclKind
- metadata : Metadata
Instances For
Equations
Equations
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- StrataDDM.instReprArgDecl = { reprPrec := StrataDDM.instReprArgDecl.repr }
Equations
- StrataDDM.instBEqArgDecls.beq { toArray := a } { toArray := b } = (a == b)
- StrataDDM.instBEqArgDecls.beq x✝¹ x✝ = false
Instances For
Equations
Equations
- StrataDDM.instInhabitedArgDecls.default = { toArray := default }
Instances For
Equations
Equations
- StrataDDM.instReprArgDecls = { reprPrec := StrataDDM.instReprArgDecls.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Equations
- StrataDDM.ArgDecls.instEmptyCollection = { emptyCollection := StrataDDM.ArgDecls.empty }
Equations
- StrataDDM.ArgDecls.instGetElemNatArgDeclLtSize = { getElem := fun (a : StrataDDM.ArgDecls) (i : Nat) (p : i < a.size) => StrataDDM.ArgDecls.instGetElemNatArgDeclLtSize._private_1 a i p }
Equations
- a.foldl f init = Array.foldl f init a.toArray
Instances For
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
Indices for introducing a new expression or operation.
- nameIndex : DebruijnIndex argDecls.size
- argsIndex : Option (DebruijnIndex argDecls.size)
- typeIndex : DebruijnIndex argDecls.size
- allowCat : Bool
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Indices for introducing a new type binding.
- nameIndex : DebruijnIndex argDecls.size
- argsIndex : Option (DebruijnIndex argDecls.size)
- defIndex : Option (DebruijnIndex argDecls.size)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Datatype Type Building Functions #
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
- StrataDDM.resolveTypeRef StrataDDM.TypeRef.datatype datatypeType fieldType dialectName = Except.ok datatypeType
- StrataDDM.resolveTypeRef StrataDDM.TypeRef.fieldType datatypeType (some ft) dialectName = Except.ok ft
- StrataDDM.resolveTypeRef StrataDDM.TypeRef.fieldType datatypeType none dialectName = Except.error "TypeRef.fieldType is only valid in perField scope"
- StrataDDM.resolveTypeRef (StrataDDM.TypeRef.builtin name) datatypeType fieldType dialectName = Except.ok (StrataDDM.TypeExprF.ident default { dialect := dialectName, name := name } #[])
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Build a TypeExpr reference to the datatype with type parameters, using
.fvar for the datatype's GlobalContext index and .tvar for type parameters.
Equations
- StrataDDM.mkDatatypeTypeRef ann datatypeIndex typeParams = StrataDDM.TypeExprF.fvar ann datatypeIndex (Array.map (fun (name : String) => StrataDDM.TypeExprF.tvar ann name) typeParams)
Instances For
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
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.
- nameIndex : DebruijnIndex argDecls.size
deBrujin index of datatype name
- typeParamsIndex : DebruijnIndex argDecls.size
deBrujin index of type parameters
- constructorsIndex : DebruijnIndex argDecls.size
deBrujin index of constructors
- functionTemplates : Array FunctionTemplate
Optional list of function templates to expand
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
Equations
- value {argDecls : ArgDecls} : ValueBindingSpec argDecls → BindingSpec argDecls
- type {argDecls : ArgDecls} : TypeBindingSpec argDecls → BindingSpec argDecls
- scopedType {argDecls : ArgDecls} : TypeBindingSpec argDecls → BindingSpec argDecls
- datatype {argDecls : ArgDecls} : DatatypeBindingSpec argDecls → BindingSpec argDecls
- tvar {argDecls : ArgDecls} : TvarBindingSpec argDecls → BindingSpec argDecls
Instances For
Equations
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
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- StrataDDM.instReprSynCatDecl = { reprPrec := StrataDDM.instReprSynCatDecl.repr }
Equations
Instances For
Equations
Instances For
Equations
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- StrataDDM.instReprAnn = { reprPrec := StrataDDM.instReprAnn.repr }
A declaration of an algebraic data type.
- name : String
- argNames : Array (Ann String SourceRange)
Instances For
Equations
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- StrataDDM.instReprTypeDecl = { reprPrec := StrataDDM.instReprTypeDecl.repr }
Operator declaration
- name : String
Name of operator
- argDecls : ArgDecls
Arguments to operator.
- category : QualifiedIdent
Syntactic category of operator
- syntaxDef : SyntaxDef
Schema for operator
- metadata : Metadata
Metadata for operator.
- newBindings : Array (BindingSpec self.argDecls)
New bindings
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- StrataDDM.instReprOpDecl = { reprPrec := StrataDDM.instReprOpDecl.repr }
Equations
- StrataDDM.OpDecl.instBEq = { beq := fun (x y : StrataDDM.OpDecl) => StrataDDM.OpDecl.instBEq._private_1 x y }
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
- StrataDDM.instBEqFunctionDecl.beq x✝¹ x✝ = false
Instances For
Equations
Equations
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- num : MetadataArgType
- ident : MetadataArgType
- bool : MetadataArgType
- opt (tp : MetadataArgType) : MetadataArgType
- functionTemplate : MetadataArgType
Instances For
Equations
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.num StrataDDM.MetadataArgType.num = isTrue ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.num StrataDDM.MetadataArgType.ident = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_1✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.num StrataDDM.MetadataArgType.bool = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_2✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.num tp.opt = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.num StrataDDM.MetadataArgType.functionTemplate = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_4✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.ident StrataDDM.MetadataArgType.num = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_5✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.ident StrataDDM.MetadataArgType.ident = isTrue ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.ident StrataDDM.MetadataArgType.bool = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_6✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.ident tp.opt = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.ident StrataDDM.MetadataArgType.functionTemplate = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_8✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.bool StrataDDM.MetadataArgType.num = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_9✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.bool StrataDDM.MetadataArgType.ident = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_10✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.bool StrataDDM.MetadataArgType.bool = isTrue ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.bool tp.opt = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.bool StrataDDM.MetadataArgType.functionTemplate = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_12✝
- StrataDDM.instDecidableEqMetadataArgType.decEq tp.opt StrataDDM.MetadataArgType.num = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq tp.opt StrataDDM.MetadataArgType.ident = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq tp.opt StrataDDM.MetadataArgType.bool = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq a.opt b.opt = if h : a = b then h ▸ have inst := StrataDDM.instDecidableEqMetadataArgType.decEq a a; isTrue ⋯ else isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq tp.opt StrataDDM.MetadataArgType.functionTemplate = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.functionTemplate StrataDDM.MetadataArgType.num = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_19✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.functionTemplate StrataDDM.MetadataArgType.ident = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_20✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.functionTemplate StrataDDM.MetadataArgType.bool = isFalse StrataDDM.instDecidableEqMetadataArgType.decEq._proof_21✝
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.functionTemplate tp.opt = isFalse ⋯
- StrataDDM.instDecidableEqMetadataArgType.decEq StrataDDM.MetadataArgType.functionTemplate StrataDDM.MetadataArgType.functionTemplate = isTrue ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
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.
- name : String
- args : Array MetadataArgDecl
Instances For
Equations
Instances For
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
- syncat (d : SynCatDecl) : Decl
- op (d : OpDecl) : Decl
- type (d : TypeDecl) : Decl
- function (d : FunctionDecl) : Decl
- metadata (d : MetadataDecl) : Decl
Instances For
Equations
Equations
- StrataDDM.instBEqDecl.beq (StrataDDM.Decl.syncat a) (StrataDDM.Decl.syncat b) = (a == b)
- StrataDDM.instBEqDecl.beq (StrataDDM.Decl.op a) (StrataDDM.Decl.op b) = (a == b)
- StrataDDM.instBEqDecl.beq (StrataDDM.Decl.type a) (StrataDDM.Decl.type b) = (a == b)
- StrataDDM.instBEqDecl.beq (StrataDDM.Decl.function a) (StrataDDM.Decl.function b) = (a == b)
- StrataDDM.instBEqDecl.beq (StrataDDM.Decl.metadata a) (StrataDDM.Decl.metadata b) = (a == b)
- StrataDDM.instBEqDecl.beq x✝¹ x✝ = false
Instances For
Equations
Instances For
Equations
- StrataDDM.instReprDecl = { reprPrec := StrataDDM.instReprDecl.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- (StrataDDM.Decl.syncat a).name = a.name
- (StrataDDM.Decl.op a).name = a.name
- (StrataDDM.Decl.type a).name = a.name
- (StrataDDM.Decl.function a).name = a.name
- (StrataDDM.Decl.metadata a).name = a.name
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- StrataDDM.Collection.fold f init c = Array.foldl (fun (b : β) (d : StrataDDM.Decl) => match c.proj d with | some v => f b v | none => b) init c.declarations
Instances For
Equations
- StrataDDM.Collection.instToString = { toString := fun (c : StrataDDM.Collection α) => StrataDDM.Collection.instToString._private_1 c }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
A dialect definition.
- name : DialectName
- imports : Array DialectName
- typecheck : Bool
When false, type inference and unification are skipped during elaboration.
- cache : Std.HashMap String Decl
Instances For
Equations
- StrataDDM.Dialect.instBEq = { beq := fun (x y : StrataDDM.Dialect) => decide (x.name = y.name) && decide (x.imports = y.imports) && x.declarations == y.declarations }
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
- StrataDDM.Dialect.ofArray name importDialects a = { name := name, imports := importDialects, declarations := a }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- StrataDDM.Dialect.instMembershipString = { mem := fun (d : StrataDDM.Dialect) (nm : String) => d.mem nm = true }
Equations
Equations
- StrataDDM.DialectMap.Closed map = ∀ (d : StrataDDM.DialectName) (p : d ∈ map), (map[d].imports.all fun (x : StrataDDM.DialectName) => decide (x ∈ map)) = true
Instances For
- closed : StrataDDM.DialectMap.Closed (StrataDDM.DialectMap.map✝ self)
Instances For
Equations
- StrataDDM.DialectMap.empty = { map := ∅, closed := StrataDDM.DialectMap.empty._proof_1✝ }
Instances For
Equations
- StrataDDM.DialectMap.instEmptyCollection = { emptyCollection := StrataDDM.DialectMap.empty }
Equations
Equations
- m.mem name = decide (name ∈ StrataDDM.DialectMap.map✝ m)
Instances For
Equations
- StrataDDM.DialectMap.instMembership = { mem := fun (m : StrataDDM.DialectMap) (name : StrataDDM.DialectName) => m.mem name = true }
Equations
Equations
- One or more equations did not get rendered due to their size.
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
- dm.importedDialects dialect p = StrataDDM.DialectMap.importedDialectsAux✝ (StrataDDM.DialectMap.map✝ dm) ⋯ dialect ⋯
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
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.
Invoke a function f over each of the declaration specifications for an operator.
- expr (tp : TypeExpr) : GlobalKind
- type (params : List String) (definition : Option TypeExpr) : GlobalKind
Instances For
Equations
- StrataDDM.instBEqGlobalKind.beq (StrataDDM.GlobalKind.expr a) (StrataDDM.GlobalKind.expr b) = (a == b)
- StrataDDM.instBEqGlobalKind.beq (StrataDDM.GlobalKind.type a a_1) (StrataDDM.GlobalKind.type b b_1) = (a == b && a_1 == b_1)
- StrataDDM.instBEqGlobalKind.beq x✝¹ x✝ = false
Instances For
Equations
Equations
Equations
- StrataDDM.instReprGlobalKind = { reprPrec := StrataDDM.instReprGlobalKind.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
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:
- Looks up the operation in the dialect's operation declarations
- Checks if the operation has the appropriate metadata annotation
- Uses the indices from the annotation to extract the relevant arguments
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.
- nameMap : Std.HashMap Var FreeVarIndex
- vars : Array (Var × GlobalKind)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
- StrataDDM.GlobalContext.instInhabited = { default := ∅ }
Equations
- StrataDDM.GlobalContext.instMembershipVar = { mem := fun (ctx : StrataDDM.GlobalContext) (v : StrataDDM.Var) => v ∈ ctx.nameMap }
Equations
Define a symbol if not already present. No-op if already defined.
Equations
- ctx.ensureDefined v k = if h : v ∈ ctx then ctx else ctx.define v k h
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
- ctx.defineChecked v k true = Except.ok ctx
- ctx.defineChecked v k false = Except.error (toString "'" ++ toString v ++ toString "' already defined")
- ctx.defineChecked v k false = Except.ok (ctx.define v k h)
- ctx.defineChecked v k true = Except.error (toString "pre-registered '" ++ toString v ++ toString "' not found")
Instances For
Return the index of the variable with the given name.
Equations
- ctx.findIndex? v = ctx.nameMap.get? v
Instances For
Equations
- ctx.nameOf? idx = Option.map (fun (x : StrataDDM.Var × StrataDDM.GlobalKind) => x.fst) ctx.vars[idx]?
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
- dialects : DialectMap
Map from dialect names to the dialect definition.
- dialect : DialectName
Main dialect for program.
Top level commands in file.
- globalContext : GlobalContext
Final global context for program.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
- StrataDDM.tacticSizeOf_op_arg_dec = Lean.ParserDescr.node `StrataDDM.tacticSizeOf_op_arg_dec 1024 (Lean.ParserDescr.nonReservedSymbol "sizeOf_op_arg_dec" false)