Snarky_integer.IntegerPositive integers as field elements.
These operations assert that the value of the field element does not exceed the largest element in the field -- ie. that the operations do not overflow.
Whenever possible, the bit representation is cached to avoid recomputing it.
module Interval : sig ... endtype 'f t = {| value : 'f Snarky_backendless.Cvar.t; | 
| interval : Interval.t; | 
| mutable bits : 'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t list
                 option; | 
}val constant : 
  ?length:int ->
  m:'f Snarky_backendless.Snark.m ->
  Bigint.t ->
  'f tCreate an value representing the given constant value.
The bit representation of the constant is cached, and is padded to length when given.
val shift_left : m:'f Snarky_backendless.Snark.m -> 'f t -> int -> 'f tshift_left ~m x k is equivalent to multiplying x by 2^k.
The result has a cached bit representation whenever the given x had a cached bit representation.
val of_bits : 
  m:'f Snarky_backendless.Snark.m ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t
    Bitstring_lib.Bitstring.Lsb_first.t ->
  'f tCreate a value from the given bit string.
The given bit representation is cached.
val to_bits : 
  ?length:int ->
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t
    Bitstring_lib.Bitstring.Lsb_first.tCompute the bit representation of the given integer.
If the bit representation has already been cached, it is returned and no additional constraints are added. If the representation is computed, the value is updated to include the cache.
val to_bits_exn : 
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t
    Bitstring_lib.Bitstring.Lsb_first.tReturn the cached bit representation, or raise an exception if the bit representation has not been cached.
val to_bits_opt : 
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t
    Bitstring_lib.Bitstring.Lsb_first.t
    optionReturns Some bs for bs the cached bit representation, or None if the bit representation has not been cached.
val div_mod : m:'f Snarky_backendless.Snark.m -> 'f t -> 'f t -> 'f t * 'f tdiv_mod ~m a b = (q, r) such that a = q * b + r and r < b.
The bit representations of q and r are calculated and cached.
NOTE: This uses approximately log2(a) + 2 * log2(b) constraints.
val to_field : 'f t -> 'f Snarky_backendless.Cvar.tval create : value:'f Snarky_backendless.Cvar.t -> upper_bound:Bigint.t -> 'f tval min : m:'f Snarky_backendless.Snark.m -> 'f t -> 'f t -> 'f tmin ~m x y returns a value equal the lesser of x and y.
The result does not carry a cached bit representation.
val if_ : 
  m:'f Snarky_backendless.Snark.m ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t ->
  then_:'f t ->
  else_:'f t ->
  'f tval succ : m:'f Snarky_backendless.Snark.m -> 'f t -> 'f tsucc ~m x computes the successor x+1 of x.
The result does not carry a cached bit representation.
val succ_if : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t ->
  'f tsucc_if ~m x b computes the integer x+1 if b is true, or x otherwise.
The result does not carry a cached bit representation.
val equal : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.tval lt : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.tval lte : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.tval gt : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.tval gte : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f t ->
  'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.tval add : m:'f Snarky_backendless.Snark.m -> 'f t -> 'f t -> 'f tadd ~m x y computes x + y.
The result does not carry a cached bit representation.
val mul : m:'f Snarky_backendless.Snark.m -> 'f t -> 'f t -> 'f tmul ~m x y computes x * y.
The result does not carry a cached bit representation.
val subtract_unpacking : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f t ->
  'f tsubtract_unpacking ~m x y computes x - y.
The bit representation is calculated to ensure that 0 <= x - y, and is cached in the result.
NOTE: This uses approximately log2(x) constraints.
val subtract_unpacking_or_zero : 
  m:'f Snarky_backendless.Snark.m ->
  'f t ->
  'f t ->
  [ `Underflow of 'f Snarky_backendless.Cvar.t Snarky_backendless.Boolean.t ]
  * 'f tsubtract_unpacking_or_zero ~m x y computes x - y.
`Underflow is true, x < y and the returned integer value is pinned to zero.`Underflow is false, x >= y and the returned integer value is equal to x - y.The bit representation is calculated to check for underflow.
NOTE: This uses approximately log2(x) constraints.