Fail-closed bridge from decoded compiler data to the fixed interpreter AST. Successful lowering is syntax construction, not execution readiness or UB freedom. The original envelope and source scopes remain available beside the MIR body.
Equations
Instances For
Membership acceleration whose type ties it to the exact source array. Its constructor is private, and the exactness field proves that its value is the corresponding index built from that array. Any update must preserve this equality.
- values : Std.HashSet TypeId
Instances For
- values : Std.HashSet AllocationId
Instances For
- values : Std.HashMap TypeId Nat
Instances For
Each supplied type ID must refer to this compilation's metadata graph.
Exact byte widths from compiler layout metadata; required for scalar constants.
- allocationIds : Array AllocationId
- obligations : Array Obligation
Raw source document used only to revalidate exact source-path roles while lowering. A bare caller-supplied path never discharges an obligation.
- compilerValueMemo : Option CompilerValueMemo
- typeIndex : Option (LowerContextTypeIndex self.typeIds)
Optional exact-array certificates; hand-built contexts default to the original linear lookup behavior.
- allocationIndex : Option (LowerContextAllocationIndex self.allocationIds)
- scalarIndex : Option (LowerContextScalarIndex self.scalarSizes)
Instances For
Consume complete import-time compiler values; manual contexts decode directly.
Equations
- ctx.decodeCompilerValue raw = Miri.Input.decodeCompilerValueWithMemo raw ctx.compilerValueMemo
Instances For
Equations
Instances For
Equations
- ctx.containsAllocationId id = match ctx.allocationIndex with | some index => index.values.contains id | none => ctx.allocationIds.contains id
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rebase the source type universe and rebuild its private membership cache.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rebase the allocation universe and rebuild its private membership cache.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rebase scalar layouts and rebuild the first-row-preserving width cache.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Derive scalar widths from compiler metadata, never from bits or host types.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Resolve graph identities from the same decoded compilation. Metadata semantics remain independent from syntax lowering and its obligations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A prepared lowering context tied to one exact decoded source document. The private constructor and equality field prevent reusing it for a different document, even when the documents serialize to equal JSON.
- value : LowerContext
Instances For
Prepare the context and retain its exact document identity in the type.
Equations
- Miri.Input.LowerContext.bindDocument document = { value := Miri.Input.LowerContext.ofDocument document, exact := ⋯ }
Instances For
- body : MIR.Body
- spans : Array SourceSpanData
- input : BodyCore
- definitions : Array DefinitionId
- typeConstants : Array MIR.TypeConst
- obligations : Array Obligation
Instances For
Resolve a crate-qualified compiler definition into this bundle's dense identity. Raw rustc definition indices are never runtime definition IDs.
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
Constructor inventory. true means a lowering branch exists, subject to
child metadata checks; it does not mean execution semantics is implemented.
Exhaustive matches make newly added input constructors require a decision.
Equations
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.use = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.binaryOp = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.unaryOp = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.discriminant = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.copyForDeref = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.wrapUnsafeBinder = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.repeat = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.ref = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.threadLocalRef = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.rawPtr = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.cast = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.aggregate = true
- Miri.Input.rvalueLoweringBranch Miri.Input.RvalueVariant.reborrow = true
- Miri.Input.rvalueLoweringBranch (Miri.Input.RvalueVariant.unknown value) = false
Instances For
Equations
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.assign = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.setDiscriminant = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.storageLive = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.storageDead = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.placeMention = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.constEvalCounter = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.nop = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.fakeRead = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.ascribeUserType = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.coverage = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.intrinsic = true
- Miri.Input.statementLoweringBranch Miri.Input.StatementVariant.backwardIncompatibleDropHint = true
- Miri.Input.statementLoweringBranch (Miri.Input.StatementVariant.unknown value) = false
Instances For
Equations
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.goto = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.unwindResume = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.return = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.unreachable = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.assert = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.coroutineDrop = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.falseEdge = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.switchInt = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.unwindTerminate = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.drop = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.call = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.tailCall = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.yield = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.falseUnwind = true
- Miri.Input.terminatorLoweringBranch Miri.Input.TerminatorVariant.inlineAsm = true
- Miri.Input.terminatorLoweringBranch (Miri.Input.TerminatorVariant.unknown value) = false
Instances For
A standalone body's definition/type-constant/span IDs are local to this
result. Use lowerBodies or lowerProgram for cross-function linking.
Equations
- Miri.Input.lowerBody ctx input = Except.map Prod.fst (Miri.Input.lowerBodyState✝ ctx input { })
Instances For
- bodies : Array LoweredBody
- spans : Array SourceSpanData
- definitions : Array DefinitionId
- typeConstants : Array MIR.TypeConst
Instances For
Lower a compilation's bodies through one shared interner, including mutually recursive references. Every returned body uses the same ID tables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- bundle : LoweredBodies
Root body indices into
bundle.bodies, in the original document order.- instances : Array (InstanceId × Nat)
Instance graph identity to body index; the source graph is retained below.
(parent body index, promoted index, body index).
- input : ImportDocumentCore
Instances For
Look up a document root's frame identity without assuming it was called or that source and runtime definition indices coincide.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lower all present root, instance, and promoted bodies with global compiler identity tables. Unavailable bodies remain explicit source graph obligations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compatibility entrypoint for full diagnostic documents. Runtime clients
that decode without retaining the typed JSON tree should call
lowerCoreProgram.
Equations
- Miri.Input.lowerProgram input = Miri.Input.lowerCoreProgram input.toCore
Instances For
Interner state shared by metadata-query lowering and MIR syntax. Appending entries preserves every previously lowered ID.
- spans : Array SourceSpanData
- definitions : Array DefinitionId
- typeConstants : Array MIR.TypeConst
Instances For
Equations
- program.compilerTables = { spans := program.bundle.spans, definitions := program.bundle.definitions, typeConstants := program.bundle.typeConstants }
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
- Miri.Input.lowerCompilerConstValue ctx ty value = Miri.Input.constValue✝ ctx ty value
Instances For
Canonical type-constant interning for compiler pattern/query metadata.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Intern a compiler span without synthesizing a source location.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Incremental exact span interning for compiler source-map batches. The candidate index is seeded once from the existing table; buckets only narrow the search and full span equality remains authoritative.
- tables : Miri.Input.CompilerTables
- spanReflexivity : SpanArrayReflexivity (tables self).spans
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reuse an index only when the complete span arrays compare equal. The certificate makes the common same-array case constant time while preserving a full equality check for independently allocated or reordered tables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- interner.getTables = Miri.Input.CompilerSpanInterner.tables✝ interner
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compare the result of an independent lowering against the unchanged base. The checked pointer shortcut retains the full original array comparator.
Equations
- result.sameSpansAs base = Miri.Input.SpanArrayReflexivity.matchesRight✝ ⋯ (Miri.Input.CompilerSpanInterner.tables✝ result).spans
Instances For
Lower a compiler constant operand using an exact, persistent span index.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decode the source place key for compiler query evidence. Projection types must already belong to the shared input type graph.
Equations
- Miri.Input.lowerCompilerPlace ctx value = Miri.Input.place✝ ctx value