1:-include(library('ec_planner/ec_test_incl')).    2:-expects_dialect(pfc).    3 %  loading(always,'foundations/ECCausal.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%; Causal Constraints
   15%;
   16%; @inproceedings{Shanahan:1999a,
   17%;   author = "Murray Shanahan",
   18%;   year = "1999",
   19%;   title = "The ramification problem in the event calculus",
   20%;   booktitle = "\uppercase{P}roceedings of the \uppercase{S}ixteenth \uppercase{I}nternational \uppercase{J}oint \uppercase{C}onference on \uppercase{A}rtificial \uppercase{I}ntelligence",
   21%;   pages = "140--146",
   22%;   address = "San Mateo, CA",
   23%;   publisher = "Morgan Kaufmann",
   24%; }
   25%;
   26
   27% predicate Started(fluent,time)
   28 %  predicate(started(fluent,time)).
   29==> mpred_prop(started(fluent,time),predicate).
   30==> meta_argtypes(started(fluent,time)).
   31
   32% predicate Stopped(fluent,time)
   33 %  predicate(stopped(fluent,time)).
   34==> mpred_prop(stopped(fluent,time),predicate).
   35==> meta_argtypes(stopped(fluent,time)).
   36
   37
   38% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:26
   39% [fluent,time]
   40% Started(fluent,time) <->
   41% (HoldsAt(fluent,time) |
   42%  ({event} Happens(event,time) & Initiates(event,fluent,time))).
   43
   44 /*  started(Fluent, Time) <->
   45       (   holds_at(Fluent, Time)
   46       ;   exists([Event],
   47                   (happens(Event, Time), initiates(Event, Fluent, Time)))
   48       ).
   49 */
   50% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:29
   51axiom(started(Fluent, Time),
   52    [holds_at(Fluent, Time)]).
   53axiom(started(Fluent, Time),
   54   
   55    [ happens(Event, Time),
   56      initiates(Event, Fluent, Time)
   57    ]).
   58
   59 /*   if(started(Fluent, Time),
   60          (holds_at(Fluent, Time);exists([Event],  (happens(Event, Time), initiates(Event, Fluent, Time))))).
   61 */
   62
   63 /*  not(started(Started_Param, Time3)) :-
   64       not(holds_at(Started_Param, Time3)),
   65       (   not(happens(Happens_Param, Time3))
   66       ;   not(initiates(Happens_Param, Started_Param, Time3))
   67       ).
   68 */
   69axiom(not(started(Started_Param, Time3)),
   70   
   71    [ not(happens(Happens_Param, Time3)),
   72      not(holds_at(Started_Param, Time3))
   73    ]).
   74axiom(not(started(Started_Param, Time3)),
   75   
   76    [ not(initiates(Happens_Param, Started_Param, Time3)),
   77      not(holds_at(Started_Param, Time3))
   78    ]).
   79
   80 /*  holds_at(Holds_at_Param, Time6) :-
   81       (   not(happens(Happens_Param8, Time6))
   82       ;   not(initiates(Happens_Param8, Holds_at_Param, Time6))
   83       ),
   84       started(Holds_at_Param, Time6).
   85 */
   86axiom(holds_at(Holds_at_Param, Time6),
   87   
   88    [ not(happens(Happens_Param8, Time6)),
   89      started(Holds_at_Param, Time6)
   90    ]).
   91axiom(holds_at(Holds_at_Param, Time6),
   92   
   93    [ not(initiates(Happens_Param8, Holds_at_Param, Time6)),
   94      started(Holds_at_Param, Time6)
   95    ]).
   96
   97 /*  happens(Happens_Param10, Maptime) :-
   98       not(holds_at(Holds_at_Param11, Maptime)),
   99       started(Holds_at_Param11, Maptime).
  100 */
  101axiom(happens(Happens_Param10, Maptime),
  102   
  103    [ not(holds_at(Holds_at_Param11, Maptime)),
  104      started(Holds_at_Param11, Maptime)
  105    ]).
  106
  107 /*  initiates(Initiates_Param, Holds_at_Param14, Time12) :-
  108       not(holds_at(Holds_at_Param14, Time12)),
  109       started(Holds_at_Param14, Time12).
  110 */
  111axiom(initiates(Initiates_Param, Holds_at_Param14, Time12),
  112   
  113    [ not(holds_at(Holds_at_Param14, Time12)),
  114      started(Holds_at_Param14, Time12)
  115    ]).
  116
  117
  118% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:31
  119% [fluent,time]
  120% Stopped(fluent,time) <->
  121% (!HoldsAt(fluent,time) |
  122%  ({event} Happens(event,time) & Terminates(event,fluent,time))).
  123
  124 /*  stopped(Fluent, Time) <->
  125       (   not(holds_at(Fluent, Time))
  126       ;   exists([Event],
  127                   (happens(Event, Time), terminates(Event, Fluent, Time)))
  128       ).
  129 */
  130% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:34
  131axiom(stopped(Fluent, Time),
  132    [not(holds_at(Fluent, Time))]).
  133axiom(stopped(Fluent, Time),
  134   
  135    [ happens(Event, Time),
  136      terminates(Event, Fluent, Time)
  137    ]).
  138
  139 /*   if(stopped(Fluent, Time),
  140          (not(holds_at(Fluent, Time));exists([Event],  (happens(Event, Time), terminates(Event, Fluent, Time))))).
  141 */
  142
  143 /*  not(stopped(Stopped_Param, Time3)) :-
  144       holds_at(Stopped_Param, Time3),
  145       (   not(happens(Happens_Param, Time3))
  146       ;   not(terminates(Happens_Param, Stopped_Param, Time3))
  147       ).
  148 */
  149axiom(not(stopped(Stopped_Param, Time3)),
  150   
  151    [ not(happens(Happens_Param, Time3)),
  152      holds_at(Stopped_Param, Time3)
  153    ]).
  154axiom(not(stopped(Stopped_Param, Time3)),
  155   
  156    [ not(terminates(Happens_Param, Stopped_Param, Time3)),
  157      holds_at(Stopped_Param, Time3)
  158    ]).
  159
  160 /*  not(holds_at(Holds_at_Param, Time6)) :-
  161       (   not(happens(Happens_Param8, Time6))
  162       ;   not(terminates(Happens_Param8, Holds_at_Param, Time6))
  163       ),
  164       stopped(Holds_at_Param, Time6).
  165 */
  166axiom(not(holds_at(Holds_at_Param, Time6)),
  167   
  168    [ not(happens(Happens_Param8, Time6)),
  169      stopped(Holds_at_Param, Time6)
  170    ]).
  171axiom(not(holds_at(Holds_at_Param, Time6)),
  172   
  173    [ not(terminates(Happens_Param8, Holds_at_Param, Time6)),
  174      stopped(Holds_at_Param, Time6)
  175    ]).
  176
  177 /*  happens(Happens_Param10, Maptime) :-
  178       holds_at(Holds_at_Param11, Maptime),
  179       stopped(Holds_at_Param11, Maptime).
  180 */
  181axiom(happens(Happens_Param10, Maptime),
  182   
  183    [ holds_at(Holds_at_Param11, Maptime),
  184      stopped(Holds_at_Param11, Maptime)
  185    ]).
  186
  187 /*  terminates(Terminates_Param, Holds_at_Param14, Time12) :-
  188       holds_at(Holds_at_Param14, Time12),
  189       stopped(Holds_at_Param14, Time12).
  190 */
  191axiom(terminates(Terminates_Param, Holds_at_Param14, Time12),
  192   
  193    [ holds_at(Holds_at_Param14, Time12),
  194      stopped(Holds_at_Param14, Time12)
  195    ]).
  196
  197% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:36
  198% predicate Initiated(fluent,time)
  199 %  predicate(initiated(fluent,time)).
  200% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:37
  201==> mpred_prop(initiated(fluent,time),predicate).
  202==> meta_argtypes(initiated(fluent,time)).
  203
  204% predicate Terminated(fluent,time)
  205 %  predicate(terminated(fluent,time)).
  206% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:38
  207==> mpred_prop(terminated(fluent,time),predicate).
  208==> meta_argtypes(terminated(fluent,time)).
  209
  210
  211% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:39
  212% [fluent,time]
  213% Initiated(fluent,time) <->
  214% (Started(fluent,time) &
  215%  !({event} Happens(event,time) & Terminates(event,fluent,time))).
  216
  217 /*  initiated(Fluent, Time) <->
  218       started(Fluent, Time),
  219       not(exists([Event],
  220                   (happens(Event, Time), terminates(Event, Fluent, Time)))).
  221 */
  222% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:42
  223axiom(initiated(Fluent, Time),
  224    [not(happens(Event, Time)), started(Fluent, Time)]).
  225axiom(initiated(Fluent, Time),
  226   
  227    [ not(terminates(Event, Fluent, Time)),
  228      started(Fluent, Time)
  229    ]).
  230
  231 /*   if(initiated(Fluent, Time),
  232          (started(Fluent, Time), not(exists([Event],  (happens(Event, Time), terminates(Event, Fluent, Time)))))).
  233 */
  234
  235 /*  not(initiated(Initiated_Param, Maptime)) :-
  236       (   not(started(Initiated_Param, Maptime))
  237       ;   happens(Happens_Param, Maptime),
  238           terminates(Happens_Param, Initiated_Param, Maptime)
  239       ).
  240 */
  241axiom(not(initiated(Initiated_Param, Maptime)),
  242    [not(started(Initiated_Param, Maptime))]).
  243axiom(not(initiated(Initiated_Param, Maptime)),
  244   
  245    [ happens(Happens_Param, Maptime),
  246      terminates(Happens_Param, Initiated_Param, Maptime)
  247    ]).
  248
  249 /*  started(Started_Param, Started_Ret) :-
  250       initiated(Started_Param, Started_Ret).
  251 */
  252axiom(started(Started_Param, Started_Ret),
  253    [initiated(Started_Param, Started_Ret)]).
  254
  255 /*  not(happens(Happens_Param9, Maptime8)) :-
  256       terminates(Happens_Param9, Initiated_Param10, Maptime8),
  257       initiated(Initiated_Param10, Maptime8).
  258 */
  259axiom(not(happens(Happens_Param9, Maptime8)),
  260   
  261    [ terminates(Happens_Param9, Initiated_Param10, Maptime8),
  262      initiated(Initiated_Param10, Maptime8)
  263    ]).
  264
  265 /*  not(terminates(Terminates_Param, Initiated_Param13, Maptime11)) :-
  266       happens(Terminates_Param, Maptime11),
  267       initiated(Initiated_Param13, Maptime11).
  268 */
  269axiom(not(terminates(Terminates_Param, Initiated_Param13, Maptime11)),
  270   
  271    [ happens(Terminates_Param, Maptime11),
  272      initiated(Initiated_Param13, Maptime11)
  273    ]).
  274
  275
  276% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:44
  277% [fluent,time]
  278% Terminated(fluent,time) <->
  279% (Stopped(fluent,time) &
  280%  !({event} Happens(event,time) & Initiates(event,fluent,time))).
  281
  282 /*  terminated(Fluent, Time) <->
  283       stopped(Fluent, Time),
  284       not(exists([Event],
  285                   (happens(Event, Time), initiates(Event, Fluent, Time)))).
  286 */
  287% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:47
  288axiom(terminated(Fluent, Time),
  289    [not(happens(Event, Time)), stopped(Fluent, Time)]).
  290axiom(terminated(Fluent, Time),
  291   
  292    [ not(initiates(Event, Fluent, Time)),
  293      stopped(Fluent, Time)
  294    ]).
  295
  296 /*   if(terminated(Fluent, Time),
  297          (stopped(Fluent, Time), not(exists([Event],  (happens(Event, Time), initiates(Event, Fluent, Time)))))).
  298 */
  299
  300 /*  not(terminated(Terminated_Param, Maptime)) :-
  301       (   not(stopped(Terminated_Param, Maptime))
  302       ;   happens(Happens_Param, Maptime),
  303           initiates(Happens_Param, Terminated_Param, Maptime)
  304       ).
  305 */
  306axiom(not(terminated(Terminated_Param, Maptime)),
  307    [not(stopped(Terminated_Param, Maptime))]).
  308axiom(not(terminated(Terminated_Param, Maptime)),
  309   
  310    [ happens(Happens_Param, Maptime),
  311      initiates(Happens_Param, Terminated_Param, Maptime)
  312    ]).
  313
  314 /*  stopped(Stopped_Param, Stopped_Ret) :-
  315       terminated(Stopped_Param, Stopped_Ret).
  316 */
  317axiom(stopped(Stopped_Param, Stopped_Ret),
  318    [terminated(Stopped_Param, Stopped_Ret)]).
  319
  320 /*  not(happens(Happens_Param9, Maptime8)) :-
  321       initiates(Happens_Param9, Terminated_Param10, Maptime8),
  322       terminated(Terminated_Param10, Maptime8).
  323 */
  324axiom(not(happens(Happens_Param9, Maptime8)),
  325   
  326    [ initiates(Happens_Param9, Terminated_Param10, Maptime8),
  327      terminated(Terminated_Param10, Maptime8)
  328    ]).
  329
  330 /*  not(initiates(Initiates_Param, Terminated_Param13, Maptime11)) :-
  331       happens(Initiates_Param, Maptime11),
  332       terminated(Terminated_Param13, Maptime11).
  333 */
  334axiom(not(initiates(Initiates_Param, Terminated_Param13, Maptime11)),
  335   
  336    [ happens(Initiates_Param, Maptime11),
  337      terminated(Terminated_Param13, Maptime11)
  338    ]).
  339
  340
  341% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/foundations/ECCausal.e:49
  342%; End of file.