Documentation ¶
Overview ¶
This file contains the public API for running the extractor.
Index ¶
- func CircuitToLean(circuit frontend.Circuit, field ecc.ID) (string, error)
- func CircuitToLeanWithName(circuit frontend.Circuit, field ecc.ID, namespace string) (out string, err error)
- func ExtractCircuits(namespace string, field ecc.ID, circuits ...frontend.Circuit) (out string, err error)
- func ExtractGadgets(namespace string, field ecc.ID, gadgets ...abstractor.GadgetDefinition) (out string, err error)
- func GadgetToLean(gadget abstractor.GadgetDefinition, field ecc.ID) (string, error)
- func GadgetToLeanWithName(gadget abstractor.GadgetDefinition, field ecc.ID, namespace string) (out string, err error)
- type App
- type Code
- type CodeExtractor
- func (ce *CodeExtractor) Add(i1, i2 frontend.Variable, in ...frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) AddApp(op Op, args ...frontend.Variable) Operand
- func (ce *CodeExtractor) And(a, b frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) AssertIsBoolean(i1 frontend.Variable)
- func (ce *CodeExtractor) AssertIsDifferent(i1, i2 frontend.Variable)
- func (ce *CodeExtractor) AssertIsEqual(i1, i2 frontend.Variable)
- func (ce *CodeExtractor) AssertIsLessOrEqual(v frontend.Variable, bound frontend.Variable)
- func (ce *CodeExtractor) Call(gadget abstractor.GadgetDefinition) interface{}
- func (ce *CodeExtractor) Cmp(i1, i2 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) Commit(...frontend.Variable) (frontend.Variable, error)
- func (ce *CodeExtractor) Compiler() frontend.Compiler
- func (ce *CodeExtractor) ConstantValue(v frontend.Variable) (*big.Int, bool)
- func (ce *CodeExtractor) DefineGadget(gadget abstractor.GadgetDefinition) abstractor.Gadget
- func (ce *CodeExtractor) Div(i1, i2 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) DivUnchecked(i1, i2 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) Field() *big.Int
- func (ce *CodeExtractor) FieldBitLen() int
- func (ce *CodeExtractor) FromBinary(b ...frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) Inverse(i1 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) IsBoolean(v frontend.Variable) bool
- func (ce *CodeExtractor) IsZero(i1 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) Lookup2(b0, b1 frontend.Variable, i0, i1, i2, i3 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) MarkBoolean(v frontend.Variable)
- func (ce *CodeExtractor) Mul(i1, i2 frontend.Variable, in ...frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) MulAcc(a, b, c frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) Neg(i1 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) NewHint(f hint.Function, nbOutputs int, inputs ...frontend.Variable) ([]frontend.Variable, error)
- func (ce *CodeExtractor) Or(a, b frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) Println(a ...frontend.Variable)
- func (ce *CodeExtractor) Select(b frontend.Variable, i1, i2 frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) Sub(i1, i2 frontend.Variable, in ...frontend.Variable) frontend.Variable
- func (ce *CodeExtractor) ToBinary(i1 frontend.Variable, n ...int) []frontend.Variable
- func (ce *CodeExtractor) Xor(a, b frontend.Variable) frontend.Variable
- type Const
- type ExArg
- type ExArgType
- type ExCircuit
- type ExGadget
- type Gate
- type Input
- type Integer
- type Op
- type OpKind
- type Operand
- type Proj
- type ProjArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CircuitToLean ¶
CircuitToLean exports a `circuit` to Lean over a `field` with the namespace being the struct name of `circuit` When the namespace argument is not defined, it uses the name of the struct circuit
func CircuitToLeanWithName ¶
func CircuitToLeanWithName(circuit frontend.Circuit, field ecc.ID, namespace string) (out string, err error)
CircuitToLeanWithName exports a `circuit` to Lean over a `field` with `namespace` CircuitToLeanWithName and CircuitToLean aren't joined in a single function CircuitToLean(circuit abstractor.Circuit, field ecc.ID, namespace ...string) because the long term view is to add an optional parameter to support custom `set_option` directives in the header.
func ExtractCircuits ¶
func ExtractCircuits(namespace string, field ecc.ID, circuits ...frontend.Circuit) (out string, err error)
ExtractCircuits is used to export a series of `circuits` to Lean over a `field` under `namespace`.
func ExtractGadgets ¶
func ExtractGadgets(namespace string, field ecc.ID, gadgets ...abstractor.GadgetDefinition) (out string, err error)
ExtractGadgets is used to export a series of `gadgets` to Lean over a `field` under `namespace`.
func GadgetToLean ¶
func GadgetToLean(gadget abstractor.GadgetDefinition, field ecc.ID) (string, error)
GadgetToLean exports a `gadget` to Lean over a `field`
func GadgetToLeanWithName ¶
func GadgetToLeanWithName(gadget abstractor.GadgetDefinition, field ecc.ID, namespace string) (out string, err error)
GadgetToLeanWithName exports a `gadget` to Lean over a `field` with `namespace` Same notes written for CircuitToLeanWithName apply to GadgetToLeanWithName and GadgetToLean
Types ¶
type CodeExtractor ¶
func (*CodeExtractor) AddApp ¶
func (ce *CodeExtractor) AddApp(op Op, args ...frontend.Variable) Operand
func (*CodeExtractor) AssertIsBoolean ¶
func (ce *CodeExtractor) AssertIsBoolean(i1 frontend.Variable)
func (*CodeExtractor) AssertIsDifferent ¶
func (ce *CodeExtractor) AssertIsDifferent(i1, i2 frontend.Variable)
func (*CodeExtractor) AssertIsEqual ¶
func (ce *CodeExtractor) AssertIsEqual(i1, i2 frontend.Variable)
func (*CodeExtractor) AssertIsLessOrEqual ¶
func (ce *CodeExtractor) AssertIsLessOrEqual(v frontend.Variable, bound frontend.Variable)
func (*CodeExtractor) Call ¶
func (ce *CodeExtractor) Call(gadget abstractor.GadgetDefinition) interface{}
func (*CodeExtractor) Cmp ¶
func (ce *CodeExtractor) Cmp(i1, i2 frontend.Variable) frontend.Variable
func (*CodeExtractor) Compiler ¶
func (ce *CodeExtractor) Compiler() frontend.Compiler
func (*CodeExtractor) ConstantValue ¶
func (*CodeExtractor) DefineGadget ¶
func (ce *CodeExtractor) DefineGadget(gadget abstractor.GadgetDefinition) abstractor.Gadget
func (*CodeExtractor) Div ¶
func (ce *CodeExtractor) Div(i1, i2 frontend.Variable) frontend.Variable
func (*CodeExtractor) DivUnchecked ¶
func (ce *CodeExtractor) DivUnchecked(i1, i2 frontend.Variable) frontend.Variable
func (*CodeExtractor) Field ¶
func (ce *CodeExtractor) Field() *big.Int
func (*CodeExtractor) FieldBitLen ¶
func (ce *CodeExtractor) FieldBitLen() int
func (*CodeExtractor) FromBinary ¶
func (ce *CodeExtractor) FromBinary(b ...frontend.Variable) frontend.Variable
func (*CodeExtractor) Inverse ¶
func (ce *CodeExtractor) Inverse(i1 frontend.Variable) frontend.Variable
func (*CodeExtractor) IsZero ¶
func (ce *CodeExtractor) IsZero(i1 frontend.Variable) frontend.Variable
func (*CodeExtractor) MarkBoolean ¶
func (ce *CodeExtractor) MarkBoolean(v frontend.Variable)
func (*CodeExtractor) MulAcc ¶
func (ce *CodeExtractor) MulAcc(a, b, c frontend.Variable) frontend.Variable
func (*CodeExtractor) Println ¶
func (ce *CodeExtractor) Println(a ...frontend.Variable)
type ExGadget ¶
type ExGadget struct { Name string Arity int Code []App OutputsFlat []Operand Outputs interface{} Extractor *CodeExtractor Fields []schema.Field Args []ExArg }
func (*ExGadget) Call ¶
func (g *ExGadget) Call(gadget abstractor.GadgetDefinition) interface{}
type Input ¶
type Input struct {
Index int
}
Input is used to save the position of the argument in the list of arguments of the circuit function.
type Integer ¶
Integer struct is used to distinguish between a constant in place of a frontend.Variable and an integer where an integer is the only type allowed. Integer sruct is currently only used for the length of the result in ToBinary function.