Typed holes¶
Where a checked module's typed holes are, and the refusal every export path makes for a module that has one. The typing and evaluation rules are in Typed holes.
holes
¶
Typed holes in checked QIEC: where they are and who refuses them.
A typed hole stands for a value or a type the author has not written yet.
A value hole is the core term HoleValue,
well typed at its goal type and at no other. A type hole is an opaque
family with no constructors whose name is the hole's spelling, ?A:
checking treats it as an unknown type distinct from every other type, so a
body that checks with it checks for every type that could fill it. ?
cannot begin a declared name, so only a type hole declares such a family.
A module with holes checks and runs on the reference machine, but it has no
compiled or exported form. Every export path (the stable wire form,
compilation to PyTorch, transpilation, fitting, and runs that produce
experiment records) calls refuse_holes,
which lists every hole of the module, not only the first.
HoleSite
didactic-model
¶
HoleSite(*, name: str, kind: Literal['value', 'type'], goal: str, origin: SourceOrigin | None = field(default=None, opaque=True, extras=OPAQUE_BY_VALUE))
Bases: ValueModel
One typed hole of a module, as an export refusal lists it.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The hole's name, without the sigil.
TYPE:
|
kind
|
Whether the hole stands for a value or for a type.
TYPE:
|
goal
|
The rendered goal: the hole's type for a value hole,
TYPE:
|
origin
|
Where a value hole was written; a type hole is reported by name.
TYPE:
|
render
¶
Render the hole as one line of a refusal.
| RETURNS | DESCRIPTION |
|---|---|
str
|
|
Source code in src/quivers/qiec/holes.py
HoleError
¶
HoleError(action: str, holes: tuple[HoleSite, ...])
Bases: ValueError
An export path was given a module that contains typed holes.
| PARAMETER | DESCRIPTION |
|---|---|
action
|
What was refused, as a noun phrase (
TYPE:
|
holes
|
Every hole of the module.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
code |
The diagnostic code,
TYPE:
|
Source code in src/quivers/qiec/holes.py
type_hole_name
¶
The name of the opaque family a type hole ?name declares.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The hole's name as written, without the sigil.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
|
Source code in src/quivers/qiec/holes.py
is_type_hole
¶
is_type_hole(family: FamilyDecl) -> bool
Whether a family is the opaque family of a type hole.
| PARAMETER | DESCRIPTION |
|---|---|
family
|
The family.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True when its local name begins with |
Source code in src/quivers/qiec/holes.py
holes_in
¶
Every value hole a QIEC datum contains, in traversal order.
| PARAMETER | DESCRIPTION |
|---|---|
datum
|
A module, declaration, computation, value, or tuple of them.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[HoleValue, ...]
|
Each occurrence once, outermost and leftmost first. |
Source code in src/quivers/qiec/holes.py
type_holes_in
¶
type_holes_in(datum: HeldValue) -> tuple[FamilyDecl, ...]
Every type-hole family a QIEC datum declares.
| PARAMETER | DESCRIPTION |
|---|---|
datum
|
A module or any datum holding family declarations.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[FamilyDecl, ...]
|
The opaque families of type holes, in traversal order. |
Source code in src/quivers/qiec/holes.py
hole_sites
¶
Every typed hole of a QIEC datum, as refusals list them.
| PARAMETER | DESCRIPTION |
|---|---|
datum
|
A module or any part of one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[HoleSite, ...]
|
The type holes by name, then each value hole occurrence by position; an occurrence reached through two paths is listed once. |
Source code in src/quivers/qiec/holes.py
has_holes
¶
has_holes(datum: HeldValue) -> bool
Whether a QIEC datum contains a typed hole of either kind.
| PARAMETER | DESCRIPTION |
|---|---|
datum
|
A module or any part of one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True when a value hole occurs in it or it declares a type hole. |
Source code in src/quivers/qiec/holes.py
refuse_holes
¶
refuse_holes(datum: HeldValue, *, action: str) -> None
Refuse a module, or any part of one, that contains a typed hole.
Every path that leaves the reference machine calls this first: a hole has no compiled, transpiled, serialized, or fitted form, and a run that feeds an experiment record must not depend on one.
| PARAMETER | DESCRIPTION |
|---|---|
datum
|
The module, or the declaration or term about to be exported.
TYPE:
|
action
|
What is being refused, as a noun phrase that names the path.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
HoleError
|
If the datum contains a hole; the message lists every hole with its goal and position. |