package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-libs.plompiler/Plompiler/Solver/index.html
Module Plompiler.Solver
Source
This module defines a description format and interpretation of the programs needed to populate the PlonK witness for a Plompiler circuit given the initial inputs.
Index of a wire
Index of a row
Input/output tag for generic lookups.
Descriptors for core gates.
type arith_desc = {
wires : row array;
linear : Csir.Scalar.t array;
qm : Csir.Scalar.t;
qc : Csir.Scalar.t;
qx5a : Csir.Scalar.t;
qx2b : Csir.Scalar.t;
to_solve : wire;
}
type ed_desc = {
a : Csir.Scalar.t;
d : Csir.Scalar.t;
x1 : int;
y1 : int;
x2 : int;
y2 : int;
x3 : int;
y3 : int;
}
type ed_cond_desc = {
a : Csir.Scalar.t;
d : Csir.Scalar.t;
x1 : int;
y1 : int;
x2 : int;
y2 : int;
bit : int;
x3 : int;
y3 : int;
}
type pos128full_desc = {
x0 : int;
y0 : int;
x1 : int;
y1 : int;
x2 : int;
y2 : int;
k : Csir.Scalar.t array;
matrix : Linear_algebra.Make_VectorSpace(Csir.Scalar).matrix;
}
type pos128partial_desc = {
a : int;
b : int;
c : int;
a_5 : int;
b_5 : int;
c_5 : int;
x0 : int;
y0 : int;
x1 : int;
y1 : int;
x2 : int;
y2 : int;
k_cols : Linear_algebra.Make_VectorSpace(Csir.Scalar).matrix array;
matrix : Linear_algebra.Make_VectorSpace(Csir.Scalar).matrix;
}
type anemoi_desc = {
x0 : int;
y0 : int;
w : int;
v : int;
x1 : int;
y1 : int;
kx : Csir.Scalar.t;
ky : Csir.Scalar.t;
}
type anemoi_double_desc = {
x0 : int;
y0 : int;
w0 : int;
w1 : int;
y1 : int;
x2 : int;
y2 : int;
kx1 : Csir.Scalar.t;
ky1 : Csir.Scalar.t;
kx2 : Csir.Scalar.t;
ky2 : Csir.Scalar.t;
}
type anemoi_custom_desc = {
x0 : int;
y0 : int;
x1 : int;
y1 : int;
x2 : int;
y2 : int;
kx1 : Csir.Scalar.t;
ky1 : Csir.Scalar.t;
kx2 : Csir.Scalar.t;
ky2 : Csir.Scalar.t;
}
type mod_arith_desc = {
modulus : Z.t;
base : Z.t;
nb_limbs : int;
moduli : Z.t list;
qm_bound : Z.t * Z.t;
ts_bounds : (Z.t * Z.t) list;
inverse : bool;
inp1 : int list;
inp2 : int list;
out : int list;
qm : int;
ts : int list;
}
See lib_plompiler/gadget_mod_arith.ml
for documentation on mod_arith
See lib_plompiler/gadget_mod_arith.ml
for documentation on mod_arith
type solver_desc =
| Arith of arith_desc
| Pow5 of pow5_desc
| IsZero of wires_desc
| IsNotZero of wires_desc
| Lookup of lookup_desc
| Ecc_Ws of ws_desc
| Ecc_Ed of ed_desc
| Ecc_Cond_Ed of ed_cond_desc
| Swap of swap_desc
| Skip
| BitsOfS of bits_desc
| LimbsOfS of limbs_desc
| Poseidon128Full of pos128full_desc
| Poseidon128Partial of pos128partial_desc
| AnemoiRound of anemoi_desc
| AnemoiDoubleRound of anemoi_double_desc
| AnemoiCustom of anemoi_custom_desc
| Mod_Add of mod_arith_desc
| Mod_Mul of mod_arith_desc
| Mod_IsZero of mod_arith_is_zero_desc
| Updater of Optimizer.trace_info
Solver description language. Each core gate has a descriptor holding the data needed to compute the part of the trace it determines.
Collection of solver descriptors for a circuit.
A solver is formed by solver descriptors together with meta-data about the size of the initial inputs and final size of the witness.
append_solver sd s
sdds a solver descriptor sd
to a solver s
.
solve s inital
computes the witness using solver s
and the initial
inputs.