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

ZkFold.Symbolic.Fold

Documentation

class Symbolic c => SymbolicFold c where Source #

Methods

sfoldl Source #

Arguments

:: (Binary (Rep f), NFData (Rep f), Ord (Rep f)) 
=> (forall a. Binary a => Binary (f a)) 
=> (Representable f, NFData1 f, Traversable f) 
=> (Binary (Rep p), Representable p) 
=> (Binary (Rep g), NFData (Rep g), Ord (Rep g), Representable g) 
=> (forall a. Binary a => Binary (h a)) 
=> WitnessField c ~ wc 
=> (forall s. (SymbolicFold s, BaseField s ~ BaseField c) => s f -> p (WitnessField s) -> s g -> (s f, p (WitnessField s)))

A folding step. See arguments' documentation above.

-> c f

Initial state layout.

-> p wc

Initial state payload.

-> c h

An identifier of a data stream (most likely a hash).

-> Infinite (g wc)

data stream itself.

-> c Par1

A number of folding steps to perform.

-> (c f, p wc)

Final state layout and payload after folding.

A function to perform folding in a generic context.

To do this, you need quite a few arguments, see documentation. Or, even better, use more high-level Symbolic List API.

Instances

Instances details
Arithmetic a => SymbolicFold (Interpreter a) Source # 
Instance details

Defined in ZkFold.Symbolic.Interpreter

Methods

sfoldl :: forall (f :: Type -> Type) p g (h :: Type -> Type) wc. (Binary (Rep f), NFData (Rep f), Ord (Rep f), forall a0. Binary a0 => Binary (f a0), Representable f, NFData1 f, Traversable f, Binary (Rep p), Representable p, Binary (Rep g), NFData (Rep g), Ord (Rep g), Representable g, forall a1. Binary a1 => Binary (h a1), WitnessField (Interpreter a) ~ wc) => (forall (s :: (Type -> Type) -> Type). (SymbolicFold s, BaseField s ~ BaseField (Interpreter a)) => s f -> p (WitnessField s) -> s g -> (s f, p (WitnessField s))) -> Interpreter a f -> p wc -> Interpreter a h -> Infinite (g wc) -> Interpreter a Par1 -> (Interpreter a f, p wc) Source #

(Arithmetic a, Binary a, Binary (Rep p), Binary (Rep i), Ord (Rep i), NFData (Rep i)) => SymbolicFold (ArithmeticCircuit a p i) Source # 
Instance details

Defined in ZkFold.Symbolic.Compiler.ArithmeticCircuit.Internal

Methods

sfoldl :: forall (f :: Type -> Type) p0 g (h :: Type -> Type) wc. (Binary (Rep f), NFData (Rep f), Ord (Rep f), forall a0. Binary a0 => Binary (f a0), Representable f, NFData1 f, Traversable f, Binary (Rep p0), Representable p0, Binary (Rep g), NFData (Rep g), Ord (Rep g), Representable g, forall a1. Binary a1 => Binary (h a1), WitnessField (ArithmeticCircuit a p i) ~ wc) => (forall (s :: (Type -> Type) -> Type). (SymbolicFold s, BaseField s ~ BaseField (ArithmeticCircuit a p i)) => s f -> p0 (WitnessField s) -> s g -> (s f, p0 (WitnessField s))) -> ArithmeticCircuit a p i f -> p0 wc -> ArithmeticCircuit a p i h -> Infinite (g wc) -> ArithmeticCircuit a p i Par1 -> (ArithmeticCircuit a p i f, p0 wc) Source #