Reactive tlcore

When the –reactive option is set for tlcore, then the application becomes reactive, and the set of equations is allowed to vary over time, and the expressions being evaluated can refer to the time dimension. The idea is that at each instant,

  • The header may be added to.
  • The set of equations may be modified.
  • The set of expressions to be evaluated may be modified.
  • Then the expressions for that instant are evaluated.

When tlcore is reading from the standard input, then the input will be of the form

header
%%
equations
%%
expressions
$$
header
%%
equations
%%
expressions
$$
...

Each instant corresponds to the lines appearing between successive occurrences of $$.
The output is of the same form as the input, with occurrences of $$ to separate the different instants.

When the input is given in the form of option —input=infile, then the entire input, for all instants, is read from infile. When the input is given in the form of option –inputiter=inprefix, then the input for instant n comes from file inprefixn. In other words, the input for each instant is placed in a different file.

Similarly for –output and –outputiter.

If the –uuid option is set, then the universal identifiers for the equations are presented to the programmer, who can then manipulate them explicitly, with lines like the following two:

delete eqnuuid1;;
replace eqnuuid2 equation;;

For the first line, if #time, the time that this line is added to the equations, has value t, then from t on, eqnuuid1 is no longer usable. For the second line, the equation corresponding to eqnuuid2 is replaced, from t on, with equation. If the value of #time is changed to t’, which happens to be less than t, then all of the equations available at time t’ continue to be accessible.

Changes to the set of equations are done synchronously. All additions, deletions and replacements for a given instant are done as a single transaction, and must be consistent.

An empty instant stops the tlcore program.

Advertisements