#include <wtk/bolt/PLASMASnooze.h>
PLASMASnooze
Include this API as
Members of this API live in the following namespace
namespace wtk { namespace bolt { ...
The PLASMASnooze Interpreter is parameterized on two templates.
Number_T
-
This template is the same integer-like template which the Parser API uses for numeric literals.
Wire_T
-
This template is an opaque structure supplied by the Backend for encapsulating data related to a wire. PLASMASnooze requires the
Wire_T
to be default constructible/destructable as well as mutable/overwritable.
The PLASMASnooze API is an IR interpreter sharing the Backend API. It runs in a single pass and ignores certain deviations from the IR Specification, where they are deemed harmless. The name PLASMASnooze is derived from FIREALARM. PLASMA is an improvement upon FIRE (in the sense of performance and pluggability of ZK Backends), while Snooze is the opposite of ALARM (in the sense of ignoring harmless deviations from the IR Spec). The acryonym expands to Practical Local Acceleration for Single-pass with Malleable Assumtions Snooze.
template<typename Wire_T, typename Number_T> class PLASMASnooze
The wtk::bolt::PLASMASnooze<Wire_T, Number_T>
is a main driver object.
It walks an IR syntax tree and, at each gate, invokes a corresponding gate handler from the Backend API.
PLASMASnooze(wtk::bolt::Backend<Wire_T, Number_T>* const b)
The constructor requires just a pointer to a wtk::bolt::Backend<Wire_T, Number_T>
.
PLASMASnooze(wtk::bolt::Backend<Wire_T, Number_T>* const b);
wtk::bolt::PLASMASnoozeStatus evaluate(wtk::IRTree<Number_T>* const rel_tree, wtk::InputStream<Number_T>* const ins_stream, wtk::InputStream<Number_T>* const wit_stream)
Evaluates an wtk::IRTree<Number_T>
relation and returns an enum wtk::bolt::PLASMASnoozeStatus
.
It must also have two wtk::InputStream<Number_T>
s.
The first, instance
, must not be nullptr
, while the second, witness
, may be nullptr
for the cases where the witness is inaccessible to a verifier.
PLASMASnoozeStatus evaluate(
wtk::IRTree<Number_T>* const relation,
wtk::InputStream<Number_T>* const instance,
wtk::InputStream<Number_T>* const witness);
enum class PLASMASnoozeStatus
This is an enumeration of statuses that PLASMASnooze can return.
wtk::bolt::PLASMASnooze::bad_relation
-
The relation is poorly-formed.
wtk::bolt::PLASMASnooze::bad_stream
-
The instance or witness is poorly-formed.
wtk::bolt::PLASMASnooze::well_formed
-
The relation, witness, and instance are all well-formed.