Advertisement
raultres

Turn off the heat

Jul 30th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 0.83 KB | None | 0 0
  1. #const t_max=8.
  2. t(0..t_max).
  3.  
  4. #domain fluent(F).
  5. #domain t(T).
  6. #domain event(E).
  7.  
  8. initiated(F,T) :-
  9.     happens(E,T),
  10.     initiates(E,F,T).
  11.  
  12. terminates(E,F,T) :- happens (E,T).
  13. %once the event is initiated and happens(last two lines in program) the event
  14. %terminates(E,F,T) would cause the heat to terminate in the function below
  15.  
  16.  
  17. terminated(F,T) :-
  18.     happens(E,T),
  19.     terminates(E,F,T).
  20.  
  21. holds(F,T+1) :-
  22.     holds(F,T),
  23.     not terminated(F,T).
  24.  
  25. -holds(F,T+1) :-
  26.     -holds(F,T),
  27.     not initiated(F,T).
  28.  
  29. holds(F,T+1) :-
  30.     initiated(F,T).
  31.  
  32. -holds(F,T+1) :-
  33.     terminated(F,T).
  34.  
  35. holds(F,0) :- initially(F).
  36. -holds(F,0) :- not initially(F).
  37.  
  38. initially(hot).
  39. fluent(hot).
  40.  
  41. event(airconditioning).
  42. happens(airconditioning,5).
  43.  
  44. %Lparse arguements               --true-negation
  45. %run it here : http://chapaai.adamsmith.as:8118/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement