1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 24
26:- set_ec_option(trajectory, on). 27
28% sort xschema
29==> sort(xschema).
30%; parameters
31
32% predicate XWalkAgent(xschema,agent)
33 % predicate(xWalkAgent(xschema,agent)).
34==> mpred_prop(xWalkAgent(xschema,agent),predicate).
35==> meta_argtypes(xWalkAgent(xschema,agent)).
36
37% function XWalkRate(xschema): offset ; step duration
38 % functional_predicate(xWalkRate(xschema,[offset,;,step,duration])).
39==> mpred_prop(xWalkRate(xschema,[offset,;,step,duration]),
40 functional_predicate).
41==> meta_argtypes(xWalkRate(xschema,[offset,;,step,duration])).
42resultIsa(xWalkRate,[offset,;,step,duration]).
43
44% function XWalkSize(xschema): offset ; step size
45 % functional_predicate(xWalkSize(xschema,[offset,;,step,size])).
46==> mpred_prop(xWalkSize(xschema,[offset,;,step,size]),
47 functional_predicate).
48==> meta_argtypes(xWalkSize(xschema,[offset,;,step,size])).
49resultIsa(xWalkSize,[offset,;,step,size]).
50%; TTL input lines
51
52% fluent XWalkEnabled(xschema)
53 % fluent(xWalkEnabled(xschema)).
54==> mpred_prop(xWalkEnabled(xschema),fluent).
55==> meta_argtypes(xWalkEnabled(xschema)).
56
57% fluent XWalkGroundStable(xschema)
58 % fluent(xWalkGroundStable(xschema)).
59==> mpred_prop(xWalkGroundStable(xschema),fluent).
60==> meta_argtypes(xWalkGroundStable(xschema)).
61
62% fluent XWalkPosture(xschema)
63 % fluent(xWalkPosture(xschema)).
64==> mpred_prop(xWalkPosture(xschema),fluent).
65==> meta_argtypes(xWalkPosture(xschema)).
66
67% fluent XWalkFootingOK(xschema)
68 % fluent(xWalkFootingOK(xschema)).
69==> mpred_prop(xWalkFootingOK(xschema),fluent).
70==> meta_argtypes(xWalkFootingOK(xschema)).
71
72% noninertial XWalkEnabled, XWalkGroundStable, XWalkPosture, XWalkFootingOK
73==> noninertial(xWalkEnabled).
74==> noninertial(xWalkGroundStable).
75==> noninertial(xWalkPosture).
76==> noninertial(xWalkFootingOK).
77%; fluents
78
79% fluent XWalkDistance(xschema,distance)
80 % fluent(xWalkDistance(xschema,distance)).
81==> mpred_prop(xWalkDistance(xschema,distance),fluent).
82==> meta_argtypes(xWalkDistance(xschema,distance)).
83
84
91axiom(Distance1=Distance2,
92
93 [ holds_at(xWalkDistance(Xschema, Distance1), Time),
94 holds_at(xWalkDistance(Xschema, Distance2), Time)
95 ]).
96
97
98% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:48
99%; logic gate behavior
100
101% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:50
102% fluent XWalkVision(xschema)
103 % fluent(xWalkVision(xschema)).
104% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:51
105==> mpred_prop(xWalkVision(xschema),fluent).
106==> meta_argtypes(xWalkVision(xschema)).
107
108% fluent XWalkVisionOK(xschema)
109 % fluent(xWalkVisionOK(xschema)).
110% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:52
111==> mpred_prop(xWalkVisionOK(xschema),fluent).
112==> meta_argtypes(xWalkVisionOK(xschema)).
113
114% fluent XWalkAtDestination(xschema)
115 % fluent(xWalkAtDestination(xschema)).
116% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:53
117==> mpred_prop(xWalkAtDestination(xschema),fluent).
118==> meta_argtypes(xWalkAtDestination(xschema)).
119
120% fluent XWalkDone(xschema)
121 % fluent(xWalkDone(xschema)).
122% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:54
123==> mpred_prop(xWalkDone(xschema),fluent).
124==> meta_argtypes(xWalkDone(xschema)).
125
126% noninertial XWalkVision, XWalkVisionOK, XWalkAtDestination, XWalkDone
127% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:55
128==> noninertial(xWalkVision).
129==> noninertial(xWalkVisionOK).
130==> noninertial(xWalkAtDestination).
131==> noninertial(xWalkDone).
132
133
138
139 143axiom(holds_at(xWalkGroundStable(Xschema), Time),
144 [holds_at(xWalkVision(Xschema), Time)]).
145axiom(holds_at(xWalkVision(Xschema), Time),
146 [holds_at(xWalkGroundStable(Xschema), Time)]).
147
148
155
156 159
160 163
164 171axiom(not(holds_at(xWalkVisionOK(XWalkVisionOK_Ret), Time2)),
172 [not(holds_at(xWalkEnabled(XWalkVisionOK_Ret), Time2))]).
173axiom(not(holds_at(xWalkVisionOK(XWalkVisionOK_Ret), Time2)),
174 [not(holds_at(xWalkVision(XWalkVisionOK_Ret), Time2))]).
175axiom(not(holds_at(xWalkVisionOK(XWalkVisionOK_Ret), Time2)),
176 [not(holds_at(xWalkPosture(XWalkVisionOK_Ret), Time2))]).
177
178 181axiom(holds_at(xWalkEnabled(XWalkEnabled_Ret), Time4),
182 [holds_at(xWalkVisionOK(XWalkEnabled_Ret), Time4)]).
183
184 187axiom(holds_at(xWalkVision(XWalkVision_Ret), Time6),
188 [holds_at(xWalkVisionOK(XWalkVision_Ret), Time6)]).
189
190 193axiom(holds_at(xWalkPosture(XWalkPosture_Ret), Time8),
194 [holds_at(xWalkVisionOK(XWalkPosture_Ret), Time8)]).
195axiom(holds_at(xWalkVisionOK(Xschema), Time),
196
197 [ holds_at(xWalkEnabled(Xschema), Time),
198 holds_at(xWalkVision(Xschema), Time),
199 holds_at(xWalkPosture(Xschema), Time)
200 ]).
201
202
207
208 212axiom(holds_at(xWalkDistance(Xschema, 0), Time),
213 [holds_at(xWalkAtDestination(Xschema), Time)]).
214axiom(holds_at(xWalkAtDestination(Xschema), Time),
215 [holds_at(xWalkDistance(Xschema, 0), Time)]).
216
217
222
223 227axiom(holds_at(xWalkAtDestination(Xschema), Time),
228 [holds_at(xWalkDone(Xschema), Time)]).
229axiom(holds_at(xWalkDone(Xschema), Time),
230 [holds_at(xWalkAtDestination(Xschema), Time)]).
231
232
233% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:74
234%; durative events
235%; distance is the goal
236
237% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:77
238% fluent XWalkStepping(xschema,distance)
239 % fluent(xWalkStepping(xschema,distance)).
240% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:78
241==> mpred_prop(xWalkStepping(xschema,distance),fluent).
242==> meta_argtypes(xWalkStepping(xschema,distance)).
243
244% event XWalkSteppingOn(xschema)
245 % event(xWalkSteppingOn(xschema)).
246% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:79
247==> mpred_prop(xWalkSteppingOn(xschema),event).
248==> meta_argtypes(xWalkSteppingOn(xschema)).
249
250% event XWalkSteppingOff(xschema)
251 % event(xWalkSteppingOff(xschema)).
252% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:80
253==> mpred_prop(xWalkSteppingOff(xschema),event).
254==> meta_argtypes(xWalkSteppingOff(xschema)).
255
256
263axiom(initiates(xWalkSteppingOn(Xschema), xWalkStepping(Xschema, Distance2), Time),
264
265 [ holds_at(xWalkDistance(Xschema, Distance1), Time),
266 equals(Distance2, Distance1-xWalkSize(Xschema))
267 ]).
268
269
274axiom(terminates(xWalkSteppingOff(Xschema), xWalkStepping(Xschema, Distance), Time),
275 []).
276
277
282axiom(releases(xWalkSteppingOn(Xschema), xWalkDistance(Xschema, Distance), Time),
283 []).
284
285
292axiom(terminates(xWalkSteppingOff(Xschema), xWalkDistance(Xschema, Distance2), Time),
293
294 [ holds_at(xWalkDistance(Xschema, Distance1), Time),
295 { dif(Distance1, Distance2)
296 }
297 ]).
298
299
305axiom(initiates(xWalkSteppingOff(Xschema), xWalkDistance(Xschema, Distance), Time),
306 [holds_at(xWalkDistance(Xschema, Distance), Time)]).
307
308
318axiom(trajectory(xWalkStepping(Xschema, Distance02), Time, xWalkDistance(Xschema, Distance03), Offset),
319
320 [ holds_at(xWalkDistance(Xschema, Distance01), Time),
321 equals(Distance03,
322 Distance01-Offset*(xWalkSize(Xschema)/xWalkRate(Xschema)))
323 ]).
324
325
332axiom(happens(xWalkSteppingOff(Xschema), Time),
333
334 [ holds_at(xWalkStepping(Xschema, Distance), Time),
335 holds_at(xWalkDistance(Xschema, Distance), Time)
336 ]).
337
338
339% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:114
340%; punctual events
341
342% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:116
343% event XWalkTestFooting(xschema)
344 % event(xWalkTestFooting(xschema)).
345% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:117
346==> mpred_prop(xWalkTestFooting(xschema),event).
347==> meta_argtypes(xWalkTestFooting(xschema)).
348
349% event XWalkMoveFoot(xschema)
350 % event(xWalkMoveFoot(xschema)).
351% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:118
352==> mpred_prop(xWalkMoveFoot(xschema),event).
353==> meta_argtypes(xWalkMoveFoot(xschema)).
354
355
362axiom(happens(xWalkMoveFoot(Xschema), start),
363
364 [ happens(xWalkTestFooting(Xschema), t),
365 not(holds_at(xWalkFootingOK(Xschema), t)),
366 b(t, start),
367 ignore(t+1=start)
368 ]).
369
370
376axiom(happens(xWalkReadyOn(Xschema), start),
377 [happens(xWalkMoveFoot(Xschema), t), b(t, start), ignore(t+1=start)]).
378
379
380% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:128
381%; Petri net behavior
382
383% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:130
384% fluent XWalkReady(xschema)
385 % fluent(xWalkReady(xschema)).
386% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:131
387==> mpred_prop(xWalkReady(xschema),fluent).
388==> meta_argtypes(xWalkReady(xschema)).
389
390% event XWalkReadyOn(xschema)
391 % event(xWalkReadyOn(xschema)).
392% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:132
393==> mpred_prop(xWalkReadyOn(xschema),event).
394==> meta_argtypes(xWalkReadyOn(xschema)).
395
396% event XWalkReadyOff(xschema)
397 % event(xWalkReadyOff(xschema)).
398% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/XWalk.e:133
399==> mpred_prop(xWalkReadyOff(xschema),event).
400==> meta_argtypes(xWalkReadyOff(xschema)).
401
402
412axiom(happens(xWalkReadyOn(Xschema), Time),
413
414 [ holds_at(xWalkEnabled(Xschema), Time),
415 holds_at(xWalkVision(Xschema), Time),
416 holds_at(xWalkPosture(Xschema), Time),
417 not(holds_at(xWalkStepping(Xschema, Distance), Time)),
418 not(holds_at(xWalkReady(Xschema), Time))
419 ]).
420
421
426axiom(initiates(xWalkReadyOn(Xschema), xWalkReady(Xschema), Time),
427 []).
428
429
434axiom(terminates(xWalkReadyOff(Xschema), xWalkReady(Xschema), Time),
435 []).
436
437
448
449 453
454 465axiom(not(some(Some_Param, '$kolem_Fn_198'(Fn_198_Param, Time4))),
466
467 [ not(happens(xWalkSteppingOn(Fn_198_Param), Time4)),
468 not(holds_at(xWalkStepping(Fn_198_Param, Some_Param),
469 Time4)),
470 holds_at(xWalkVisionOK(Fn_198_Param), Time4),
471 holds_at(xWalkReady(Fn_198_Param), Time4)
472 ]).
473axiom(not(some(Some_Param, '$kolem_Fn_198'(Fn_198_Param, Time4))),
474
475 [ not(happens(xWalkReadyOff(Fn_198_Param), Time4)),
476 not(holds_at(xWalkStepping(Fn_198_Param, Some_Param),
477 Time4)),
478 holds_at(xWalkVisionOK(Fn_198_Param), Time4),
479 holds_at(xWalkReady(Fn_198_Param), Time4)
480 ]).
481
482 492axiom(holds_at(xWalkStepping(XWalkStepping_Param, Some_Param9), Time7),
493
494 [ not(happens(xWalkSteppingOn(XWalkStepping_Param), Time7)),
495 holds_at(xWalkVisionOK(XWalkStepping_Param), Time7),
496 holds_at(xWalkReady(XWalkStepping_Param), Time7),
497 some(Some_Param9,
498 '$kolem_Fn_198'(XWalkStepping_Param, Time7))
499 ]).
500axiom(holds_at(xWalkStepping(XWalkStepping_Param, Some_Param9), Time7),
501
502 [ not(happens(xWalkReadyOff(XWalkStepping_Param), Time7)),
503 holds_at(xWalkVisionOK(XWalkStepping_Param), Time7),
504 holds_at(xWalkReady(XWalkStepping_Param), Time7),
505 some(Some_Param9,
506 '$kolem_Fn_198'(XWalkStepping_Param, Time7))
507 ]).
508
509 519axiom(not(holds_at(xWalkVisionOK(XWalkStepping_Param11), Time10)),
520
521 [ not(happens(xWalkSteppingOn(XWalkStepping_Param11), Time10)),
522 holds_at(xWalkReady(XWalkStepping_Param11), Time10),
523 not(holds_at(xWalkStepping(XWalkStepping_Param11,
524 Some_Param12),
525 Time10)),
526 some(Some_Param12,
527 '$kolem_Fn_198'(XWalkStepping_Param11, Time10))
528 ]).
529axiom(not(holds_at(xWalkVisionOK(XWalkStepping_Param11), Time10)),
530
531 [ not(happens(xWalkReadyOff(XWalkStepping_Param11), Time10)),
532 holds_at(xWalkReady(XWalkStepping_Param11), Time10),
533 not(holds_at(xWalkStepping(XWalkStepping_Param11,
534 Some_Param12),
535 Time10)),
536 some(Some_Param12,
537 '$kolem_Fn_198'(XWalkStepping_Param11, Time10))
538 ]).
539
540 550axiom(not(holds_at(xWalkReady(XWalkStepping_Param14), Time13)),
551
552 [ not(happens(xWalkSteppingOn(XWalkStepping_Param14), Time13)),
553 holds_at(xWalkVisionOK(XWalkStepping_Param14), Time13),
554 not(holds_at(xWalkStepping(XWalkStepping_Param14,
555 Some_Param15),
556 Time13)),
557 some(Some_Param15,
558 '$kolem_Fn_198'(XWalkStepping_Param14, Time13))
559 ]).
560axiom(not(holds_at(xWalkReady(XWalkStepping_Param14), Time13)),
561
562 [ not(happens(xWalkReadyOff(XWalkStepping_Param14), Time13)),
563 holds_at(xWalkVisionOK(XWalkStepping_Param14), Time13),
564 not(holds_at(xWalkStepping(XWalkStepping_Param14,
565 Some_Param15),
566 Time13)),
567 some(Some_Param15,
568 '$kolem_Fn_198'(XWalkStepping_Param14, Time13))
569 ]).
570
571 581axiom(happens(xWalkSteppingOn(XWalkStepping_Param17), Maptime),
582
583 [ not(holds_at(xWalkStepping(XWalkStepping_Param17,
584 Some_Param18),
585 Maptime)),
586 holds_at(xWalkVisionOK(XWalkStepping_Param17), Maptime),
587 holds_at(xWalkReady(XWalkStepping_Param17), Maptime),
588 some(Some_Param18,
589 '$kolem_Fn_198'(XWalkStepping_Param17, Maptime))
590 ]).
591
592 602axiom(happens(xWalkReadyOff(XWalkStepping_Param20), Maptime19),
603
604 [ not(holds_at(xWalkStepping(XWalkStepping_Param20,
605 Some_Param21),
606 Maptime19)),
607 holds_at(xWalkVisionOK(XWalkStepping_Param20), Maptime19),
608 holds_at(xWalkReady(XWalkStepping_Param20), Maptime19),
609 some(Some_Param21,
610 '$kolem_Fn_198'(XWalkStepping_Param20, Maptime19))
611 ]).
612
613
624
625 629
630 641axiom(not(some(Some_Param, '$kolem_Fn_199'(Fn_199_Param, Time4))),
642
643 [ not(happens(xWalkTestFooting(Fn_199_Param), Time4)),
644 not(holds_at(xWalkStepping(Fn_199_Param, Some_Param),
645 Time4)),
646 not(holds_at(xWalkVisionOK(Fn_199_Param), Time4)),
647 holds_at(xWalkReady(Fn_199_Param), Time4)
648 ]).
649axiom(not(some(Some_Param, '$kolem_Fn_199'(Fn_199_Param, Time4))),
650
651 [ not(happens(xWalkReadyOff(Fn_199_Param), Time4)),
652 not(holds_at(xWalkStepping(Fn_199_Param, Some_Param),
653 Time4)),
654 not(holds_at(xWalkVisionOK(Fn_199_Param), Time4)),
655 holds_at(xWalkReady(Fn_199_Param), Time4)
656 ]).
657
658 668axiom(holds_at(xWalkStepping(XWalkStepping_Param, Some_Param9), Time7),
669
670 [ not(happens(xWalkTestFooting(XWalkStepping_Param), Time7)),
671 not(holds_at(xWalkVisionOK(XWalkStepping_Param), Time7)),
672 holds_at(xWalkReady(XWalkStepping_Param), Time7),
673 some(Some_Param9,
674 '$kolem_Fn_199'(XWalkStepping_Param, Time7))
675 ]).
676axiom(holds_at(xWalkStepping(XWalkStepping_Param, Some_Param9), Time7),
677
678 [ not(happens(xWalkReadyOff(XWalkStepping_Param), Time7)),
679 not(holds_at(xWalkVisionOK(XWalkStepping_Param), Time7)),
680 holds_at(xWalkReady(XWalkStepping_Param), Time7),
681 some(Some_Param9,
682 '$kolem_Fn_199'(XWalkStepping_Param, Time7))
683 ]).
684
685 696axiom(holds_at(xWalkVisionOK(XWalkStepping_Param11), Time10),
697
698 [ not(happens(xWalkTestFooting(XWalkStepping_Param11), Time10)),
699 holds_at(xWalkReady(XWalkStepping_Param11), Time10),
700 not(holds_at(xWalkStepping(XWalkStepping_Param11,
701 Some_Param12),
702 Time10)),
703 some(Some_Param12,
704 '$kolem_Fn_199'(XWalkStepping_Param11, Time10))
705 ]).
706axiom(holds_at(xWalkVisionOK(XWalkStepping_Param11), Time10),
707
708 [ not(happens(xWalkReadyOff(XWalkStepping_Param11), Time10)),
709 holds_at(xWalkReady(XWalkStepping_Param11), Time10),
710 not(holds_at(xWalkStepping(XWalkStepping_Param11,
711 Some_Param12),
712 Time10)),
713 some(Some_Param12,
714 '$kolem_Fn_199'(XWalkStepping_Param11, Time10))
715 ]).
716
717 728axiom(not(holds_at(xWalkReady(XWalkStepping_Param14), Time13)),
729
730 [ not(happens(xWalkTestFooting(XWalkStepping_Param14), Time13)),
731 not(holds_at(xWalkVisionOK(XWalkStepping_Param14), Time13)),
732 not(holds_at(xWalkStepping(XWalkStepping_Param14,
733 Some_Param15),
734 Time13)),
735 some(Some_Param15,
736 '$kolem_Fn_199'(XWalkStepping_Param14, Time13))
737 ]).
738axiom(not(holds_at(xWalkReady(XWalkStepping_Param14), Time13)),
739
740 [ not(happens(xWalkReadyOff(XWalkStepping_Param14), Time13)),
741 not(holds_at(xWalkVisionOK(XWalkStepping_Param14), Time13)),
742 not(holds_at(xWalkStepping(XWalkStepping_Param14,
743 Some_Param15),
744 Time13)),
745 some(Some_Param15,
746 '$kolem_Fn_199'(XWalkStepping_Param14, Time13))
747 ]).
748
749 759axiom(happens(xWalkTestFooting(XWalkStepping_Param17), Maptime),
760
761 [ not(holds_at(xWalkStepping(XWalkStepping_Param17,
762 Some_Param18),
763 Maptime)),
764 not(holds_at(xWalkVisionOK(XWalkStepping_Param17), Maptime)),
765 holds_at(xWalkReady(XWalkStepping_Param17), Maptime),
766 some(Some_Param18,
767 '$kolem_Fn_199'(XWalkStepping_Param17, Maptime))
768 ]).
769
770 780axiom(happens(xWalkReadyOff(XWalkStepping_Param20), Maptime19),
781
782 [ not(holds_at(xWalkStepping(XWalkStepping_Param20,
783 Some_Param21),
784 Maptime19)),
785 not(holds_at(xWalkVisionOK(XWalkStepping_Param20), Maptime19)),
786 holds_at(xWalkReady(XWalkStepping_Param20), Maptime19),
787 some(Some_Param21,
788 '$kolem_Fn_199'(XWalkStepping_Param20, Maptime19))
789 ]).
790
791
799axiom(happens(xWalkReadyOn(Xschema), Time),
800
801 [ holds_at(xWalkStepping(Xschema, Distance), Time),
802 holds_at(xWalkDistance(Xschema, Distance), Time),
803 comparison(Distance, 0, >)
804 ]).
805
806