BOLT Evaluator API

Table of Contents

Include this API as

#include <wtk/bolt/Evaluator.h>

Members of this API live in the following namespace

namespace wtk { namespace bolt { ...

The BOLT API 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. The Builder requires it to be default constructible/destructible, and the Evaluator requires it be mutable/overwritable.

class Evaluator

The wtk::bolt::Evaluator<Wire_T, Number_T> class encapsulates the second phase of BOLT invocation. It traverses the BOLT relation and "executes" each gate. Thus, it is by definition O(n) where n is the total number of gates.

Evaluator(wtk::bolt::Backend<Wire_T, Number_T>* const b)

The single constructor requires just a pointer to the wtk::bolt::Backend<Wire_T, Number_T> implementation.

Evaluator(wtk::bolt::Backend<Wire_T, Number_T>* const b);

bool evaluate(wtk::bolt::Bolt<Wire_T, Number_T>* const bolt, wtk::InputStream<Number_T>* const instance, wtk::InputStream<Number_T>* const witness)

Evaluates a wtk::bolt::Bolt<Wire_T, Number_T> relation and returns true on success. The bolt relation may be constructed using the BOLT Builder. 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.

bool evaluate(Bolt<Wire_T, Number_T>* const bolt,
    wtk::InputStream<Number_T>* const instance,
    wtk::InputStream<Number_T>* const witness);