Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Arithmetic a = (FiniteField a, Eq a, BinaryExpansion a)
- class Arithmetic a => Arithmetizable a x where
- arithmetize :: x -> [ArithmeticCircuit a] -> [ArithmeticCircuit a]
- inputSize :: Natural
- outputSize :: Natural
- data SomeArithmetizable a where
- SomeArithmetizable :: (Typeable t, Arithmetizable a t) => t -> SomeArithmetizable a
- data SomeData a where
- SomeData :: (Typeable t, SymbolicData a t) => t -> SomeData a
- class Arithmetic a => SymbolicData a x where
- pieces :: x -> [ArithmeticCircuit a]
- restore :: [ArithmeticCircuit a] -> x
- typeSize :: Natural
Documentation
type Arithmetic a = (FiniteField a, Eq a, BinaryExpansion a) Source #
class Arithmetic a => Arithmetizable a x where Source #
A class for arithmetizable types, that is, a class of types whose
computations can be represented by arithmetic circuits.
Type a
is the finite field of the arithmetic circuit.
Type x
represents the arithmetizable type.
arithmetize :: x -> [ArithmeticCircuit a] -> [ArithmeticCircuit a] Source #
Given a list of circuits computing inputs, return a list of circuits
computing the result of x
.
The number of finite field elements needed to describe an input of x
.
outputSize :: Natural Source #
The number of finite field elements needed to describe the result of x
.
Instances
SymbolicData a x => Arithmetizable a x Source # | |
Defined in ZkFold.Symbolic.Compiler.Arithmetizable arithmetize :: x -> [ArithmeticCircuit a] -> [ArithmeticCircuit a] Source # outputSize :: Natural Source # | |
(SymbolicData a x, Arithmetizable a f) => Arithmetizable a (x -> f) Source # | |
Defined in ZkFold.Symbolic.Compiler.Arithmetizable arithmetize :: (x -> f) -> [ArithmeticCircuit a] -> [ArithmeticCircuit a] Source # outputSize :: Natural Source # | |
(Typeable name, Eq name, Eq BuiltinFunctions, Typeable a, Arithmetic a) => Arithmetizable a (Term name BuiltinFunctions a) Source # | |
Defined in ZkFold.Symbolic.Cardano.UPLC arithmetize :: Term name BuiltinFunctions a -> [ArithmeticCircuit a] -> [ArithmeticCircuit a] Source # outputSize :: Natural Source # |
data SomeArithmetizable a where Source #
SomeArithmetizable :: (Typeable t, Arithmetizable a t) => t -> SomeArithmetizable a |
class Arithmetic a => SymbolicData a x where Source #
A class for Symbolic data types.
Type a
is the finite field of the arithmetic circuit.
Type x
represents the data type.
pieces :: x -> [ArithmeticCircuit a] Source #
Returns the circuits that make up x
.
restore :: [ArithmeticCircuit a] -> x Source #
Restores x
from the circuits' outputs.
Returns the number of finite field elements needed to describe x
.