cottax.relational.consumers.execution.jax_solvers.canonical_nlp module

The arithmetic over a Programme at the values of a condition’s reads: canonical, every objective minimised and every relation a residual, box, and next_values.

class Canonical(objectives: tuple[Any, ...], equalities: tuple[Any, ...], inequalities: tuple[Any, ...])[source]

Bases: NamedTuple

min objectives subject to equalities = 0 and inequalities <= 0.

objectives: tuple[Any, ...]

Alias for field number 0

equalities: tuple[Any, ...]

Alias for field number 1

inequalities: tuple[Any, ...]

Alias for field number 2

class Box(lower: tuple[Any, ...], upper: tuple[Any, ...])[source]

Bases: NamedTuple

Per unknown, in condition.unknowns order, its lower and upper bound, None where it has none.

lower: tuple[Any, ...]

Alias for field number 0

upper: tuple[Any, ...]

Alias for field number 1

canonical[V: Place](condition: RelationalCondition[V], unknowns: tuple[Any, ...], values: tuple[Any, ...])[source]

The objectives, and every relation but a bound as a residual in its group.

Return type:

Canonical

box[V: Place](condition: RelationalCondition[V], unknowns: tuple[Any, ...], values: tuple[Any, ...])[source]

Each unknown’s bounds: the tightest of its lower bounds, and of its upper ones.

Return type:

Box

next_values[V: Place](condition: RelationalCondition[V], unknowns: tuple[Any, ...], values: tuple[Any, ...])[source]

For u = g(u): g per unknown, in condition.unknowns order – the update an iteration applies. One relation per unknown is FixedPointIterator.accepts’s.

Return type:

tuple[Any, ...]

class NotSquare(implementation: str, got: int, unknowns: int)[source]

Bases: Violation

implementation: str
got: int
unknowns: int
template: AbstractClassVar[str] = '{implementation} needs as many numbers in the residuals as in the unknowns -- this problem gives {got} for {unknowns}'

e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’

Type:

Wording