Module type Snark_intf.Boolean_intf

type field_var
type _ checked
type (_, _) typ
type var

The type that stores booleans as R1CS variables.

type value = bool
val true_ : var

An R1CS variable containing Field.one, representing true.

val false_ : var

An R1CS variable containing Field.zero, representing false.

val if_ : var -> then_:var -> else_:var -> var checked

if_ b ~then_ ~else_ returns then_ if b is true, or else_ otherwise.

val not : var -> var

Negate a boolean value

val (&&) : var -> var -> var checked

Boolean and

val (&&&) : var -> var -> var checked

Boolean and, non-aliasing to bool operator.

val (||) : var -> var -> var checked

Boolean or

val (|||) : var -> var -> var checked

Boolean or, non-aliasing to bool operator.

val (lxor) : var -> var -> var checked

Boolean xor (exclusive-or)

val any : var list -> var checked

Returns true if any value in the list is true, false otherwise.

val all : var list -> var checked

Returns true if all value in the list are true, false otherwise.

val of_field : field_var -> var checked

Convert a value in a field to a boolean, adding checks to the R1CS that it is a valid boolean value.

val var_of_value : value -> var

Convert an OCaml bool into a R1CS variable representing the same value.

val typ : ( var, value ) typ

The relationship between var and value, with a check that the value is valid (ie. Field.zero or Field.one).

val typ_unchecked : ( var, value ) typ

typ without a validity check for the underlying field value.

val equal : var -> var -> var checked
module Expr : sig ... end

Build trees representing boolean expressions.

module Unsafe : sig ... end
module Assert : sig ... end
module Array : sig ... end