- inputCtx : Lean.Parser.InputContext
- globalContext : StrataDDM.GlobalContext
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
Instances For
Record a translation error without panicking, then continue with fallback.
Use for malformed user input (as opposed to internal invariant violations,
which use TransM.error).
Equations
- Strata.TransM.recordError msg fallback = do fun (s : Strata.TransState) => ((), { inputCtx := s.inputCtx, errors := s.errors.push msg, globalContext := s.globalContext }) pure fallback
Instances For
Equations
- Strata.SourceRange.toMetaData ictx sr = Imperative.MetaData.ofSourceRange (Strata.Uri.file ictx.fileName) sr
Instances For
Equations
- Strata.getOpMetaData op = do let __do_lift ← StateT.get pure (Strata.SourceRange.toMetaData __do_lift.inputCtx op.ann)
Instances For
Equations
- Strata.getArgMetaData arg = do let __do_lift ← StateT.get pure (Strata.SourceRange.toMetaData __do_lift.inputCtx (StrataDDM.ArgF.ann arg))
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.
- Strata.checkOpArg arg name argc = pure (Array.ofFn fun (x : Fin argc) => default)
Instances For
Equations
- Strata.translateCommaSep f (StrataDDM.ArgF.seq ann StrataDDM.SepFormat.comma args) = Array.mapM f args
- Strata.translateCommaSep f arg = Strata.TransM.error (toString "Expected commaSepList: " ++ toString (repr arg))
Instances For
Equations
- Strata.translateOption f (StrataDDM.ArgF.option ann maybe_arg) = f maybe_arg
- Strata.translateOption f arg = Strata.TransM.error (toString "Expected Option: " ++ toString (repr arg))
Instances For
Equations
- Strata.translateIdent Identifier (StrataDDM.ArgF.ident ann name) = pure (Coe.coe name)
- Strata.translateIdent Identifier arg = Strata.TransM.error (toString "Expected ident: " ++ toString (repr arg))
Instances For
Translate an optional Core.label argument, returning the user-supplied
label name if one was written, or none otherwise.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Strata.translateOptionLabel default arg = do let __do_lift ← Strata.translateOptionLabel? arg pure (__do_lift.getD default)
Instances For
Equations
- Strata.translateNat (StrataDDM.ArgF.num ann n) = pure n
- Strata.translateNat arg = Strata.TransM.error (toString "translateNat expects num lit")
Instances For
Equations
- Strata.translateBitVec width (StrataDDM.ArgF.num ann n) = pure (n % 2 ^ width)
- Strata.translateBitVec width arg = Strata.TransM.error (toString "translateBitVec expects num lit")
Instances For
Equations
- Strata.translateStr (StrataDDM.ArgF.strlit ann s) = pure s
- Strata.translateStr arg = Strata.TransM.error (toString "translateStr expects string lit")
Instances For
Equations
- Strata.translateReal (StrataDDM.ArgF.decimal ann d) = pure d
- Strata.translateReal arg = Strata.TransM.error (toString "translateReal expects decimal lit")
Instances For
Translate a MetadataAnnKey to a string (bare or dialect-prefixed).
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateMetadataAnnKey arg = Strata.TransM.error (toString "translateMetadataAnnKey expected op " ++ toString (repr arg))
Instances For
Translate a MetadataAnnEntry to a MetaDataElem (flags and string values only; expression values are not yet supported).
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateMetadataAnnEntry arg = Strata.TransM.error (toString "translateMetadataAnnEntry expected op " ++ toString (repr arg))
Instances For
Translate an Option MetadataAnn argument into MetaData. Returns empty metadata if the annotation is absent.
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateOptMetadataAnn (StrataDDM.ArgF.option ann none) = pure Imperative.MetaData.empty
- Strata.translateOptMetadataAnn (StrataDDM.ArgF.option ann (some annArg)) = Strata.TransM.error (toString "translateOptMetadataAnn expected op " ++ toString (repr annArg))
- Strata.translateOptMetadataAnn arg = Strata.TransM.error (toString "translateOptMetadataAnn unexpected " ++ toString (repr arg))
Instances For
Merge explicit annotation metadata (annMd) into source-position metadata
(md).
getOpMetaData derives a provenance element from the op's DDM source
position. There is only ever one provenance, so an explicit
@[provenance = …] replaces that derived one instead of being appended
and ignored. Other keys stay additive. A future metadata validator can
reject bad input like duplicate provenance; for now the last one wins.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Merge explicit annotation metadata into source-position metadata from an op.
Combines getOpMetaData (source positions) with translateOptMetadataAnn
(user-supplied annotations).
Equations
- Strata.getMetaDataWithAnn op annotsArg = do let annMd ← Strata.translateOptMetadataAnn annotsArg let md ← Strata.getOpMetaData op pure (Strata.mergeAnnMetaData md annMd)
Instances For
Equations
- Strata.instReprGenNum = { reprPrec := Strata.instReprGenNum.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
A scoped frame of the translator. :)
- boundTypeVars : Array Lambda.TyIdentifier
- boundVars : Array (Lambda.LExpr Core.CoreLParams.mono)
- gen : GenNum
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Generate a default label and increment the counter for the given kind.
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.
Equations
- Strata.instInhabitedDecl = { default := Core.Decl.type (Core.TypeDecl.con { name := "badguy", params := [] }) Imperative.MetaData.empty }
Equations
Equations
- Strata.instInhabitedProdDeclTransBindings = { default := (Core.Decl.type (Core.TypeDecl.con { name := "badguy", params := [] }) Imperative.MetaData.empty, { }) }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- Strata.translateTypeVar op = do let args ← Strata.checkOpArg op { dialect := "Core", name := "type_var" } 1 Strata.translateIdent Lambda.TyIdentifier args[0]!
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.
- Strata.translateBindMk bindings arg = Strata.TransM.error (toString "translateBindMk expected op " ++ toString (repr arg))
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateMonoBindMk bindings arg = Strata.TransM.error (toString "translateMonoBindMk expected op " ++ toString (repr arg))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Shared binding setup for lambdas and quantifiers: translates the declaration list, creates scoped bound variables, and translates the body in the extended scope.
Translate a have x : T = value in body binding. body is translated with
x in scope (reusing withScopedBindings, as lambda does); value is
translated in the outer scope. Desugars to (λ x : T. body) value via
LExpr.mkHave.
Resolve a function from a recFuncBlock by its global-context index.
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.
- Strata.translateInvariant p bindings arg = pure []
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateMeasure p bindings arg = pure none
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
Decompose an LHS into a base identifier and a (reversed) list of index
expressions. For m[k1][k2], returns (m, [k2, k1]).
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateFnPreconds p name bindings arg = Strata.TransM.error (toString "translateFnPreconds expected seq " ++ toString (repr arg))
Instances For
Translate an assert/cover/assume statement with optional metadata annotations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- input : BindingKind
- out : BindingKind
- inout : BindingKind
- cases : BindingKind
Instances For
Equations
- Strata.instReprBindingKind = { reprPrec := Strata.instReprBindingKind.repr }
Equations
- Strata.instReprBindingKind.repr Strata.BindingKind.input prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Strata.BindingKind.input")).group prec✝
- Strata.instReprBindingKind.repr Strata.BindingKind.out prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Strata.BindingKind.out")).group prec✝
- Strata.instReprBindingKind.repr Strata.BindingKind.inout prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Strata.BindingKind.inout")).group prec✝
- Strata.instReprBindingKind.repr Strata.BindingKind.cases prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Strata.BindingKind.cases")).group prec✝
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Strata.translateInitMkBindings bindings ops = Array.mapM (fun (op : StrataDDM.Arg) => Strata.translateInitMkBinding bindings op) ops
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Like translateBindings but also returns the index of the @[cases] parameter, if any.
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.
- Strata.translateOptionFree (StrataDDM.ArgF.option ann none) = pure Core.Procedure.CheckAttr.Default
- Strata.translateOptionFree arg = Strata.TransM.error (toString "translateOptionFree unexpected " ++ toString (repr arg))
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.
- Strata.translateSpecElem p name count bindings arg = Strata.TransM.error (toString "translateSpecElem expects an op " ++ toString (repr arg))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Translate a procedure's parameter bindings (the mkBindings arg bop) and
push the body's variable scope.
Returns the partitioned input/output signatures for the header, together with
bindings extended by the parameter scope. The declaration-order invariant
lives here: the body's de Bruijn indices are assigned against the original
textual order, not the input/output partition, so the scope binds every
parameter in declaration order.
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
Translate a top-level block command as a nameless parameterless procedure
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.
- Strata.translateTransfer p bindings arg = Strata.TransM.error (toString "translateTransfer expected op " ++ toString (repr arg))
Instances For
Translate a single CFG block
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateCFGBlock p bindings arg = Strata.TransM.error (toString "translateCFGBlock expected op " ++ toString (repr arg))
Instances For
Translate a list of CFG blocks
Translate a CFG body
Equations
- One or more equations did not get rendered due to their size.
- Strata.translateCFGBody p bindings arg = Strata.TransM.error (toString "translateCFGBody expected op " ++ toString (repr arg))
Instances For
Translate a procedure with CFG body
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.
- Strata.translateOptionInline (StrataDDM.ArgF.option ann none) = pure #[]
- Strata.translateOptionInline arg = Strata.TransM.error (toString "translateOptionInline unexpected " ++ toString (repr arg))
Instances For
Translate const x : T;, a constant whose value is left unspecified.
It elaborates to a nullary function without a body, so x is constrained only
by whatever axioms mention it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Translate const x : T := v;, a constant declared together with its value.
It elaborates to a nullary function whose body is v, so the value is available
to the type checker and to symbolic evaluation without an SMT-level axiom
relating x to v. As for a function definition, the body is substituted at
each use only when the declaration is marked inline.
Like const x : T;, this form takes no type arguments: a constant is
monomorphic. Write a polymorphic nullary value with function syntax instead.
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
- Strata.instReprFnInterp.repr Strata.FnInterp.Definition prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Strata.FnInterp.Definition")).group prec✝
- Strata.instReprFnInterp.repr Strata.FnInterp.Declaration prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Strata.FnInterp.Declaration")).group prec✝
Instances For
Equations
- Strata.instReprFnInterp = { reprPrec := Strata.instReprFnInterp.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Translate a single function within a mutual recursive block.
fnOp is a recfn_decl operation.
preBindings has placeholder fvars for all functions in the block.
siblingExprs contains the opExpr for each preceding sibling (for bvar resolution).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Translate a command_recfndefs block (one or more mutually recursive functions).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Information about a single constructor extracted during translation.
This is the Strata Core-specific version of ConstructorInfo from AST.lean,
with types translated from TypeExpr to LMonoTy.
- name : Core.CoreIdent
Constructor name
- fields : Array (Core.CoreIdent × Lambda.LMonoTy)
Fields as (fieldName, fieldType) pairs with translated types
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extract and translate constructor information from a constructor list argument.
Parameters:
p: The DDM Program (provides dialect map for annotation lookup)bindings: Current translation bindings (for type variable resolution)arg: The constructor list argument from the parsed datatype command
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extract type arguments from a datatype's optional bindings argument.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Create a placeholder LDatatype for recursive type references.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Filter factory function declarations to extract constructor, tester, and field accessor decls for a single datatype.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Build LConstr list from TransConstructorInfo array.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Generate factory function declarations from a list of LDatatypes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Translate a datatype block (one or more datatype declarations).
The @[preRegisterTypes] metadata on command_datatypes ensures that
type names are pre-registered in the DDM GlobalContext before processing.
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.