Kernel IR¶
The typed, target-independent mirror of a checked kernel module.
qiec_ir
¶
Typed, target-independent IR for the Quivers Indexed Effect Core.
The QIEC kernel deliberately uses frozen dataclasses: they are convenient for
type checking and evaluation, but are not part of the structural transpiler
IR. This module is the lossless boundary between the two. Every stable QIEC
construct has a corresponding :mod:didactic model, so a backend can inspect
effects, values, evidence, resumptions, and source provenance without parsing
an opaque JSON side channel.
QiecFeature
¶
QiecFeature = Literal['declarations', 'return', 'bind', 'perform', 'handle', 'case', 'if', 'call', 'recursion', 'resume', 'local-instance', 'authored-handler', 'arithmetic', 'comparison', 'boolean', 'string', 'conversion', 'math', 'tuple', 'tensor', 'distribution', 'plate', 'log-density', 'site', 'gather', 'segment-sum', 'kernel-matrix', 'affine-map', 'table-map', 'neural-attachment', 'search', 'reduction', 'rowwise', 'comprehension', 'special', 'activation', 'weight', 'evidence', 'transport', 'attachment', 'structured-value', 'effectful-row', 'open-effect-row', 'type-polymorphism', 'index-polymorphism', 'effect-polymorphism', 'named-parameter', 'non-scalar-result', 'non-scalar-parameter', 'zero-resumption', 'affine-resumption', 'linear-resumption', 'unrestricted-resumption']
One QIEC construct a target may or may not preserve.
analyze_qiec_capabilities
names the features a module needs, and a
QiecTargetCapabilities
names the ones a target has.
IRQiecId
didactic-model
¶
Bases: Model
A stable QIEC identifier, split into namespace and digest.
IRQiecSourceOrigin
didactic-model
¶
IRQiecSourceOrigin(*, module: str, structural_path: tuple[IRPathPart, ...], role: str, source_protocol: str, file: str | None = None, line: int | None = None, column: int | None = None)
Bases: Model
Mirror of a kernel source origin: a site's structural location.
Line and column are diagnostic coordinates; the structural path alone locates the site.
| PARAMETER | DESCRIPTION |
|---|---|
module
|
The module the site belongs to.
TYPE:
|
structural_path
|
The path of names and positions from the module root to the site.
TYPE:
|
role
|
What the site is, such as
TYPE:
|
source_protocol
|
The source language or protocol the path is expressed in.
TYPE:
|
file
|
The file the site was read from, if any.
TYPE:
|
line
|
The one-based line of the site, if known.
TYPE:
|
column
|
The one-based column of the site, if known.
TYPE:
|
IRQiecDynamicAddressFrame
didactic-model
¶
Bases: Model
One component of a dynamic effect address.
| PARAMETER | DESCRIPTION |
|---|---|
scope
|
What kind of frame this is, such as a call, a handler clause, a resumption, or a local instance.
TYPE:
|
key
|
The frame's position within its scope: a name or an ordinal.
TYPE:
|
IRQiecSiteProvenance
didactic-model
¶
IRQiecSiteProvenance(*, origin: IRQiecSourceOrigin, dynamic_path: tuple[IRQiecDynamicAddressFrame, ...] = (), resumption_path: tuple[int, ...] = (), relation: Literal['preserve', 'split', 'duplicate', 'eliminate'] = 'preserve', parents: tuple[IRQiecId, ...] = ())
Bases: Model
Static and dynamic provenance of an effect request.
| PARAMETER | DESCRIPTION |
|---|---|
origin
|
The source site the request was written at.
TYPE:
|
dynamic_path
|
The address frames entered to reach this occurrence of the site, outermost first.
TYPE:
|
resumption_path
|
The ordinal of each resumption taken to reach this occurrence.
TYPE:
|
relation
|
How this request relates to the source site:
TYPE:
|
parents
|
The static sites a derived request was generated from.
TYPE:
|
IRQiecTypeKind
didactic-model
¶
Bases: IRQiecKind
The kind of types.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
IRQiecEffectKind
didactic-model
¶
Bases: IRQiecKind
The kind of effect interfaces.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
IRQiecRowKind
didactic-model
¶
Bases: IRQiecKind
The kind of effect rows.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
IRQiecArrowKind
didactic-model
¶
IRQiecArrowKind(*, domain: IRQiecKind, codomain: IRQiecKind, kind: Literal['arrow'] = 'arrow')
Bases: IRQiecKind
The kind of a constructor from one kind to another.
| PARAMETER | DESCRIPTION |
|---|---|
domain
|
The kind of the argument.
TYPE:
|
codomain
|
The kind of the result.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecNatSort
didactic-model
¶
Bases: IRQiecIndexSort
The sort of natural-number indices.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
IRQiecShapeSort
didactic-model
¶
Bases: IRQiecIndexSort
The sort of shapes, optionally restricted to a fixed rank.
| PARAMETER | DESCRIPTION |
|---|---|
rank
|
The number of dimensions, or
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecContextSort
didactic-model
¶
Bases: IRQiecIndexSort
The sort of logic-program contexts over a named signature.
| PARAMETER | DESCRIPTION |
|---|---|
signature
|
The name of the signature whose contexts inhabit this sort.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecUserIndexSort
didactic-model
¶
IRQiecUserIndexSort(*, name: str, constructors: tuple[str, ...], arities: tuple[int, ...], kind: Literal['user'] = 'user')
Bases: IRQiecIndexSort
A closed user-defined index datatype.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The sort's name, part of its identity.
TYPE:
|
constructors
|
The constructor names, part of the identity.
TYPE:
|
arities
|
The argument count of each constructor, aligned with
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecBinder
didactic-model
¶
Bases: TaggedUnion
A telescope binder for a static argument.
The subclasses distinguish type, index, and effect binders by the
kind discriminator.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The binder's display name.
TYPE:
|
refinable
|
Whether case analysis may refine the bound argument; true for a family's indices and false for its uniform parameters.
TYPE:
|
IRQiecTypeBinder
didactic-model
¶
IRQiecTypeBinder(*, name: str, refinable: bool = False, type_kind: IRQiecKind, kind: Literal['type'] = 'type')
Bases: IRQiecBinder
A telescope binder for a type-kinded static argument.
Inherits name and refinable from
IRQiecBinder.
| PARAMETER | DESCRIPTION |
|---|---|
type_kind
|
The kind of the bound argument.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecIndexBinder
didactic-model
¶
IRQiecIndexBinder(*, name: str, refinable: bool = False, sort: IRQiecIndexSort, kind: Literal['index'] = 'index')
Bases: IRQiecBinder
A telescope binder for an index argument.
Inherits name and refinable from
IRQiecBinder.
| PARAMETER | DESCRIPTION |
|---|---|
sort
|
The closed index sort of the bound argument.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecEffectBinder
didactic-model
¶
Bases: IRQiecBinder
A telescope binder for an effect argument.
Inherits name and refinable from
IRQiecBinder.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
IRQiecStatic
didactic-model
¶
Bases: TaggedUnion
Type, index, or effect argument in the QIEC static language.
IRQiecIndexVariable
didactic-model
¶
IRQiecIndexVariable(*, name: str, sort: IRQiecIndexSort, identity: IRQiecId | None = None, kind: Literal['index-variable'] = 'index-variable')
Bases: IRQiecStatic
A variable standing for an index term.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The variable's display name.
TYPE:
|
sort
|
The closed index sort of the terms it stands for.
TYPE:
|
identity
|
The rigid identity of a case branch's skolem, or
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecIndexLiteral
didactic-model
¶
IRQiecIndexLiteral(*, value: int | str, sort: IRQiecIndexSort, kind: Literal['index-literal'] = 'index-literal')
Bases: IRQiecStatic
A closed index literal.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
A natural number for the nat sort, or a nullary constructor name for a user-defined index sort.
TYPE:
|
sort
|
The sort the literal inhabits.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecIndexConstructor
didactic-model
¶
IRQiecIndexConstructor(*, name: str, arguments: tuple[IRQiecStatic, ...], sort: IRQiecIndexSort, kind: Literal['index-constructor'] = 'index-constructor')
Bases: IRQiecStatic
A fully applied constructor of a user-defined index sort.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The constructor's name, which belongs to
TYPE:
|
arguments
|
The constructor's index arguments, in order.
TYPE:
|
sort
|
The sort the constructor builds.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecShapeIndex
didactic-model
¶
IRQiecShapeIndex(*, dimensions: tuple[IRQiecStatic, ...], kind: Literal['shape-index'] = 'shape-index')
Bases: IRQiecStatic
A shape given by its dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
dimensions
|
One index term per dimension, outermost first.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecTypeVariable
didactic-model
¶
IRQiecTypeVariable(*, name: str, type_kind: IRQiecKind, identity: IRQiecId | None = None, kind: Literal['type-variable'] = 'type-variable')
Bases: IRQiecStatic
A variable standing for a type-kinded static argument.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The variable's display name.
TYPE:
|
type_kind
|
The kind of the arguments it stands for.
TYPE:
|
identity
|
The rigid identity of a case branch's skolem, or
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecTypeConstructor
didactic-model
¶
IRQiecTypeConstructor(*, id: IRQiecId, name: str, telescope: tuple[IRQiecBinder, ...] = ())
Bases: Model
A fully qualified type constructor and its kinding telescope.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The constructor's stable identity, which alone determines equality.
TYPE:
|
name
|
The constructor's display name.
TYPE:
|
telescope
|
The binders the constructor's arguments instantiate, in order.
TYPE:
|
IRQiecTypeApplication
didactic-model
¶
IRQiecTypeApplication(*, constructor: IRQiecTypeConstructor, arguments: tuple[IRQiecStatic, ...] = (), kind: Literal['type-application'] = 'type-application')
Bases: IRQiecStatic
A type constructor applied to static arguments.
| PARAMETER | DESCRIPTION |
|---|---|
constructor
|
The constructor applied.
TYPE:
|
arguments
|
The arguments instantiating the constructor's telescope, in order; empty for a nullary constructor.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecFunctionType
didactic-model
¶
IRQiecFunctionType(*, parameter: IRQiecStatic, result: IRQiecStatic, kind: Literal['function-type'] = 'function-type')
Bases: IRQiecStatic
A pure function type.
An effectful codomain is a
IRQiecComputationType,
which keeps the value and computation strata apart.
| PARAMETER | DESCRIPTION |
|---|---|
parameter
|
The argument type.
TYPE:
|
result
|
The result type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecEqualityType
didactic-model
¶
IRQiecEqualityType(*, classifier: IRQiecKind | IRQiecIndexSort, left: IRQiecStatic, right: IRQiecStatic, kind: Literal['equality-type'] = 'equality-type')
Bases: IRQiecStatic
The proposition that two static arguments are equal.
| PARAMETER | DESCRIPTION |
|---|---|
classifier
|
The kind or index sort both sides inhabit.
TYPE:
|
left
|
The left side of the equation.
TYPE:
|
right
|
The right side of the equation.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecEffectVariable
didactic-model
¶
IRQiecEffectVariable(*, name: str, identity: IRQiecId | None = None, kind: Literal['effect-variable'] = 'effect-variable')
Bases: IRQiecStatic
A variable standing for an effect interface application.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The variable's display name.
TYPE:
|
identity
|
The rigid identity of a case branch's skolem, or
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecEffectRef
didactic-model
¶
IRQiecEffectRef(*, id: IRQiecId, name: str, arguments: tuple[IRQiecStatic, ...] = (), kind: Literal['effect-ref'] = 'effect-ref')
Bases: IRQiecStatic
One closed effect interface application.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The stable identity of the interface declaration.
TYPE:
|
name
|
The interface's display name.
TYPE:
|
arguments
|
The arguments instantiating the interface's telescope, in order.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecLocal
didactic-model
¶
IRQiecLocal(*, name: str, type: IRQiecStatic)
Bases: Model
A typed binder for a runtime value.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The binder's display name.
TYPE:
|
type
|
The type of every value bound to it.
TYPE:
|
IRQiecRowVariable
didactic-model
¶
Bases: Model
The open tail of an effect row, with the instances it excludes.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The display name, used in diagnostics only.
TYPE:
|
identity
|
The stable identity, which equality is taken from.
TYPE:
|
lacks
|
The instances the tail is proven not to contain.
TYPE:
|
IRQiecRowEntry
didactic-model
¶
IRQiecRowEntry(*, instance: IRQiecId, effect: IRQiecEffectRef)
Bases: Model
One lexical effect instance and the interface it implements.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The lexical instance, which is the row's key.
TYPE:
|
effect
|
The interface application the instance implements.
TYPE:
|
IRQiecEffectRow
didactic-model
¶
IRQiecEffectRow(*, entries: tuple[IRQiecRowEntry, ...] = (), tail: IRQiecRowVariable | None = None)
Bases: Model
A finite map from lexical instances to interfaces, plus a tail.
| PARAMETER | DESCRIPTION |
|---|---|
entries
|
The instances the row names, each with its interface.
TYPE:
|
tail
|
A row variable standing for further entries, or
TYPE:
|
IRQiecComputationType
didactic-model
¶
IRQiecComputationType(*, effects: IRQiecEffectRow, result: IRQiecStatic)
Bases: Model
The type of a computation: its effect row and result type.
| PARAMETER | DESCRIPTION |
|---|---|
effects
|
The row of effect instances the computation may perform.
TYPE:
|
result
|
The type of the value it returns.
TYPE:
|
IRQiecEvidence
didactic-model
¶
Bases: TaggedUnion
Kernel-issued equality evidence.
IRQiecReflexivity
didactic-model
¶
IRQiecReflexivity(*, equality: IRQiecEqualityType, kind: Literal['reflexivity'] = 'reflexivity')
Bases: IRQiecEvidence
Evidence that an equality holds because both sides are the same term.
| PARAMETER | DESCRIPTION |
|---|---|
equality
|
The proposition witnessed.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecBranchGiven
didactic-model
¶
IRQiecBranchGiven(*, id: IRQiecId, equality: IRQiecEqualityType, kind: Literal['branch-given'] = 'branch-given')
Bases: IRQiecEvidence
Evidence granted by a case branch's constructor refinement.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The stable identity of the given, derived from the branch scope.
TYPE:
|
equality
|
The proposition the branch's constructor makes available.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecLiteral
didactic-model
¶
Bases: TaggedUnion
JSON-safe literal data, including bytes and nested tuples.
IRQiecNullLiteral
didactic-model
¶
Bases: IRQiecLiteral
The null literal.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
The discriminator; always
TYPE:
|
IRQiecBoolLiteral
didactic-model
¶
Bases: IRQiecLiteral
A Boolean literal.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The Boolean.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecIntLiteral
didactic-model
¶
Bases: IRQiecLiteral
An integer literal.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The integer.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecFloatLiteral
didactic-model
¶
Bases: IRQiecLiteral
A floating-point literal.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The number.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecStringLiteral
didactic-model
¶
Bases: IRQiecLiteral
A string literal.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The string.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecBytesLiteral
didactic-model
¶
Bases: IRQiecLiteral
A byte-string literal.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The bytes, written as a hexadecimal string.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecTupleLiteral
didactic-model
¶
IRQiecTupleLiteral(*, items: tuple[IRQiecLiteral, ...], kind: Literal['tuple'] = 'tuple')
Bases: IRQiecLiteral
A tuple of literals.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
The component literals, in order.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecValue
didactic-model
¶
Bases: TaggedUnion
Stable value node consumed by QIEC-capable renderers.
IRQiecVar
didactic-model
¶
IRQiecVar(*, local: IRQiecLocal, kind: Literal['var'] = 'var')
Bases: IRQiecValue
Reference to a bound local.
| PARAMETER | DESCRIPTION |
|---|---|
local
|
The binder referenced.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecLiteralValue
didactic-model
¶
IRQiecLiteralValue(*, value: IRQiecLiteral, type: IRQiecStatic, kind: Literal['literal'] = 'literal')
Bases: IRQiecValue
A literal host value at a primitive or tuple type.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The literal's data.
TYPE:
|
type
|
The literal's type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecConstructorValue
didactic-model
¶
IRQiecConstructorValue(*, constructor: IRQiecId, static_arguments: tuple[IRQiecStatic, ...], fields: tuple[IRQiecValue, ...], result_type: IRQiecStatic, kind: Literal['constructor'] = 'constructor')
Bases: IRQiecValue
Application of a declared constructor to static and value arguments.
| PARAMETER | DESCRIPTION |
|---|---|
constructor
|
The stable identity of the constructor applied.
TYPE:
|
static_arguments
|
The constructor's telescope instantiation, in binder order.
TYPE:
|
fields
|
The field values, in declaration order.
TYPE:
|
result_type
|
The indexed family type the application inhabits.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecEvidenceValue
didactic-model
¶
IRQiecEvidenceValue(*, evidence: IRQiecEvidence, kind: Literal['evidence'] = 'evidence')
Bases: IRQiecValue
Kernel-checked equality evidence used as a value.
| PARAMETER | DESCRIPTION |
|---|---|
evidence
|
The evidence term.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecAttachmentRef
didactic-model
¶
IRQiecAttachmentRef(*, attachment: IRQiecId, type: IRQiecStatic, kind: Literal['attachment'] = 'attachment')
Bases: IRQiecValue
A stable reference to a runtime-owned host value.
| PARAMETER | DESCRIPTION |
|---|---|
attachment
|
The identity under which a runtime provider binds the host value.
TYPE:
|
type
|
The type the bound value inhabits.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecPrimitiveApplication
didactic-model
¶
IRQiecPrimitiveApplication(*, primitive: IRQiecId, name: str, arguments: tuple[IRQiecValue, ...], result_type: IRQiecStatic, origin: IRQiecSourceOrigin, kind: Literal['primitive'] = 'primitive')
Bases: IRQiecValue
Application of a pure primitive from the closed registry.
| PARAMETER | DESCRIPTION |
|---|---|
primitive
|
The primitive's stable identity.
TYPE:
|
name
|
The primitive's nominal name.
TYPE:
|
arguments
|
The value arguments, in order.
TYPE:
|
result_type
|
The primitive's result type.
TYPE:
|
origin
|
The application's source location.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecTupleValue
didactic-model
¶
IRQiecTupleValue(*, items: tuple[IRQiecValue, ...], result_type: IRQiecStatic, kind: Literal['tuple'] = 'tuple')
Bases: IRQiecValue
Construction of a finite product from its components.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
The component values, in order.
TYPE:
|
result_type
|
The product type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecTensorValue
didactic-model
¶
IRQiecTensorValue(*, items: tuple[IRQiecValue, ...], result_type: IRQiecStatic, kind: Literal['tensor'] = 'tensor')
Bases: IRQiecValue
Construction of a tensor from its entries along the outermost axis.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
The entries, each an element or a tensor one rank lower.
TYPE:
|
result_type
|
The
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecProjection
didactic-model
¶
IRQiecProjection(*, value: IRQiecValue, position: int, result_type: IRQiecStatic, kind: Literal['projection'] = 'projection')
Bases: IRQiecValue
Selection of one component of a finite product.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The product value.
TYPE:
|
position
|
The zero-based component selected.
TYPE:
|
result_type
|
The component's type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecNamedArgument
didactic-model
¶
IRQiecNamedArgument(*, name: str, value: IRQiecValue)
Bases: Model
One named argument of a distribution construction.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The family parameter supplied.
TYPE:
|
value
|
The value supplied for it.
TYPE:
|
IRQiecPlateAxis
didactic-model
¶
IRQiecPlateAxis(*, name: str, size: IRQiecStatic)
Bases: Model
One axis of a plated distribution.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The axis's source name.
TYPE:
|
size
|
Its extent, an index term.
TYPE:
|
IRQiecPlateShape
didactic-model
¶
IRQiecPlateShape(*, batch: tuple[IRQiecPlateAxis, ...] = (), event: tuple[IRQiecPlateAxis, ...] = ())
Bases: Model
The plate a distribution is constructed over.
| PARAMETER | DESCRIPTION |
|---|---|
batch
|
The independent replication axes, outermost first.
TYPE:
|
event
|
The joint axes, outermost first.
TYPE:
|
IRQiecDistributionValue
didactic-model
¶
IRQiecDistributionValue(*, family: IRQiecId, name: str, arguments: tuple[IRQiecNamedArgument, ...], result_type: IRQiecStatic, origin: IRQiecSourceOrigin, plate: IRQiecPlateShape = IRQiecPlateShape(), kind: Literal['distribution'] = 'distribution')
Bases: IRQiecValue
Construction of a distribution from a family of the registry.
| PARAMETER | DESCRIPTION |
|---|---|
family
|
The family's stable identity.
TYPE:
|
name
|
The family's source name.
TYPE:
|
arguments
|
The named parameters, in source order.
TYPE:
|
result_type
|
The
TYPE:
|
origin
|
The construction's source location.
TYPE:
|
plate
|
The plate the construction ranges over; empty for one draw.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecLogDensity
didactic-model
¶
IRQiecLogDensity(*, sampleable: IRQiecValue, value: IRQiecValue, origin: IRQiecSourceOrigin, batch: tuple[IRQiecPlateAxis, ...] = (), kind: Literal['log_density'] = 'log_density')
Bases: IRQiecValue
Evaluation of a distribution's log density at a value.
| PARAMETER | DESCRIPTION |
|---|---|
sampleable
|
The distribution.
TYPE:
|
value
|
The point evaluated.
TYPE:
|
origin
|
The evaluation's source location.
TYPE:
|
batch
|
The batch axes the weights are kept apart over; empty for one total weight.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecGather
didactic-model
¶
IRQiecGather(*, value: IRQiecValue, index: IRQiecValue, result_type: IRQiecStatic, kind: Literal['gather'] = 'gather')
Bases: IRQiecValue
Selection along a tensor's outermost axis.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The tensor selected from.
TYPE:
|
index
|
An integer or a tensor of integers.
TYPE:
|
result_type
|
The selection's type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecWeightSum
didactic-model
¶
IRQiecWeightSum(*, value: IRQiecValue, kind: Literal['weight_sum'] = 'weight_sum')
Bases: IRQiecValue
The total of a tensor of log weights.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The weights.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecSegmentSum
didactic-model
¶
IRQiecSegmentSum(*, value: IRQiecValue, index: IRQiecValue, groups: IRQiecStatic, result_type: IRQiecStatic, kind: Literal['segment_sum'] = 'segment_sum')
Bases: IRQiecValue
Per-group totals of a vector of log weights.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The weights.
TYPE:
|
index
|
Each entry's group.
TYPE:
|
groups
|
The number of groups.
TYPE:
|
result_type
|
The totals' type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecKernelMatrix
didactic-model
¶
IRQiecKernelMatrix(*, inputs: IRQiecValue, kernel: str, length_scale: float, jitter: float, result_type: IRQiecStatic, kind: Literal['kernel_matrix'] = 'kernel_matrix')
Bases: IRQiecValue
A covariance matrix over input locations.
| PARAMETER | DESCRIPTION |
|---|---|
inputs
|
The locations.
TYPE:
|
kernel
|
The kernel's name.
TYPE:
|
length_scale
|
Its length scale.
TYPE:
|
jitter
|
The diagonal jitter.
TYPE:
|
result_type
|
The matrix type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecAffineMap
didactic-model
¶
IRQiecAffineMap(*, weight: IRQiecValue, bias: IRQiecValue, sources: tuple[IRQiecValue, ...], row_offset: int, rows: int, transform: Literal['identity', 'exp', 'exp_floor'], result_type: IRQiecStatic, kind: Literal['affine_map'] = 'affine_map')
Bases: IRQiecValue
One head of an affine parameter map.
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
The weight matrix.
TYPE:
|
bias
|
The bias vector.
TYPE:
|
sources
|
The conditioning row's factors in order.
TYPE:
|
row_offset
|
The first row of the head's block.
TYPE:
|
rows
|
The block's height.
TYPE:
|
transform
|
TYPE:
|
result_type
|
The head's type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecTableMap
didactic-model
¶
IRQiecTableMap(*, table: IRQiecValue, index: IRQiecValue, row_offset: int, rows: int, transform: Literal['identity', 'exp', 'exp_floor'], result_type: IRQiecStatic, kind: Literal['table_map'] = 'table_map')
Bases: IRQiecValue
One head of a table-indexed parameter map.
| PARAMETER | DESCRIPTION |
|---|---|
table
|
The parameter table, one row per element of the domain.
TYPE:
|
index
|
The element of the domain.
TYPE:
|
row_offset
|
The first column of the head's block.
TYPE:
|
rows
|
The block's width.
TYPE:
|
transform
|
TYPE:
|
result_type
|
The head's type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecSiteValue
didactic-model
¶
IRQiecSiteValue(*, label: str, result_type: IRQiecStatic, kind: Literal['site'] = 'site')
Bases: IRQiecValue
A named sample site.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The site's source name.
TYPE:
|
result_type
|
The
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecReduction
didactic-model
¶
IRQiecReduction(*, operator: str, value: IRQiecValue, result_type: IRQiecStatic, kind: Literal['reduction'] = 'reduction')
Bases: IRQiecValue
A number summarizing every entry of a tensor.
| PARAMETER | DESCRIPTION |
|---|---|
operator
|
The reduction.
TYPE:
|
value
|
The tensor.
TYPE:
|
result_type
|
The element type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecRowwise
didactic-model
¶
IRQiecRowwise(*, operator: str, value: IRQiecValue, result_type: IRQiecStatic, kind: Literal['rowwise'] = 'rowwise')
Bases: IRQiecValue
An operation along a tensor's last axis keeping its shape.
| PARAMETER | DESCRIPTION |
|---|---|
operator
|
The operation.
TYPE:
|
value
|
The tensor.
TYPE:
|
result_type
|
The tensor's type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecComprehension
didactic-model
¶
IRQiecComprehension(*, binder: IRQiecLocal, extent: IRQiecStatic, body: IRQiecValue, result_type: IRQiecStatic, kind: Literal['comprehension'] = 'comprehension')
Bases: IRQiecValue
A tensor built by evaluating a body at every index of an axis.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The index local.
TYPE:
|
extent
|
The axis's extent.
TYPE:
|
body
|
The entry at each index.
TYPE:
|
result_type
|
The tensor type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecTransportValue
didactic-model
¶
IRQiecTransportValue(*, evidence: IRQiecEvidence, value: IRQiecValue, target_type: IRQiecStatic, kind: Literal['transport'] = 'transport')
Bases: IRQiecValue
Transport of a value along kernel-checked equality evidence.
| PARAMETER | DESCRIPTION |
|---|---|
evidence
|
The equality the value is carried across.
TYPE:
|
value
|
The value at the equality's left type.
TYPE:
|
target_type
|
The type the transported value inhabits, which the equality's right side determines.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecEffectRequest
didactic-model
¶
IRQiecEffectRequest(*, instance: IRQiecId, effect: IRQiecEffectRef, operation: IRQiecId, static_arguments: tuple[IRQiecStatic, ...], arguments: tuple[IRQiecValue, ...], result_type: IRQiecStatic, origin: IRQiecSiteProvenance)
Bases: Model
A typed request for one effect operation.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The effect instance the request is addressed to.
TYPE:
|
effect
|
The instance's interface application.
TYPE:
|
operation
|
The operation requested.
TYPE:
|
static_arguments
|
The operation's telescope instantiation, in binder order.
TYPE:
|
arguments
|
The value arguments, one per operation argument.
TYPE:
|
result_type
|
The type of the value the operation returns under the instantiation.
TYPE:
|
origin
|
Where the request was written and how it was reached.
TYPE:
|
IRQiecComputation
didactic-model
¶
Bases: TaggedUnion
Stable computation node consumed by QIEC-capable renderers.
IRQiecReturn
didactic-model
¶
IRQiecReturn(*, value: IRQiecValue, kind: Literal['return'] = 'return')
Bases: IRQiecComputation
Return of a value with no effects.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The value produced.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecBindStep
didactic-model
¶
IRQiecBindStep(*, binder: IRQiecLocal, first: IRQiecComputation)
Bases: Model
One step of a bind sequence: a computation and the local it binds.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The local the step's result is bound to.
TYPE:
|
first
|
The computation run at the step.
TYPE:
|
IRQiecBind
didactic-model
¶
IRQiecBind(*, steps: tuple[IRQiecBindStep, ...], then: IRQiecComputation, kind: Literal['bind'] = 'bind')
Bases: IRQiecComputation
A straight-line sequence of binds ending in a computation.
A kernel Bind chain nests one bind inside the next; the mirror
keeps the chain flat so a long straight-line body is a tuple of
steps rather than a term as deep as it is long.
| PARAMETER | DESCRIPTION |
|---|---|
steps
|
The binds, in evaluation order; each may read the binders before it.
TYPE:
|
then
|
The computation after the last step, which may read every binder.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecPerform
didactic-model
¶
IRQiecPerform(*, request: IRQiecEffectRequest, kind: Literal['perform'] = 'perform')
Bases: IRQiecComputation
Performance of one effect operation.
| PARAMETER | DESCRIPTION |
|---|---|
request
|
The operation, its instance, arguments, and result type.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecHandle
didactic-model
¶
IRQiecHandle(*, instance: IRQiecId, handler: IRQiecId, computation: IRQiecComputation, static_arguments: tuple[IRQiecStatic, ...] = (), kind: Literal['handle'] = 'handle')
Bases: IRQiecComputation
A computation run under a handler installed for one effect instance.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The effect instance whose operations the handler intercepts.
TYPE:
|
handler
|
The stable identity of the handler installed.
TYPE:
|
computation
|
The handled computation.
TYPE:
|
static_arguments
|
The handler's telescope instantiation, in binder order.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecCaseMotive
didactic-model
¶
IRQiecCaseMotive(*, indices: tuple[IRQiecBinder, ...], result_type: IRQiecStatic)
Bases: Model
The result family of an indexed case expression.
| PARAMETER | DESCRIPTION |
|---|---|
indices
|
The binders abstracting the scrutinee's indices in
TYPE:
|
result_type
|
The type every branch produces, over
TYPE:
|
IRQiecCaseBranch
didactic-model
¶
IRQiecCaseBranch(*, constructor: IRQiecId, static_arguments: tuple[IRQiecStatic, ...], fields: tuple[IRQiecLocal, ...], body: IRQiecComputation, scope: IRQiecId)
Bases: Model
One branch of an indexed case expression.
| PARAMETER | DESCRIPTION |
|---|---|
constructor
|
The constructor this branch matches.
TYPE:
|
static_arguments
|
The constructor's static arguments as bound by the pattern, in binder order.
TYPE:
|
fields
|
The locals binding the constructor's fields, in declaration order.
TYPE:
|
body
|
The computation run when the branch is selected.
TYPE:
|
scope
|
The static scope identity under which the branch's skolems and equality evidence are minted.
TYPE:
|
IRQiecCase
didactic-model
¶
IRQiecCase(*, scrutinee: IRQiecValue, motive: IRQiecCaseMotive, branches: tuple[IRQiecCaseBranch, ...], kind: Literal['case'] = 'case')
Bases: IRQiecComputation
Case analysis over an indexed family value.
| PARAMETER | DESCRIPTION |
|---|---|
scrutinee
|
The value analyzed.
TYPE:
|
motive
|
The result family, over the scrutinee's indices.
TYPE:
|
branches
|
One branch per constructor considered.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecIf
didactic-model
¶
IRQiecIf(*, condition: IRQiecValue, then: IRQiecComputation, otherwise: IRQiecComputation, kind: Literal['if'] = 'if')
Bases: IRQiecComputation
Branch on a Boolean value.
| PARAMETER | DESCRIPTION |
|---|---|
condition
|
The Boolean value branched on.
TYPE:
|
then
|
The computation run when the condition holds.
TYPE:
|
otherwise
|
The computation run when it does not.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecCall
didactic-model
¶
IRQiecCall(*, callee: IRQiecId, name: str, static_arguments: tuple[IRQiecStatic, ...], arguments: tuple[IRQiecValue, ...], result_type: IRQiecStatic, effects: IRQiecEffectRow, origin: IRQiecSourceOrigin, kind: Literal['call'] = 'call')
Bases: IRQiecComputation
Application of a named computation by stable identity.
| PARAMETER | DESCRIPTION |
|---|---|
callee
|
The identity of the computation called.
TYPE:
|
name
|
The callee's display name.
TYPE:
|
static_arguments
|
The callee's telescope instantiation, in binder order.
TYPE:
|
arguments
|
The value arguments, one per callee parameter.
TYPE:
|
result_type
|
The callee's result type under the instantiation.
TYPE:
|
effects
|
The callee's effect row under the instantiation.
TYPE:
|
origin
|
The call site's source location.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecResume
didactic-model
¶
IRQiecResume(*, value: IRQiecValue, origin: IRQiecSourceOrigin, kind: Literal['resume'] = 'resume')
Bases: IRQiecComputation
Invocation of the enclosing handler clause's continuation.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The value returned to the suspended computation.
TYPE:
|
origin
|
The resumption's source location.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecNewInstance
didactic-model
¶
IRQiecNewInstance(*, instance: IRQiecId, effect: IRQiecEffectRef, body: IRQiecComputation, origin: IRQiecSourceOrigin, kind: Literal['new_instance'] = 'new_instance')
Bases: IRQiecComputation
Lexically scoped allocation of an effect instance.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The scope-derived identity of the allocated instance.
TYPE:
|
effect
|
The applied interface the instance provides.
TYPE:
|
body
|
The computation within which the instance is in scope.
TYPE:
|
origin
|
The allocation's source location.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecFieldDef
didactic-model
¶
IRQiecFieldDef(*, name: str, type: IRQiecStatic)
Bases: Model
One named, typed field of a constructor.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The field's display name.
TYPE:
|
type
|
The field's type, which may mention the constructor's telescope.
TYPE:
|
IRQiecFamilyDecl
didactic-model
¶
IRQiecFamilyDecl(*, id: IRQiecId, name: str, parameters: tuple[IRQiecBinder, ...], indices: tuple[IRQiecBinder, ...], constructors: tuple[IRQiecId, ...], closed: bool = True)
Bases: Model
A closed or opaque indexed data family.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The family's stable identity.
TYPE:
|
name
|
The family's source name.
TYPE:
|
parameters
|
The binders uniform across every constructor.
TYPE:
|
indices
|
The binders a constructor result may refine.
TYPE:
|
constructors
|
The constructors the family declares.
TYPE:
|
closed
|
Whether the constructor list is exhaustive, which admits coverage checking.
TYPE:
|
IRQiecConstructorDecl
didactic-model
¶
IRQiecConstructorDecl(*, id: IRQiecId, family: IRQiecId, name: str, telescope: tuple[IRQiecBinder, ...], fields: tuple[IRQiecFieldDef, ...], result_indices: tuple[IRQiecStatic, ...])
Bases: Model
One constructor of an indexed data family.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The constructor's stable identity.
TYPE:
|
family
|
The family the constructor belongs to.
TYPE:
|
name
|
The constructor's source name.
TYPE:
|
telescope
|
The binders local to the constructor, which are rigid while a branch matching it is checked.
TYPE:
|
fields
|
The values the constructor carries.
TYPE:
|
result_indices
|
What the constructor fixes the family's indices to, one per family index.
TYPE:
|
IRQiecArgumentDef
didactic-model
¶
IRQiecArgumentDef(*, name: str, type: IRQiecStatic)
Bases: Model
One named, typed value argument of an operation.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The argument's display name.
TYPE:
|
type
|
The argument's type, which may mention the operation's telescope.
TYPE:
|
IRQiecOperationDef
didactic-model
¶
IRQiecOperationDef(*, id: IRQiecId, name: str, telescope: tuple[IRQiecBinder, ...], arguments: tuple[IRQiecArgumentDef, ...], result_type: IRQiecStatic)
Bases: Model
One result-indexed request constructor of an effect interface.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The operation's stable identity.
TYPE:
|
name
|
The operation's source name.
TYPE:
|
telescope
|
The static binders the operation adds to the interface's own.
TYPE:
|
arguments
|
The value arguments the request carries.
TYPE:
|
result_type
|
What resuming the request supplies.
TYPE:
|
IRQiecEffectDef
didactic-model
¶
IRQiecEffectDef(*, ref: IRQiecEffectRef, telescope: tuple[IRQiecBinder, ...], operations: tuple[IRQiecOperationDef, ...])
Bases: Model
An effect interface: its telescope and operations.
| PARAMETER | DESCRIPTION |
|---|---|
ref
|
The declaration's own reference.
TYPE:
|
telescope
|
The static binders the interface takes.
TYPE:
|
operations
|
The declared operations.
TYPE:
|
IRQiecHandlerClauseDef
didactic-model
¶
IRQiecHandlerClauseDef(*, operation: IRQiecId, grade: Literal['0', 'aff', '1', 'omega'], parameters: tuple[IRQiecLocal, ...] = (), body: IRQiecComputation | None = None)
Bases: Model
One operation a handler covers, and how it may resume.
| PARAMETER | DESCRIPTION |
|---|---|
operation
|
The operation the clause handles.
TYPE:
|
grade
|
How often the clause may invoke its continuation: never (
TYPE:
|
parameters
|
The binders for the operation's value arguments, in declaration order.
TYPE:
|
body
|
What the clause does, or
TYPE:
|
IRQiecHandlerReturnClauseDef
didactic-model
¶
IRQiecHandlerReturnClauseDef(*, binder: IRQiecLocal, body: IRQiecComputation)
Bases: Model
What a handler does with a value its computation returns.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The local naming the returned value inside the body.
TYPE:
|
body
|
What the handler produces from it.
TYPE:
|
IRQiecHandlerDef
didactic-model
¶
IRQiecHandlerDef(*, id: IRQiecId, name: str, effect: IRQiecEffectRef, clauses: tuple[IRQiecHandlerClauseDef, ...], input_type: IRQiecStatic, output_type: IRQiecStatic, introduced: IRQiecEffectRow, total: bool, forwards_unknown: bool, telescope: tuple[IRQiecBinder, ...], return_clause: IRQiecHandlerReturnClauseDef | None = None, implementation: Literal['authored', 'foreign'] = 'foreign')
Bases: Model
The type-and-coverage signature of a handler.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The handler's stable identity.
TYPE:
|
name
|
The handler's display name.
TYPE:
|
effect
|
The interface application the handler handles.
TYPE:
|
clauses
|
One clause per operation the handler covers.
TYPE:
|
input_type
|
The result type of the computation the handler accepts.
TYPE:
|
output_type
|
The type of the handler's answer.
TYPE:
|
introduced
|
The effects the handler's own clauses perform.
TYPE:
|
total
|
Whether the clauses cover every operation of
TYPE:
|
forwards_unknown
|
Whether an operation no clause covers is forwarded outward rather than rejected.
TYPE:
|
telescope
|
The static parameters the handler abstracts over, in order.
TYPE:
|
return_clause
|
How the handler answers the computation's return, or
TYPE:
|
implementation
|
TYPE:
|
IRQiecNamedEffectInstance
didactic-model
¶
IRQiecNamedEffectInstance(*, name: str, entry: IRQiecRowEntry, origin: IRQiecSourceOrigin)
Bases: Model
A source name for one lexical effect instance.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name requests resolve through.
TYPE:
|
entry
|
The allocated instance and its interface application.
TYPE:
|
origin
|
Where the instance was declared.
TYPE:
|
IRQiecNamedComputation
didactic-model
¶
IRQiecNamedComputation(*, id: IRQiecId, name: str, telescope: tuple[IRQiecBinder, ...], parameters: tuple[IRQiecLocal, ...], body: IRQiecComputation, type: IRQiecComputationType, origin: IRQiecSourceOrigin)
Bases: Model
One named computation and its checked type.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The computation's stable identity, which calls refer to.
TYPE:
|
name
|
The display name, unique within the module.
TYPE:
|
telescope
|
The static parameters the computation abstracts over, in order.
TYPE:
|
parameters
|
The value parameters, in order.
TYPE:
|
body
|
The computation's body, with the parameters in scope.
TYPE:
|
type
|
The checked effect row and result type of
TYPE:
|
origin
|
Where the computation was declared.
TYPE:
|
IRQiecProgramParameter
didactic-model
¶
IRQiecProgramParameter(*, name: str, role: str, type: IRQiecStatic, axes: tuple[str, ...] = ())
Bases: Model
One parameter of an elaborated program.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The parameter's name.
TYPE:
|
role
|
How it is supplied.
TYPE:
|
type
|
Its type.
TYPE:
|
axes
|
The name of each dimension of a tensor-typed parameter.
TYPE:
|
IRQiecProgramSite
didactic-model
¶
IRQiecProgramSite(*, name: str, kind: str, family: str, batch: tuple[IRQiecPlateAxis, ...] = (), event: tuple[IRQiecPlateAxis, ...] = ())
Bases: Model
One probabilistic step of an elaborated program.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The site's label.
TYPE:
|
kind
|
TYPE:
|
family
|
The family drawn from.
TYPE:
|
batch
|
The plate's batch axes.
TYPE:
|
event
|
The plate's event axes.
TYPE:
|
IRQiecProgramEntry
didactic-model
¶
IRQiecProgramEntry(*, name: str, computation: IRQiecId, parameters: tuple[IRQiecProgramParameter, ...], return_names: tuple[str, ...], return_labels: tuple[str, ...] | None, sites: tuple[IRQiecProgramSite, ...], random_instance: IRQiecId, score_instance: IRQiecId, telescope: tuple[IRQiecBinder, ...] = ())
Bases: Model
The typed entry point a program declaration elaborates to.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The program's name.
TYPE:
|
computation
|
The identity of the computation holding its body.
TYPE:
|
parameters
|
The computation's parameters with their roles.
TYPE:
|
return_names
|
The names the program returns.
TYPE:
|
return_labels
|
The labels of a labelled return, or
TYPE:
|
sites
|
The program's probabilistic steps.
TYPE:
|
random_instance
|
The
TYPE:
|
score_instance
|
The
TYPE:
|
telescope
|
The static index binders of the open input extents.
TYPE:
|
IRQiecModule
didactic-model
¶
IRQiecModule(*, module: str, source_protocol: str, index_sorts: tuple[IRQiecUserIndexSort, ...] = (), families: tuple[IRQiecFamilyDecl, ...] = (), constructors: tuple[IRQiecConstructorDecl, ...] = (), effects: tuple[IRQiecEffectDef, ...] = (), instances: tuple[IRQiecNamedEffectInstance, ...] = (), handlers: tuple[IRQiecHandlerDef, ...] = (), computations: tuple[IRQiecNamedComputation, ...] = (), entries: tuple[IRQiecProgramEntry, ...] = (), programs: tuple[IRQiecId, ...] = (), gap: str = '', abi: str)
Bases: Model
Lossless structural projection of one checked :class:QiecModule.
program_computations
¶
The computations that hold programs and their marginal helpers.
| RETURNS | DESCRIPTION |
|---|---|
frozenset[str]
|
Identity texts of every entry point's computation and of every helper it calls, transitively, as the kernel module recorded them at lowering. |
Source code in src/quivers/transpile/qiec_ir.py
QiecTargetCapabilities
didactic-model
¶
QiecTargetCapabilities(*, features: frozenset[QiecFeature] = frozenset({'declarations'}))
Bases: Model
Feature set one target can preserve without semantic erasure.
| PARAMETER | DESCRIPTION |
|---|---|
features
|
The features the target preserves.
TYPE:
|
supports
¶
supports(feature: QiecFeature) -> bool
Whether the target preserves one feature.
| PARAMETER | DESCRIPTION |
|---|---|
feature
|
The feature asked about.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
Source code in src/quivers/transpile/qiec_ir.py
QiecCapabilityDiagnostic
didactic-model
¶
QiecCapabilityDiagnostic(*, code: Literal['qiec-capability'] = 'qiec-capability', target: str, feature: QiecFeature, computation: str | None = None, origin: IRQiecSourceOrigin | None = None, detail: str)
Bases: Model
One precise target mismatch discovered before renderer dispatch.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The diagnostic code; always
TYPE:
|
target
|
The target that lacks the feature.
TYPE:
|
feature
|
The feature the target lacks.
TYPE:
|
computation
|
The computation that needs the feature, or
TYPE:
|
origin
|
Where the computation was declared, when known.
TYPE:
|
detail
|
Why the target cannot preserve the feature, phrased to follow the
target's name, as in
TYPE:
|
lower_qiec_ir
¶
lower_qiec_ir(module: QiecModule) -> IRQiecModule
Project an already checked kernel module into structural IR.
| PARAMETER | DESCRIPTION |
|---|---|
module
|
The checked module.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IRQiecModule
|
The mirror, with the program computations recorded so a renderer need not walk every body to find them. |
Source code in src/quivers/transpile/qiec_ir.py
capabilities_for_target
¶
capabilities_for_target(target: str) -> QiecTargetCapabilities
Return the registered QIEC capability set for target.
The eight host-language backends lower the full stable core through the
QIEC runtime ABI. Stan admits closed, monomorphic, effect-free scalar
computations as user-defined functions: binds, scalar primitives,
conditionals, calls, and recursion. BUGS and JAGS admit only
return/bind computations, which they inline. Unknown targets
safely retain declaration metadata only.
| PARAMETER | DESCRIPTION |
|---|---|
target
|
The target name, with or without the
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
QiecTargetCapabilities
|
The features the target preserves. |
Source code in src/quivers/transpile/qiec_ir.py
analyze_qiec_capabilities
¶
analyze_qiec_capabilities(module_or_ir: QiecModule | IRQiecModule | None, target: str, *, capabilities: QiecTargetCapabilities | None = None) -> tuple[QiecCapabilityDiagnostic, ...]
Report every QIEC feature target cannot preserve.
| PARAMETER | DESCRIPTION |
|---|---|
module_or_ir
|
The checked module or its IR projection;
TYPE:
|
target
|
The target name.
TYPE:
|
capabilities
|
The feature set to check against, else the target's registered one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[QiecCapabilityDiagnostic, ...]
|
One diagnostic per feature a computation or handler needs that the target lacks. Program computations and their marginal helpers are excluded: a renderer emits them from the program's target plan rather than through the host runtime. |
Source code in src/quivers/transpile/qiec_ir.py
3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 | |
host_runtime_capability_diagnostics
¶
host_runtime_capability_diagnostics(module_or_ir: QiecModule | IRQiecModule, target: str, *, capabilities: QiecTargetCapabilities | None = None) -> tuple[QiecCapabilityDiagnostic, ...]
Report unavailable search and neural runtime boundaries.
This is the shared entry-root policy used by transpilation, the CLI, the REPL, the TUI, and the language server. Keeping it beside the general capability analyzer prevents those surfaces from diagnosing different generated helpers for the same source declaration.
| PARAMETER | DESCRIPTION |
|---|---|
module_or_ir
|
The checked module or its IR projection.
TYPE:
|
target
|
The target name.
TYPE:
|
capabilities
|
The feature set to check against, else the target's registered one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[QiecCapabilityDiagnostic, ...]
|
One diagnostic per search or neural host-runtime boundary an entry root reaches that the target cannot provide. |
Source code in src/quivers/transpile/qiec_ir.py
3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 | |