Module 1-Impl.Checked

Checked computations.

These are the values used to generate an R1CS for a computation.

('ret, 'state) t represents a computation 'state -> 'ret that can be compiled into an R1CS.

We form a monad over this type, which allows us to work inside the checked function to do further checked computations. For example (using monad let-syntax):

let multiply3 (x : Field.Var.t) (y : Field.Var.t) (z : Field.Var.t)
  : (Field.Var.t) Checked.t =
  open Checked.Let_syntax in
  let%bind x_times_y = Field.Checked.mul x y in
  Field.Checked.mul x_times_y z
type run_state = Field.t Run_state.t
include Monad_let.S
type 'a t
include Core_kernel.Monad.S_without_syntax with type 'a t := 'a t
val (>>=) : 'a t -> ( 'a -> 'b t ) -> 'b t
val (>>|) : 'a t -> ( 'a -> 'b ) -> 'b t
module Monad_infix : sig ... end
val bind : 'a t -> f:( 'a -> 'b t ) -> 'b t
val return : 'a -> 'a t
val map : 'a t -> f:( 'a -> 'b ) -> 'b t
val join : 'a t t -> 'a t
val ignore_m : 'a t -> unit t
val all : 'a t list -> 'a list t
val all_unit : unit t list -> unit t
module Let_syntax : sig ... end
module List : Monad_sequence.S with type 'a monad := 'a t and type 'a t = 'a list and type boolean := Boolean.var
module Array : Monad_sequence.S with type 'a monad := 'a t and type 'a t = 'a array and type boolean := Boolean.var
type Request.t +=
| Choose_preimage : field * int -> bool list Request.t

Choose_preimage is the request issued by Field.Checked.choose_preimage_var before falling back to its default implementation. You can respond to this request to override the default behaviour.

See Request for more information on requests.