Skip to content

Getting Started

Symbolic Fundamentals

zkFold Symbolic uses the Haskell type system to distinguish arithmetizable computations from non-arithmetizable ones. Every arithmetizable function must be polymorphic in the context variable c satisfying the type constraint Symbolic c. This allows us to manipulate the function as a mathematical expression and compile it to an arithmetic circuit as well as evaluate it on concrete inputs.

A sufficient condition for a function to be arithmetizable is that all its arguments and the return value belong to the class SymbolicData c. Our Standard Library provides a collection of basic types with instances of SymbolicData c. Basic types are covered on the next page of this documentation. Oftentimes, when building on top of those basic types, developers can derive instances of SymbolicData c for their custom types. We will discuss custom type implementation on the Custom Types page.