1:-include(library('ec_planner/ec_test_incl')).    2:-expects_dialect(pfc).    3 %  loading(always,'examples/Mueller2006/Chapter9/RunningAndDriving.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% load foundations/Root.e
   24
   25% load foundations/EC.e
   26
   27% sort agent
   28==> sort(agent).
   29
   30% sort location
   31==> sort(location).
   32
   33% agent James
   34==> t(agent,james).
   35
   36% location Bookstore
   37==> t(location,bookstore).
   38
   39% fluent Tired(agent)
   40 %  fluent(tired(agent)).
   41==> mpred_prop(tired(agent),fluent).
   42==> meta_argtypes(tired(agent)).
   43
   44% event Go(agent,location)
   45 %  event(go(agent,location)).
   46==> mpred_prop(go(agent,location),event).
   47==> meta_argtypes(go(agent,location)).
   48
   49% event Run(agent,location)
   50 %  event(run(agent,location)).
   51==> mpred_prop(run(agent,location),event).
   52==> meta_argtypes(run(agent,location)).
   53
   54% event Drive(agent,location)
   55 %  event(drive(agent,location)).
   56==> mpred_prop(drive(agent,location),event).
   57==> meta_argtypes(drive(agent,location)).
   58
   59
   60% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:34
   61% [agent,location,time]
   62% Happens(Go(agent,location),time) ->
   63% Happens(Run(agent,location),time) | Happens(Drive(agent,location),time).
   64
   65 /*   if(happens(go(Agent, Location), Time),
   66          (happens(run(Agent, Location), Time);happens(drive(Agent, Location), Time))).
   67 */
   68
   69 /*  happens(run(Run_Param, Run_Ret), Maptime) :-
   70       not(happens(drive(Run_Param, Run_Ret), Maptime)),
   71       happens(go(Run_Param, Run_Ret), Maptime).
   72 */
   73% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:36
   74axiom(happens(run(Run_Param, Run_Ret), Maptime),
   75   
   76    [ not(happens(drive(Run_Param, Run_Ret), Maptime)),
   77      happens(go(Run_Param, Run_Ret), Maptime)
   78    ]).
   79
   80 /*  happens(drive(Drive_Param, Drive_Ret), Maptime6) :-
   81       not(happens(run(Drive_Param, Drive_Ret), Maptime6)),
   82       happens(go(Drive_Param, Drive_Ret), Maptime6).
   83 */
   84axiom(happens(drive(Drive_Param, Drive_Ret), Maptime6),
   85   
   86    [ not(happens(run(Drive_Param, Drive_Ret), Maptime6)),
   87      happens(go(Drive_Param, Drive_Ret), Maptime6)
   88    ]).
   89
   90 /*  not(happens(go(Go_Param, Go_Ret), Maptime9)) :-
   91       not(happens(run(Go_Param, Go_Ret), Maptime9)),
   92       not(happens(drive(Go_Param, Go_Ret), Maptime9)).
   93 */
   94axiom(not(happens(go(Go_Param, Go_Ret), Maptime9)),
   95   
   96    [ not(happens(run(Go_Param, Go_Ret), Maptime9)),
   97      not(happens(drive(Go_Param, Go_Ret), Maptime9))
   98    ]).
   99
  100% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:38
  101% xor Run, Drive
  102% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:39
  103xor([run,drive]).
  104
  105
  106% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:40
  107% [agent,location,time]
  108 % Initiates(Run(agent,location),Tired(agent),time).
  109axiom(initiates(run(Agent, Location), tired(Agent), Time),
  110    []).
  111
  112
  113% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:42
  114% !HoldsAt(Tired(James),0).
  115 %  not(initially(tired(james))).
  116axiom(not(initially(tired(james))),
  117    []).
  118
  119
  120% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:43
  121% Happens(Go(James,Bookstore),0).
  122axiom(happens(go(james, bookstore), t),
  123    [is_time(0)]).
  124
  125
  126% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:44
  127% HoldsAt(Tired(James),1).
  128holds_at(tired(james),1).
  129
  130% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:46
  131% range time 0 1
  132% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:47
  133==> range(time,0,1).
  134
  135% range offset 1 1
  136% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:48
  137==> range(offset,1,1).
  138%; End of file.