LPS execution happens in discretely timestamped cycles. There are three steps that occur in each cycle:
The database is updated destructively according to a domain-specific causal theory specified in the given LPS program. An executed action or externally observed event can either initiate a fluent, terminate a fluent or update a fluent.
Theorectically speaking, LPS cycles can go on infinitely without stopping. However, for practicality, there are several halting conditions of a LPS program:
The maximum number of cycles allowed for the execution of a LPS program can be set using the
maxTime/1 definition. By default, the maximum number of cycles allowed is
20 if no definition for
maxTime/1 is given. For example to set the maximum timestamp to
To specifically request for the program to be halted, the term
lpsHalt/0 can be used. Upon execution of the
lpsHalt/0, the interpreter will finish the current cycle and stop execution. To write a rule that says if an event
operationComplete was observed, the program halts:
operationComplete(T1, T2) -> lpsHalt.