program

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTraceIoMap

func NewTraceIoMap[F field.Element[F]](trace tr.Trace[F]) io.Map

NewTraceIoMap constructs a new instance of TraceIoMap[F].

Types

type Assignment

type Assignment[F field.Element[F], T io.Instruction] struct {
	// contains filtered or unexported fields
}

Assignment represents a wrapper around an instruction in order for it to conform to the schema.Assignment interface.

func NewAssignment

func NewAssignment[F field.Element[F], T io.Instruction](id sc.ModuleId, fn *io.Function[T],
) *Assignment[F, T]

NewAssignment constructs a new assignment capable of trace filling for a given function.

func (Assignment[F, T]) Bounds

func (p Assignment[F, T]) Bounds(module uint) util.Bounds

Bounds implementation for schema.Assignment interface.

func (Assignment[F, T]) Compute

func (p Assignment[F, T]) Compute(trace tr.Trace[F], schema sc.AnySchema[F]) ([]array.MutArray[F], error)

Compute implementation for schema.Assignment interface.

func (Assignment[F, T]) Consistent

func (p Assignment[F, T]) Consistent(sc.AnySchema[F]) []error

Consistent implementation for schema.Assignment interface.

func (Assignment[F, T]) Lisp

func (p Assignment[F, T]) Lisp(schema sc.AnySchema[F]) sexp.SExp

Lisp implementation for schema.Assignment interface.

func (Assignment[F, T]) RegistersExpanded

func (p Assignment[F, T]) RegistersExpanded() []register.Ref

RegistersExpanded implementation for schema.Assignment interface.

func (Assignment[F, T]) RegistersRead

func (p Assignment[F, T]) RegistersRead() []register.Ref

RegistersRead implementation for schema.Assignment interface.

func (Assignment[F, T]) RegistersWritten

func (p Assignment[F, T]) RegistersWritten() []register.Ref

RegistersWritten implementation for schema.Assignment interface.

func (Assignment[F, T]) Substitute

func (p Assignment[F, T]) Substitute(map[string]F)

Substitute implementation for schema.Assignment interface.

type Constraint

type Constraint[F field.Element[F], T io.Instruction] struct {
	// contains filtered or unexported fields
}

Constraint represents a wrapper around an instruction in order for it to conform to the constraint interface.

func (Constraint[F, T]) Accepts

func (p Constraint[F, T]) Accepts(trace tr.Trace[F], _ sc.AnySchema[F],
) (bit.Set, sc.Failure)

Accepts implementation for schema.Constraint interface.

func (Constraint[F, T]) Bounds

func (p Constraint[F, T]) Bounds(module uint) util.Bounds

Bounds implementation for schema.Constraint interface.

func (Constraint[F, T]) Consistent

func (p Constraint[F, T]) Consistent(sc.AnySchema[F]) []error

Consistent implementation for schema.Constraint interface.

func (Constraint[F, T]) Contexts

func (p Constraint[F, T]) Contexts() []sc.ModuleId

Contexts implementation for schema.Constraint interface.

func (Constraint[F, T]) Lisp

func (p Constraint[F, T]) Lisp(schema sc.AnySchema[F]) sexp.SExp

Lisp implementation for schema.Constraint interface.

func (Constraint[F, T]) Name

func (p Constraint[F, T]) Name() string

Name implementation for schema.Constraint interface.

func (Constraint[F, T]) Substitute

func (p Constraint[F, T]) Substitute(map[string]F)

Substitute implementation for schema.Constraint interface.

type ConstraintFailure

type ConstraintFailure[F field.Element[F]] struct {
	// Module where constraint failed
	Context schema.ModuleId
	// Row on which the constraint failed
	Row uint
	// Message
	Msg string
}

ConstraintFailure provides structural information about a failing vanishing constraint.

func (*ConstraintFailure[F]) Message

func (p *ConstraintFailure[F]) Message() string

Message provides a suitable error message

func (*ConstraintFailure[F]) RequiredCells

func (p *ConstraintFailure[F]) RequiredCells(tr trace.Trace[F]) *set.AnySortedSet[trace.CellRef]

RequiredCells identifies the cells required to evaluate the failing constraint at the failing row.

func (*ConstraintFailure[F]) String

func (p *ConstraintFailure[F]) String() string

type Module

type Module[F field.Element[F], T io.Instruction] struct {
	// contains filtered or unexported fields
}

Module programs a wrapper around an io.Function which makes it look like a schema.Module.

func NewModule

func NewModule[F field.Element[F], T io.Instruction](id sc.ModuleId, function io.Component[T]) *Module[F, T]

NewModule constructs a new wrapper around a given io.Function instance.

func (*Module[F, T]) AllowPadding

func (p *Module[F, T]) AllowPadding() bool

AllowPadding implementation for schema.Module interface.

func (*Module[F, T]) Assignments

func (p *Module[F, T]) Assignments() iter.Iterator[schema.Assignment[F]]

Assignments implementation for schema.Module interface.

func (*Module[F, T]) Consistent

func (p *Module[F, T]) Consistent(fieldWidth uint, schema schema.AnySchema[F]) []error

Consistent implementation for schema.Module interface.

func (*Module[F, T]) Constraints

func (p *Module[F, T]) Constraints() iter.Iterator[schema.Constraint[F]]

Constraints implementation for schema.Module interface.

func (*Module[F, T]) Function

func (p *Module[F, T]) Function() io.Component[T]

Function returns the underlying function being wrapped.

func (*Module[F, T]) HasRegister

func (p *Module[F, T]) HasRegister(name string) (register.Id, bool)

HasRegister implementation for register.RegisterMap interface.

func (*Module[F, T]) IsNative

func (p *Module[F, T]) IsNative() bool

IsNative implementation for schema.Module interface. Modules originating from the assembly pipeline are never native.

func (*Module[F, T]) IsPublic

func (p *Module[F, T]) IsPublic() bool

IsPublic implementation for schema.Module interface.

func (*Module[F, T]) IsStatic

func (p *Module[F, T]) IsStatic() bool

IsStatic implementation for schema.Module interface. Modules originating from the assembly pipeline are never static.

func (*Module[F, T]) IsSynthetic

func (p *Module[F, T]) IsSynthetic() bool

IsSynthetic implementation for schema.Module interface.

func (*Module[F, T]) Keys

func (p *Module[F, T]) Keys() uint

Keys implementation of Module interface.

func (*Module[F, T]) LengthMultiplier

func (p *Module[F, T]) LengthMultiplier() uint

LengthMultiplier implementation for schema.Module interface.

func (*Module[F, T]) Name

func (p *Module[F, T]) Name() module.Name

Name implementation for register.RegisterMap interface.

func (*Module[F, T]) Register

func (p *Module[F, T]) Register(id register.Id) register.Register

Register implementation for register.RegisterMap interface.

func (*Module[F, T]) Registers

func (p *Module[F, T]) Registers() []register.Register

Registers implementation for register.RegisterMap interface.

func (*Module[F, T]) StaticContents

func (p *Module[F, T]) StaticContents() [][]F

StaticContents implementation for schema.Module interface. Modules originating from the assembly pipeline are never static, hence this function always panics.

func (*Module[F, T]) String

func (p *Module[F, T]) String() string

func (*Module[F, T]) Substitute

func (p *Module[F, T]) Substitute(mapping map[string]F)

Substitute any matchined labelled constants within this module

func (*Module[F, T]) Width

func (p *Module[F, T]) Width() uint

Width implementation for schema.Module interface.

type TraceIoMap

type TraceIoMap[F field.Element[F]] struct {
	// contains filtered or unexported fields
}

TraceIoMap adapts a trace to look like an instance of io.Map. This assumes all function instances are already recorded in the trace (i.e. trace propagation has already occurred).

func (TraceIoMap[F]) Read

func (p TraceIoMap[F]) Read(bus uint, address []big.Int, nOutputs uint) []big.Int

Read implementation of the io.Map interface.

func (TraceIoMap[F]) Write

func (p TraceIoMap[F]) Write(bus uint, address []big.Int, values []big.Int)

Write implementation of the io.Map interface.

Jump to

Keyboard shortcuts

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