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
Index ¶
- func Assert(value bool, message string, args ...any)
- func Cast[S uint8 | uint16 | uint32, T uint8 | uint16 | uint32 | uint](val T) S
- func GenerateRandomElements[E any](n uint, elems []E) []E
- func GenerateRandomInts(n uint, m int) []int
- func GenerateRandomUint64s(n, m uint64) []uint64
- func GenerateRandomUints(n, m uint) []uint
- func ParExec[J ParBatchJob](worklist []J) error
- func SampleElements[E comparable](n uint, elems []E) []E
- func ShallowCloneMap[K comparable, V any](orig map[K]V) map[K]V
- type BigInter
- type Boundable
- type Bounds
- type Comparable
- type ComparableUint64
- type Comparator
- type Counter
- type Equal
- type FlowGraph
- type GreaterThan
- type GreaterThanOrEqual
- type LessThan
- type LessThanOrEqual
- type NotEqual
- type Option
- type Pair
- type ParBatchJob
- type PerfStats
- type Range
- type Uinter64
- type Union
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶ added in v1.2.21
Assert that a given value holds, otherwise panic with a given message.
func Cast ¶ added in v1.2.21
Cast provides a safe cast from a value of one type to a value of another (typically smaller) type. In particular, if the value does not fit in the given type then this will panic.
func GenerateRandomElements ¶
GenerateRandomElements generates n elements selected at random from the given array.
func GenerateRandomInts ¶
GenerateRandomInts generates n random unsigned integers in the range -m..m.
func GenerateRandomUint64s ¶
GenerateRandomUint64s generates n random 64bit unsigned integers in the range 0..m.
func GenerateRandomUints ¶
GenerateRandomUints generates n random unsigned integers in the range 0..m.
func ParExec ¶
func ParExec[J ParBatchJob](worklist []J) error
ParExec executes a set of jobs in parallel using go-routines.
func SampleElements ¶
func SampleElements[E comparable](n uint, elems []E) []E
SampleElements selects exactly n elements from the given array when its length is greater (otherwise returns the array untouched).
func ShallowCloneMap ¶
func ShallowCloneMap[K comparable, V any](orig map[K]V) map[K]V
ShallowCloneMap makes a shallow clone of a given map.
Types ¶
type BigInter ¶ added in v1.2.21
BigInter captures any type which can be convered into a big.Int value. NOTE: the return value should be fresh (i.e. not an alias for some internal state).
type Boundable ¶
type Boundable interface {
// Determine the well-definedness bounds for this expression for both the
// negative (left) or positive (right) directions. For example, consider an
// expression such as "(shift X -1)". This is technically undefined for the
// first row of any trace and, by association, any constraint evaluating
// this expression on that first row is also undefined (and hence must pass).
Bounds() Bounds
}
Boundable captures computations which are well-defined only for a specific subrange of rows (the bounds).
type Bounds ¶
type Bounds struct {
// Number of rows from first row where computation starts being defined.
Start uint
// Number of rows before last row where computation is no longer defined.
End uint
}
Bounds captures the subrange of rows for which a computation is well-defined.
EMPTY_BOUND is the bound which overlaps exactly with the original range. It represents the maximum possible bound.
func BoundsForArray ¶
BoundsForArray determines the bounds for an array of expressions.
type Comparable ¶
type Comparable[T any] interface { // Cmp returns < 0 if this is less than other, or 0 if they are equal, or > // 0 if this is greater than other. Cmp(other T) int }
Comparable interface which can be implemented by non-primitive types.
type ComparableUint64 ¶
type ComparableUint64 interface {
// Cmp returns < 0 if this is less than other, or 0 if they are equal, or >
// 0 if this is greater than other.
Cmp64(other uint64) int
}
ComparableUint64 interface which can be implemented by non-primitive types.
type Comparator ¶
type Comparator[W Comparable[W]] interface { // Cmp returns true when the underlying comparison (e.g. l < r) holds. Cmp(l, r W) bool }
Comparator provides a generic concept of comparing two values (e.g. l < r).
type Counter ¶ added in v1.2.21
type Counter struct {
// contains filtered or unexported fields
}
Counter is a simple countdown which fires (returns true from Tick) once every `initial` ticks. It begins at its initial value and, on each Tick, decrements the current count; upon reaching zero it resets to the initial value and reports true. This is useful, for example, for triggering an action periodically (e.g. taking a checkpoint every N instructions).
func NewCounter ¶ added in v1.2.21
NewCounter constructs a counter which fires every n ticks.
func NewCounterOnce ¶ added in v1.2.21
NewCounterOnce constructs a counter which fires once after n ticks.
type FlowGraph ¶ added in v1.2.21
type FlowGraph struct {
// contains filtered or unexported fields
}
FlowGraph renders a set of vertical columns down a grid of rows. Each range occupies its own column (in the order added) and is "active" on the rows within its span. The intention is to visualise, at a glance, which rows each range covers.
func NewFlowGraph ¶ added in v1.2.21
NewFlowGraph constructs a FlowGraph from the given ranges, one column per range in the order provided.
func (*FlowGraph) Add ¶ added in v1.2.21
Add appends a new range (column) spanning rows start..finish (inclusive).
func (*FlowGraph) Render ¶ added in v1.2.21
Render produces n strings, one per row. Ranges are packed into columns such that non-overlapping ranges share a column; each column contributes two adjacent characters (in left-to-right order), and adjacent columns are separated by a space. A range draws a vertical arrow spanning it: a horizontal lead-in at the source row, and an arrow head turning left toward the instruction at the target row. Rows outside every range in a column render as blank there.
type GreaterThan ¶
type GreaterThan[W Comparable[W]] struct { }
GreaterThan comparator holds when l > r
func (GreaterThan[W]) Cmp ¶
func (p GreaterThan[W]) Cmp(l, r W) bool
Cmp implementation for Comparable interface
type GreaterThanOrEqual ¶
type GreaterThanOrEqual[W Comparable[W]] struct { }
GreaterThanOrEqual comparator holds when l >= r
func (GreaterThanOrEqual[W]) Cmp ¶
func (p GreaterThanOrEqual[W]) Cmp(l, r W) bool
Cmp implementation for Comparable interface
type LessThanOrEqual ¶
type LessThanOrEqual[W Comparable[W]] struct { }
LessThanOrEqual comparator holds when l <= r
func (LessThanOrEqual[W]) Cmp ¶
func (p LessThanOrEqual[W]) Cmp(l, r W) bool
Cmp implementation for Comparable interface
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
Option provides a simple encoding for an optional value. A key advantage over a pointer is that this serialises nicely.
func MapOption ¶ added in v1.2.21
MapOption maps an option from one type to another using a given mapping function.
func (*Option[T]) GobEncode ¶
GobEncode an option. This allows it to be marshalled into a binary form.
func (Option[T]) HasValue ¶
HasValue indicates whether or not this option contains an actual value, or whether it is empty.
func (Option[T]) IsEmpty ¶
IsEmpty indicates whether or not this option is empty (i.e. contains no value).
type Pair ¶
Pair provides a simple encapsulation of two items paired together.
func NewPairRef ¶
NewPairRef returns a reference to a new instance of Pair.
type ParBatchJob ¶
type ParBatchJob interface {
// Get the job identifies for all jobs in this batch.
Jobs() []uint
// Get the jobs on which this at least one job in this batch dependend. In
// otherwords, all of the return jobs must be complete before this batch can
// run.
Dependencies() []uint
// Run this batch job
Run() error
}
ParBatchJob represents an atomic division of work which is composed of one or more jobs. The idea is that all of these jobs must be computed together in one large batch, and cannot be further broken down.
type PerfStats ¶
type PerfStats struct {
// contains filtered or unexported fields
}
PerfStats provides a snapshot of memory allocation at a given point in time.
func NewPerfStats ¶
func NewPerfStats() *PerfStats
NewPerfStats creates a new snapshot of the current amount of memory allocated.
type Range ¶ added in v1.2.21
Range identifies a contiguous span of rows, from Start up to and including Finish, during which its column is considered active. The endpoints may be given in either order.
type Uinter64 ¶
type Uinter64 interface {
// Convert the given type into a uint64 value.
Uint64() uint64
}
Uinter64 captures any type which can be converted into a uint64 value.
type Union ¶
type Union[S, T any] struct { // contains filtered or unexported fields }
Union represents a value which is either of the first type or of the second type.
func (Union[S, T]) First ¶
func (u Union[S, T]) First() S
First returns the contained value of the first type. If the union does not hold a value of the first type, then this will panic.
func (Union[S, T]) HasFirst ¶
HasFirst indicates whether this union holds a value of the first type (or not).