|Page 267 of 800||Search internet|
When the machine enters the input-eval-output-loop, the interface asks the engine to reduce the term t. The term t may be the one formed at machine invocation or it may be the one formed at the end of the previous execution of the loop.
The result of reducing t is supposed to be a list of output messages. The interface then executes the output messages one at a time as follows:
If the interface manages to execute all output events and does not encounter a quit or exec event, the machine exits with exit code 0.
If the interface encounters an exec request ( p , h ) it proceeds thus:
The value of p must be maptagged. The interface asks the engine to reduce p. During reduction of p there is an upper, system dependent limit on the time and memory the engine may use. Reduction of p may stop because of timeout, memory overflow, or external interrupts. Reduction may also stop because the engine succeeds to reduce p. We shall refer to the latter situation as an exit interrupt so that reduction of p always ends with an interrupt. Then the interface forms the term
where are reply messages. Then the interface reenters the input-eval-output-loop. Replies occur in the reverse order of their associated requests. In particular, is the reply to the exec request.
The exec reply has form
The value of I indicates which interrupt has occurred. The value of p equals the value of the p of the exec request, but the value under the maptag may have been reduced. If one reduces the value under the maptag of the p of the exec reply then computation will continue from the point it had reached when the interrupt occurred. In particular, in case I is an exit interrupt then the value under the maptag of p is already on root normal form.
The value of I has form
The values of r and i indicate what kind of interrupt has occurred and are possible interrupt parameters.
The predefined interrupts (exit, time, and memory) take no parameters. An exit interrupt indicates that p has been reduced. A time interrupt indicates that execution of p was stopped by a timer. A memory interrupt indicates that execution of p ran out of memory. As a minimum, Logiweb machines must support the exit interrupt.
The current lgwam only supports the exit interrupt.
|Page 267 of 800||Search logiweb.eu|