1:-include(library('ec_planner/ec_test_incl')).    2:-expects_dialect(pfc).    3 %  loading(always,'examples/Mueller2006/Exercises/MixingPaints.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 palette
   28==> sort(palette).
   29
   30% sort color
   31==> sort(color).
   32
   33% palette Palette1
   34==> t(palette,palette1).
   35
   36% color Red, Yellow, Blue, Green
   37==> t(color,red).
   38==> t(color,yellow).
   39==> t(color,blue).
   40==> t(color,green).
   41
   42% event PlaceOnPalette(palette,color)
   43 %  event(placeOnPalette(palette,color)).
   44==> mpred_prop(placeOnPalette(palette,color),event).
   45==> meta_argtypes(placeOnPalette(palette,color)).
   46
   47% fluent OnPalette(palette,color)
   48 %  fluent(onPalette(palette,color)).
   49==> mpred_prop(onPalette(palette,color),fluent).
   50==> meta_argtypes(onPalette(palette,color)).
   51
   52
   53% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:31
   54% [palette,color,time]
   55% !Happens(PlaceOnPalette(palette,Yellow),time) |
   56% !Happens(PlaceOnPalette(palette,Blue),time) ->
   57% Initiates(PlaceOnPalette(palette,color),OnPalette(palette,color),time).
   58% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:34
   59axiom(initiates(placeOnPalette(Palette, Color), onPalette(Palette, Color), Time),
   60    [not(happens(placeOnPalette(Palette, yellow), Time))]).
   61axiom(initiates(placeOnPalette(Palette, Color), onPalette(Palette, Color), Time),
   62    [not(happens(placeOnPalette(Palette, blue), Time))]).
   63
   64
   65% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:36
   66% [palette,color1,color2,time]
   67% Happens(PlaceOnPalette(palette,Yellow),time) &
   68% color1 = Blue &
   69% color2 = Green ->
   70% Initiates(PlaceOnPalette(palette,color1),OnPalette(palette,color2),time).
   71% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:40
   72axiom(initiates(placeOnPalette(Palette, Color1), onPalette(Palette, Color2), Time),
   73   
   74    [ happens(placeOnPalette(Palette, yellow), Time),
   75      equals(Color1, blue),
   76      equals(Color2, green)
   77    ]).
   78
   79
   80% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:42
   81% [palette,color1,color2,time]
   82% !(Happens(PlaceOnPalette(palette,Yellow),time) &
   83%   Happens(PlaceOnPalette(palette,Blue),time)) &
   84% HoldsAt(OnPalette(palette,color1),time) &
   85% color1 != color2 ->
   86% Terminates(PlaceOnPalette(palette,color2),OnPalette(palette,color1),time).
   87% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:47
   88axiom(terminates(placeOnPalette(Palette, Color2), onPalette(Palette, Color1), Time),
   89   
   90    [ not(happens(placeOnPalette(Palette, yellow), Time)),
   91      holds_at(onPalette(Palette, Color1), Time),
   92      { dif(Color1, Color2)
   93      }
   94    ]).
   95axiom(terminates(placeOnPalette(Palette, Color2), onPalette(Palette, Color1), Time),
   96   
   97    [ not(happens(placeOnPalette(Palette, blue), Time)),
   98      holds_at(onPalette(Palette, Color1), Time),
   99      { dif(Color1, Color2)
  100      }
  101    ]).
  102
  103
  104% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:49
  105% [palette,color1,color2,time]
  106% Happens(PlaceOnPalette(palette,Yellow),time) &
  107% HoldsAt(OnPalette(palette,color2),time) &
  108% color1 = Blue &
  109% color2 != Green ->
  110% Terminates(PlaceOnPalette(palette,color1),OnPalette(palette,color2),time).
  111% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:54
  112axiom(terminates(placeOnPalette(Palette, Color1), onPalette(Palette, Color2), Time),
  113   
  114    [ happens(placeOnPalette(Palette, yellow), Time),
  115      holds_at(onPalette(Palette, Color2), Time),
  116      equals(Color1, blue),
  117      { dif(Color2, green)
  118      }
  119    ]).
  120
  121
  122% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:56
  123%; state constraint
  124% [palette,color1,color2,time]
  125% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:59
  126% HoldsAt(OnPalette(palette,color1),time) &
  127% HoldsAt(OnPalette(palette,color2),time) ->
  128% color1 = color2.
  129% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:61
  130axiom(Color1=Color2,
  131   
  132    [ holds_at(onPalette(Palette, Color1), Time),
  133      holds_at(onPalette(Palette, Color2), Time)
  134    ]).
  135
  136
  137% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:63
  138%; (1) place green over red
  139
  140
  141% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:64
  142% HoldsAt(OnPalette(Palette1,Red),0).
  143axiom(initially(onPalette(palette1, red)),
  144    []).
  145
  146% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:65
  147% Delta: 
  148next_axiom_uses(delta).
  149 
  150
  151
  152% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:65
  153% Happens(PlaceOnPalette(Palette1,Green),0).
  154axiom(happens(placeOnPalette(palette1, green), t),
  155    [is_time(0)]).
  156
  157
  158% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:67
  159%; (2) place yellow+blue over green
  160
  161% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:68
  162% Delta: 
  163next_axiom_uses(delta).
  164 
  165
  166
  167% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:68
  168% Happens(PlaceOnPalette(Palette1,Yellow),1).
  169axiom(happens(placeOnPalette(palette1, yellow), start),
  170    [is_time(1), b(t, start), ignore(t+1=start)]).
  171
  172% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:69
  173% Delta: 
  174next_axiom_uses(delta).
  175 
  176
  177
  178% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:69
  179% Happens(PlaceOnPalette(Palette1,Blue),1).
  180axiom(happens(placeOnPalette(palette1, blue), start),
  181    [is_time(1), b(t, start), ignore(t+1=start)]).
  182
  183
  184% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:71
  185%; (3) place yellow
  186
  187% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:72
  188% Delta: 
  189next_axiom_uses(delta).
  190 
  191
  192
  193% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:72
  194% Happens(PlaceOnPalette(Palette1,Yellow),2).
  195axiom(happens(placeOnPalette(palette1, yellow), t2),
  196    [is_time(2), b(t, t2), ignore(t+2=t2)]).
  197
  198
  199% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:74
  200%; (4) place blue
  201
  202% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:75
  203% Delta: 
  204next_axiom_uses(delta).
  205 
  206
  207
  208% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:75
  209% Happens(PlaceOnPalette(Palette1,Blue),3).
  210axiom(happens(placeOnPalette(palette1, blue), t3),
  211    [is_time(3), b(t, t3), ignore(t+3=t3)]).
  212
  213
  214% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:77
  215%; (5) place green
  216
  217% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:78
  218% Delta: 
  219next_axiom_uses(delta).
  220 
  221
  222
  223% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:78
  224% Happens(PlaceOnPalette(Palette1,Yellow),4).
  225axiom(happens(placeOnPalette(palette1, yellow), t4),
  226    [is_time(4), b(t, t4), ignore(t+4=t4)]).
  227
  228% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:79
  229% Delta: 
  230next_axiom_uses(delta).
  231 
  232
  233
  234% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:79
  235% Happens(PlaceOnPalette(Palette1,Blue),4).
  236axiom(happens(placeOnPalette(palette1, blue), t4),
  237    [is_time(4), b(t, t4), ignore(t+4=t4)]).
  238
  239% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:81
  240% completion Delta Happens
  241% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:82
  242==> completion(delta).
  243==> completion(happens).
  244
  245% range time 0 5
  246% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:84
  247==> range(time,0,5).
  248
  249% range offset 1 1
  250% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Exercises/MixingPaints.e:85
  251==> range(offset,1,1).
  252%; End of file.