-
Notifications
You must be signed in to change notification settings - Fork 14
The Standard Library
delehef edited this page Jun 11, 2023
·
12 revisions
Corset comes with a standard library, that provides functions commonly used in the writing of constraints.
Chronological functions peeks into the past or future values of columns or expressions, allowing the writing of constraints describing to the temporal evolution of the system rather than its instantaneous state.
Access functions fetch the value of a column at a different row than the currently evaluated one, and are the primitives used to build all more specialized chronological function.
(shift X n): (Column{M} int) -> Column{M}
- returns the value of the column
X
n
steps in the past (ifn
is negative) or the future (ifn
is positive) (prev X) ≔ Column{M} -> Column{M}
- return the value of
X
one step in the past
(next X): Column{M} -> Column{M}
- return the value of
X
one step in the future
These functions define constraints to the variation of a column in the temporal dimension.
(did-inc! X offset) [(Column{M} integer) -> 𝕃]
- ensures that
X
increased byoffset
during the transition between the previous row and the current
(did-dec! X offset): (Column{M} integer) -> 𝕃
- ensures that
X
decreased byoffset
during the transition between the previous row and the current (will-inc! X offset): (Column{M} integer) -> 𝕃
- ensures that
X
will increase byoffset
during the transition between the current row and the next one (will-dec! X offset): (Column{M} integer) -> 𝕃
- ensures that
X
will decrease byoffset
during the transition between the current row and the next one (remained-constant! X): (Column{M}) -> 𝕃
- ensures that
X
has not changed its value between the previous row and the current one (will-remain-constant! X): (Column{M}) -> 𝕃
- ensures that
X
will not change its value between the current row and the next one