Terms¶
The core separates values from computations (Moggi, 1991). A value can be passed as it is, while a computation may request effects and must be sequenced to give its result. The term classes make these distinctions explicit, including the continuation that receives the answer to an operation.
LogMass(sampleable, origin, batch=()) is the structural total-mass
query, with scalar LogWeight result by default. A nonempty batch
retains the construction's declared batch axes and returns one log
weight per batch entry. LogDensity evaluates the same raw sampleable
value at an outcome. Both terms preserve their source origins through
substitution and serialization; neither introduces a scoring effect.
terms
¶
Stable value and computation terms for QIEC.
Terms contain no Python callables. Runtime values and handler bodies cross the boundary only through stable attachment and handler identifiers.
SCALE_FLOOR
module-attribute
¶
The floor an exponentiated scale head of an :class:AffineMap or
:class:TableMap is clamped at, which every backend applies alike.
LiteralData
¶
LiteralData = None | bool | int | float | str | bytes | tuple[LiteralData, ...]
The host data a literal carries: a scalar, bytes, or a tuple of literal data.
ReductionOperator
¶
ReductionOperator = Literal['sum', 'mean', 'max', 'min', 'logsumexp', 'prod', 'projective_tree_partition']
The reductions of a whole tensor to one number.
RowwiseOperator
¶
The operations along a tensor's last axis that keep its shape.
Value
¶
Value = Var | LiteralValue | ConstructorValue | EvidenceValue | AttachmentRef | TransportValue | PrimitiveApplication | TupleValue | TensorValue | Projection | DistributionValue | LogMass | LogDensity | SiteValue | ParameterName | Gather | WeightSum | SegmentSum | KernelMatrix | AffineMap | TableMap | Reduction | DppLogProb | DirectedTreeLogPartition | Rowwise | CholeskyFactor | Comprehension | ConditionalValue | LetValue | RecordValue | FieldProjection | RecordRestriction | RecordConcat | VariantInjection | VariantEmbed | Lambda | HoleValue
A value term: every pure, effect-free term a computation may mention.
Computation
¶
Computation = Return | Bind | Perform | Handle | Case | If | Call | ApplyPure | CallAddress | HandlerReturnAddress | InstanceAddress | WithTraceAddresses | Resume | NewInstance | Apply | VariantCase | VariantSplit | LetRec | Mask
A computation term: every term that may perform effects or control flow.
Local
didactic-model
¶
Local(*, name: str, type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
A typed binder for a runtime value.
Locals are compared by identity of name and type together, so two binders of the same name at different types are distinct.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The binder's display name.
TYPE:
|
type
|
The type of every value bound to it.
TYPE:
|
Var
didactic-model
¶
Var(*, local: Local = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['var'] = 'var')
Bases: QiecModel
Reference to a bound local.
| PARAMETER | DESCRIPTION |
|---|---|
local
|
The binder being referenced.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
LiteralValue
didactic-model
¶
LiteralValue(*, value: LiteralData = field(opaque=True, extras=OPAQUE_BY_VALUE), type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['literal'] = 'literal')
Bases: QiecModel
A literal host value at a primitive or tuple type.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The literal's data:
TYPE:
|
type
|
The literal's type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
ConstructorValue
didactic-model
¶
ConstructorValue(*, constructor: ConstructorId = field(opaque=True, extras=OPAQUE_BY_VALUE), static_arguments: tuple[StaticArgument, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), fields: tuple[Value, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['constructor'] = 'constructor')
Bases: QiecModel
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
EvidenceValue
didactic-model
¶
EvidenceValue(*, evidence: EqualityEvidence = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['evidence'] = 'evidence')
Bases: QiecModel
Kernel-checked equality evidence used as a value.
| PARAMETER | DESCRIPTION |
|---|---|
evidence
|
The evidence term.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
AttachmentRef
didactic-model
¶
AttachmentRef(*, attachment: AttachmentId = field(opaque=True, extras=OPAQUE_BY_VALUE), type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['attachment'] = 'attachment')
Bases: QiecModel
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 must inhabit.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
TransportValue
didactic-model
¶
TransportValue(*, evidence: EqualityEvidence = field(opaque=True, extras=OPAQUE_BY_VALUE), value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), target_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['transport'] = 'transport')
Bases: QiecModel
Transport 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:
|
tag
|
The serialization discriminator; always
TYPE:
|
PrimitiveApplication
didactic-model
¶
PrimitiveApplication(*, primitive: PrimitiveId = field(opaque=True, extras=OPAQUE_BY_VALUE), name: str, arguments: tuple[Value, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['primitive'] = 'primitive')
Bases: QiecModel
Application of a pure primitive from the closed registry.
The primitive is named nominally and its signature is fixed, so the checker validates the arguments against the registry and a backend renders the name it knows or refuses the capability; nothing is resolved by inspecting a runtime value.
| PARAMETER | DESCRIPTION |
|---|---|
primitive
|
The stable identity of the primitive applied.
TYPE:
|
name
|
The primitive's nominal name, as the registry spells it.
TYPE:
|
arguments
|
The value arguments, one per parameter.
TYPE:
|
result_type
|
The primitive's result type.
TYPE:
|
origin
|
The application's source location.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
TupleValue
didactic-model
¶
TupleValue(*, items: tuple[Value, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['tuple'] = 'tuple')
Bases: QiecModel
Construction of a finite product from its components.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
The component values, in order.
TYPE:
|
result_type
|
The product type of the components.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
TensorValue
didactic-model
¶
TensorValue(*, items: tuple[Value, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['tensor'] = 'tensor')
Bases: QiecModel
Construction of a tensor from its entries along the outermost axis.
A rank-one tensor lists its elements; a tensor of higher rank lists the tensors one rank lower that are its slices, all of one shape, so a matrix literal is a tensor of row tensors.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
The entries along the outermost axis, in order.
TYPE:
|
result_type
|
The
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Projection
didactic-model
¶
Projection(*, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), position: int, result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['projection'] = 'projection')
Bases: QiecModel
Select a component of a product or an admitted nominal record local.
The latter is a direct variable of an exact, closed, unindexed singleton layout over ordinary scalars and products. Its index is a declared field ordinal and is checked against the actual nominal constructor.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The product value projected from.
TYPE:
|
position
|
The zero-based component selected.
TYPE:
|
result_type
|
The selected component's type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
PlateAxis
didactic-model
¶
PlateAxis(*, name: str, size: IndexTerm = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['plate_axis'] = 'plate_axis')
Bases: QiecModel
One axis of a plated distribution.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The axis's source name, the object it ranges over.
TYPE:
|
size
|
The axis's extent, an index term of the nat sort.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
PlateShape
didactic-model
¶
PlateShape(*, batch: tuple[PlateAxis, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), event: tuple[PlateAxis, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['plate_shape'] = 'plate_shape')
Bases: QiecModel
The plate a distribution is constructed over.
Batch axes replicate the distribution independently, one draw per position, each scored on its own; event axes join the draws along them into one event, scored together. The trailing event axes are the family's own event dimensions when it has any; any leading ones extend a scalar family's event.
| PARAMETER | DESCRIPTION |
|---|---|
batch
|
The independent replication axes, outermost first.
TYPE:
|
event
|
The joint axes, outermost first.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
empty
property
¶
Whether the plate has no axes at all.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
DistributionValue
didactic-model
¶
DistributionValue(*, family: DistributionId = field(opaque=True, extras=OPAQUE_BY_VALUE), name: str, arguments: tuple[tuple[str, Value], ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), plate: PlateShape = field(default=PlateShape(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['distribution'] = 'distribution')
Bases: QiecModel
Construction of a distribution from a family of the semantic registry.
The family is named nominally and its parameters are supplied by name, so the term records which parameterization the source used and a backend renders the spelling it knows without inspecting values. A plate replicates the family over batch axes and joins draws along event axes; a parameter may then be a tensor whose leading dimensions follow a suffix of the plate's axes and broadcast over the rest.
| PARAMETER | DESCRIPTION |
|---|---|
family
|
The stable identity of the family applied.
TYPE:
|
name
|
The family's source name, as the registry spells it.
TYPE:
|
arguments
|
The parameters supplied, each named, in source order.
TYPE:
|
result_type
|
The
TYPE:
|
origin
|
The construction's source location.
TYPE:
|
plate
|
The plate the distribution is constructed over; empty for one draw of the family.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Gather
didactic-model
¶
Gather(*, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), index: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['gather'] = 'gather')
Bases: QiecModel
Selection along the outermost axis of a tensor.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The tensor selected from.
TYPE:
|
index
|
An
TYPE:
|
result_type
|
The selection's type: the slice type for an integer index, or a tensor of slices shaped like the index tensor.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
WeightSum
didactic-model
¶
WeightSum(*, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['weight_sum'] = 'weight_sum')
Bases: QiecModel
The total of a tensor of log weights.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
A
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
SegmentSum
didactic-model
¶
SegmentSum(*, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), index: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), groups: IndexTerm = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['segment_sum'] = 'segment_sum')
Bases: QiecModel
Per-group totals of a vector of log weights.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
A
TYPE:
|
index
|
A
TYPE:
|
groups
|
The number of groups, an index term of the nat sort.
TYPE:
|
result_type
|
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
KernelMatrix
didactic-model
¶
KernelMatrix(*, inputs: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), kernel: str, length_scale: float, jitter: float, result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['kernel_matrix'] = 'kernel_matrix')
Bases: QiecModel
A positive-definite covariance over input locations.
| PARAMETER | DESCRIPTION |
|---|---|
inputs
|
A
TYPE:
|
kernel
|
The kernel's name;
TYPE:
|
length_scale
|
The kernel's length scale.
TYPE:
|
jitter
|
The diagonal added for numerical positive definiteness.
TYPE:
|
result_type
|
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Reduction
didactic-model
¶
Reduction(*, operator: ReductionOperator = field(opaque=True, extras=OPAQUE_BY_VALUE), value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['reduction'] = 'reduction')
Bases: QiecModel
A number summarizing every entry of a tensor.
| PARAMETER | DESCRIPTION |
|---|---|
operator
|
The reduction.
TYPE:
|
value
|
A tensor of reals, or of integers for
TYPE:
|
result_type
|
The element type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
DppLogProb
didactic-model
¶
DppLogProb(*, features: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), membership: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['dpp_log_prob'] = 'dpp_log_prob')
Bases: QiecModel
A finite Gram determinantal point process's subset log probability.
| PARAMETER | DESCRIPTION |
|---|---|
features
|
A rank-two real tensor with one row per ground item.
TYPE:
|
membership
|
A rank-one Boolean tensor with the same ground-item extent.
TYPE:
|
origin
|
The application's source location.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
DirectedTreeLogPartition
didactic-model
¶
DirectedTreeLogPartition(*, scores: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), root: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), mask: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['directed_tree_log_partition'] = 'directed_tree_log_partition')
Bases: QiecModel
The log total mass of directed spanning trees rooted at one node.
| PARAMETER | DESCRIPTION |
|---|---|
scores
|
The square real edge-score tensor in parent-by-child order.
TYPE:
|
root
|
The integer node index.
TYPE:
|
mask
|
The equally shaped Boolean tensor of permitted edges.
TYPE:
|
origin
|
The application's source location.
TYPE:
|
tag
|
The serialization discriminator.
TYPE:
|
Rowwise
didactic-model
¶
Rowwise(*, operator: RowwiseOperator = field(opaque=True, extras=OPAQUE_BY_VALUE), value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['rowwise'] = 'rowwise')
Bases: QiecModel
An operation along a tensor's last axis keeping its shape.
| PARAMETER | DESCRIPTION |
|---|---|
operator
|
The operation.
TYPE:
|
value
|
A tensor of reals.
TYPE:
|
result_type
|
The tensor's own type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
CholeskyFactor
didactic-model
¶
CholeskyFactor(*, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['cholesky_factor'] = 'cholesky_factor')
Bases: QiecModel
The lower Cholesky factor of a symmetric positive-definite matrix.
The factor L of A is the lower-triangular matrix with a positive
diagonal and L L^T = A. Leading axes, if any, index independent
matrices.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
A tensor of reals whose last two axes have one extent.
TYPE:
|
result_type
|
The tensor's own type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Comprehension
didactic-model
¶
Comprehension(*, binder: Local = field(opaque=True, extras=OPAQUE_BY_VALUE), extent: IndexTerm = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['comprehension'] = 'comprehension')
Bases: QiecModel
A tensor built by evaluating a body at every index of an axis.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The
TYPE:
|
extent
|
The axis's extent, an index term of the nat sort.
TYPE:
|
body
|
The entry at each index.
TYPE:
|
result_type
|
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
ConditionalValue
didactic-model
¶
ConditionalValue(*, condition: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), then: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), otherwise: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['conditional_value'] = 'conditional_value')
Bases: QiecModel
Evaluate exactly one pure branch selected by a scalar Boolean.
| PARAMETER | DESCRIPTION |
|---|---|
condition
|
Scalar Boolean deciding which branch is evaluated.
TYPE:
|
then
|
Equally typed branches; the inactive branch is not evaluated.
TYPE:
|
otherwise
|
Equally typed branches; the inactive branch is not evaluated.
TYPE:
|
result_type
|
The common branch type, including its tensor or sampleable indices.
TYPE:
|
tag
|
Serialization discriminator, always
TYPE:
|
LetBinding
didactic-model
¶
LetValue
didactic-model
¶
LetValue(*, bindings: tuple[LetBinding, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['let'] = 'let')
Bases: QiecModel
A pure value shared by name through sequential bindings.
Each binding's value is evaluated once, in order, and is in scope in
every later binding and in the body, so a term that reads one
intermediate value several times holds it once. The bindings bind
sequentially, as let* does: binding k may read binders
0 through k - 1.
| PARAMETER | DESCRIPTION |
|---|---|
bindings
|
The bindings, in evaluation order; at least one.
TYPE:
|
body
|
The value the term denotes, read with every binder in scope.
TYPE:
|
result_type
|
The body's type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
AffineMap
didactic-model
¶
AffineMap(*, weight: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), bias: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), sources: tuple[Value, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), row_offset: int, rows: int, transform: Literal['identity', 'exp', 'exp_floor'], result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['affine_map'] = 'affine_map')
Bases: QiecModel
One head of an affine parameter map, W x + b on a row block.
For i below rows the head's coordinate i is the sum over
j of weight[row_offset + i, j] * x[j] plus
bias[row_offset + i], where x concatenates the sources in
order; exp exponentiates every coordinate afterwards, and
exp_floor exponentiates and clamps each at the scale floor.
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
A
TYPE:
|
bias
|
A
TYPE:
|
sources
|
The conditioning row's factors in order, each a
TYPE:
|
row_offset
|
The first row of the head's block.
TYPE:
|
rows
|
The block's height.
TYPE:
|
transform
|
TYPE:
|
result_type
|
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
TableMap
didactic-model
¶
TableMap(*, table: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), index: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), row_offset: int, rows: int, transform: Literal['identity', 'exp', 'exp_floor'], result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['table_map'] = 'table_map')
Bases: QiecModel
One head of a table-indexed parameter map, a row block of T[i].
A kernel over a finite domain reads its parameters from a table
with one row per element of the domain: for i below rows
the head's coordinate i is table[index, row_offset + i],
with exp exponentiating every coordinate afterwards and
exp_floor exponentiating and clamping each at the scale floor.
| PARAMETER | DESCRIPTION |
|---|---|
table
|
A
TYPE:
|
index
|
An
TYPE:
|
row_offset
|
The first column of the head's block.
TYPE:
|
rows
|
The block's width.
TYPE:
|
transform
|
TYPE:
|
result_type
|
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
SiteValue
didactic-model
¶
SiteValue(*, label: str, result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['site'] = 'site')
Bases: QiecModel
A named sample site.
A site is the address a probabilistic step is observed and traced under. Its label is the source name of the step, which is stable data; the dynamic address a run adds comes from the request that carries it.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The site's source name.
TYPE:
|
result_type
|
The
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
ParameterName
didactic-model
¶
Bases: QiecModel
The name of a learned parameter that a declaration owns.
A declaration with learned parameters (a deduction's weighted lexicon
and rules) reads each one through Param.get by a String name.
The name is the owner's name followed by the parameter's member path
below it. Both are names the core resolves by spelling, so content
identity treats them as names, not as data: renaming the owner or the
production a member path names leaves every declaration that reads the
parameter with the same hash, while a run reads the spelled name.
| PARAMETER | DESCRIPTION |
|---|---|
owner
|
The owning declaration's name.
TYPE:
|
member
|
The parameter's path below the owner, such as
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
spelled
¶
The name a run reads the parameter under.
| RETURNS | DESCRIPTION |
|---|---|
str
|
|
LogMass
didactic-model
¶
LogMass(*, sampleable: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), batch: tuple[PlateAxis, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['log_mass'] = 'log_mass')
Bases: QiecModel
Total mass of a sampleable, preserving declared batch axes.
| PARAMETER | DESCRIPTION |
|---|---|
sampleable
|
The measure, of type
TYPE:
|
origin
|
Source location of the query.
TYPE:
|
batch
|
Independent batch axes retained in the result; empty for one total
TYPE:
|
tag
|
Serialization discriminator, always
TYPE:
|
LogDensity
didactic-model
¶
LogDensity(*, sampleable: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), batch: tuple[PlateAxis, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['log_density'] = 'log_density')
Bases: QiecModel
Evaluation of a distribution's log density at a value.
| PARAMETER | DESCRIPTION |
|---|---|
sampleable
|
The distribution, of type
TYPE:
|
value
|
The point evaluated, of type
TYPE:
|
origin
|
The evaluation's source location.
TYPE:
|
batch
|
The batch axes the density is kept apart over: empty for one
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
RecordFieldValue
didactic-model
¶
RecordFieldValue(*, label: str, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
One labelled field of a record value.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The field's label.
TYPE:
|
value
|
The field's value.
TYPE:
|
RecordValue
didactic-model
¶
RecordValue(*, fields: tuple[RecordFieldValue, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['record_value'] = 'record_value')
Bases: QiecModel
A record built from one value per label.
| PARAMETER | DESCRIPTION |
|---|---|
fields
|
The fields, in any order; normalized to canonical label order, which is also their evaluation order.
TYPE:
|
result_type
|
The closed record type of the fields.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
FieldProjection
didactic-model
¶
FieldProjection(*, record: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), label: str, result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['field_projection'] = 'field_projection')
Bases: QiecModel
The value of one field of a record.
| PARAMETER | DESCRIPTION |
|---|---|
record
|
The record.
TYPE:
|
label
|
The field read.
TYPE:
|
result_type
|
The field's type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
RecordRestriction
didactic-model
¶
RecordRestriction(*, record: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['record_restriction'] = 'record_restriction')
Bases: QiecModel
A record cut down to the fields of a contained row.
| PARAMETER | DESCRIPTION |
|---|---|
record
|
The record.
TYPE:
|
result_type
|
The record type of the fields kept; its row must be contained in the record's row.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
RecordConcat
didactic-model
¶
RecordConcat(*, left: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), right: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['record_concat'] = 'record_concat')
Bases: QiecModel
The record of all fields of two records with disjoint rows.
| PARAMETER | DESCRIPTION |
|---|---|
left
|
The two records; their rows must combine into the result's row.
TYPE:
|
right
|
The two records; their rows must combine into the result's row.
TYPE:
|
result_type
|
The record type of the combined row.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
VariantInjection
didactic-model
¶
VariantInjection(*, label: str, payload: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['variant_injection'] = 'variant_injection')
Bases: QiecModel
A variant value: one label with its payload.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The alternative chosen.
TYPE:
|
payload
|
The value the alternative carries;
TYPE:
|
result_type
|
The variant type, whose row must contain the label at the payload's type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
VariantEmbed
didactic-model
¶
VariantEmbed(*, variant: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['variant_embed'] = 'variant_embed')
Bases: QiecModel
A variant seen at a variant type of a containing row.
| PARAMETER | DESCRIPTION |
|---|---|
variant
|
The variant.
TYPE:
|
result_type
|
The wider variant type; the variant's row must be contained in its row.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Lambda
didactic-model
¶
Lambda(*, code: ComputationId = field(opaque=True, extras=OPAQUE_BY_VALUE), name: str, parameter: Local = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['lambda'] = 'lambda')
Bases: QiecModel
A function value: a closure over the locals in scope.
Building a closure performs nothing. Applying it runs body with
the captured locals and the argument bound, as a call of the closure's
code: the application has a call address under name, like a call
of a named computation, so specialization and defunctionalization can
replace it by a call of a generated computation with the same address.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The stable identity of the closure's code, from its source site.
TYPE:
|
name
|
The code's display name: a local definition's name, or a name derived from the source position of an anonymous function.
TYPE:
|
parameter
|
The local the argument is bound to.
TYPE:
|
body
|
The computation an application runs.
TYPE:
|
result_type
|
The function type: the parameter's type, the body's result type, and the row the body may perform.
TYPE:
|
origin
|
Where the function was written.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
HoleValue
didactic-model
¶
HoleValue(*, name: str, type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['hole'] = 'hole')
Bases: QiecModel
A typed hole: a value the author has not written yet.
A hole is well typed at its type and at no other, so a body that mentions it checks exactly as it would with any value of that type in its place. Nothing reduces it: the reference machine holds it as a hole closure, the hole paired with the values of the locals in scope, and a step that must inspect the value stops there with an indeterminate result. No compiled or exported form exists, so every export path refuses a module that contains one.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The hole's name as written, without the
TYPE:
|
type
|
The hole's goal: the type every filling must have.
TYPE:
|
origin
|
Where the hole was written.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Return
didactic-model
¶
Return(*, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['return'] = 'return')
Bases: QiecModel
Return a value with no effects.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The value produced.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Bind
didactic-model
¶
Bind(*, binder: Local = field(opaque=True, extras=OPAQUE_BY_VALUE), first: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), then: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['bind'] = 'bind')
Bases: QiecModel
Sequence two computations, binding the first's result in the second.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The local the first computation's result is bound to.
TYPE:
|
first
|
The computation run first.
TYPE:
|
then
|
The computation run second, with
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Perform
didactic-model
¶
Perform(*, request: EffectRequest = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['perform'] = 'perform')
Bases: QiecModel
Perform one effect operation.
| PARAMETER | DESCRIPTION |
|---|---|
request
|
The operation, its instance, static arguments, value arguments, and result type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Handle
didactic-model
¶
Handle(*, instance: EffectInstanceId = field(opaque=True, extras=OPAQUE_BY_VALUE), handler: HandlerId = field(opaque=True, extras=OPAQUE_BY_VALUE), computation: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), static_arguments: tuple[StaticArgument, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), arguments: tuple[Value, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['handle'] = 'handle')
Bases: QiecModel
Run a computation 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, one per parameter, in declaration order; empty for a handler without parameters.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
CaseMotive
didactic-model
¶
CaseMotive(*, indices: Telescope = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
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 must produce, over
TYPE:
|
CaseBranch
didactic-model
¶
CaseBranch(*, constructor: ConstructorId = field(opaque=True, extras=OPAQUE_BY_VALUE), static_arguments: tuple[StaticArgument, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), fields: tuple[Local, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), scope: StaticScopeId = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
One stable GADT branch with no host-language closure.
| 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:
|
Case
didactic-model
¶
Case(*, scrutinee: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), motive: CaseMotive = field(opaque=True, extras=OPAQUE_BY_VALUE), branches: tuple[CaseBranch, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['case'] = 'case')
Bases: QiecModel
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; coverage is checked against the exact applied family.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Call
didactic-model
¶
Call(*, callee: ComputationId = field(opaque=True, extras=OPAQUE_BY_VALUE), name: str, static_arguments: tuple[StaticArgument, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), arguments: tuple[Value, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), effects: EffectRow = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['call'] = 'call')
Bases: QiecModel
Application of a named computation.
The callee is a stable identifier rather than an inlined body, which is what lets a recursive or mutually recursive call graph serialize as a finite tree.
| PARAMETER | DESCRIPTION |
|---|---|
callee
|
The stable identity of the computation called.
TYPE:
|
name
|
The callee's display name, for diagnostics and traces.
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
ApplyPure
didactic-model
¶
ApplyPure(*, callee: ComputationId = field(opaque=True, extras=OPAQUE_BY_VALUE), arguments: tuple[Value, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['apply_pure'] = 'apply_pure')
Bases: QiecModel
Apply a closed address-inert definition to explicit strict operands.
The kernel checks the actual callee body. Application introduces only a lexical scope and does not allocate a call address.
| PARAMETER | DESCRIPTION |
|---|---|
callee
|
The nominal monomorphic definition.
TYPE:
|
arguments
|
The operands, in declaration and evaluation order.
TYPE:
|
result_type
|
The exact declared result.
TYPE:
|
origin
|
The original application site for diagnostics.
TYPE:
|
tag
|
The serialization discriminator, always
TYPE:
|
Resume
didactic-model
¶
Resume(*, value: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), arguments: tuple[Value, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['resume'] = 'resume')
Bases: QiecModel
Invocation of the enclosing handler clause's continuation.
The resumption is not a value and cannot be stored, so it is a term of its own rather than a call to a bound name. That is what makes a clause's grade checkable by counting invocations along the paths through its body.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The value returned to the suspended computation as the operation's result.
TYPE:
|
origin
|
The resumption's source location.
TYPE:
|
arguments
|
The values the handler's parameters have while the resumed
computation runs, one per parameter, in declaration order. A
source
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
CallAddress
didactic-model
¶
CallAddress(*, callee: ComputationId = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), previous: Var | None = field(default=None, opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['call_address'] = 'call_address')
Bases: QiecModel
Allocate the address of a call that discharge has inlined.
Allocation takes place at the original call entry. The address can be restored around several parts of the rewritten continuation.
| PARAMETER | DESCRIPTION |
|---|---|
callee
|
The called computation's identity.
TYPE:
|
origin
|
The original call site.
TYPE:
|
previous
|
The replaced call's allocation when this was a tail call.
TYPE:
|
tag
|
The serialization discriminator.
TYPE:
|
InstanceAddress
didactic-model
¶
InstanceAddress(*, origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['instance_address'] = 'instance_address')
Bases: QiecModel
Allocate the address of a local instance removed during discharge.
| PARAMETER | DESCRIPTION |
|---|---|
origin
|
The site of the original allocation.
TYPE:
|
tag
|
The serialization discriminator.
TYPE:
|
HandlerReturnAddress
didactic-model
¶
HandlerReturnAddress(*, handler: HandlerId = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['handler_return_address'] = 'handler_return_address')
Bases: QiecModel
Allocate the return address of a discharged handler installation.
| PARAMETER | DESCRIPTION |
|---|---|
handler
|
The installed declaration whose return clause can make requests.
TYPE:
|
tag
|
The serialization discriminator.
TYPE:
|
HandlerClauseAddress
didactic-model
¶
HandlerClauseAddress(*, site: SiteId = field(opaque=True, extras=OPAQUE_BY_VALUE), captured: tuple[SiteId | Var, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
A relative operation-clause address that reads captured scopes.
| PARAMETER | DESCRIPTION |
|---|---|
site
|
The static site of the request that entered the clause.
TYPE:
|
captured
|
The ordered call sites and bindings for captured instance or return addresses.
TYPE:
|
WithTraceAddresses
didactic-model
¶
WithTraceAddresses(*, addresses: tuple[Var, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), previous: Var | None = field(default=None, opaque=True, extras=OPAQUE_BY_VALUE), resumptions: tuple[int, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), clauses: tuple[DynamicAddressFrame | HandlerClauseAddress, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['with_trace_addresses'] = 'with_trace_addresses')
Bases: QiecModel
Run a residual computation under previously allocated trace addresses.
| PARAMETER | DESCRIPTION |
|---|---|
addresses
|
The live calls, local instances and handler returns, in outer-to-inner order.
TYPE:
|
body
|
The computation that observes the restored addresses.
TYPE:
|
previous
|
A replaced inlined caller whose lexical path a residual tail call inherits.
TYPE:
|
resumptions
|
The discharged shots enclosing a residual call, in order.
TYPE:
|
clauses
|
The discharged clause activations enclosing a residual call.
TYPE:
|
tag
|
The serialization discriminator.
TYPE:
|
NewInstance
didactic-model
¶
NewInstance(*, instance: EffectInstanceId = field(opaque=True, extras=OPAQUE_BY_VALUE), effect: EffectRef = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['new_instance'] = 'new_instance')
Bases: QiecModel
Lexically scoped allocation of an effect instance.
The identity is derived from the module, the enclosing computation, the lexical path, and the applied interface, so the same allocation site yields the same instance on every run while two sites of the same interface stay distinct.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The scope-derived stable 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:
|
tag
|
The serialization discriminator; always
TYPE:
|
If
didactic-model
¶
If(*, condition: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), then: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), otherwise: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['if'] = 'if')
Bases: QiecModel
Branch on a Boolean value.
Both branches must produce the same type; the row of the whole is the union of the branches' rows. This is what lets a recursive computation stop, since a value-level select would evaluate both branches and never terminate.
| 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:
|
tag
|
The serialization discriminator; always
TYPE:
|
Apply
didactic-model
¶
Apply(*, function: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), argument: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), effects: EffectRow = field(opaque=True, extras=OPAQUE_BY_VALUE), origin: SourceOrigin = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['apply'] = 'apply')
Bases: QiecModel
Application of a function value.
| PARAMETER | DESCRIPTION |
|---|---|
function
|
The function value.
TYPE:
|
argument
|
The argument, at the function's parameter type.
TYPE:
|
result_type
|
The function's result type.
TYPE:
|
effects
|
The function's effect row, which the application performs.
TYPE:
|
origin
|
The application's source location.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
VariantBranch
didactic-model
¶
VariantBranch(*, label: str, binder: Local = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
One alternative of a variant case.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The alternative matched.
TYPE:
|
binder
|
The local its payload is bound to.
TYPE:
|
body
|
The computation run when the alternative is selected.
TYPE:
|
VariantRest
didactic-model
¶
VariantRest(*, binder: Local = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
A branch of a variant split, which receives the variant at a part's type.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The local the variant is bound to, at the variant type of the part.
TYPE:
|
body
|
The computation run when the alternative is in the part.
TYPE:
|
VariantCase
didactic-model
¶
VariantCase(*, scrutinee: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), branches: tuple[VariantBranch, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['variant_case'] = 'variant_case')
Bases: QiecModel
Case analysis on the alternative of a variant.
| PARAMETER | DESCRIPTION |
|---|---|
scrutinee
|
The variant analyzed, whose row is closed.
TYPE:
|
branches
|
One branch per alternative of its row.
TYPE:
|
result_type
|
The type every branch returns.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
VariantSplit
didactic-model
¶
VariantSplit(*, scrutinee: Value = field(opaque=True, extras=OPAQUE_BY_VALUE), left: VariantRest = field(opaque=True, extras=OPAQUE_BY_VALUE), right: VariantRest = field(opaque=True, extras=OPAQUE_BY_VALUE), result_type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['variant_split'] = 'variant_split')
Bases: QiecModel
Branching on which of two disjoint parts a variant's alternative is in.
| PARAMETER | DESCRIPTION |
|---|---|
scrutinee
|
The variant, whose row is the combination of the two parts.
TYPE:
|
left
|
The branch for an alternative of the left part, which receives the variant at the left part's variant type.
TYPE:
|
right
|
The same for the right part.
TYPE:
|
result_type
|
The type both branches return.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
RecursiveBinding
didactic-model
¶
RecursiveBinding(*, binder: Local = field(opaque=True, extras=OPAQUE_BY_VALUE), function: Lambda = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
One function of a group of local, mutually recursive definitions.
| PARAMETER | DESCRIPTION |
|---|---|
binder
|
The local the function is bound to, at its function type.
TYPE:
|
function
|
The function, which may refer to every binder of its group.
TYPE:
|
LetRec
didactic-model
¶
LetRec(*, bindings: tuple[RecursiveBinding, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['let_rec'] = 'let_rec')
Bases: QiecModel
Local, mutually recursive function definitions scoped to a body.
| PARAMETER | DESCRIPTION |
|---|---|
bindings
|
The definitions; each function's body has every binder in scope.
TYPE:
|
body
|
The computation the definitions are visible in.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Mask
didactic-model
¶
Mask(*, instance: EffectInstanceId = field(opaque=True, extras=OPAQUE_BY_VALUE), body: Computation = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['mask'] = 'mask')
Bases: QiecModel
Route one instance's requests past the innermost handler of it.
A request to instance made while body runs skips the innermost
handler of that instance installed outside the mask, and is answered
by the next one out. This is how a request that reaches generic code
through an abstract effect row tunnels past a handler the generic code
installed for its own requests: the generic code was never given the
instance, so its handler does not see the request. Masks of one
instance nest, each skipping one more handler.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The instance whose requests tunnel.
TYPE:
|
body
|
The computation whose requests to
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
Cited sources¶
Eugenio Moggi. Notions of Computation and Monads. Information and Computation, 93(1):55–92, 1991. URL: https://www.sciencedirect.com/science/article/pii/0890540191900524, doi:10.1016/0890-5401(91)90052-4.