Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ArithmeticCircuit a p i o = ArithmeticCircuit {
- acSystem :: Map ByteString (Constraint a i)
- acRange :: MonoidalMap a (Set (SysVar i))
- acWitness :: Map ByteString (WitnessF a (WitVar p i))
- acOutput :: o (Var a i)
- data Var a i
- data SysVar i
- = InVar (Rep i)
- | NewVar ByteString
- data WitVar p i
- type VarField = Zp (2 ^ (32 * 8))
- type Arithmetic a = (ResidueField Natural a, Eq a, Ord a, NFData a)
- type Constraint c i = Poly c (SysVar i) Natural
- acInput :: Representable i => i (Var a i)
- getAllVars :: forall a p i o. (Representable i, Foldable i) => ArithmeticCircuit a p i o -> [SysVar i]
- crown :: ArithmeticCircuit a p i g -> f (Var a i) -> ArithmeticCircuit a p i f
- hlmap :: (Representable i, Representable j, Ord (Rep j), Functor o) => (forall x. j x -> i x) -> ArithmeticCircuit a p i o -> ArithmeticCircuit a p j o
- hpmap :: (Representable p, Representable q) => (forall x. q x -> p x) -> ArithmeticCircuit a p i o -> ArithmeticCircuit a q i o
- witnessGenerator :: (Arithmetic a, Representable p, Representable i) => ArithmeticCircuit a p i o -> p a -> i a -> Map ByteString a
- eval :: (Arithmetic a, Representable p, Representable i, Functor o) => ArithmeticCircuit a p i o -> p a -> i a -> o a
- eval1 :: (Arithmetic a, Representable p, Representable i) => ArithmeticCircuit a p i Par1 -> p a -> i a -> a
- exec :: (Arithmetic a, Functor o) => ArithmeticCircuit a U1 U1 o -> o a
- exec1 :: Arithmetic a => ArithmeticCircuit a U1 U1 Par1 -> a
- apply :: (Eq a, Field a, Ord (Rep j), Representable i) => i a -> ArithmeticCircuit a p (i :*: j) U1 -> ArithmeticCircuit a p j U1
- indexW :: (Arithmetic a, Representable p, Representable i) => ArithmeticCircuit a p i o -> p a -> i a -> Var a i -> a
Documentation
data ArithmeticCircuit a p i o Source #
Arithmetic circuit in the form of a system of polynomial constraints.
ArithmeticCircuit | |
|
Instances
Instances
InVar (Rep i) | |
NewVar ByteString |
Instances
Instances
(Arithmetic a, Binary a, Binary (Rep p), Binary (Rep i), Ord (Rep i), o ~ (U1 :: Type -> Type)) => MonadCircuit (Var a i) a (WitnessF a (WitVar p i)) (State (ArithmeticCircuit a p i o)) Source # | |
Defined in ZkFold.Symbolic.Compiler.ArithmeticCircuit.Internal unconstrained :: WitnessF a (WitVar p i) -> State (ArithmeticCircuit a p i o) (Var a i) Source # constraint :: ClosedPoly (Var a i) a -> State (ArithmeticCircuit a p i o) () Source # rangeConstraint :: Var a i -> a -> State (ArithmeticCircuit a p i o) () Source # newAssigned :: ClosedPoly (Var a i) a -> State (ArithmeticCircuit a p i o) (Var a i) Source # | |
Finite a => Witness (Var a i) (WitnessF a (WitVar p i)) Source # | |
type Arithmetic a = (ResidueField Natural a, Eq a, Ord a, NFData a) Source #
Field of residues with decidable equality and ordering
is called an `arithmetic'
field.
type Constraint c i = Poly c (SysVar i) Natural Source #
The type that represents a constraint in the arithmetic circuit.
acInput :: Representable i => i (Var a i) Source #
getAllVars :: forall a p i o. (Representable i, Foldable i) => ArithmeticCircuit a p i o -> [SysVar i] Source #
crown :: ArithmeticCircuit a p i g -> f (Var a i) -> ArithmeticCircuit a p i f Source #
hlmap :: (Representable i, Representable j, Ord (Rep j), Functor o) => (forall x. j x -> i x) -> ArithmeticCircuit a p i o -> ArithmeticCircuit a p j o Source #
hpmap :: (Representable p, Representable q) => (forall x. q x -> p x) -> ArithmeticCircuit a p i o -> ArithmeticCircuit a q i o Source #
witnessGenerator :: (Arithmetic a, Representable p, Representable i) => ArithmeticCircuit a p i o -> p a -> i a -> Map ByteString a Source #
eval :: (Arithmetic a, Representable p, Representable i, Functor o) => ArithmeticCircuit a p i o -> p a -> i a -> o a Source #
Evaluates the arithmetic circuit using the supplied input map.
eval1 :: (Arithmetic a, Representable p, Representable i) => ArithmeticCircuit a p i Par1 -> p a -> i a -> a Source #
Evaluates the arithmetic circuit with one output using the supplied input map.
exec :: (Arithmetic a, Functor o) => ArithmeticCircuit a U1 U1 o -> o a Source #
Evaluates the arithmetic circuit with no inputs.
exec1 :: Arithmetic a => ArithmeticCircuit a U1 U1 Par1 -> a Source #
Evaluates the arithmetic circuit with no inputs and one output.
apply :: (Eq a, Field a, Ord (Rep j), Representable i) => i a -> ArithmeticCircuit a p (i :*: j) U1 -> ArithmeticCircuit a p j U1 Source #
Applies the values of the first couple of inputs to the arithmetic circuit.
indexW :: (Arithmetic a, Representable p, Representable i) => ArithmeticCircuit a p i o -> p a -> i a -> Var a i -> a Source #