Package code.instr

This package abstracts the instructions of the functional logic virtual machine.

See:
          Description

Interface Summary
Instruction Interface of all the instructions of the virtual machine.
 

Class Summary
Branch Execute a goto -like instruction of the virtual machine code.
Choice Execute a non-deterministic step.
Fail Fail the current computation.
Load Load in the machine register a subterm of the top of the pre-redex stack.
MakeAnon Construct a fresh (anonymous) variable and push it on the pre-term stack.
MakeChar Construct a character term and push it on the pre-term stack.
MakeFloat Construct an float term and push it on the pre-term stack.
MakeInt Construct an integer term and push it on the pre-term stack.
MakePartial Construct a term from a (root) symbol partially applied to a bunch of arguments.
MakeRef Construct a term that wraps a variable.
MakeTerm Construct a term from a (root) symbol and a bunch of arguments.
MakeVar Push on the stack an uninstantiated free variable stored in some register of variables.
Narrow Narrow the top term of the pre-term stack.
Pop Move the top term of the pre-term stack (which is popped) in the register.
Push Push the register on the pre-term stack.
Replace Replace the top of the pre-redex stack with the register.
Residuate Residuate the current computation.
StoreVar Store a fresh uninstantiated variable in a register
 

Package code.instr Description

This package abstracts the instructions of the functional logic virtual machine. The machine executed code consisting of an array of instructions.

Currently (Fri Jan 24 14:22:57 PST 2003) the instructions are represented by Java objects. An instruction is generated by calling its constructor. There is no provision (yet) to read instructions from a stream.

Some instructions refer to Symbols of a source functional logic program. These symbols are represented by string when they occur as arguments of an instruction's constructor. The same symbols are represented by integer in the constructor object to ensure fast access to a symbol information.

The representation of instructions as object is potentially inefficient, but excellent for prototyping. There are no specific classes for the functional logic virtual machine. Rather, each instruction defines an execute method, dispatched by virtual polymorphism, which perform the computation intended by the instruction. This allows the programmer to add/replace/delete each instruction independently of any other instruction.

An instruction is executed within the context of a Computation. A computation has the following main elements: