Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- module ZkFold.Symbolic.Compiler.ArithmeticCircuit
- compile :: forall a y f c s. (CompilesWith c s f, RestoresFrom c y, Layout y ~ Layout f, c ~ ArithmeticCircuit a (Payload s) (Layout s), Binary a) => f -> y
- compileIO :: forall a c p f s l. (c ~ ArithmeticCircuit a p l, FromJSON a, ToJSON a, ToJSONKey a, SymbolicData f, Context f ~ c, Support f ~ s, ToJSON (Layout f (Var a l)), SymbolicInput s, Context s ~ c, Layout s ~ l, Payload s ~ p, FromJSON (Rep l), ToJSON (Rep l), Binary a) => FilePath -> f -> IO ()
- compileWith :: forall a y p i q j s f c0 c1. (CompilesWith c0 s f, c0 ~ ArithmeticCircuit a p i, Representable p, Representable i, RestoresFrom c1 y, c1 ~ ArithmeticCircuit a q j, Binary a, Binary (Rep p), Binary (Rep i), Binary (Rep j), Ord (Rep i), Ord (Rep j), Binary (Rep q)) => (c0 (Layout f) -> c1 (Layout y)) -> (forall x. p x -> i x -> (Payload s x, Layout s x)) -> f -> y
Documentation
compile :: forall a y f c s. (CompilesWith c s f, RestoresFrom c y, Layout y ~ Layout f, c ~ ArithmeticCircuit a (Payload s) (Layout s), Binary a) => f -> y Source #
compile f
compiles a function f
into an optimized arithmetic circuit
packed inside a suitable SymbolicData
.
compileIO :: forall a c p f s l. (c ~ ArithmeticCircuit a p l, FromJSON a, ToJSON a, ToJSONKey a, SymbolicData f, Context f ~ c, Support f ~ s, ToJSON (Layout f (Var a l)), SymbolicInput s, Context s ~ c, Layout s ~ l, Payload s ~ p, FromJSON (Rep l), ToJSON (Rep l), Binary a) => FilePath -> f -> IO () Source #
Compiles a function f
into an arithmetic circuit. Writes the result to a file.
:: forall a y p i q j s f c0 c1. (CompilesWith c0 s f, c0 ~ ArithmeticCircuit a p i, Representable p, Representable i, RestoresFrom c1 y, c1 ~ ArithmeticCircuit a q j, Binary a, Binary (Rep p), Binary (Rep i), Binary (Rep j), Ord (Rep i), Ord (Rep j), Binary (Rep q)) | |
=> (c0 (Layout f) -> c1 (Layout y)) | Circuit transformation to apply before optimization. |
-> (forall x. p x -> i x -> (Payload s x, Layout s x)) | An algorithm to prepare support argument from the circuit input. |
-> f | Function to compile. |
-> y |
compileWith opts inputT
compiles a function f
into an optimized
arithmetic circuit packed inside a suitable SymbolicData
.