1:-include(library('ec_planner/ec_test_incl')).    2:-expects_dialect(pfc).    3 %  loading(always,'examples/Shanahan1999/ChessBoard.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%; due to Raymond Reiter
   15%;
   16%; @inproceedings{KarthaLifschitz:1994,
   17%;   author = "G. Neelakantan Kartha and Vladimir Lifschitz",
   18%;   year = "1994",
   19%;   title = "Actions with indirect effects (preliminary report)",
   20%;   editor = "Jon Doyle and Erik Sandewall and Pietro Torasso",
   21%;   booktitle = "\uppercase{P}roceedings of the \uppercase{F}ourth \uppercase{I}nternational \uppercase{C}onference on \uppercase{P}rinciples of \uppercase{K}nowledge \uppercase{R}epresentation and \uppercase{R}easoning",
   22%;   pages = "341--350",
   23%;   address = "San Francisco",
   24%;   publisher = "Morgan Kaufmann",
   25%; }
   26%;
   27%; @incollection{Shanahan:1999,
   28%;   author = "Shanahan, Murray",
   29%;   year = "1999",
   30%;   title = "The Event Calculus explained",
   31%;   editor = "Michael J. Wooldridge and Manuela M. Veloso",
   32%;   booktitle = "Artificial Intelligence Today: Recent Trends and Developments",
   33%;   series = "Lecture Notes in Computer Science",
   34%;   volume = "1600",
   35%;   pages = "409--430",
   36%;   address = "Berlin",
   37%;   publisher = "Springer",
   38%; }
   39%;
   40%; model finding
   41%;
   42%; modifications from Shanahan's formulation:
   43%; InitiallyN -> !HoldsAt
   44%; pruning of models irrelevant to example
   45%; timestamps
   46%;
   47
   48% load foundations/Root.e
   49
   50% load foundations/EC.e
   51
   52% event Throw()
   53 %  event(throw()).
   54==> mpred_prop(throw(),event).
   55==> meta_argtypes(throw()).
   56
   57% fluent ItsBlack()
   58 %  fluent(itsBlack()).
   59==> mpred_prop(itsBlack(),fluent).
   60==> meta_argtypes(itsBlack()).
   61
   62% fluent ItsWhite()
   63 %  fluent(itsWhite()).
   64==> mpred_prop(itsWhite(),fluent).
   65==> meta_argtypes(itsWhite()).
   66
   67% fluent OnBlack()
   68 %  fluent(onBlack()).
   69==> mpred_prop(onBlack(),fluent).
   70==> meta_argtypes(onBlack()).
   71
   72% fluent OnWhite()
   73 %  fluent(onWhite()).
   74==> mpred_prop(onWhite(),fluent).
   75==> meta_argtypes(onWhite()).
   76
   77% noninertial ItsBlack, ItsWhite
   78==> noninertial(itsBlack).
   79==> noninertial(itsWhite).
   80
   81
   82% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:54
   83% [time]
   84% HoldsAt(ItsWhite(),time) ->
   85% Initiates(Throw(),OnWhite(),time).
   86% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:56
   87axiom(initiates(throw(), onWhite(), Time),
   88    [holds_at(itsWhite(), Time)]).
   89
   90
   91% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:58
   92% [time]
   93% HoldsAt(ItsBlack(),time) ->
   94% Initiates(Throw(),OnBlack(),time).
   95% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:60
   96axiom(initiates(throw(), onBlack(), Time),
   97    [holds_at(itsBlack(), Time)]).
   98
   99
  100% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:62
  101% [time]
  102 % HoldsAt(ItsWhite(),time) | HoldsAt(ItsBlack(),time).
  103
  104 /*   (   holds_at(itsWhite(), Time)
  105      ;   holds_at(itsBlack(), Time)
  106      ).
  107 */
  108
  109 /*  holds_at(itsWhite(), Time1) :-
  110       not(holds_at(itsBlack(), Time1)).
  111 */
  112axiom(holds_at(itsWhite(), Time1),
  113    [not(holds_at(itsBlack(), Time1))]).
  114
  115 /*  holds_at(itsBlack(), Time2) :-
  116       not(holds_at(itsWhite(), Time2)).
  117 */
  118axiom(holds_at(itsBlack(), Time2),
  119    [not(holds_at(itsWhite(), Time2))]).
  120
  121
  122% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:64
  123% !HoldsAt(OnWhite(),0).
  124 %  not(initially(onWhite())).
  125axiom(not(initially(onWhite())),
  126    []).
  127
  128
  129% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:65
  130% !HoldsAt(OnBlack(),0).
  131 %  not(initially(onBlack())).
  132axiom(not(initially(onBlack())),
  133    []).
  134
  135
  136% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:66
  137% Happens(Throw(),1).
  138axiom(happens(throw(), start),
  139    [is_time(1), b(t, start), ignore(t+1=start)]).
  140
  141
  142% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:68
  143%; prune models irrelevant to example:
  144
  145
  146% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:69
  147% HoldsAt(ItsWhite(),0).
  148axiom(initially(itsWhite()),
  149    []).
  150
  151
  152% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:70
  153% HoldsAt(ItsBlack(),0).
  154axiom(initially(itsBlack()),
  155    []).
  156
  157
  158% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:71
  159% HoldsAt(ItsWhite(),2).
  160holds_at(itsWhite(),2).
  161
  162
  163% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:72
  164% HoldsAt(ItsBlack(),2).
  165holds_at(itsBlack(),2).
  166
  167% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:74
  168% completion Happens
  169% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:75
  170==> completion(happens).
  171
  172% range time 0 2
  173% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:77
  174==> range(time,0,2).
  175
  176% range offset 1 1
  177% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:78
  178==> range(offset,1,1).
  179%; End of file.