4%% Include the BASIC EVENT CALCULUS THEORY
5#include '../bec_theory'.
10initiates(turn_on, light_on, T).
11
14releases(turn_on, light_red, T).
15releases(turn_on, light_green, T).
16
18terminates(turn_off, light_on, T).
19
20% After a light is turned on, it will emit red for two seconds and
21% green after the first two seconds:
22trajectory(light_on, T1, light_red, T2) :- T2 .>=. T1, T2.<.T1 + 2.
23trajectory(light_on, T1, light_green, T2) :- T2 .>=. T1 + 2.
24
25:- holdsAt(light_red,T), holdsAt(light_green,T). 26
27initiallyN(light_on).
30happens(turn_on, 2).
38?- holdsAt(light_green,5).