Timer active expression


Subject: Timer active expression
From: Rick Reed TSE (rickreed#tseng.co.uk)
Date: Fri Apr 20 2001 - 20:56:50 GMT


The work of under Q.7/10 and the Interval project has stated (in papers to
the SDL Forum) that the semantics of the timer active expression has changed
between a previous version of SDL and SDL-2000.

I thought that this was the case myself and that in SDL-96 a timer was
inactive if the timer had expired and a signal had been posted in the input
queue. However, I checked and found that this was incorrect and the same
text for "timer" and "active" appears in the main body of Z.100 in the Blue
Book Z.100 (SDL-88), Z.100(03/93) SDL-92, and Z.100(11/99) SDL-2000.

I then checked the formal definition for SDL-92 and this has the same
semantics: a timer remains active until the corresponding timer signal is
consumed. I have not checked the current formal definition, but I assume it
also follows the Z.100 definition (which has not changed since 1988).

However, there seems to be a (common?) understanding that there was at one
time a Z.100 definition that a timer was active until it "expired" and the
signal was put into the input queue - at which time it becomes "inactive".
The only document in which I can find this interpretation is in "Engineering
Real Time Systems" by Rolv Braek and Oystein Haugen. It is correct in the
Sarma/Hogrefe books and in the Olsen et al. book.

Though the Braek/Haugen meaning is not correct according to Z.100 (or SDT -
I have not checked GEODE or Cinderella), it is easy to see why there should
be a misunderstanding. The current active expression is not particularly
useful as the value does not change unless the signal has been consumed,
whereas an expression that is evaluated as Braek/Haugen suggest (let's call
this "unexpired") would be more accurate than "active". This would make it
easy to do something which otherwise requires the value used in the "set"
statement to be stored. If the timer T was set with:

SET(time_t, T);

then "unexpired(T)" would have the value of the Boolean expression:

NOW < time_t

assuming that the value of "time_t" had not been changed. As this expression
can be written in SDL in any case, such an active expression does not
require any new underlying semantics in SDL.

By examining now in enabling conditions or continuous signals either
explicitly or by the application of "unexpired" - it is possible to leave a
state as soon as a timer expires: it is not necessary to wait for the signal
to be consumed.

The possible states of a timer are:

- inactive: timer never set or set and the signal consumed;

- active unexpired: timer set but time not reached and no signal generated;

- active expired: timer expired, signal in input queue.

I suggest therefore to add a additional active operator "expired" to SDL.

--
Rick Reed - rickreed#tseng.co.uk
Tel:+44 1455 55 96 55 Fax:+44 1455 55 96 58 Mob.:+44 7970 50 96 50



This archive was generated by hypermail 2a23 : Mon May 05 2008 - 20:30:55 GMT