1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2006/Chapter7/FallingObjectWithEvents.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 object 28==> sort(object). 29 30% sort agent 31==> sort(agent). 32 33% sort height: integer 34==> subsort(height,integer). 35 36% agent Nathan 37==> t(agent,nathan). 38 39% object Apple 40==> t(object,apple). 41 42% fluent Falling(object) 43 % fluent(falling(object)). 44==> mpred_prop(falling(object),fluent). 45==> meta_argtypes(falling(object)). 46 47% fluent Height(object,height) 48 % fluent(height(object,height)). 49==> mpred_prop(height(object,height),fluent). 50==> meta_argtypes(height(object,height)). 51 52% event Drop(agent,object) 53 % event(drop(agent,object)). 54==> mpred_prop(drop(agent,object),event). 55==> meta_argtypes(drop(agent,object)). 56 57% event HitGround(object) 58 % event(hitGround(object)). 59==> mpred_prop(hitGround(object),event). 60==> meta_argtypes(hitGround(object)). 61 62 63% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:35 64%; Sigma 65% [agent,object,time] 66% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:38 67% Initiates(Drop(agent,object),Falling(object),time). 68axiom(initiates(drop(Agent, Object), falling(Object), Time), 69 []). 70 71 72% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:40 73% [agent,object,height,time] 74% Releases(Drop(agent,object),Height(object,height),time). 75% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:41 76axiom(releases(drop(Agent, Object), height(Object, Height), Time), 77 []). 78 79 80% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:43 81% [object,time] 82% Terminates(HitGround(object),Falling(object),time). 83% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:44 84axiom(terminates(hitGround(Object), falling(Object), Time), 85 []). 86 87 88% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:46 89% [object,height,time] 90% HoldsAt(Height(object,height),time) -> 91% Initiates(HitGround(object),Height(object,height),time). 92% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:48 93axiom(initiates(hitGround(Object), height(Object, Height), Time), 94 [holds_at(height(Object, Height), Time)]). 95 96 97% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:50 98%; Delta 99 100% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:52 101% Delta: 102next_axiom_uses(delta). 103 104 105 106% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:52 107% [object,time] 108% HoldsAt(Falling(object),time) & 109% HoldsAt(Height(object,0),time) -> 110% Happens(HitGround(object),time). 111% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:55 112axiom(happens(hitGround(Object), Time), 113 114 [ holds_at(falling(Object), Time), 115 holds_at(height(Object, 0), Time) 116 ]). 117 118% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:57 119% Delta: 120next_axiom_uses(delta). 121 122 123 124% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:57 125% Happens(Drop(Nathan,Apple),0). 126axiom(happens(drop(nathan, apple), t), 127 [is_time(0)]). 128 129 130% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:59 131%; Psi 132% [object,height1,height2,time] 133% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:62 134% HoldsAt(Height(object,height1),time) & 135% HoldsAt(Height(object,height2),time) -> 136% height1=height2. 137% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:64 138axiom(Height1=Height2, 139 140 [ holds_at(height(Object, Height1), Time), 141 holds_at(height(Object, Height2), Time) 142 ]). 143 144 145% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:66 146%; Pi 147% [object,height1,height2,offset,time] 148% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:69 149% HoldsAt(Height(object,height1),time) & 150% height2 = (height1 - offset) -> 151% Trajectory(Falling(object),time,Height(object,height2),offset). 152% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:71 153axiom(trajectory(falling(Object), Time, height(Object, Height2), Offset), 154 155 [ holds_at(height(Object, Height1), Time), 156 equals(Height2, Height1-Offset) 157 ]). 158 159 160% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:73 161%; Gamma 162 163 164% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:75 165% !HoldsAt(Falling(Apple),0). 166 % not(initially(falling(apple))). 167axiom(not(initially(falling(apple))), 168 []). 169 170 171% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:76 172% HoldsAt(Height(Apple,3),0). 173axiom(initially(height(apple, 3)), 174 []). 175 176% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:78 177% completion Delta Happens 178% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:79 179==> completion(delta). 180==> completion(happens). 181 182% range time 0 5 183% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:81 184==> range(time,0,5). 185 186% range height 0 3 187% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:82 188==> range(height,0,3). 189 190% range offset 1 3 191% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter7/FallingObjectWithEvents.e:83 192==> range(offset,1,3). 193%; End of file.