o1-labs / snarky

OCaml DSL for verifiable computation
MIT License
496 stars 74 forks source link

Make Checked.t abstract #652

Closed mrmr1993 closed 2 years ago

mrmr1993 commented 2 years ago

This PR makes the Checked.t type abstract in Snark_intf.

This will allow us to swap out the implementation of Checked.t for some other one (e.g. snarky.rs) without any changes on the Mina side.

This PR also updates ppx_snarky, adding the ability to expose paths on the %snarkydef and %with_label annotations, to direct them at the appropriate module if required.

Note that this leaves the type of check in the Typ.t as Checked_ast.t, because it was surprisingly annoying to make it work on the Mina side. Instead, this PR introduces make_checked_ast and run_checked_ast functions, which allow converting between the types and the AST type.