1:-include(library('ec_planner/ec_test_incl')).    2:-expects_dialect(pfc).    3 %  loading(always,'examples/Mueller2006/Chapter12/DefaultEvent.e').
    4%;
    5%; Copyright (c) 2005 IBM Corporation and others.
    6%; All rights reserved. This program and the accompanying materials
    7%; are made available under the terms of the Common Public License v1.0
    8%; which accompanies this distribution, and is available at
    9%; http://www.eclipse.org/legal/cpl-v10.html
   10%;
   11%; Contributors:
   12%; IBM - Initial implementation
   13%;
   14%; @book{Mueller:2006,
   15%;   author = "Erik T. Mueller",
   16%;   year = "2006",
   17%;   title = "Commonsense Reasoning",
   18%;   address = "San Francisco",
   19%;   publisher = "Morgan Kaufmann/Elsevier",
   20%; }
   21%;
   22
   23% option modeldiff on
   24:- set_ec_option(modeldiff, on).   25
   26% load foundations/Root.e
   27
   28% load foundations/EC.e
   29
   30% sort agent
   31==> sort(agent).
   32
   33% sort clock
   34==> sort(clock).
   35
   36% fluent Beeping(clock)
   37 %  fluent(beeping(clock)).
   38==> mpred_prop(beeping(clock),fluent).
   39==> meta_argtypes(beeping(clock)).
   40
   41% fluent AlarmTime(clock,time)
   42 %  fluent(alarmTime(clock,time)).
   43==> mpred_prop(alarmTime(clock,time),fluent).
   44==> meta_argtypes(alarmTime(clock,time)).
   45
   46% fluent AlarmOn(clock)
   47 %  fluent(alarmOn(clock)).
   48==> mpred_prop(alarmOn(clock),fluent).
   49==> meta_argtypes(alarmOn(clock)).
   50
   51% event SetAlarmTime(agent,clock,time)
   52 %  event(setAlarmTime(agent,clock,time)).
   53==> mpred_prop(setAlarmTime(agent,clock,time),event).
   54==> meta_argtypes(setAlarmTime(agent,clock,time)).
   55
   56% event StartBeeping(clock)
   57 %  event(startBeeping(clock)).
   58==> mpred_prop(startBeeping(clock),event).
   59==> meta_argtypes(startBeeping(clock)).
   60
   61% event TurnOnAlarm(agent,clock)
   62 %  event(turnOnAlarm(agent,clock)).
   63==> mpred_prop(turnOnAlarm(agent,clock),event).
   64==> meta_argtypes(turnOnAlarm(agent,clock)).
   65
   66% event TurnOffAlarm(agent,clock)
   67 %  event(turnOffAlarm(agent,clock)).
   68==> mpred_prop(turnOffAlarm(agent,clock),event).
   69==> meta_argtypes(turnOffAlarm(agent,clock)).
   70
   71% predicate Ab1(clock,time)
   72 %  predicate(ab1(clock,time)).
   73==> mpred_prop(ab1(clock,time),predicate).
   74==> meta_argtypes(ab1(clock,time)).
   75
   76% agent Nathan
   77==> t(agent,nathan).
   78
   79% clock Clock
   80==> t(clock,clock).
   81%; Sigma
   82% [agent,clock,time1,time2,time]
   83% HoldsAt(AlarmTime(clock,time1),time) &
   84% time1!=time2 ->
   85% Initiates(SetAlarmTime(agent,clock,time2),AlarmTime(clock,time2),time).
   86axiom(initiates(setAlarmTime(Agent, Clock, Time2), alarmTime(Clock, Time2), Time),
   87   
   88    [ holds_at(alarmTime(Clock, Time1), Time),
   89      { dif(Time1, Time2)
   90      }
   91    ]).
   92
   93
   94% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:48
   95% [agent,clock,time1,time2,time]
   96% HoldsAt(AlarmTime(clock,time1),time) &
   97% time1!=time2 ->
   98% Terminates(SetAlarmTime(agent,clock,time2),AlarmTime(clock,time1),time).
   99% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:51
  100axiom(terminates(setAlarmTime(Agent, Clock, Time2), alarmTime(Clock, Time1), Time),
  101   
  102    [ holds_at(alarmTime(Clock, Time1), Time),
  103      { dif(Time1, Time2)
  104      }
  105    ]).
  106
  107
  108% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:53
  109% [agent,clock,time]
  110% Initiates(TurnOnAlarm(agent,clock),AlarmOn(clock),time).
  111% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:54
  112axiom(initiates(turnOnAlarm(Agent, Clock), alarmOn(Clock), Time),
  113    []).
  114
  115
  116% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:56
  117% [agent,clock,time]
  118% Terminates(TurnOffAlarm(agent,clock),AlarmOn(clock),time).
  119% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:57
  120axiom(terminates(turnOffAlarm(Agent, Clock), alarmOn(Clock), Time),
  121    []).
  122
  123
  124% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:59
  125% [clock,time]
  126% Initiates(StartBeeping(clock),Beeping(clock),time).
  127% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:60
  128axiom(initiates(startBeeping(Clock), beeping(Clock), Time),
  129    []).
  130
  131
  132% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:62
  133% [agent,clock,time]
  134% Terminates(TurnOffAlarm(agent,clock),Beeping(clock),time).
  135% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:63
  136axiom(terminates(turnOffAlarm(Agent, Clock), beeping(Clock), Time),
  137    []).
  138
  139
  140% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:65
  141%; Delta
  142% [clock,time]
  143% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:68
  144% HoldsAt(AlarmTime(clock,time),time) &
  145% HoldsAt(AlarmOn(clock),time) &
  146% !Ab1(clock,time) ->
  147% Happens(StartBeeping(clock),time).
  148% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:71
  149axiom(happens(startBeeping(Clock), Time),
  150   
  151    [ holds_at(alarmTime(Clock, Time), Time),
  152      holds_at(alarmOn(Clock), Time),
  153      not(ab1(Clock, Time))
  154    ]).
  155
  156
  157% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:73
  158% Happens(SetAlarmTime(Nathan,Clock,2),0).
  159axiom(happens(setAlarmTime(nathan, clock, 2), t),
  160    [is_time(0)]).
  161
  162
  163% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:74
  164% Happens(TurnOnAlarm(Nathan,Clock),1).
  165axiom(happens(turnOnAlarm(nathan, clock), start),
  166    [is_time(1), b(t, start), ignore(t+1=start)]).
  167
  168
  169% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:76
  170%; Psi
  171% [clock,time1,time2,time]
  172% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:79
  173% HoldsAt(AlarmTime(clock,time1),time) &
  174% HoldsAt(AlarmTime(clock,time2),time) ->
  175% time1=time2.
  176% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:81
  177axiom(Time1=Time2,
  178   
  179    [ holds_at(alarmTime(Clock, Time1), Time),
  180      holds_at(alarmTime(Clock, Time2), Time)
  181    ]).
  182
  183
  184% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:83
  185%; Gamma
  186
  187
  188% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:85
  189% !HoldsAt(AlarmOn(Clock),0).
  190 %  not(initially(alarmOn(clock))).
  191axiom(not(initially(alarmOn(clock))),
  192    []).
  193
  194
  195% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:86
  196% !HoldsAt(Beeping(Clock),0).
  197 %  not(initially(beeping(clock))).
  198axiom(not(initially(beeping(clock))),
  199    []).
  200
  201
  202% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:87
  203% HoldsAt(AlarmTime(Clock,3),0).
  204axiom(initially(alarmTime(clock, 3)),
  205    []).
  206
  207% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:89
  208% completion Happens
  209% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:90
  210==> completion(happens).
  211
  212% completion Theta Ab1
  213% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:91
  214==> completion(theta).
  215==> completion(ab1).
  216
  217% range time 0 3
  218% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:93
  219==> range(time,0,3).
  220
  221% range offset 1 1
  222% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/DefaultEvent.e:94
  223==> range(offset,1,1).
  224%; End of file.