Types¶
Static terms are the types, indices, shapes, and effect references of the core (family declarations). A vector's length index, for instance, constrains how many elements a value has, and the checker tracks that constraint through constructor applications and effectful computations. The module also renders static terms as text.
IndexSum represents canonical addition of Nat variables and a nonnegative
constant. add_indices folds constants and nested sums; shift_index
adds an offset or removes one already proved present in the constant part.
Rigid identities survive both operations. The checked source form is
nat_add(n, 1), described in the
index reference.
solve_index_equation cancels affine terms only when the solution remains
a representable nonnegative Nat expression. infer_index_extents solves
exact shape equations, reports inconsistent or nonintegral evidence, and
leaves underdetermined variables unbound. Neither helper guesses that
unrelated axes coincide because their extents happen to agree.
types
¶
Static terms for the Quivers Indexed Effect Core (QIEC).
The module intentionally models only the kernel's small static language. Didactic and Panproto check a first-order projection of its indexed-family declarations, while these frozen records retain the QIEC-specific distinction between uniform parameters and refinable indices.
UNIT
module-attribute
¶
UNIT = TypeApplication(constructor=TypeConstructorRef.builtin('Unit'))
The unit type, inhabited by None alone.
BOOL
module-attribute
¶
BOOL = TypeApplication(constructor=TypeConstructorRef.builtin('Bool'))
The Boolean type.
INT
module-attribute
¶
INT = TypeApplication(constructor=TypeConstructorRef.builtin('Int'))
The integer type.
REAL
module-attribute
¶
REAL = TypeApplication(constructor=TypeConstructorRef.builtin('Real'))
The real-number type.
STRING
module-attribute
¶
STRING = TypeApplication(constructor=TypeConstructorRef.builtin('String'))
The string type.
IndexTerm
¶
IndexTerm = IndexVariable | IndexLiteral | AxisExtent | IndexConstructor | IndexSum | ShapeIndex
A static index: a variable, a literal, a constructor application, or a shape.
TypeExpr
¶
TypeExpr = TypeVariable | TypeApplication | FunctionType | EqualityType | RecordType | VariantType
A type: a variable, an application, a function, an equality, a record, or a variant.
AxisType
¶
AxisType = TypeExpr | UserIndexSort
What a named tensor axis ranges over: a finite type or a finite index sort.
StaticArgument
¶
StaticArgument = TypeExpr | TypeRow | IndexTerm | EffectRef | EffectVariable
Anything a telescope binder may be instantiated at: a type, a row, an index, or an effect.
IndexVariable
didactic-model
¶
IndexVariable(*, name: str, sort: IndexSort = field(opaque=True, extras=OPAQUE_BY_VALUE), identity: StaticVariableId | None = field(default=None, opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['index_variable'] = 'index_variable')
Bases: QiecModel
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
IndexLiteral
didactic-model
¶
IndexLiteral(*, value: int | str, sort: IndexSort = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['index_literal'] = 'index_literal')
Bases: QiecModel
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
IndexConstructor
didactic-model
¶
IndexConstructor(*, name: str, arguments: tuple[IndexTerm, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), sort: IndexSort = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['index_constructor'] = 'index_constructor')
Bases: QiecModel
A fully applied constructor of a user-defined index sort.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The constructor's name, which must belong to
TYPE:
|
arguments
|
The constructor's index arguments, in order.
TYPE:
|
sort
|
The sort the constructor builds.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
IndexSum
didactic-model
¶
IndexSum(*, terms: tuple[IndexVariable, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), constant: int = 0, tag: Literal['index_sum'] = 'index_sum')
Bases: QiecModel
A canonical sum of natural-number variables and a constant.
| PARAMETER | DESCRIPTION |
|---|---|
terms
|
Nat variables, sorted by nominal identity; repeated summands remain.
TYPE:
|
constant
|
Nonnegative constant part. Use
TYPE:
|
tag
|
Serialization discriminator, always
TYPE:
|
ShapeIndex
didactic-model
¶
ShapeIndex(*, dimensions: tuple[IndexTerm, ...] = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['shape_index'] = 'shape_index')
Bases: QiecModel
A shape given by its dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
dimensions
|
One index term per dimension, outermost first.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
TypeVariable
didactic-model
¶
TypeVariable(*, name: str, kind: Kind = field(default=TYPE, opaque=True, extras=OPAQUE_BY_VALUE), identity: StaticVariableId | None = field(default=None, opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['type_variable'] = 'type_variable')
Bases: QiecModel
A variable standing for a type or effect-kinded static argument.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The variable's display name.
TYPE:
|
kind
|
The kind of the arguments it stands for.
TYPE:
|
identity
|
The rigid identity of a case branch's skolem, or
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
TypeConstructorRef
didactic-model
¶
TypeConstructorRef(*, id: TypeId = field(opaque=True, extras=OPAQUE_BY_VALUE), name: str, telescope: Telescope = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
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:
|
builtin
classmethod
¶
builtin(name: str) -> TypeConstructorRef
A constructor for one of the language's own types.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The builtin's name.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TypeConstructorRef
|
A nullary constructor whose identity derives from the
|
Source code in src/quivers/qiec/types.py
TypeApplication
didactic-model
¶
TypeApplication(*, constructor: TypeConstructorRef = field(opaque=True, extras=OPAQUE_BY_VALUE), arguments: tuple[StaticArgument, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['type_application'] = 'type_application')
Bases: QiecModel
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
FunctionType
didactic-model
¶
FunctionType(*, parameter: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), result: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE), effects: EffectRow = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['function_type'] = 'function_type')
Bases: QiecModel
The type of a function value, with the row its application performs.
A function value is a closure: building one performs nothing, and
applying one runs its body, which may request the instances of
effects. The value stratum stays first order in the sense that
applying is a computation, never a value.
| PARAMETER | DESCRIPTION |
|---|---|
parameter
|
The argument type.
TYPE:
|
result
|
The result type.
TYPE:
|
effects
|
The effect row an application of the function may perform; the empty row for a pure function.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
EqualityType
didactic-model
¶
EqualityType(*, kind: Kind | IndexSort = field(opaque=True, extras=OPAQUE_BY_VALUE), left: StaticArgument = field(opaque=True, extras=OPAQUE_BY_VALUE), right: StaticArgument = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['equality_type'] = 'equality_type')
Bases: QiecModel
The proposition that two static arguments are equal.
| PARAMETER | DESCRIPTION |
|---|---|
kind
|
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
RowField
didactic-model
¶
RowField(*, label: str, type: TypeExpr = field(opaque=True, extras=OPAQUE_BY_VALUE))
Bases: QiecModel
One labelled entry of a row of types.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The entry's label, unique within its row.
TYPE:
|
type
|
The type the label carries: a field's type in a record, an alternative's payload type in a variant.
TYPE:
|
TypeRow
didactic-model
¶
TypeRow(*, fields: tuple[RowField, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tail: TypeVariable | None = field(default=None, opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['type_row'] = 'type_row')
Bases: QiecModel
A finite map from labels to types, closed or open in a row variable.
Labels are unique: a row is a set of labelled types, not a list with
shadowing, so {a : Int | r} asserts that r has no a.
Fields are sorted by label at construction, which makes equality
insensitive to the order a row is written in and fixes the canonical
field order every first-order encoding uses.
| PARAMETER | DESCRIPTION |
|---|---|
fields
|
The explicit entries, in any order.
TYPE:
|
tail
|
A variable of the data-row kind standing for further entries, or
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
labels
property
¶
The explicit labels, in canonical order.
| RETURNS | DESCRIPTION |
|---|---|
tuple[str, ...]
|
The sorted labels of the explicit fields. |
closed
property
¶
Whether the row has no tail.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True for a closed row, whose labels are exactly its fields. |
lookup
¶
lookup(label: str) -> TypeExpr | None
The type an explicit label carries.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The label to resolve.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TypeExpr or None
|
The type, or None when no explicit field has the label. The tail is not consulted. |
Source code in src/quivers/qiec/types.py
position
¶
The canonical position of an explicit label.
| PARAMETER | DESCRIPTION |
|---|---|
label
|
The label to locate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Its zero-based position among the sorted explicit labels, which is its offset in a closed row's first-order encoding. |
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If no explicit field has the label. |
Source code in src/quivers/qiec/types.py
RecordType
didactic-model
¶
RecordType(*, row: TypeRow = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['record_type'] = 'record_type')
Bases: QiecModel
The type of records whose fields are the entries of a row.
| PARAMETER | DESCRIPTION |
|---|---|
row
|
The fields: one value of each labelled type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
VariantType
didactic-model
¶
VariantType(*, row: TypeRow = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['variant_type'] = 'variant_type')
Bases: QiecModel
The type of variants whose alternatives are the entries of a row.
| PARAMETER | DESCRIPTION |
|---|---|
row
|
The alternatives: a value is one label with a payload of its type.
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
AxisExtent
didactic-model
¶
AxisExtent(*, value: int | str, sort: IndexSort = field(opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['axis_extent'] = 'axis_extent', axis: AxisType = field(opaque=True, extras=OPAQUE_BY_VALUE), label: str | None = None)
Bases: IndexLiteral
The extent of a tensor axis named by a finite type.
The inherited value gives the axis's cardinality and sort is
always Nat. The dimension ranges over the elements of axis in
their canonical order. Positional dimensions are plain literals and variables,
which is the Fin n case. Because the name is part of the
dimension, every computation on shapes (slicing, broadcasting, a
comprehension's extent, a plate's size) carries it unchanged, and two
tensors over different finite types of one cardinality have different
types.
A record type is known by its fields, so the name an axis is written with, such as a declared record's, is kept as a display label: data and transpile targets name the axis by it. The label is not part of the type: two extents over one type are equal whatever their labels, and content hashes drop it.
| PARAMETER | DESCRIPTION |
|---|---|
axis
|
The finite type or index sort the axis ranges over.
TYPE:
|
label
|
The name the axis is written with where it is used, or
TYPE:
|
tag
|
The serialization discriminator; always
TYPE:
|
EffectVariable
didactic-model
¶
EffectVariable(*, name: str, identity: StaticVariableId | None = field(default=None, opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['effect_variable'] = 'effect_variable')
Bases: QiecModel
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
EffectRef
didactic-model
¶
EffectRef(*, id: EffectId = field(opaque=True, extras=OPAQUE_BY_VALUE), name: str, arguments: tuple[StaticArgument, ...] = field(default=(), opaque=True, extras=OPAQUE_BY_VALUE), tag: Literal['effect_ref'] = 'effect_ref')
Bases: QiecModel
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:
|
tag
|
The serialization discriminator; always
TYPE:
|
add_indices
¶
Add Nat indices, folding constants and flattening nested sums.
| PARAMETER | DESCRIPTION |
|---|---|
*terms
|
Natural-number indices. An empty sum denotes zero.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IndexTerm
|
A canonical literal, variable, or |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If a term is not a Nat literal, Nat variable, or Nat sum. |
Source code in src/quivers/qiec/types.py
shift_index
¶
Shift a Nat extent, removing only a provably present constant part.
| PARAMETER | DESCRIPTION |
|---|---|
term
|
A natural-number extent.
TYPE:
|
offset
|
Integer shift. A negative shift must be absorbed by a literal or the existing constant part of a sum; no unconstrained predecessor exists.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IndexTerm
|
The canonical shifted extent, retaining every symbolic identity. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the extent is not Nat or the offset is not an integer. |
ValueError
|
If a negative shift cannot be proved nonnegative. |
Source code in src/quivers/qiec/types.py
product_type
¶
product_type(*components: TypeExpr) -> TypeApplication
Construct the canonical finite-product type of the given arity.
| PARAMETER | DESCRIPTION |
|---|---|
components
|
The component types, in order.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TypeApplication
|
The product. Its constructor identity derives from the arity, so every two-component product in every module is the same type constructor and two products of different arity are different ones. |
Source code in src/quivers/qiec/types.py
static_kind
¶
static_kind(term: StaticArgument) -> Kind
Return the outer kind of a static term.
Index sorts are deliberately not collapsed into Type: callers that
validate an index binder compare the term's concrete sort separately.
| PARAMETER | DESCRIPTION |
|---|---|
term
|
The static term to classify.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Kind
|
The term's kind. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the term is an index, which carries a sort rather than a kind. Raising rather than returning a placeholder is what keeps a caller from comparing an index against a kind and finding them equal. |
Source code in src/quivers/qiec/types.py
index_sort
¶
Return an index term's sort, checking shape dimensions.
| PARAMETER | DESCRIPTION |
|---|---|
term
|
The index whose sort is wanted.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IndexSort
|
The term's sort. A shape reports its concrete rank, which is what lets a rank-polymorphic binder accept it while a binder of a fixed rank does not. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If a shape dimension is not of |
Source code in src/quivers/qiec/types.py
validate_static_argument
¶
validate_static_argument(term: StaticArgument) -> None
Recursively validate one intrinsically kinded static argument.
| PARAMETER | DESCRIPTION |
|---|---|
term
|
The static term to validate, together with everything nested in it.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If a term is of a class that cannot appear in a static position. |
ValueError
|
If an application is ill-kinded, or an index constructor is applied at the wrong arity. |
Source code in src/quivers/qiec/types.py
943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 | |
check_static_arguments
¶
check_static_arguments(telescope: Telescope, arguments: tuple[StaticArgument, ...]) -> tuple[tuple[tuple[str, TypeExpr | TypeRow], ...], tuple[tuple[str, IndexTerm], ...], tuple[tuple[str, EffectRef | EffectVariable], ...]]
Kind-check static arguments against a telescope and classify them.
| PARAMETER | DESCRIPTION |
|---|---|
telescope
|
The binders the arguments instantiate, in order.
TYPE:
|
arguments
|
One argument per binder.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[tuple[tuple[str, TypeExpr | TypeRow], ...], tuple[tuple[str, IndexTerm], ...], tuple[tuple[str, EffectRef | EffectVariable], ...]]
|
The type and row, index, and effect bindings the arguments make, each paired with its binder's name, in telescope order. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the counts differ, an argument is of the wrong static class for its binder, or an argument is of the wrong kind or index sort. |
ValueError
|
If a nested application is ill-kinded, or an index constructor is applied at the wrong arity. |
Source code in src/quivers/qiec/types.py
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 | |
render_static
¶
render_static(term: StaticArgument) -> str
Render a static term in the surface spelling.
| PARAMETER | DESCRIPTION |
|---|---|
term
|
The type, index, or effect term to render.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
A readable rendering: a constructor applied to its arguments in
brackets, with shape arguments in parentheses after them; an
arrow for a function type; an equality with |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the term is not a static term. |
Source code in src/quivers/qiec/types.py
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | |
render_axis
¶
render_axis(axis: AxisType) -> str
Render what a named axis ranges over, as a tensor type spells it.
| PARAMETER | DESCRIPTION |
|---|---|
axis
|
A finite type or a finite index sort.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The sort's name, or the type's rendering; a product type renders
with |
Source code in src/quivers/qiec/types.py
render_row_entries
¶
render_row_entries(row: EffectRow) -> str
Render an effect row's instances and tail without delimiters.
| PARAMETER | DESCRIPTION |
|---|---|
row
|
The row to render.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Each instance's stable identifier, then |
Source code in src/quivers/qiec/types.py
render_row_fields
¶
render_row_fields(row: TypeRow, separator: str) -> str
Render a row's entries and tail without delimiters.
| PARAMETER | DESCRIPTION |
|---|---|
row
|
The row to render.
TYPE:
|
separator
|
What separates two entries.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
|
Source code in src/quivers/qiec/types.py
bind_effect_rows
¶
bind_effect_rows(row_class: type[EffectRow]) -> None
Make the forward reference to the effect row resolvable.
The effect calculus imports this module, so the row a function type
carries is named here by a forward reference, which
:mod:quivers.qiec.effects resolves once it has defined the class.
| PARAMETER | DESCRIPTION |
|---|---|
row_class
|
The effect-row record class.
TYPE:
|
Source code in src/quivers/qiec/types.py
index_arithmetic
¶
Exact addition and cancellation for natural-number tensor extents.
The static language represents nonnegative affine expressions. These helpers never introduce subtraction whose result has no representable Nat proof.
solve_index_equation
¶
solve_index_equation(left: IndexTerm, right: IndexTerm, unknown: IndexVariable) -> IndexTerm | None
Solve a Nat equality when cancellation leaves a nonnegative affine term.
| PARAMETER | DESCRIPTION |
|---|---|
left
|
Natural-number terms equated by a checked shape relation.
TYPE:
|
right
|
Natural-number terms equated by a checked shape relation.
TYPE:
|
unknown
|
Nonrigid Nat variable to solve; every other variable remains symbolic.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IndexTerm or None
|
The exact solution, or None when it requires unproved subtraction, nonintegral coefficients, or does not determine this variable. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If an argument is not Nat, or the unknown is a rigid skolem. |
Source code in src/quivers/qiec/index_arithmetic.py
infer_index_extents
¶
infer_index_extents(equations: Sequence[tuple[IndexTerm, int]], given: Mapping[str, int] | None = None) -> dict[str, int]
Infer extents forced by exact affine shape equations.
| PARAMETER | DESCRIPTION |
|---|---|
equations
|
A checked Nat dimension and the observed integer axis length.
TYPE:
|
given
|
Previously fixed nonnegative integer extents.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, int]
|
Supplied and uniquely determined extents. Underdetermined variables remain absent; no equal-size or free-variable heuristic is applied. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If evidence is not an integer, a term is not Nat, or a rigid variable is used as a named extent. |
ValueError
|
If evidence is negative, equations disagree, or a forced solution is negative or nonintegral. |
Source code in src/quivers/qiec/index_arithmetic.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |