View source with raw comments or as raw
    2%% BASIC EVENT CALCULUS (BEC) THEORY
    3
    4
    5%% BEC1 - StoppedIn(t1,f,t2)
    6stoppedIn(T1, Fluent, T2) :-
    7    T1 .<. T, T .<. T2,
    8    terminates(Event, Fluent, T),
    9    happens(Event, T).
   10
   11stoppedIn(T1, Fluent, T2) :-
   12    T1 .<. T, T .<. T2,
   13    releases(Event, Fluent, T),
   14    happens(Event, T).
   15
   16%% BEC2 - StartedIn(t1,f,t2)
   17startedIn(T1, Fluent, T2) :-
   18    T1 .<. T, T .<. T2,
   19    initiates(Event, Fluent, T),
   20    happens(Event, T).
   21
   22startedIn(T1, Fluent, T2) :-
   23    T1 .<. T, T .<. T2,
   24    releases(Event, Fluent, T),
   25    happens(Event, T).
   26
   27%% BEC3 - HoldsAt(f,t)
   28holdsAt(Fluent2, T2) :-
   29    initiates(Event, Fluent1, T1),
   30    happens(Event, T1),
   31    trajectory(Fluent1, T1, Fluent2, T2),
   32    not stoppedIn(T1, Fluent1, T2).
   33%% BEC4 - HoldsAt(f,t)
   34holdsAt(Fluent, T) :-
   35    0 .<. T,
   36    initiallyP(Fluent),
   37    not stoppedIn(0, Fluent, T).
   38
   39%% BEC5 - not HoldsAt(f,t)
   40-holdsAt(Fluent, T) :-
   41    0 .<. T,
   42    initiallyN(Fluent),
   43    not startedIn(0, Fluent, T).
   44
   45%% BEC6 - HoldsAt(f,t)
   46holdsAt(Fluent, T) :-
   47    T1 .<. T,
   48    initiates(Event, Fluent, T1),
   49    happens(Event, T1),
   50    not stoppedIn(T1, Fluent, T).
   51
   52%% BEC7 - not HoldsAt(f,t)
   53-holdsAt(Fluent, T) :-
   54    T1