Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- 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
- varsToReplace :: (Arithmetic a, Ord (Rep i)) => (Map ByteString (Constraint a i), Map (SysVar i) a) -> (Map ByteString (Constraint a i), Map (SysVar i) a)
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
varsToReplace :: (Arithmetic a, Ord (Rep i)) => (Map ByteString (Constraint a i), Map (SysVar i) a) -> (Map ByteString (Constraint a i), Map (SysVar i) a) Source #