7 releases (breaking)
new 0.6.0 | Nov 5, 2024 |
---|---|
0.5.0 | Oct 29, 2024 |
0.4.0 | Sep 30, 2024 |
0.3.0 | Aug 13, 2024 |
0.0.0-release | Jul 8, 2024 |
#957 in Magic Beans
1,630 downloads per month
Used in 16 crates
(4 directly)
260KB
6K
SLoC
essential-constraint-vm
The Essential constraint checking VM.
lib.rs
:
The essential constraint checking implementation.
Checking Predicates
The primary entrypoint for this crate is the check_predicate
function
which allows for checking a contract of constraints associated with a single
predicate against some provided solution data and state slot mutations in
parallel.
Checking Individual Constraints
Functions are also exposed for checking constraints individually.
- The
exec_bytecode
,exec_bytecode_iter
andexec_ops
functions allow for executing the constraint and returning the resultingStack
. - The
eval_bytecode
,eval_bytecode_iter
andeval_ops
functions are similar to theirexec_*
counterparts, but expect the top of theStack
to contain a single boolean value indicating whether the constraint was satisfied (0
forfalse
,1
fortrue
) and returns this value.
Performing a Single Operation
The step_op
function (and related step_op_*
functions) are exposed to
allow for applying a single operation to the given stack. This can be useful
in the case of integrating constraint operations in a downstream VM (e.g.
the essential state read VM).
Understanding the Assembly
The essential-constraint-asm
crate is re-exported as the [asm
] module.
See [this module's documentation][asm] for information about the expected
behaviour of individual operations.
Dependencies
~12MB
~184K SLoC