symbolic-base-0.1.0.0: ZkFold Symbolic compiler and zero-knowledge proof protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

ZkFold.Symbolic.Compiler.ArithmeticCircuit.Optimization

Synopsis

Documentation

optimize :: forall a p i o. (Arithmetic a, Ord (Rep i), Functor o, Binary (Rep i), Binary a, Binary (Rep p)) => ArithmeticCircuit a p i o -> ArithmeticCircuit a p i o Source #

Replaces linear polynoms of the form (fromConstant k) * (NewVar nV) + (fromConstant c) with a constant variable fromConstant $ negate c // k in an arithmetic circuit and replaces variable with a constant in witness