accessors

package
v0.0.0-...-06294fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConstant

func NewConstant(f field.Element) ifaces.Accessor

NewConstant returns an ifaces.Accessor object representing a constant value.

func NewExponent

func NewExponent(a symbolic.Metadata, n int) ifaces.Accessor

NewExponent constructs an accessor for the exponentiation of a another ifaces.Accessor by another constant `n`.

func NewFromCoin

func NewFromCoin(info coin.Info) ifaces.Accessor

NewFromCoin returns an ifaces.Accessor object symbolizing a coin.Info. The supplied coin.Info must be of type coin.Field or the function panics.

func NewFromExpression

func NewFromExpression(expr *symbolic.Expression, exprName string) ifaces.Accessor

NewFromExpression returns an ifaces.Accessor symbolizing the evaluation of a symbolic expression. The provided expression must be evaluable from verifier inputs only meaning in may contain only (accessors or coins) otherwise, calling ifaces.Accessor.GetVal may panic.

This can be used if we want to use, not the

func NewFromIntegerVecCoinPosition

func NewFromIntegerVecCoinPosition(info coin.Info, pos int) ifaces.Accessor

NewFromIntegerVecCoinPosition constructs an ifaces.Accessor object refering to a specific position of a coin of the coin.IntegerVec. It is used to build generic verifier columns.

func NewFromPublicColumn

func NewFromPublicColumn(col ifaces.Column, pos int) ifaces.Accessor

NewFromPublicColumn constructs an ifaces.Accessor refering to the row #pos of the column `col`. The provided column must be public and the position must exist. Note that if the compiler later decide to make the column internal to the prover, the accessor will become invalid and this will panic at verifier time with a "column does not exist" error.

The function accepts only Natural columns and panics if they are not of this type.

func NewLocalOpeningAccessor

func NewLocalOpeningAccessor(q query.LocalOpening, qRound int) ifaces.Accessor

NewLocalOpeningAccessor creates an ifaces.Accessor returning the opening point of a query.LocalOpening.

func NewUnivariateX

func NewUnivariateX(q query.UnivariateEval, qround int) ifaces.Accessor

NewUnivariateX returns an ifaces.Accessor object symbolizing the evaluation point (the "X" value) of a query.UnivariateEval. `qRound` is must be the underlying declaration round of the query object.

Types

type FromCoinAccessor

type FromCoinAccessor struct {
	// Info represents the underlying [coin.Info] being wrapped by the accessor.
	Info coin.Info
}

FromCoinAccessor implements ifaces.Accessor and represents the value of a coin.Info of type coin.Field. It is sometime used to supply a coin to a function requiring an accessor explcitly. For github.com/consensys/linea-monorepo/prover/symbolic.Expression this should not be necessary as coin.Info already implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata.

func (*FromCoinAccessor) AsVariable

func (c *FromCoinAccessor) AsVariable() *symbolic.Expression

AsVariable implements the ifaces.Accessor interface

func (*FromCoinAccessor) GetFrontendVariable

func (c *FromCoinAccessor) GetFrontendVariable(_ frontend.API, circ ifaces.GnarkRuntime) frontend.Variable

GetFrontendVariable implements ifaces.Accessor

func (*FromCoinAccessor) GetVal

func (c *FromCoinAccessor) GetVal(run ifaces.Runtime) field.Element

GetVal implements ifaces.Accessor

func (*FromCoinAccessor) Name

func (c *FromCoinAccessor) Name() string

Name implements ifaces.Accessor

func (*FromCoinAccessor) Round

func (c *FromCoinAccessor) Round() int

Round implements the ifaces.Accessor interface

func (*FromCoinAccessor) String

func (c *FromCoinAccessor) String() string

String implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata

type FromConstAccessor

type FromConstAccessor struct {
	// F is the constant served by the accessor
	F field.Element
}

FromConstAccessor implements ifaces.Accessor. It symbolizes a constant value and be used as input to functions that expects an ifaces.Accessor but where the caller is only interested in passing a constant value.

func (*FromConstAccessor) AsVariable

func (c *FromConstAccessor) AsVariable() *symbolic.Expression

AsVariable implements the ifaces.Accessor interface

func (*FromConstAccessor) GetFrontendVariable

func (c *FromConstAccessor) GetFrontendVariable(_ frontend.API, circ ifaces.GnarkRuntime) frontend.Variable

GetFrontendVariable implements ifaces.Accessor

func (*FromConstAccessor) GetVal

func (c *FromConstAccessor) GetVal(run ifaces.Runtime) field.Element

GetVal implements ifaces.Accessor

func (*FromConstAccessor) Name

func (c *FromConstAccessor) Name() string

Name implements ifaces.Accessor

func (*FromConstAccessor) Round

func (c *FromConstAccessor) Round() int

Round implements the ifaces.Accessor interface

func (*FromConstAccessor) String

func (c *FromConstAccessor) String() string

String implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata

type FromExprAccessor

type FromExprAccessor struct {
	// The expression represented by the accessor
	Expr *symbolic.Expression
	// The boarded expression
	Boarded symbolic.ExpressionBoard
	// An identifier to denote the expression. This will be used to evaluate
	// [ifaces.Accessor.String]
	ExprName string
	// The definition round of the expression
	ExprRound int
}

FromExprAccessor symbolizes a value derived from others values via a symbolic.Expression and implements ifaces.Accessor.

func (*FromExprAccessor) AsVariable

func (e *FromExprAccessor) AsVariable() *symbolic.Expression

AsVariable implements the ifaces.Accessor interface

func (*FromExprAccessor) GetFrontendVariable

func (e *FromExprAccessor) GetFrontendVariable(api frontend.API, circ ifaces.GnarkRuntime) frontend.Variable

GetFrontendVariable implements ifaces.Accessor

func (*FromExprAccessor) GetVal

func (e *FromExprAccessor) GetVal(run ifaces.Runtime) field.Element

GetVal implements ifaces.Accessor

func (*FromExprAccessor) Name

func (e *FromExprAccessor) Name() string

Name implements ifaces.Accessor

func (*FromExprAccessor) Round

func (e *FromExprAccessor) Round() int

Round implements the ifaces.Accessor interface

func (*FromExprAccessor) String

func (e *FromExprAccessor) String() string

String implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata

type FromIntVecCoinPositionAccessor

type FromIntVecCoinPositionAccessor struct {
	// Info points to the underlying coin on which the accessor points to.
	Info coin.Info
	// Pos indexes the pointed position in the coin.
	Pos int
}

FromIntVecCoinPositionAccessor refers to a position of a random coin of type coin.IntegerVec.

func (*FromIntVecCoinPositionAccessor) AsVariable

AsVariable implements the ifaces.Accessor interface

func (*FromIntVecCoinPositionAccessor) GetFrontendVariable

GetFrontendVariable implements ifaces.Accessor

func (*FromIntVecCoinPositionAccessor) GetVal

GetVal implements ifaces.Accessor

func (*FromIntVecCoinPositionAccessor) Name

Name implements ifaces.Accessor

func (*FromIntVecCoinPositionAccessor) Round

Round implements the ifaces.Accessor interface

func (*FromIntVecCoinPositionAccessor) String

String implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata

type FromLocalOpeningYAccessor

type FromLocalOpeningYAccessor struct {
	// Q is the underlying query whose parameters are accessed by the current
	// [ifaces.Accessor].
	Q query.LocalOpening
	// QRound is the declaration round of the query
	QRound int
}

FromLocalOpeningYAccessor implements ifaces.Accessor and accesses the result of a query.LocalOpening.

func (*FromLocalOpeningYAccessor) AsVariable

AsVariable implements the ifaces.Accessor interface

func (*FromLocalOpeningYAccessor) GetFrontendVariable

func (l *FromLocalOpeningYAccessor) GetFrontendVariable(_ frontend.API, circ ifaces.GnarkRuntime) frontend.Variable

GetFrontendVariable implements ifaces.Accessor

func (*FromLocalOpeningYAccessor) GetVal

GetVal implements ifaces.Accessor

func (*FromLocalOpeningYAccessor) Name

Name implements ifaces.Accessor

func (*FromLocalOpeningYAccessor) Round

func (l *FromLocalOpeningYAccessor) Round() int

Round implements the ifaces.Accessor interface

func (*FromLocalOpeningYAccessor) String

func (l *FromLocalOpeningYAccessor) String() string

String implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata

type FromPublicColumn

type FromPublicColumn struct {
	// Info points to the underlying coin on which the accessor points to.
	Col column.Natural
	// Pos indexes the pointed position in the coin.
	Pos int
}

FromPublicColumn refers to a position of a public column

func (*FromPublicColumn) AsVariable

func (c *FromPublicColumn) AsVariable() *symbolic.Expression

AsVariable implements the ifaces.Accessor interface

func (*FromPublicColumn) GetFrontendVariable

func (c *FromPublicColumn) GetFrontendVariable(_ frontend.API, circ ifaces.GnarkRuntime) frontend.Variable

GetFrontendVariable implements ifaces.Accessor

func (*FromPublicColumn) GetVal

func (c *FromPublicColumn) GetVal(run ifaces.Runtime) field.Element

GetVal implements ifaces.Accessor

func (*FromPublicColumn) Name

func (c *FromPublicColumn) Name() string

Name implements ifaces.Accessor

func (*FromPublicColumn) Round

func (c *FromPublicColumn) Round() int

Round implements the ifaces.Accessor interface

func (*FromPublicColumn) String

func (c *FromPublicColumn) String() string

String implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata

type FromUnivXAccessor

type FromUnivXAccessor struct {
	// Q is the underlying univariate evaluation query
	Q query.UnivariateEval
	// Round is the declaration round of Q
	QRound int
}

FromUnivXAccessor implements ifaces.Accessor. It represents the "X" of a univariate evaluation query (see query.UnivariateEval).

func (*FromUnivXAccessor) AsVariable

func (u *FromUnivXAccessor) AsVariable() *symbolic.Expression

AsVariable implements the ifaces.Accessor interface

func (*FromUnivXAccessor) GetFrontendVariable

func (u *FromUnivXAccessor) GetFrontendVariable(_ frontend.API, circ ifaces.GnarkRuntime) frontend.Variable

GetFrontendVariable implements ifaces.Accessor

func (*FromUnivXAccessor) GetVal

func (u *FromUnivXAccessor) GetVal(run ifaces.Runtime) field.Element

GetVal implements ifaces.Accessor

func (*FromUnivXAccessor) Name

func (u *FromUnivXAccessor) Name() string

Name implements ifaces.Accessor

func (*FromUnivXAccessor) Round

func (u *FromUnivXAccessor) Round() int

Round implements the ifaces.Accessor interface

func (*FromUnivXAccessor) String

func (u *FromUnivXAccessor) String() string

String implements github.com/consensys/linea-monorepo/prover/symbolic.Metadata

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL