[an error occurred while processing this directive]

Implementing ADM - Mike Slade's Version

Program Execution

Once the entity descriptions are entered, the desired instantiations are made by commands of the form

name (parameter_list)

More than one instantiation of the same entity can occure, but each must be disambiguated by the use of distinct parameters. The program can be executed by typing start. Execution consists of repeated execution cycles. Each execution cycle involves evaluating all guards, performing the procedural actions associated with true guards and putting the associated command lists into the run set, and then executing the lists of commands on the run set. Evaluation is optimised, so "true || x" always evaluates to true. Evaluation of guards and printing of messages is performed prior to any redefinition in an execution cycle.

The program executes until a stop command is executed, no guards are true, the specified number of iterations have been performed, or an error occurs. Errors are classified into notifiable, avoidance and fatal, with explanatory diagnostics. A notifiable error occurs when a variable which is referred to is not in the definition store D, or a dynamic action refers to an entity which is not in the program store P. An avoidance error occurs when a guard cannot be evaluated. A fatal error occurs when there is interference between the commands in the run set. See a summary of the execution model.

Control variables in am

There are four control variables used by am (default values in brackets):

nflag (true)
if true then print notifiable errors
aflag (true)
if true then print avoidance errors
silent (false)
if false then print information during simulation
iterations (0)
the number of execution cycles which are to be performed in each simulation

Their values can be examined by the keyword status, and can be changed either by using the command line flags -n, -a, -s and -inumber respectively, or as a command from within am using the keyword set, e.g. "set iterations = 12" or "set aflag = false".

Commands to am

Generally a program will be executed for a specified number of execution cycles (according to the value of iterations), and then the user will be allowed to intervene. The contents of the various stores can be examined:

l en
list the contents of the program store P
l ds
list the contents of the definition store D
l as
list the contents of the action store A
l in
list the currently instantiated entities

The run set can be loaded and examined:

load runset
load the run set
l runset
list the run set

Entities can be instantiated, in the same way as the initial instantiations were made. Variables can be redefined directly:

define variable = expression ;

The definition and value of a variable can be printed:

?(variable)

Notice that these facilities are intrinsic to the execution of an ADM program, and are not merely debugging aids. In particular, it is intended that the user will intervene to effect changes of state by means of redefinitions and instantiations. Such changes will be guided by the curent state, which is discerned by examination of the various stores. Execution can then be continued by using the keyword cont.

The implementation described here uses boolean and arithmetic data types and operators. Other underlying algebras could have been used, which would be more suitable for specialised applications. More sophisticated variants of the ADM can be simulated by using the print command to generate input to an interpreter for a special purpose definitive notation, such as DoNaLD and SCOUT.

[an error occurred while processing this directive]