View source with raw comments or as raw
    4%% Include the BASIC EVENT CALCULUS THEORY
    5#include '../bec_theory'.
    9% If a light is turned on, it will be on:
   10initiates(turn_on, light_on, T).
   11
   12% If a light is turned on, whether it is red or green will be released
   13% from the commonsense law of inertia:
   14releases(turn_on, light_red, T).
   15releases(turn_on, light_green, T).
   16
   17% If a light is turned off, it will not be on, red, or green:
   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). 
   39% ?- holdsAt(light_on,3).