-
Notifications
You must be signed in to change notification settings - Fork 1
Description
We should have light weight syntax for defining circuits along with privacy and type information.
Currently we do everything in defcircuit but most functions are not the entry point and thus the publicity of the arguments go ignored.
Further it would be nice to declare types in a separate call if need be. Thus I propose a few abstractions
sig
I believe we should have a sig macro that updates the type signature of the circuit. This should not be redefined by the circuit unless it has explicit type signatures on the form.
Sig should look like
(sig constrain (-> nested bool))where -> is the function syntax.
defgate
Defgate allows us to not include the privacy information when declaring a circuit. Like defcircuit, types are needed but they can be deferred to a sig call.
(sig constrain (-> nested bool))
(defgate constrain (nest)
(def ((plane (plane nest))
(time (time nest)))
(= (* (x plane)
(y plane))
(* (x time)
(y time)))))
(defgate constrain ((nest nested) &out bool)
(def ((plane (plane nest))
(time (time nest)))
(= (* (x plane)
(y plane))
(* (x time)
(y time)))))public
We should be able to declare parameters public, making them private by default for defgate, if we wish for a defgate to be the real entry point to the circuit.
(public constrain nest)