1:-include(library('ec_planner/ec_test_incl')).    2:-expects_dialect(pfc).    3 %  loading(always,'examples/Shanahan1999/ThielscherCircuit.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%; @article{Thielscher:1997,
   15%;   author = "Michael Thielscher",
   16%;   year = "1997",
   17%;   title = "Ramification and causality",
   18%;   journal = "Artificial Intelligence",
   19%;   volume = "89",
   20%;   pages = "317--364",
   21%; }
   22%;
   23%; @incollection{Shanahan:1999,
   24%;   author = "Shanahan, Murray",
   25%;   year = "1999",
   26%;   title = "The Event Calculus explained",
   27%;   editor = "Michael J. Wooldridge and Manuela M. Veloso",
   28%;   booktitle = "Artificial Intelligence Today: Recent Trends and Developments",
   29%;   series = "Lecture Notes in Computer Science",
   30%;   volume = "1600",
   31%;   pages = "409--430",
   32%;   address = "Berlin",
   33%;   publisher = "Springer",
   34%; }
   35%;
   36%; deduction
   37%;
   38%; modifications from Shanahan's formulation:
   39%; timestamps
   40%;
   41
   42% load foundations/Root.e
   43
   44% load foundations/EC.e
   45
   46% load foundations/ECCausal.e
   47
   48% event LightOn()
   49 %  event(lightOn()).
   50==> mpred_prop(lightOn(),event).
   51==> meta_argtypes(lightOn()).
   52
   53% event Close1()
   54 %  event(close1()).
   55==> mpred_prop(close1(),event).
   56==> meta_argtypes(close1()).
   57
   58% event Open2()
   59 %  event(open2()).
   60==> mpred_prop(open2(),event).
   61==> meta_argtypes(open2()).
   62
   63% event CloseRelay()
   64 %  event(closeRelay()).
   65==> mpred_prop(closeRelay(),event).
   66==> meta_argtypes(closeRelay()).
   67
   68% fluent Light()
   69 %  fluent(light()).
   70==> mpred_prop(light(),fluent).
   71==> meta_argtypes(light()).
   72
   73% fluent Switch1()
   74 %  fluent(switch1()).
   75==> mpred_prop(switch1(),fluent).
   76==> meta_argtypes(switch1()).
   77
   78% fluent Switch2()
   79 %  fluent(switch2()).
   80==> mpred_prop(switch2(),fluent).
   81==> meta_argtypes(switch2()).
   82
   83% fluent Switch3()
   84 %  fluent(switch3()).
   85==> mpred_prop(switch3(),fluent).
   86==> meta_argtypes(switch3()).
   87
   88% fluent Relay()
   89 %  fluent(relay()).
   90==> mpred_prop(relay(),fluent).
   91==> meta_argtypes(relay()).
   92
   93
   94% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:53
   95% [time]
   96% Stopped(Light(),time) &
   97% Initiated(Switch1(),time) &
   98% Initiated(Switch2(),time) ->
   99% Happens(LightOn(),time).
  100% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:57
  101axiom(happens(lightOn(), Time),
  102   
  103    [ stopped(light(), Time),
  104      initiated(switch1(), Time),
  105      initiated(switch2(), Time)
  106    ]).
  107
  108
  109% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:59
  110% [time]
  111% Started(Switch2(),time) &
  112% Initiated(Relay(),time) ->
  113% Happens(Open2(),time).
  114% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:62
  115axiom(happens(open2(), Time),
  116    [started(switch2(), Time), initiated(relay(), Time)]).
  117
  118
  119% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:64
  120% [time]
  121% Stopped(Relay(),time) &
  122% Initiated(Switch1(),time) &
  123% Initiated(Switch3(),time) ->
  124% Happens(CloseRelay(),time).
  125% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:68
  126axiom(happens(closeRelay(), Time),
  127   
  128    [ stopped(relay(), Time),
  129      initiated(switch1(), Time),
  130      initiated(switch3(), Time)
  131    ]).
  132
  133
  134% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:70
  135% [time]
  136 % Initiates(LightOn(),Light(),time).
  137axiom(initiates(lightOn(), light(), Time),
  138    []).
  139
  140
  141% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:72
  142% [time]
  143 % Terminates(Open2(),Switch2(),time).
  144axiom(terminates(open2(), switch2(), Time),
  145    []).
  146
  147
  148% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:74
  149% [time]
  150 % Initiates(CloseRelay(),Relay(),time).
  151axiom(initiates(closeRelay(), relay(), Time),
  152    []).
  153
  154
  155% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:76
  156% [time]
  157 % Initiates(Close1(),Switch1(),time).
  158axiom(initiates(close1(), switch1(), Time),
  159    []).
  160
  161
  162% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:78
  163% !HoldsAt(Switch1(),0).
  164 %  not(initially(switch1())).
  165axiom(not(initially(switch1())),
  166    []).
  167
  168
  169% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:79
  170% HoldsAt(Switch2(),0).
  171axiom(initially(switch2()),
  172    []).
  173
  174
  175% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:80
  176% HoldsAt(Switch3(),0).
  177axiom(initially(switch3()),
  178    []).
  179
  180
  181% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:81
  182% !HoldsAt(Relay(),0).
  183 %  not(initially(relay())).
  184axiom(not(initially(relay())),
  185    []).
  186
  187
  188% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:82
  189% !HoldsAt(Light(),0).
  190 %  not(initially(light())).
  191axiom(not(initially(light())),
  192    []).
  193
  194
  195% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:84
  196% Happens(Close1(),0).
  197axiom(happens(close1(), t),
  198    [is_time(0)]).
  199
  200% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:86
  201% completion Happens
  202% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:87
  203==> completion(happens).
  204
  205% range time 0 1
  206% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:89
  207==> range(time,0,1).
  208
  209% range offset 1 1
  210% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:90
  211==> range(offset,1,1).
  212%; End of file.