ieletestinginterpreter

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const TopCellInitializer m.KLabel = m.LblInitGeneratedTopCell

TopCellInitializer ... label passed to Eval to initialize the top cell

Variables

View Source
var NullReference = KReference(0)

NullReference is the zero-value of KReference. It doesn't point to anything. It has type nullRef.

Functions

func MatchKApply added in v0.0.9

func MatchKApply(ref KReference, expectedLabel uint64, expectedArity uint64) bool

MatchKApply returns true if reference is a KApply with correct label and arity. Function should be inlined, for performance reasons.

func MatchKToken added in v0.0.9

func MatchKToken(ref KReference, expectedSort uint64) bool

MatchKToken returns true if reference is a KToken with correct sort. Function should be inlined, for performance reasons.

func MatchNonEmptyKSequence added in v0.0.9

func MatchNonEmptyKSequence(ref KReference) bool

MatchNonEmptyKSequence returns true if reference is a K sequence with at least this many items, OR another any item type other than empty K sequence. Function should be inlined, for performance reasons.

func MatchNonEmptyKSequenceMinLength added in v0.0.9

func MatchNonEmptyKSequenceMinLength(ref KReference, minimumLength uint64) bool

MatchNonEmptyKSequenceMinLength returns true if reference is a K sequence with at least this many items. Argument minimumLength must be minimum 2. Function should be inlined, for performance reasons.

func StartTraceReferenceComparer

func StartTraceReferenceComparer(referenceFileName string)

StartTraceReferenceComparer ... set the code to compare each step to list of steps exported from somewhere else

Types

type Interpreter

type Interpreter struct {
	Model *m.ModelState

	MaxSteps int

	Verbose bool
	// contains filtered or unexported fields
}

Interpreter is a container with a reference to model and basic options

func NewInterpreter

func NewInterpreter(kryptoRef *krypto.Krypto) *Interpreter

NewInterpreter creates a new interpreter instance

func (*Interpreter) DebugPrint

func (i *Interpreter) DebugPrint(info string, c m.KReference)

DebugPrint ... prints a K item to console, useful for debugging

func (*Interpreter) Eval

func (i *Interpreter) Eval(c m.KReference, config m.KReference) (m.KReference, error)

Eval ... evaluates a KApply item based on its label and arguments

func (*Interpreter) Execute

func (i *Interpreter) Execute(kastMap map[string][]byte) error

Execute interprets the program with the structure

func (*Interpreter) ExecuteSimple

func (i *Interpreter) ExecuteSimple(kdir string, execFile string)

ExecuteSimple interprets the program in the file given at input

func (*Interpreter) GetNrSteps

func (i *Interpreter) GetNrSteps() int

GetNrSteps yields how many steps were executed until now from the start of the last execution

func (*Interpreter) GetState

func (i *Interpreter) GetState() m.KReference

GetLastState yields the current (last) state of the interpreter

func (*Interpreter) SetTracePretty

func (i *Interpreter) SetTracePretty()

SetTracePretty makes the interpreter save pretty traces of the execution

func (*Interpreter) TakeStepsNoThread

func (i *Interpreter) TakeStepsNoThread(k m.KReference) error

TakeStepsNoThread executes as many steps as possible given the starting configuration

type KReference added in v0.0.9

type KReference = uint64

KReference is a reference to a K item. For some types, like bool and small int, the entire state can be kept in the reference object. For the others, the reference contains enough data to find the object in the model state.

Jump to

Keyboard shortcuts

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