1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 4 /* loading(always, 5 'examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e'). 6 */ 7%; 8%; Copyright (c) 2005 IBM Corporation and others. 9%; All rights reserved. This program and the accompanying materials 10%; are made available under the terms of the Common Public License v1.0 11%; which accompanies this distribution, and is available at 12%; http://www.eclipse.org/legal/cpl-v10.html 13%; 14%; Contributors: 15%; IBM - Initial implementation 16%; 17%; @book{Mueller:2006, 18%; author = "Erik T. Mueller", 19%; year = "2006", 20%; title = "Commonsense Reasoning", 21%; address = "San Francisco", 22%; publisher = "Morgan Kaufmann/Elsevier", 23%; } 24%; 25 26% option encoding 3 27:- set_ec_option(encoding, 3). 28 29% option trajectory on 30:- set_ec_option(trajectory, on). 31 32% load foundations/Root.e 33 34% load foundations/EC.e 35 36% sort object 37==> sort(object). 38 39% sort agent 40==> sort(agent). 41 42% sort height: integer 43==> subsort(height,integer). 44 45% agent Nathan 46==> t(agent,nathan). 47 48% object Apple 49==> t(object,apple). 50 51% fluent Falling(object) 52 % fluent(falling(object)). 53==> mpred_prop(falling(object),fluent). 54==> meta_argtypes(falling(object)). 55 56% fluent Height(object,height) 57 % fluent(height(object,height)). 58==> mpred_prop(height(object,height),fluent). 59==> meta_argtypes(height(object,height)). 60 61% noninertial Height 62==> noninertial(height). 63 64% event Drop(agent,object) 65 % event(drop(agent,object)). 66==> mpred_prop(drop(agent,object),event). 67==> meta_argtypes(drop(agent,object)). 68 69% event HitGround(object) 70 % event(hitGround(object)). 71==> mpred_prop(hitGround(object),event). 72==> meta_argtypes(hitGround(object)). 73 74 75% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:39 76%; Sigma 77% [agent,object,time] 78% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:42 79% Initiates(Drop(agent,object),Falling(object),time). 80axiom(initiates(drop(Agent, Object), falling(Object), Time), 81 []). 82 83 84% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:44 85% [object,time] 86% Terminates(HitGround(object),Falling(object),time). 87% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:45 88axiom(terminates(hitGround(Object), falling(Object), Time), 89 []). 90 91 92% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:47 93%; Delta 94 95% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:49 96% Delta: 97next_axiom_uses(delta). 98 99 100 101% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:49 102% [object,time] 103% HoldsAt(Falling(object),time) & 104% HoldsAt(Height(object,0),time) -> 105% Happens(HitGround(object),time). 106% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:52 107axiom(happens(hitGround(Object), Time), 108 109 [ holds_at(falling(Object), Time), 110 holds_at(height(Object, 0), Time) 111 ]). 112 113% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:54 114% Delta: 115next_axiom_uses(delta). 116 117 118 119% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:54 120% Happens(Drop(Nathan,Apple),0). 121axiom(happens(drop(nathan, apple), t), 122 [is_time(0)]). 123 124 125% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:56 126%; Psi 127% [object,height1,height2,time] 128% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:59 129% HoldsAt(Height(object,height1),time) & 130% HoldsAt(Height(object,height2),time) -> 131% height1=height2. 132% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:61 133axiom(Height1=Height2, 134 135 [ holds_at(height(Object, Height1), Time), 136 holds_at(height(Object, Height2), Time) 137 ]). 138 139 140% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:63 141%; Pi 142% [object,height1,height2,offset,time] 143% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:66 144% HoldsAt(Height(object,height1),time) & 145% height2 = (height1 - offset) -> 146% Trajectory(Falling(object),time,Height(object,height2),offset). 147% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:68 148axiom(trajectory(falling(Object), Time, height(Object, Height2), Offset), 149 150 [ holds_at(height(Object, Height1), Time), 151 equals(Height2, Height1-Offset) 152 ]). 153 154 155% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:70 156% [object,height,offset,time] 157% HoldsAt(Height(object,height),time) -> 158% AntiTrajectory(Falling(object),time,Height(object,height),offset). 159% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:72 160axiom(antiTrajectory(falling(Object), Time, height(Object, Height), Offset), 161 [holds_at(height(Object, Height), Time)]). 162 163 164% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:74 165%; Gamma 166 167 168% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:76 169% !HoldsAt(Falling(Apple),0). 170 % not(initially(falling(apple))). 171axiom(not(initially(falling(apple))), 172 []). 173 174 175% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:77 176% HoldsAt(Height(Apple,3),0). 177axiom(initially(height(apple, 3)), 178 []). 179 180% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:79 181% completion Delta Happens 182% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:80 183==> completion(delta). 184==> completion(happens). 185 186% range time 0 5 187% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:82 188==> range(time,0,5). 189 190% range height 0 3 191% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:83 192==> range(height,0,3). 193 194% range offset 1 3 195% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithAntiTrajectory.e:84 196==> range(offset,1,3). 197%; End of file.