eval

package
v0.0.0-...-3948e75 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package eval provides an evaluator for op3 programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

type Evaluator struct {
	// contains filtered or unexported fields
}

func NewEvaluator

func NewEvaluator(m *big.Int) *Evaluator

NewEvaluator builds an evaluator using arithmetic modulo m.

func (*Evaluator) Execute

func (e *Evaluator) Execute(p *ast.Program) error

Execute the program p.

func (*Evaluator) Initialize

func (e *Evaluator) Initialize(v ast.Variable, x *big.Int) error

Initialize the variable v to x. Errors if v is already defined.

func (*Evaluator) Load

func (e *Evaluator) Load(v ast.Variable) (*big.Int, bool)

Load the variable v.

func (*Evaluator) Store

func (e *Evaluator) Store(v ast.Variable, x *big.Int)

Store x into the variable v.

Jump to

Keyboard shortcuts

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