From f21ce88c12daea64e098d7c6dbadac3cc29ce1c9 Mon Sep 17 00:00:00 2001 From: ember arlynx Date: Sat, 23 Mar 2024 09:24:13 -0400 Subject: [PATCH] Constraint_system_intf.{num_constraints,to_asm} --- src/base/backend_intf.ml | 4 ++++ src/base/snark0.ml | 6 +++--- src/base/snark_intf.ml | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/base/backend_intf.ml b/src/base/backend_intf.ml index bd80cb798b..55eab5e8d9 100644 --- a/src/base/backend_intf.ml +++ b/src/base/backend_intf.ml @@ -23,6 +23,10 @@ module type Constraint_system_intf = sig val get_public_input_size : t -> int Core_kernel.Set_once.t val get_rows_len : t -> int + + val num_constraints : t -> int + + val to_asm : t -> string end module type S = sig diff --git a/src/base/snark0.ml b/src/base/snark0.ml index 11ffde363d..7da2996a4f 100644 --- a/src/base/snark0.ml +++ b/src/base/snark0.ml @@ -645,7 +645,7 @@ struct end end -(** The main functor for the monadic interface. +(** The main functor for the monadic interface. See [Run.Make] for the same thing but for the imperative interface. *) module Make (Backend : Backend_intf.S) = struct module Backend_extended = Backend_extended.Make (Backend) @@ -1263,8 +1263,8 @@ module Run = struct let inject_wrapper ~f x = f x in inject_wrapper ~f (x a) - (** Caches the global [state] before running [f]. - It is expected that [f] will reset the global state for its own use only, + (** Caches the global [state] before running [f]. + It is expected that [f] will reset the global state for its own use only, hence why we need to reset it after running [f].*) let finalize_is_running f = let cached_state = !state in diff --git a/src/base/snark_intf.ml b/src/base/snark_intf.ml index 465daf2089..0f53bd3864 100644 --- a/src/base/snark_intf.ml +++ b/src/base/snark_intf.ml @@ -1117,6 +1117,10 @@ module type Run_basic = sig val get_public_input_size : t -> int Core_kernel.Set_once.t val get_rows_len : t -> int + + val num_constraints : t -> int + + val to_asm : t -> string end (** The finite field over which the R1CS operates. *)