SLIDE 23 8 / 12
www.software.imdea.org
Translating Event Calculus into s(CASP): Examples
BEC6: HoldsAt(f,t2) ← Happens(e,t1) ∧ Initiates(e,f,t1) ∧ t1 < t2 ∧¬StoppedIn(t1,f,t2) holdsAt(F,T2) :- T1 #< T2, initiates(E,F,T1), happens(E,T1), not stoppedIn(T1,F,T2). BEC1: StoppedIn(t1,f,t2) ≡ ∃e,t(Happens(e,t) ∧ t1 < t < t2 ∧[Terminates(e,f,t) ∨ Releases(e,f,t)]) stoppedIn(T1,F,T2) :- T1 #< T, T #< T2, terminates(E,F,T), happens(E,T). stoppedIn(T1,F,T2) :- T1 #< T, T #< T2, releases(E,F,T), happens(E,T). Dual (not stoppedIn/3): introduced by the s(CASP) compiler not stoppedIn(T1,F,T2) :- not o_stoppedIn1(T1,F,T2), not o_stoppedIn2(T1,F,T2). not o_stoppedIn1(T1,F,T2) :- forall(T,forall(E, not o_stoppedIn1(T1,F,T2,T,E))). not o_stoppedIn1(T1,F,T2,T,E) :- T1 #>= T. not o_stoppedIn1(T1,F,T2,T,E) :- T1 #< T, T #>= T2. not o_stoppedIn1(T1,F,T2,T,E) :- T1 #< T, T #< T2, not terminates(E,F,T). not o_stoppedIn1(T1,F,T2,T,E) :- T1 #< T, T #< T2, terminates(E,F,T), not happens(E,T).
madrid institute for advanced studies in software development technologies