Documentation
¶
Overview ¶
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Index ¶
- func CastOf[F field.Element[F], T Expr[F, T]](arg T, bitwidth uint) T
- func ComplexityOfTerm[F field.Element[F], T Expr[F, T]](c T) uint
- func Conjunction[F field.Element[F], T Logical[F, T]](terms ...T) T
- func Const[F field.Element[F], T Expr[F, T]](val F) T
- func Const64[F field.Element[F], T Expr[F, T]](val uint64) T
- func Disjunction[F field.Element[F], T Logical[F, T]](terms ...T) T
- func Equals[F field.Element[F], S Logical[F, S], T Expr[F, T]](lhs T, rhs T) S
- func Exponent[F field.Element[F], T Expr[F, T]](arg T, pow uint64) T
- func False[F field.Element[F], T Logical[F, T]]() T
- func IfElse[F field.Element[F], S Logical[F, S], T Expr[F, T]](condition S, trueBranch T, falseBranch T) T
- func IfThenElse[F field.Element[F], T Logical[F, T]](condition T, trueBranch T, falseBranch T) T
- func IsConstant[F field.Element[F], T Expr[F, T]](term T) (F, bool)
- func IsConstant64[F field.Element[F], T Expr[F, T]](term T) (constant uint64, ok bool)
- func IsFalse[F field.Element[F], T Logical[F, T]](term T) bool
- func IsPowerOf2(val big.Int) (n uint, ok bool)
- func IsTrue[F field.Element[F], T Logical[F, T]](term T) bool
- func IsUnsafeExpr[F field.Element[F], S Logical[F, S], T Expr[F, T]](c T) bool
- func IsUnsafeLogical[F field.Element[F], S Logical[F, S], T Expr[F, T]](c S) bool
- func LabelledConstant[F field.Element[F], T Expr[F, T]](label string, value F) T
- func Negation[F field.Element[F], T Logical[F, T]](body T) T
- func NewRegisterAccess[F field.Element[F], T Expr[F, T]](register register.Id, bitwidth uint, shift int) T
- func NewVectorAccess[F field.Element[F], T Expr[F, T]](vars []*RegisterAccess[F, T]) T
- func Normalise[F field.Element[F], T Expr[F, T]](arg T) T
- func NotEquals[F field.Element[F], S Logical[F, S], T Expr[F, T]](lhs T, rhs T) S
- func Product[F field.Element[F], T Expr[F, T]](terms ...T) T
- func SubdivideExpr[F field.Element[F], S Logical[F, S], T Expr[F, T]](c T, mapping register.LimbsMap) T
- func SubdivideExprs[F field.Element[F], S Logical[F, S], T Expr[F, T]](cs []T, mapping register.LimbsMap) []T
- func SubdivideLogical[F field.Element[F], S Logical[F, S], T Expr[F, T]](c S, mapping register.LimbsMap) S
- func SubdivideLogicals[F field.Element[F], S Logical[F, S], T Expr[F, T]](cs []S, mapping register.LimbsMap) []S
- func Subtract[F field.Element[F], T Expr[F, T]](terms ...T) T
- func Sum[F field.Element[F], T Expr[F, T]](terms ...T) T
- func True[F field.Element[F], T Logical[F, T]]() T
- type Add
- func (p *Add[F, T]) Air()
- func (p *Add[F, T]) ApplyShift(shift int) T
- func (p *Add[F, T]) Bounds() util.Bounds
- func (p *Add[F, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *Add[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Add[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Add[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Add[F, T]) ShiftRange() (int, int)
- func (p *Add[F, T]) Simplify(casts bool) T
- func (p *Add[F, T]) Substitute(mapping map[string]F)
- func (p *Add[F, T]) ValueRange() math.Interval
- type Cast
- func (p *Cast[F, T]) ApplyShift(shift int) T
- func (p *Cast[F, T]) Bounds() util.Bounds
- func (p *Cast[F, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *Cast[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Cast[F, T]) Range() math.Interval
- func (p *Cast[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Cast[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Cast[F, T]) ShiftRange() (int, int)
- func (p *Cast[F, T]) Simplify(casts bool) T
- func (p *Cast[F, T]) Substitute(mapping map[string]F)
- func (p *Cast[F, T]) ValueRange() math.Interval
- type Computation
- type ComputationTerm
- type Conjunct
- func (p *Conjunct[F, T]) ApplyShift(shift int) T
- func (p *Conjunct[F, T]) Bounds() util.Bounds
- func (p *Conjunct[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Conjunct[F, S]) Negate() S
- func (p *Conjunct[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Conjunct[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Conjunct[F, T]) ShiftRange() (int, int)
- func (p *Conjunct[F, T]) Simplify(casts bool) T
- func (p *Conjunct[F, T]) Substitute(mapping map[string]F)
- func (p *Conjunct[F, T]) TestAt(k int, tr trace.Module[F], sc register.Map) (bool, uint, error)
- type Constant
- func (p *Constant[F, T]) Air()
- func (p *Constant[F, T]) ApplyShift(int) T
- func (p *Constant[F, T]) Bounds() util.Bounds
- func (p *Constant[F, T]) EvalAt(k int, _ trace.Module[F], _ register.Map) (F, error)
- func (p *Constant[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Constant[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Constant[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Constant[F, T]) ShiftRange() (int, int)
- func (p *Constant[F, T]) Simplify(casts bool) T
- func (p *Constant[F, T]) Substitute(mapping map[string]F)
- func (p *Constant[F, T]) ValueRange() util_math.Interval
- type Contextual
- type Costable
- type Disjunct
- func (p *Disjunct[F, T]) ApplyShift(shift int) T
- func (p *Disjunct[F, T]) Bounds() util.Bounds
- func (p *Disjunct[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Disjunct[F, S]) Negate() S
- func (p *Disjunct[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Disjunct[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Disjunct[F, T]) ShiftRange() (int, int)
- func (p *Disjunct[F, T]) Simplify(casts bool) T
- func (p *Disjunct[F, T]) Substitute(mapping map[string]F)
- func (p *Disjunct[F, T]) TestAt(k int, tr trace.Module[F], sc register.Map) (bool, uint, error)
- type Equal
- func (p *Equal[F, S, T]) ApplyShift(shift int) S
- func (p *Equal[F, S, T]) Bounds() util.Bounds
- func (p *Equal[F, S, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Equal[F, S, T]) Negate() S
- func (p *Equal[F, S, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Equal[F, S, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Equal[F, S, T]) ShiftRange() (int, int)
- func (p *Equal[F, S, T]) Simplify(casts bool) S
- func (p *Equal[F, S, T]) Substitute(mapping map[string]F)
- func (p *Equal[F, S, T]) TestAt(k int, tr trace.Module[F], sc register.Map) (bool, uint, error)
- type Evaluable
- type Exp
- func (p *Exp[F, T]) ApplyShift(shift int) T
- func (p *Exp[F, T]) Bounds() util.Bounds
- func (p *Exp[F, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *Exp[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Exp[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Exp[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Exp[F, T]) ShiftRange() (int, int)
- func (p *Exp[F, T]) Simplify(casts bool) T
- func (p *Exp[F, T]) Substitute(mapping map[string]F)
- func (p *Exp[F, T]) ValueRange() math.Interval
- type Expr
- type IfZero
- func (p *IfZero[F, S, T]) ApplyShift(shift int) T
- func (p *IfZero[F, S, T]) Bounds() util.Bounds
- func (p *IfZero[F, S, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *IfZero[F, S, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *IfZero[F, S, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *IfZero[F, S, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *IfZero[F, S, T]) ShiftRange() (int, int)
- func (p *IfZero[F, S, T]) Simplify(casts bool) T
- func (p *IfZero[F, S, T]) Substitute(mapping map[string]F)
- func (p *IfZero[F, S, T]) ValueRange() math.Interval
- type Ite
- func (p *Ite[F, T]) ApplyShift(shift int) T
- func (p *Ite[F, T]) Bounds() util.Bounds
- func (p *Ite[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Ite[F, S]) Negate() S
- func (p *Ite[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Ite[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Ite[F, T]) ShiftRange() (int, int)
- func (p *Ite[F, T]) Simplify(casts bool) T
- func (p *Ite[F, T]) Substitute(mapping map[string]F)
- func (p *Ite[F, T]) TestAt(k int, tr trace.Module[F], sc register.Map) (bool, uint, error)
- type LabelledConst
- func (p *LabelledConst[F, T]) ApplyShift(int) T
- func (p *LabelledConst[F, T]) Bounds() util.Bounds
- func (p *LabelledConst[F, T]) EvalAt(k int, _ trace.Module[F], _ register.Map) (F, error)
- func (p *LabelledConst[F, T]) Lisp(_ bool, _ register.Map) sexp.SExp
- func (p *LabelledConst[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *LabelledConst[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *LabelledConst[F, T]) ShiftRange() (int, int)
- func (p *LabelledConst[F, T]) Simplify(casts bool) T
- func (p *LabelledConst[F, T]) Substitute(mapping map[string]F)
- func (p *LabelledConst[F, T]) ValueRange() util_math.Interval
- type Logical
- type LogicalComputation
- type LogicalComputationTerm
- type Mul
- func (p *Mul[F, T]) Air()
- func (p *Mul[F, T]) ApplyShift(shift int) T
- func (p *Mul[F, T]) Bounds() util.Bounds
- func (p *Mul[F, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *Mul[F, T]) IsDefined() bool
- func (p *Mul[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Mul[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Mul[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Mul[F, T]) ShiftRange() (int, int)
- func (p *Mul[F, T]) Simplify(casts bool) T
- func (p *Mul[F, T]) Substitute(mapping map[string]F)
- func (p *Mul[F, T]) ValueRange() math.Interval
- type Negate
- func (p *Negate[F, T]) ApplyShift(shift int) T
- func (p *Negate[F, T]) Bounds() util.Bounds
- func (p *Negate[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Negate[F, T]) Negate() T
- func (p *Negate[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Negate[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Negate[F, T]) ShiftRange() (int, int)
- func (p *Negate[F, T]) Simplify(casts bool) T
- func (p *Negate[F, T]) Substitute(mapping map[string]F)
- func (p *Negate[F, T]) TestAt(k int, tr trace.Module[F], sc register.Map) (bool, uint, error)
- type Norm
- func (p *Norm[F, T]) ApplyShift(shift int) T
- func (p *Norm[F, T]) Bounds() util.Bounds
- func (p *Norm[F, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *Norm[F, T]) IsDefined() bool
- func (p *Norm[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Norm[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Norm[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Norm[F, T]) ShiftRange() (int, int)
- func (p *Norm[F, T]) Simplify(casts bool) T
- func (p *Norm[F, T]) Substitute(mapping map[string]F)
- func (p *Norm[F, T]) ValueRange() math.Interval
- type NotEqual
- func (p *NotEqual[F, S, T]) ApplyShift(shift int) S
- func (p *NotEqual[F, S, T]) Bounds() util.Bounds
- func (p *NotEqual[F, S, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *NotEqual[F, S, T]) Negate() S
- func (p *NotEqual[F, S, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *NotEqual[F, S, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *NotEqual[F, S, T]) ShiftRange() (int, int)
- func (p *NotEqual[F, S, T]) Simplify(casts bool) S
- func (p *NotEqual[F, S, T]) Substitute(mapping map[string]F)
- func (p *NotEqual[F, S, T]) TestAt(k int, tr trace.Module[F], sc register.Map) (bool, uint, error)
- type RegisterAccess
- func (p *RegisterAccess[F, T]) Air()
- func (p *RegisterAccess[F, T]) ApplyShift(shift int) T
- func (p *RegisterAccess[F, T]) BitWidth() uint
- func (p *RegisterAccess[F, T]) Bounds() util.Bounds
- func (p *RegisterAccess[F, T]) EvalAt(k int, module trace.Module[F], _ register.Map) (F, error)
- func (p *RegisterAccess[F, T]) HasFieldType() bool
- func (p *RegisterAccess[F, T]) IsDefined() bool
- func (p *RegisterAccess[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *RegisterAccess[F, T]) MarshalBinary() ([]byte, error)
- func (p *RegisterAccess[F, T]) Mask(maskwidth uint) *RegisterAccess[F, T]
- func (p *RegisterAccess[F, T]) MaskWidth() uint
- func (p *RegisterAccess[F, T]) Register() register.Id
- func (p *RegisterAccess[F, T]) RelativeShift() int
- func (p *RegisterAccess[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *RegisterAccess[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *RegisterAccess[F, T]) ShiftRange() (int, int)
- func (p *RegisterAccess[F, T]) Simplify(casts bool) T
- func (p *RegisterAccess[F, T]) Substitute(mapping map[string]F)
- func (p *RegisterAccess[F, T]) UnmarshalBinary(data []byte) error
- func (p *RegisterAccess[F, T]) UnmarshalBuffer(buf *bytes.Buffer) error
- func (p *RegisterAccess[F, T]) ValueRange() util_math.Interval
- type Shiftable
- type Sub
- func (p *Sub[F, T]) Air()
- func (p *Sub[F, T]) ApplyShift(shift int) T
- func (p *Sub[F, T]) Bounds() util.Bounds
- func (p *Sub[F, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *Sub[F, T]) IsDefined() bool
- func (p *Sub[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *Sub[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *Sub[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *Sub[F, T]) ShiftRange() (int, int)
- func (p *Sub[F, T]) Simplify(casts bool) T
- func (p *Sub[F, T]) Substitute(mapping map[string]F)
- func (p *Sub[F, T]) ValueRange() math.Interval
- type Substitutable
- type Testable
- type VectorAccess
- func (p *VectorAccess[F, T]) ApplyShift(shift int) T
- func (p *VectorAccess[F, T]) Bounds() util.Bounds
- func (p *VectorAccess[F, T]) EvalAt(k int, tr trace.Module[F], sc register.Map) (F, error)
- func (p *VectorAccess[F, T]) IsDefined() bool
- func (p *VectorAccess[F, T]) Lisp(global bool, mapping register.Map) sexp.SExp
- func (p *VectorAccess[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
- func (p *VectorAccess[F, T]) RequiredRegisters() *set.SortedSet[uint]
- func (p *VectorAccess[F, T]) ShiftRange() (int, int)
- func (p *VectorAccess[F, T]) Simplify(casts bool) T
- func (p *VectorAccess[F, T]) Substitute(mapping map[string]F)
- func (p *VectorAccess[F, T]) ValueRange() util_math.Interval
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CastOf ¶
CastOf constructs a new expression which has been annotated by the user to be within a given range.
func ComplexityOfTerm ¶
ComplexityOfTerm attempts to provide a cost estimate for the given expression.
func Conjunction ¶
Conjunction builds the logical conjunction (i.e. and) for a given set of constraints.
func Disjunction ¶
Disjunction creates a constraint representing the disjunction of a given set of constraints.
func Exponent ¶
Exponent constructs a new expression representing the given argument raised to a given a given power.
func IfElse ¶
func IfElse[F field.Element[F], S Logical[F, S], T Expr[F, T]](condition S, trueBranch T, falseBranch T) T
IfElse constructs a new conditional with true and false branches. Note, the true branch is taken when the condition evaluates to zero.
func IfThenElse ¶
IfThenElse constructs a new conditional branch, where either the true branch or the false branch can (optionally) be nil (but both cannot). Note, the true branch is taken when the condition evaluates to zero.
func IsConstant ¶
IsConstant checks whether an artibrary term corresponds to a constant or not.
func IsConstant64 ¶
IsConstant64 checks whether a given term is a 64bit constant (or not) and, if so, what constant it is.
func IsFalse ¶
IsFalse Check whether a given term corresponds to logical falsehood which, in this system, corresponds to an empty disjunct.
func IsPowerOf2 ¶
IsPowerOf2 checks whether a given big integer matches 2^n for some n and, if so, n is returned.
func IsTrue ¶
IsTrue checks whether a given term corresponds to logical truth which, in this system, corresponds to an empty conjunct.
func IsUnsafeExpr ¶
IsUnsafeExpr determines whether or not a given expression contains an unsafe operation (i.e. a runtime cast). Specifically, something which could fail at runtime.
func IsUnsafeLogical ¶
IsUnsafeLogical determines whether or not a given logical expression contains an unsafe operation (i.e. a runtime case). Specifically, something which could fail at runtime.
func LabelledConstant ¶
LabelledConstant construct an expression representing a constant with a given label.
func NewRegisterAccess ¶
func NewRegisterAccess[F field.Element[F], T Expr[F, T]](register register.Id, bitwidth uint, shift int) T
NewRegisterAccess constructs an AIR expression representing the value of a given register on the current row.
func NewVectorAccess ¶
func NewVectorAccess[F field.Element[F], T Expr[F, T]](vars []*RegisterAccess[F, T]) T
NewVectorAccess constructs a new vector access for a given set of registers.
func Normalise ¶
Normalise normalises the result of evaluating a given expression to be either 0 (if its value was 0) or 1 (otherwise).
func SubdivideExpr ¶
func SubdivideExpr[F field.Element[F], S Logical[F, S], T Expr[F, T]](c T, mapping register.LimbsMap) T
SubdivideExpr subdivides a computation by splitting all register accesses into vector accesses over their limbs.
func SubdivideExprs ¶
func SubdivideExprs[F field.Element[F], S Logical[F, S], T Expr[F, T]](cs []T, mapping register.LimbsMap) []T
SubdivideExprs subdivides an array of zero or more logical computations.
func SubdivideLogical ¶
func SubdivideLogical[F field.Element[F], S Logical[F, S], T Expr[F, T]](c S, mapping register.LimbsMap) S
SubdivideLogical subdivides a logical computation by splitting all register accesses into vector accesses over their limbs.
func SubdivideLogicals ¶
func SubdivideLogicals[F field.Element[F], S Logical[F, S], T Expr[F, T]](cs []S, mapping register.LimbsMap, ) []S
SubdivideLogicals Subdivides an array of zero or more logical computations.
Types ¶
type Add ¶
Add represents the addition of zero or more expressions.
func (*Add[F, T]) Air ¶
func (p *Add[F, T]) Air()
Air indicates this term can be used at the AIR level.
func (*Add[F, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*Add[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Add[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Add[F, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*Add[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*Add[F, T]) ValueRange ¶
ValueRange implementation for Term interface.
type Cast ¶
Cast attempts to narrow the width a given expression.
func (*Cast[F, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*Cast[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Cast[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Cast[F, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*Cast[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*Cast[F, T]) ValueRange ¶
ValueRange implementation for Term interface.
type Computation ¶
type Computation[F any] interface { Expr[F, Computation[F]] }
Computation represents an "unbound" term. That is, it captures any possible term (i.e. rather than a fixed set as for MIR or AIR, etc).
func NewComputation ¶
func NewComputation[F field.Element[F], S Logical[F, S], T Expr[F, T]](term Expr[F, T]) Computation[F]
NewComputation takes an arbitrary term and converts in into an instance of computation by wrapping it.
func NewComputations ¶
func NewComputations[F field.Element[F], S Logical[F, S], T Expr[F, T]](terms []T) []Computation[F]
NewComputations constructs an array of zero or more computations.
type ComputationTerm ¶
ComputationTerm provides a convenient alias for a big endian term.
type Conjunct ¶
type Conjunct[F field.Element[F], T Logical[F, T]] struct { // Terms here are disjuncted to formulate the final logical result. Args []T }
Conjunct erpresents the logical AND of zero or more terms. Observe that if there are no terms, then this is equivalent to logical truth.
func (*Conjunct[F, T]) ApplyShift ¶
ApplyShift implementation for LogicalTerm interface.
func (*Conjunct[F, T]) Lisp ¶
Lisp returns a lisp representation of this equation, which is useful for debugging.
func (*Conjunct[F, S]) Negate ¶
func (p *Conjunct[F, S]) Negate() S
Negate implementation for LogicalTerm interface
func (*Conjunct[F, T]) RequiredCells ¶
func (p *Conjunct[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*Conjunct[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Conjunct[F, T]) ShiftRange ¶
ShiftRange implementation for LogicalTerm interface.
func (*Conjunct[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
type Constant ¶
Constant represents a constant value within an expression.
func (*Constant[F, T]) Air ¶
func (p *Constant[F, T]) Air()
Air indicates this term can be used at the AIR level.
func (*Constant[F, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*Constant[F, T]) RequiredCells ¶
func (p *Constant[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*Constant[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Constant[F, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*Constant[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*Constant[F, T]) ValueRange ¶
ValueRange implementation for Term interface.
type Contextual ¶
type Contextual interface {
// RequiredRegisters returns the set of registers on which this term depends.
// That is, registers whose values may be accessed when evaluating this term
// on a given trace.
RequiredRegisters() *set.SortedSet[uint]
// RequiredCells returns the set of trace cells on which evaluation of this
// constraint element depends.
RequiredCells(int, trace.ModuleId) *set.AnySortedSet[trace.CellRef]
}
Contextual captures something which requires an evaluation context (i.e. a single enclosing module) in order to make sense. For example, expressions require a single context. This interface is separated from Evaluable (and Testable) because HIR expressions do not implement Evaluable.
type Costable ¶
type Costable interface {
Complexity() uint
}
Costable represents a component which can self-determine an approximage cost measure.
type Disjunct ¶
Disjunct erpresents the logical OR of zero or more terms. Observe that if there are no terms, then this is equivalent to logical falsehood.
func (*Disjunct[F, T]) ApplyShift ¶
ApplyShift implementation for LogicalTerm interface.
func (*Disjunct[F, T]) Lisp ¶
Lisp returns a lisp representation of this equation, which is useful for debugging.
func (*Disjunct[F, S]) Negate ¶
func (p *Disjunct[F, S]) Negate() S
Negate implementation for LogicalTerm interface
func (*Disjunct[F, T]) RequiredCells ¶
func (p *Disjunct[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*Disjunct[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Disjunct[F, T]) ShiftRange ¶
ShiftRange implementation for LogicalTerm interface.
func (*Disjunct[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
type Equal ¶
type Equal[F field.Element[F], S Logical[F, S], T Expr[F, T]] struct { Lhs Expr[F, T] Rhs Expr[F, T] }
Equal represents an Equal between two terms (e.g. "X==Y", or "X!=Y+1", etc). Equals are either equalities (or negated equalities) or inequalities.
func (*Equal[F, S, T]) ApplyShift ¶
ApplyShift implementation for LogicalTerm interface.
func (*Equal[F, S, T]) Lisp ¶
Lisp returns a lisp representation of this Equal, which is useful for debugging.
func (*Equal[F, S, T]) Negate ¶
func (p *Equal[F, S, T]) Negate() S
Negate implementation for LogicalTerm interface
func (*Equal[F, S, T]) RequiredCells ¶
func (p *Equal[F, S, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*Equal[F, S, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Equal[F, S, T]) ShiftRange ¶
ShiftRange implementation for LogicalTerm interface.
func (*Equal[F, S, T]) Substitute ¶
Substitute implementation for Substitutable interface.
type Evaluable ¶
type Evaluable[F any] interface { util.Boundable Contextual Substitutable[F] // EvalAt evaluates this expression in a given tabular context. // Observe that if this expression is *undefined* within this // context then it returns "nil". An expression can be // undefined for several reasons: firstly, if it accesses a // row which does not exist (e.g. at index -1); secondly, if // it accesses a register which does not exist. EvalAt(int, trace.Module[F], register.Map) (F, error) // Lisp converts this schema element into a simple S-Expression, for example // so it can be printed. Lisp(bool, register.Map) sexp.SExp // ValueRange returns the interval of values that this term can evaluate to. // For terms accessing registers, this is determined by the declared width of // the register. ValueRange() math.Interval }
Evaluable captures something which can be evaluated on a given table row to produce an evaluation point. For example, expressions in the Mid-Level or Arithmetic-Level IR can all be evaluated at rows of a table.
type Exp ¶
Exp represents the a given value taken to a power.
func (*Exp[F, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*Exp[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Exp[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Exp[F, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*Exp[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*Exp[F, T]) ValueRange ¶
ValueRange implementation for Term interface.
type Expr ¶
type Expr[F any, T any] interface { Contextual Shiftable[T] Evaluable[F] util.Boundable Substitutable[F] // Simplify constant expressions down to single values. For example, "(+ 1 // 2)" would be collapsed down to "3". This is then progagated throughout // an expression, so that e.g. "(+ X (+ 1 2))" becomes "(+ X 3)"", etc. // There is also an option to retain casts, or not. Simplify(casts bool) T }
Expr represents a component of an HIR/MIR/AIR expression.
type IfZero ¶
type IfZero[F field.Element[F], S Logical[F, S], T Expr[F, T]] struct { // Elements contained within this list. Condition S // True branch TrueBranch T // False branch FalseBranch T }
IfZero returns the true branch when the condition evaluates to zero, and the false branch otherwise.
func (*IfZero[F, S, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*IfZero[F, S, T]) Bounds ¶
Bounds returns max shift in either the negative (left) or positive direction (right).
func (*IfZero[F, S, T]) RequiredCells ¶
func (p *IfZero[F, S, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*IfZero[F, S, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*IfZero[F, S, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*IfZero[F, S, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*IfZero[F, S, T]) ValueRange ¶
ValueRange implementation for Term interface.
type Ite ¶
type Ite[F field.Element[F], T Logical[F, T]] struct { // Elements contained within this list. Condition T // True branch (optional). TrueBranch Logical[F, T] // False branch (optional). FalseBranch Logical[F, T] }
Ite represents an "If Then Else" expression which returns the (optional) true branch when the condition evaluates to zero, and the (optional false branch otherwise.
func (*Ite[F, T]) ApplyShift ¶
ApplyShift implementation for LogicalTerm interface.
func (*Ite[F, T]) Bounds ¶
Bounds returns max shift in either the negative (left) or positive direction (right).
func (*Ite[F, S]) Negate ¶
func (p *Ite[F, S]) Negate() S
Negate implementation for LogicalTerm interface
func (*Ite[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Ite[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Ite[F, T]) ShiftRange ¶
ShiftRange implementation for LogicalTerm interface.
func (*Ite[F, T]) Simplify ¶
Simplify this Negate as much as reasonably possible. Overall, simplifying ite is surprisingly tricky. However, its useful to retain ite rathe the compile it out completely as, in some cases, we can optimise things more effectively.
func (*Ite[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
type LabelledConst ¶
LabelledConst represents a constant value which is labelled with a given name. The purpose of this is to allow labelled constants to be substituted for different values when desired.
func (*LabelledConst[F, T]) ApplyShift ¶
func (p *LabelledConst[F, T]) ApplyShift(int) T
ApplyShift implementation for Term interface.
func (*LabelledConst[F, T]) Bounds ¶
func (p *LabelledConst[F, T]) Bounds() util.Bounds
Bounds implementation for Boundable interface.
func (*LabelledConst[F, T]) RequiredCells ¶
func (p *LabelledConst[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*LabelledConst[F, T]) RequiredRegisters ¶
func (p *LabelledConst[F, T]) RequiredRegisters() *set.SortedSet[uint]
RequiredRegisters implementation for Contextual interface.
func (*LabelledConst[F, T]) ShiftRange ¶
func (p *LabelledConst[F, T]) ShiftRange() (int, int)
ShiftRange implementation for Term interface.
func (*LabelledConst[F, T]) Simplify ¶
func (p *LabelledConst[F, T]) Simplify(casts bool) T
Simplify implementation for Term interface.
func (*LabelledConst[F, T]) Substitute ¶
func (p *LabelledConst[F, T]) Substitute(mapping map[string]F)
Substitute implementation for Substitutable interface.
func (*LabelledConst[F, T]) ValueRange ¶
func (p *LabelledConst[F, T]) ValueRange() util_math.Interval
ValueRange implementation for Term interface.
type Logical ¶
type Logical[F any, T any] interface { Contextual Shiftable[T] Testable[F] // Simplify constant expressions down to single values. For example, "(+ 1 // 2)" would be collapsed down to "3". This is then progagated throughout // an expression, so that e.g. "(+ X (+ 1 2))" becomes "(+ X 3)"", etc. // There is also an option to retain casts, or not. Simplify(casts bool) T // Negate this logical term Negate() T }
Logical represents a term which can be tested for truth or falsehood. For example, an equality comparing two arithmetic terms is a logical term.
type LogicalComputation ¶
type LogicalComputation[F any] interface { Logical[F, LogicalComputation[F]] }
LogicalComputation represents an "unbound" term. That is, it captures any possible term (i.e. rather than a fixed set as for MIR or AIR, etc).
func NewLogicalComputation ¶
func NewLogicalComputation[F field.Element[F], S Logical[F, S], T Expr[F, T]](term Logical[F, S], ) LogicalComputation[F]
NewLogicalComputation takes an arbitrary logical term and converts in into an instance of computation by wrapping it.
func NewLogicalComputations ¶
func NewLogicalComputations[F field.Element[F], S Logical[F, S], T Expr[F, T]](terms []S) []LogicalComputation[F]
NewLogicalComputations constructs an array of zero or more computations.
type LogicalComputationTerm ¶
LogicalComputationTerm provides a convenient alias for a big endian logical term.
type Mul ¶
Mul represents the product over zero or more expressions.
func (*Mul[F, T]) Air ¶
func (p *Mul[F, T]) Air()
Air indicates this term can be used at the AIR level.
func (*Mul[F, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*Mul[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Mul[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Mul[F, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*Mul[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*Mul[F, T]) ValueRange ¶
ValueRange implementation for Term interface.
type Negate ¶
Negate represents an Negate between two terms (e.g. "X==Y", or "X!=Y+1", etc). Negate are either Negateities (or negated Negateities) or inNegateities.
func (*Negate[F, T]) ApplyShift ¶
ApplyShift implementation for LogicalTerm interface.
func (*Negate[F, T]) Lisp ¶
Lisp returns a lisp representation of this Negate, which is useful for debugging.
func (*Negate[F, T]) Negate ¶
func (p *Negate[F, T]) Negate() T
Negate implementation for LogicalTerm interface
func (*Negate[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Negate[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Negate[F, T]) ShiftRange ¶
ShiftRange implementation for LogicalTerm interface.
func (*Negate[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
type Norm ¶
Norm reduces the value of an expression to either zero (if it was zero) or one (otherwise).
func (*Norm[F, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*Norm[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Norm[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Norm[F, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*Norm[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*Norm[F, T]) ValueRange ¶
ValueRange implementation for Term interface.
type NotEqual ¶
type NotEqual[F field.Element[F], S Logical[F, S], T Expr[F, T]] struct { Lhs Expr[F, T] Rhs Expr[F, T] }
NotEqual represents an NotEqual between two terms (e.g. "X==Y", or "X!=Y+1", etc). NotEquals are either NotEqualities (or negated NotEqualities) or inNotEqualities.
func (*NotEqual[F, S, T]) ApplyShift ¶
ApplyShift implementation for LogicalTerm interface.
func (*NotEqual[F, S, T]) Lisp ¶
Lisp returns a lisp representation of this NotEqual, which is useful for debugging.
func (*NotEqual[F, S, T]) Negate ¶
func (p *NotEqual[F, S, T]) Negate() S
Negate implementation for LogicalTerm interface
func (*NotEqual[F, S, T]) RequiredCells ¶
func (p *NotEqual[F, S, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*NotEqual[F, S, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*NotEqual[F, S, T]) ShiftRange ¶
ShiftRange implementation for LogicalTerm interface.
func (*NotEqual[F, S, T]) Substitute ¶
Substitute implementation for Substitutable interface.
type RegisterAccess ¶
type RegisterAccess[F field.Element[F], T Expr[F, T]] struct { // contains filtered or unexported fields }
RegisterAccess represents reading the value held at a given register in the tabular context. Furthermore, the current row maybe shifted up (or down) by a given amount. Suppose we are evaluating a constraint on row k=5 which contains the register accesses "STAMP(0)" and "CT(-1)". Then, STAMP(0) accesses the STAMP register at row 5, whilst CT(-1) accesses the CT register at row 4.
func FieldAccess ¶
func FieldAccess[F field.Element[F], T Expr[F, T]](register register.Id, shift int, ) *RegisterAccess[F, T]
FieldAccess constructs an AIR expression representing the value of a given register on the current row. There is an assumption here that the register being read has "field type". That is, it does not represent fixed width value in the usual sense. Such registers should only occur lower down in the pipeling for e.g. handling inverses, etc.
func RawRegisterAccess ¶
func RawRegisterAccess[F field.Element[F], T Expr[F, T]](register register.Id, bitwidth uint, shift int, ) *RegisterAccess[F, T]
RawRegisterAccess constructs an AIR expression representing the value of a given register on the current row.
func (*RegisterAccess[F, T]) Air ¶
func (p *RegisterAccess[F, T]) Air()
Air indicates this term can be used at the AIR level.
func (*RegisterAccess[F, T]) ApplyShift ¶
func (p *RegisterAccess[F, T]) ApplyShift(shift int) T
ApplyShift implementation for Term interface.
func (*RegisterAccess[F, T]) BitWidth ¶
func (p *RegisterAccess[F, T]) BitWidth() uint
BitWidth returns the declared bitwidth of the variable being accessed. Observe that the actual width of this access may be smaller than this if a mask is being applied.
func (*RegisterAccess[F, T]) Bounds ¶
func (p *RegisterAccess[F, T]) Bounds() util.Bounds
Bounds implementation for Boundable interface.
func (*RegisterAccess[F, T]) HasFieldType ¶
func (p *RegisterAccess[F, T]) HasFieldType() bool
HasFieldType checks whether or not this register access is for a register which has "field width". That is, it does not have a true bitwidth per se.
func (*RegisterAccess[F, T]) IsDefined ¶
func (p *RegisterAccess[F, T]) IsDefined() bool
IsDefined implementation for Evaluable interface.
func (*RegisterAccess[F, T]) MarshalBinary ¶
func (p *RegisterAccess[F, T]) MarshalBinary() ([]byte, error)
MarshalBinary converts the RegisterAccess into a sequence of bytes.
func (*RegisterAccess[F, T]) Mask ¶
func (p *RegisterAccess[F, T]) Mask(maskwidth uint) *RegisterAccess[F, T]
Mask constructs a variation on this register access which only uses the "masked" portion of the given register. For example, this can be used to implement a cast.
func (*RegisterAccess[F, T]) MaskWidth ¶
func (p *RegisterAccess[F, T]) MaskWidth() uint
MaskWidth returns the portion of the underlying column / register actually read by this access. For example, given a register of type u16 we might only be accessing the first u8 portion. In such case, the access is acting like a cast.
func (*RegisterAccess[F, T]) Register ¶
func (p *RegisterAccess[F, T]) Register() register.Id
Register returns the id of the register being accessed.
func (*RegisterAccess[F, T]) RelativeShift ¶
func (p *RegisterAccess[F, T]) RelativeShift() int
RelativeShift returns the relative shift of this access.
func (*RegisterAccess[F, T]) RequiredCells ¶
func (p *RegisterAccess[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*RegisterAccess[F, T]) RequiredRegisters ¶
func (p *RegisterAccess[F, T]) RequiredRegisters() *set.SortedSet[uint]
RequiredRegisters implementation for Contextual interface.
func (*RegisterAccess[F, T]) ShiftRange ¶
func (p *RegisterAccess[F, T]) ShiftRange() (int, int)
ShiftRange implementation for Term interface.
func (*RegisterAccess[F, T]) Simplify ¶
func (p *RegisterAccess[F, T]) Simplify(casts bool) T
Simplify implementation for Term interface.
func (*RegisterAccess[F, T]) Substitute ¶
func (p *RegisterAccess[F, T]) Substitute(mapping map[string]F)
Substitute implementation for Substitutable interface.
func (*RegisterAccess[F, T]) UnmarshalBinary ¶
func (p *RegisterAccess[F, T]) UnmarshalBinary(data []byte) error
UnmarshalBinary initialises this RegisterAccess from a given set of data bytes. This should match exactly the encoding above.
func (*RegisterAccess[F, T]) UnmarshalBuffer ¶
func (p *RegisterAccess[F, T]) UnmarshalBuffer(buf *bytes.Buffer) error
UnmarshalBuffer initialises this RegisterAccess from a given byte buffer. This should match exactly the encoding above.
func (*RegisterAccess[F, T]) ValueRange ¶
func (p *RegisterAccess[F, T]) ValueRange() util_math.Interval
ValueRange implementation for Term interface.
type Shiftable ¶
type Shiftable[T any] interface { // ApplyShift applies a given shift to all variable accesses in a given term // by a given amount. This can be used to normalise shifting in certain // circumstances. ApplyShift(int) T // ShiftRange returns the minimum and maximum shift value used anywhere in // the given term. ShiftRange() (int, int) }
Shiftable captures something which can contain row shifted accesses, and where we want information or to manipulate those accesses.
type Sub ¶
Sub represents the subtraction over zero or more expressions.
func (*Sub[F, T]) Air ¶
func (p *Sub[F, T]) Air()
Air indicates this term can be used at the AIR level.
func (*Sub[F, T]) ApplyShift ¶
ApplyShift implementation for Term interface.
func (*Sub[F, T]) RequiredCells ¶
RequiredCells implementation for Contextual interface
func (*Sub[F, T]) RequiredRegisters ¶
RequiredRegisters implementation for Contextual interface.
func (*Sub[F, T]) ShiftRange ¶
ShiftRange implementation for Term interface.
func (*Sub[F, T]) Substitute ¶
Substitute implementation for Substitutable interface.
func (*Sub[F, T]) ValueRange ¶
ValueRange implementation for Term interface.
type Substitutable ¶
type Substitutable[F any] interface { // Substitute any matchined labelled constants within this constraint Substitute(map[string]F) }
Substitutable captures the notion of a term which may contain labelled constants that can be substituted.
type Testable ¶
type Testable[F any] interface { util.Boundable Contextual Substitutable[F] // TestAt evaluates this expression in a given tabular context and checks it // against zero. Observe that if this expression is *undefined* within this // context then it returns "nil". An expression can be undefined for // several reasons: firstly, if it accesses a row which does not exist (e.g. // at index -1); secondly, if it accesses a register which does not exist. TestAt(int, trace.Module[F], register.Map) (bool, uint, error) // Lisp converts this schema element into a simple S-Expression, for example // so it can be printed. Lisp(bool, register.Map) sexp.SExp }
Testable captures the notion of a constraint which can be tested on a given row of a given trace. It is very similar to Evaluable, except that it only indicates success or failure. The reason for using this interface over Evaluable is that, for historical reasons, constraints at the HIR cannot be Evaluable (i.e. because they return multiple values, rather than a single value). However, constraints at the HIR level remain testable.
type VectorAccess ¶
type VectorAccess[F field.Element[F], T Expr[F, T]] struct{ Vars []*RegisterAccess[F, T] }
VectorAccess represents the bitwise concatenation of one or more registers. Registers are organised in little endian form. That is, the least significant register comes first (i.e. has index 0 in the array).
func RawVectorAccess ¶
func RawVectorAccess[F field.Element[F], T Expr[F, T]](vars []*RegisterAccess[F, T]) *VectorAccess[F, T]
RawVectorAccess constructs a new vector access for a given set of registers.
func (*VectorAccess[F, T]) ApplyShift ¶
func (p *VectorAccess[F, T]) ApplyShift(shift int) T
ApplyShift implementation for Term interface.
func (*VectorAccess[F, T]) Bounds ¶
func (p *VectorAccess[F, T]) Bounds() util.Bounds
Bounds implementation for Boundable interface.
func (*VectorAccess[F, T]) IsDefined ¶
func (p *VectorAccess[F, T]) IsDefined() bool
IsDefined implementation for Evaluable interface.
func (*VectorAccess[F, T]) RequiredCells ¶
func (p *VectorAccess[F, T]) RequiredCells(row int, mid trace.ModuleId) *set.AnySortedSet[trace.CellRef]
RequiredCells implementation for Contextual interface
func (*VectorAccess[F, T]) RequiredRegisters ¶
func (p *VectorAccess[F, T]) RequiredRegisters() *set.SortedSet[uint]
RequiredRegisters implementation for Contextual interface.
func (*VectorAccess[F, T]) ShiftRange ¶
func (p *VectorAccess[F, T]) ShiftRange() (int, int)
ShiftRange implementation for Term interface.
func (*VectorAccess[F, T]) Simplify ¶
func (p *VectorAccess[F, T]) Simplify(casts bool) T
Simplify implementation for Term interface.
func (*VectorAccess[F, T]) Substitute ¶
func (p *VectorAccess[F, T]) Substitute(mapping map[string]F)
Substitute implementation for Substitutable interface.
func (*VectorAccess[F, T]) ValueRange ¶
func (p *VectorAccess[F, T]) ValueRange() util_math.Interval
ValueRange implementation for Term interface.