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

ZkFold.Base.Protocol.IVC.RecursiveFunction

Synopsis

Documentation

data RecursiveI i f Source #

Public input to the recursive function

Constructors

RecursiveI (i f) f 

Instances

Instances details
(HashAlgorithm algo f, RandomOracle algo f f, RandomOracle algo (i f) f) => RandomOracle (algo :: k) (RecursiveI i f) f Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

oracle :: RecursiveI i f -> f Source #

Generic1 (RecursiveI i :: Type -> Type) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Associated Types

type Rep1 (RecursiveI i) :: k -> Type #

Methods

from1 :: forall (a :: k). RecursiveI i a -> Rep1 (RecursiveI i) a #

to1 :: forall (a :: k). Rep1 (RecursiveI i) a -> RecursiveI i a #

Representable i => Representable (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Associated Types

type Rep (RecursiveI i) #

Methods

tabulate :: (Rep (RecursiveI i) -> a) -> RecursiveI i a #

index :: RecursiveI i a -> Rep (RecursiveI i) -> a #

Foldable i => Foldable (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

fold :: Monoid m => RecursiveI i m -> m #

foldMap :: Monoid m => (a -> m) -> RecursiveI i a -> m #

foldMap' :: Monoid m => (a -> m) -> RecursiveI i a -> m #

foldr :: (a -> b -> b) -> b -> RecursiveI i a -> b #

foldr' :: (a -> b -> b) -> b -> RecursiveI i a -> b #

foldl :: (b -> a -> b) -> b -> RecursiveI i a -> b #

foldl' :: (b -> a -> b) -> b -> RecursiveI i a -> b #

foldr1 :: (a -> a -> a) -> RecursiveI i a -> a #

foldl1 :: (a -> a -> a) -> RecursiveI i a -> a #

toList :: RecursiveI i a -> [a] #

null :: RecursiveI i a -> Bool #

length :: RecursiveI i a -> Int #

elem :: Eq a => a -> RecursiveI i a -> Bool #

maximum :: Ord a => RecursiveI i a -> a #

minimum :: Ord a => RecursiveI i a -> a #

sum :: Num a => RecursiveI i a -> a #

product :: Num a => RecursiveI i a -> a #

Traversable i => Traversable (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

traverse :: Applicative f => (a -> f b) -> RecursiveI i a -> f (RecursiveI i b) #

sequenceA :: Applicative f => RecursiveI i (f a) -> f (RecursiveI i a) #

mapM :: Monad m => (a -> m b) -> RecursiveI i a -> m (RecursiveI i b) #

sequence :: Monad m => RecursiveI i (m a) -> m (RecursiveI i a) #

Functor i => Functor (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

fmap :: (a -> b) -> RecursiveI i a -> RecursiveI i b #

(<$) :: a -> RecursiveI i b -> RecursiveI i a #

Representable i => Distributive (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

distribute :: Functor f => f (RecursiveI i a) -> RecursiveI i (f a) #

collect :: Functor f => (a -> RecursiveI i b) -> f a -> RecursiveI i (f b) #

distributeM :: Monad m => m (RecursiveI i a) -> RecursiveI i (m a) #

collectM :: Monad m => (a -> RecursiveI i b) -> m a -> RecursiveI i (m b) #

Semialign i => Semialign (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

align :: RecursiveI i a -> RecursiveI i b -> RecursiveI i (These a b) #

alignWith :: (These a b -> c) -> RecursiveI i a -> RecursiveI i b -> RecursiveI i c #

Zip i => Zip (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

zip :: RecursiveI i a -> RecursiveI i b -> RecursiveI i (a, b) #

zipWith :: (a -> b -> c) -> RecursiveI i a -> RecursiveI i b -> RecursiveI i c #

Generic (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Associated Types

type Rep (RecursiveI i f) :: Type -> Type #

Methods

from :: RecursiveI i f -> Rep (RecursiveI i f) x #

to :: Rep (RecursiveI i f) x -> RecursiveI i f #

(Show f, Show (i f)) => Show (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

showsPrec :: Int -> RecursiveI i f -> ShowS #

show :: RecursiveI i f -> String #

showList :: [RecursiveI i f] -> ShowS #

(NFData f, NFData (i f)) => NFData (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

rnf :: RecursiveI i f -> () #

(SymbolicData f, SymbolicData (i f), Context f ~ Context (i f), Support f ~ Support (i f)) => SymbolicData (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Associated Types

type Context (RecursiveI i f) :: (Type -> Type) -> Type Source #

type Support (RecursiveI i f) Source #

type Layout (RecursiveI i f) :: Type -> Type Source #

type Payload (RecursiveI i f) :: Type -> Type Source #

(SymbolicInput f, SymbolicInput (i f), Context f ~ Context (i f)) => SymbolicInput (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

isValid :: RecursiveI i f -> Bool (Context (RecursiveI i f)) Source #

type Rep1 (RecursiveI i :: Type -> Type) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Rep1 (RecursiveI i :: Type -> Type) = D1 ('MetaData "RecursiveI" "ZkFold.Base.Protocol.IVC.RecursiveFunction" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "RecursiveI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 i) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
type Rep (RecursiveI i) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Rep (RecursiveI i) = GRep (RecursiveI i)
type Rep (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Rep (RecursiveI i f) = D1 ('MetaData "RecursiveI" "ZkFold.Base.Protocol.IVC.RecursiveFunction" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "RecursiveI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (i f)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 f)))
type Context (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Layout (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Layout (RecursiveI i f) = GLayout (Rep (RecursiveI i f))
type Payload (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Support (RecursiveI i f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

data RecursiveP d k i p c f Source #

Payload to the recursive function

Constructors

RecursiveP (p f) (Vector k (c f)) (AccumulatorInstance k (RecursiveI i) c f) f (Vector (d - 1) (c f)) 

Instances

Instances details
Generic1 (RecursiveP d k i p c :: Type -> Type) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Associated Types

type Rep1 (RecursiveP d k i p c) :: k -> Type #

Methods

from1 :: forall (a :: k0). RecursiveP d k i p c a -> Rep1 (RecursiveP d k i p c) a #

to1 :: forall (a :: k0). Rep1 (RecursiveP d k i p c) a -> RecursiveP d k i p c a #

(KnownNat (d - 1), KnownNat (k - 1), KnownNat k, Representable i, Representable p, Representable c) => Representable (RecursiveP d k i p c) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Associated Types

type Rep (RecursiveP d k i p c) #

Methods

tabulate :: (Rep (RecursiveP d k i p c) -> a) -> RecursiveP d k i p c a #

index :: RecursiveP d k i p c a -> Rep (RecursiveP d k i p c) -> a #

(Foldable p, Foldable i, Foldable c) => Foldable (RecursiveP d k i p c) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

fold :: Monoid m => RecursiveP d k i p c m -> m #

foldMap :: Monoid m => (a -> m) -> RecursiveP d k i p c a -> m #

foldMap' :: Monoid m => (a -> m) -> RecursiveP d k i p c a -> m #

foldr :: (a -> b -> b) -> b -> RecursiveP d k i p c a -> b #

foldr' :: (a -> b -> b) -> b -> RecursiveP d k i p c a -> b #

foldl :: (b -> a -> b) -> b -> RecursiveP d k i p c a -> b #

foldl' :: (b -> a -> b) -> b -> RecursiveP d k i p c a -> b #

foldr1 :: (a -> a -> a) -> RecursiveP d k i p c a -> a #

foldl1 :: (a -> a -> a) -> RecursiveP d k i p c a -> a #

toList :: RecursiveP d k i p c a -> [a] #

null :: RecursiveP d k i p c a -> Bool #

length :: RecursiveP d k i p c a -> Int #

elem :: Eq a => a -> RecursiveP d k i p c a -> Bool #

maximum :: Ord a => RecursiveP d k i p c a -> a #

minimum :: Ord a => RecursiveP d k i p c a -> a #

sum :: Num a => RecursiveP d k i p c a -> a #

product :: Num a => RecursiveP d k i p c a -> a #

(Traversable p, Traversable i, Traversable c) => Traversable (RecursiveP d k i p c) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

traverse :: Applicative f => (a -> f b) -> RecursiveP d k i p c a -> f (RecursiveP d k i p c b) #

sequenceA :: Applicative f => RecursiveP d k i p c (f a) -> f (RecursiveP d k i p c a) #

mapM :: Monad m => (a -> m b) -> RecursiveP d k i p c a -> m (RecursiveP d k i p c b) #

sequence :: Monad m => RecursiveP d k i p c (m a) -> m (RecursiveP d k i p c a) #

(Functor p, Functor i, Functor c) => Functor (RecursiveP d k i p c) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

fmap :: (a -> b) -> RecursiveP d k i p c a -> RecursiveP d k i p c b #

(<$) :: a -> RecursiveP d k i p c b -> RecursiveP d k i p c a #

(KnownNat (d - 1), KnownNat (k - 1), KnownNat k, Representable i, Representable p, Representable c) => Distributive (RecursiveP d k i p c) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Methods

distribute :: Functor f => f (RecursiveP d k i p c a) -> RecursiveP d k i p c (f a) #

collect :: Functor f => (a -> RecursiveP d k i p c b) -> f a -> RecursiveP d k i p c (f b) #

distributeM :: Monad m => m (RecursiveP d k i p c a) -> RecursiveP d k i p c (m a) #

collectM :: Monad m => (a -> RecursiveP d k i p c b) -> m a -> RecursiveP d k i p c (m b) #

Generic (RecursiveP d k i p c f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

Associated Types

type Rep (RecursiveP d k i p c f) :: Type -> Type #

Methods

from :: RecursiveP d k i p c f -> Rep (RecursiveP d k i p c f) x #

to :: Rep (RecursiveP d k i p c f) x -> RecursiveP d k i p c f #

type Rep1 (RecursiveP d k i p c :: Type -> Type) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Rep (RecursiveP d k i p c) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type Rep (RecursiveP d k i p c) = GRep (RecursiveP d k i p c)
type Rep (RecursiveP d k i p c f) Source # 
Instance details

Defined in ZkFold.Base.Protocol.IVC.RecursiveFunction

type RecursiveFunctionAssumptions algo d a i c f ctx = (StepFunctionAssumptions a f ctx, HashAlgorithm algo f, RandomOracle algo f f, RandomOracle algo (i f) f, RandomOracle algo (c f) f, HomomorphicCommit [f] (c f), Scale a f, Scale a (PolyVec f (d + 1)), Scale f (c f)) Source #

type RecursiveFunction algo d k a i p c = forall f ctx. RecursiveFunctionAssumptions algo d a i c f ctx => RecursiveI i f -> RecursiveP d k i p c f -> RecursiveI i f Source #

recursiveFunction :: forall algo d k a i p c. (PredicateAssumptions a i p, FunctorAssumptions c, KnownNat (d - 1), KnownNat (d + 1), KnownNat (k - 1), KnownNat k, Zip i) => StepFunction a i p -> RecursiveFunction algo d k a i p c Source #

Transform a step function into a recursive function

recursivePredicate :: forall algo d k a i p c ctx0 ctx1. (RecursivePredicateAssumptions algo d k a i p c, ctx0 ~ Interpreter a, RecursiveFunctionAssumptions algo d a i c (FieldElement ctx0) ctx0, ctx1 ~ ArithmeticCircuit a (RecursiveI i :*: RecursiveP d k i p c) U1, RecursiveFunctionAssumptions algo d a i c (FieldElement ctx1) ctx1) => RecursiveFunction algo d k a i p c -> Predicate a (RecursiveI i) (RecursiveP d k i p c) Source #