We extended PRS with a domain-independent Timed Monitor mechanism
that provides a general capability covering all our temporal monitoring
requirements. This capability was implemented in the form of Acts, with some
supporting LISP code. Four special types of timed monitors are provided,
invoked by posting facts with the predicates Check-Not-Later-Than,
Check-Not-Earlier-Than, Check-In-Window, and Check-Near-Time. We describe
our implementation for one of these; the others are similar. The Act
Check-Near-Time checks that an event occurs within a specified threshold of
some time point and can be invoked by a fact of the form:
To succeed, event.1 must occur within fuzz.1 seconds of time.1, with mode.1 indicating whether this time is absolute or relative (to the time at which this fact is posted). A Timed Monitor Act sets up a timer that expires at the given time, and PRS reacts appropriately to either the expiration of the timer or the occurrence of the event, posting facts to the database to note the success or failure of the temporal constraint. Because the above Acts are fact invoked, these mechanisms enable the establishment of separate intentions to perform timing, without blocking other processing. This modularization enables triggers to be set up to independently respond to timing results.