% ------------------------------------------------------------------------------------------------------
% Deontic Logic Example
% 
% Shows the use of deontic norms within EC rules.
% 
% ------------------------------------------------------------------------------------------------------

% include basic predicates
:-eval(consult('ContractLog/math.prova')).
:-eval(consult('ContractLog/list.prova')).
:-eval(consult('ContractLog/list_math.prova')).
:-eval(consult('ContractLog/datetime.prova')).
:-eval(consult('ContractLog/timeinterval.prova')).
:-eval(consult("ContractLog/deontic.prova")).
:-eval(consult('ContractLog/ec.prova')).
:-eval(consult("ContractLog/utils.prova")).




% ------------------------------------------------------------------------ 
%
% Some events for a webserver

happens(serverAwakes, datetime(2006,1,1,0,0,0)).

happens(serverGoesDown, datetime(2006,1,1,13,22,0)).

happens(serverAwakes, datetime(2006,1,1,13,24,20)).

initiates(serverGoesDown, oblige(provider,service,restart), T).
terminates(serverAwakes, oblige(provider,service,restart), T).


:- solve(holdsAt(oblige(provider,service,restart), datetime(2006,1,1,0,0,0))).
:- solve(holdsAt(oblige(provider,service,restart), datetime(2006,1,1,13,23,0))).
:- solve(holdsAt(permit(provider,service,restart), datetime(2006,1,1,13,23,0))).

