3%% Include the BASIC EVENT CALCULUS THEORY
4#include '../bec_theory'.
5
6%% Inspired by example from Shanahan (1999)
7
8% One world - vessel size = 10
9max_level(10) :- not max_level(16).
10max_level(16) :- not max_level(10).
11
12initiates(tapOn,filling,T).
13terminates(tapOff,filling,T).
14
15initiates(overflow,spilling,T) :-
16 max_level(Max),
17 holdsAt(level(Max), T).
18
22releases(tapOn,level(0),T) :- happens(tapOn, T).
23
26trajectory(filling,T1,level(X2),T2) :-
27 T1 #< T2,
28 X2 #= X + 4/3 * (T2 - T1),
29 max_level(Max),
30 X2 #=< Max,
31 holdsAt(level(X),T1).
32trajectory(filling,T1,overlimit,T2) :-
33 T1 #< T2,
34 X2 #= X + 4/3 * (T2 - T1),
35 max_level(Max),
36 X2 #> Max,
37 holdsAt(level(X),T1).
38
41trajectory(spilling,T1,leak(X),T2) :-
42 holdsAt(filling, T2),
43 T1 #< T2,
44 X #= 4/3 * (T2 - T1).
45
46initiallyP(level(0)).
51happens(overflow,T).
52
55happens(tapOn,5)