Kernel IR¶
IRQiecModule is the typed IR of a checked Quivers Indexed Effect Core (QIEC)
module, independent of any target. It keeps the computations and their dependencies, so a renderer
can inspect the effects and indexed operations of the reachable program.
qiec_ir
¶
Typed, target-independent IR for the Quivers Indexed Effect Core.
The QIEC kernel uses immutable recursive models for checking and evaluation.
This module projects them into fully encoded structural transpiler IR. 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', 'tunnel', 'authored-handler', 'arithmetic', 'comparison', 'strict-scalar-comparison', 'strict-scalar-division', 'boolean', 'string', 'conversion', 'math', 'tuple', 'tensor', 'distribution', 'native-family', 'plate', 'log-density', 'log-mass', 'site', 'gather', 'segment-sum', 'kernel-matrix', 'affine-map', 'table-map', 'neural-attachment', 'search', 'deduction-outcomes', 'deduction-linear-goal', 'deduction-rule-guard', 'rule-log-weight', 'bounded-index', 'reduction', 'projective-tree-partition', 'dpp-log-prob', 'directed-tree-log-partition', 'rowwise', 'cholesky-factor', 'comprehension', 'let', 'special', 'activation', 'weight', 'probability', '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', 'resumption-interval']
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:
|
IRQiecIndexSum
didactic-model
¶
IRQiecIndexSum(*, terms: tuple[IRQiecStatic, ...], constant: int = 0, kind: Literal['index-sum'] = 'index-sum')
Bases: IRQiecStatic
A canonical natural-number sum in the portable checked core.
| PARAMETER | DESCRIPTION |
|---|---|
terms
|
Nominal Nat-variable summands, with repetitions retained.
TYPE:
|
constant
|
Nonnegative constant part.
TYPE:
|
kind
|
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:
|
IRQiecConditionalValue
didactic-model
¶
IRQiecConditionalValue(*, condition: IRQiecValue, then: IRQiecValue, otherwise: IRQiecValue, result_type: IRQiecStatic, kind: Literal['conditional_value'] = 'conditional_value')
Bases: IRQiecValue
One lazily selected pure value with a shared checked result type.
| PARAMETER | DESCRIPTION |
|---|---|
condition
|
Scalar Boolean selecting the active branch.
TYPE:
|
then
|
Equally typed branches; only the selected branch is evaluated.
TYPE:
|
otherwise
|
Equally typed branches; only the selected branch is evaluated.
TYPE:
|
result_type
|
Common branch type.
TYPE:
|
kind
|
Discriminator, always
TYPE:
|
IRQiecLogMass
didactic-model
¶
IRQiecLogMass(*, sampleable: IRQiecValue, origin: IRQiecSourceOrigin, batch: tuple[IRQiecPlateAxis, ...] = (), kind: Literal['log_mass'] = 'log_mass')
Bases: IRQiecValue
Total measure mass, retaining independent batch axes.
| PARAMETER | DESCRIPTION |
|---|---|
sampleable
|
The measure queried.
TYPE:
|
origin
|
Query source location.
TYPE:
|
batch
|
Retained batch axes; empty for a scalar total log weight.
TYPE:
|
kind
|
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:
|
IRQiecCholeskyFactor
didactic-model
¶
IRQiecCholeskyFactor(*, value: IRQiecValue, result_type: IRQiecStatic, kind: Literal['cholesky_factor'] = 'cholesky_factor')
Bases: IRQiecValue
The lower Cholesky factor of each matrix in a tensor's last two axes.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The tensor of symmetric positive-definite matrices.
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:
|
IRQiecLetBinding
didactic-model
¶
IRQiecLetBinding(*, binder: IRQiecLocal, value: IRQiecValue)
Bases: Model
One binding of an :class:IRQiecLetValue.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The local the bound value is read through.
TYPE:
|
value
|
The value bound, evaluated once.
TYPE:
|
IRQiecLetValue
didactic-model
¶
IRQiecLetValue(*, bindings: tuple[IRQiecLetBinding, ...], body: IRQiecValue, result_type: IRQiecStatic, kind: Literal['let'] = 'let')
Bases: IRQiecValue
A pure value shared by name through sequential bindings.
| PARAMETER | DESCRIPTION |
|---|---|
bindings
|
The bindings in evaluation order; each is in scope in the later ones and in the body.
TYPE:
|
body
|
The value the term denotes.
TYPE:
|
result_type
|
The body's 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, ...] = (), arguments: tuple[IRQiecValue, ...] = (), 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:
|
arguments
|
The initial values of the handler's parameters.
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, arguments: tuple[IRQiecValue, ...] = (), 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:
|
arguments
|
The values the handler's parameters have while the resumed computation runs.
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:
|
IRQiecMask
didactic-model
¶
IRQiecMask(*, instance: IRQiecId, body: IRQiecComputation, kind: Literal['mask'] = 'mask')
Bases: IRQiecComputation
Route one instance's requests past the innermost handler of it.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The masked instance.
TYPE:
|
body
|
The computation whose requests to the instance skip one handler.
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:
|
IRQiecKernelSemiring
didactic-model
¶
IRQiecKernelSemiring(*, algebra: str, carrier: IRQiecStatic)
Bases: Model
A semiring of the algebra hierarchy on one kernel type.
| PARAMETER | DESCRIPTION |
|---|---|
algebra
|
The qualified name of the semiring's class, the subject of its law claims.
TYPE:
|
carrier
|
The kernel type of its elements.
TYPE:
|
IRQiecForeignSemantics
didactic-model
¶
Bases: TaggedUnion
What a foreign handler computes.
IRQiecSemiringSum
didactic-model
¶
IRQiecSemiringSum(*, semiring: IRQiecKernelSemiring, kind: Literal['semiring-sum'] = 'semiring-sum')
Bases: IRQiecForeignSemantics
A search summing its shots in a semiring.
| PARAMETER | DESCRIPTION |
|---|---|
semiring
|
The semiring.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecSemiringProduct
didactic-model
¶
IRQiecSemiringProduct(*, semiring: IRQiecKernelSemiring, forkable: bool = False, kind: Literal['semiring-product'] = 'semiring-product')
Bases: IRQiecForeignSemantics
A collector multiplying a scope's weights in a semiring.
| PARAMETER | DESCRIPTION |
|---|---|
semiring
|
The semiring.
TYPE:
|
forkable
|
Whether a shot may continue from a copy of the product so far.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecEnumeration
didactic-model
¶
IRQiecEnumeration(*, grouped: bool = False, reduction: Literal['logsumexp', 'sum', 'mean', 'table'] = 'logsumexp', kind: Literal['enumeration'] = 'enumeration')
Bases: IRQiecForeignSemantics
An enumeration of a finite draw.
| PARAMETER | DESCRIPTION |
|---|---|
grouped
|
Whether it answers one weight per group position.
TYPE:
|
reduction
|
How it aggregates its shots.
TYPE:
|
kind
|
The discriminator; always
TYPE:
|
IRQiecSettlement
didactic-model
¶
IRQiecSettlement(*, semiring: IRQiecKernelSemiring, kind: Literal['settlement'] = 'settlement')
Bases: IRQiecForeignSemantics
The settlement of an iteration's stop.
| PARAMETER | DESCRIPTION |
|---|---|
semiring
|
The semiring of the value.
TYPE:
|
kind
|
The discriminator; always
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', parameters: tuple[IRQiecLocal, ...] = (), foreign: IRQiecForeignSemantics | None = None)
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:
|
parameters
|
The handler's parameters, in declaration order.
TYPE:
|
foreign
|
What a foreign handler computes, when its declaration states it.
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, ...] = (), per_row: bool = False, constraint: str | None = None)
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:
|
per_row
|
Whether its leading axis is the plate of the draw it fills, so that a value without that axis is shared by every row.
TYPE:
|
constraint
|
A checked value restriction, retained through lowering and recovery.
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:
|
IRQiecObstacle
didactic-model
¶
Bases: Model
Why a computation of a projection still installs handlers.
| PARAMETER | DESCRIPTION |
|---|---|
computation
|
The computation's name.
TYPE:
|
reason
|
The obstacle, as a clause naming the handler and the clause, to follow "the computation".
TYPE:
|
IRQiecModule
didactic-model
¶
IRQiecModule(*, module: str, source_protocol: str, distribution_families: tuple[DistributionFamily, ...] = (), 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, ...] = (), obstacles: tuple[IRQiecObstacle, ...] = (), gap: str = '', abi: str)
Bases: Model
Lossless structural projection of the kernel of one checked :class:QiecModule.
The module's structure declarations are not mirrored: a target's plan reads the statements they decode to.
obstacles records, for a target that renders no handler, why each
computation that still installs one does.
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, obstacle: 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:
|
obstacle
|
For a computation whose handlers the target would need discharged, why they are not, as a clause to follow "the computation"; empty otherwise.
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
project_for_target
¶
project_for_target(module: QiecModule, discharged: DischargedModule, target: str, *, capabilities: QiecTargetCapabilities | None = None) -> IRQiecModule
Project a checked module as a target reads it.
A target that renders no handlers gets a checked discharge, using bounded ordinary expansion in place of native pure applications. A handler-capable target uses the checked source by default. Pyro uses the checked tagged state projection for eligible abortable recursion.
| PARAMETER | DESCRIPTION |
|---|---|
module
|
The checked module.
TYPE:
|
discharged
|
The module with its handlers discharged.
TYPE:
|
target
|
The target name.
TYPE:
|
capabilities
|
The target's feature set, else its registered one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IRQiecModule
|
The projection. |
| RAISES | DESCRIPTION |
|---|---|
UnsupportedConstruct
|
If the selected graph needs a native pure application with no target representation, a mask that evidence passing did not compile away on a target without handler frames, or an unsupported outcome operation. |
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 shared core through the
QIEC runtime ABI. Pyro additionally supports partial scalar comparison
and division.
Stan admits closed, monomorphic, effect-free scalar
computations as user-defined functions: binds, shared value bindings,
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
3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 | |
outcome_target_scope
¶
outcome_target_scope(module: QiecModule, selected: str | None = None) -> QiecModule
Omit native-only declarations when the selected program cannot use them.
Source code in src/quivers/transpile/qiec_ir.py
outcome_capability_diagnostics
¶
outcome_capability_diagnostics(module: QiecModule, target: str) -> tuple[QiecCapabilityDiagnostic, ...]
Locate target entrances that reach native-only features.
Source code in src/quivers/transpile/qiec_ir.py
4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 | |
host_runtime_capability_diagnostics
¶
host_runtime_capability_diagnostics(module_or_ir: QiecModule | IRQiecModule, target: str, *, capabilities: QiecTargetCapabilities | None = None) -> tuple[QiecCapabilityDiagnostic, ...]
Report unavailable search, tensor, 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 unavailable host-runtime boundary that an entry root reaches. |
Source code in src/quivers/transpile/qiec_ir.py
4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 | |