1 /* Generated by CHR bootstrap compiler
2 From
: guard_entailment
.chr
3 Date
: Fri Jan
21 10:00:48 2005
5 DO NOT EDIT
. EDIT THE CHR FILE INSTEAD
8 :-module
(guard_entailment
, [entails_guard
/2, simplify_guards/5]).
9 :-use_module
(chr_runtime
).
10 :-style_check
(-singleton
).
11 :-style_check
(- (discontiguous
)).
12 :-use_module
(library
(lists
)).
13 :-use_module
(hprolog
).
14 :-use_module
(builtins
).
15 entails_guard
(A
, B
) :-
16 copy_term_nat
((A
, B
), (C
, D
)),
23 entails_guard2
([A
|B
]) :-
26 simplify_guards
(A
, B
, C
, D
, E
) :-
27 copy_term_nat
((A
, C
), (F
, G
)),
32 simplified
(C
, I
, D
, B
, E
), !,
34 simplified
([], [], [], A
, A
).
35 simplified
([A
|B
], [keep
|C
], [A
|D
], E
, F
) :-
36 simplified
(B
, C
, D
, E
, F
).
37 simplified
([A
|B
], [fail
|C
], fail
, D
, D
).
38 simplified
([A
|B
], [true
|C
], [D
|E
], F
, G
) :-
39 builtins
:binds_b
(A
, H
),
41 intersect_eq
(H
, I
, J
), !,
43 -> term_variables
(F
, K
),
44 intersect_eq
(H
, K
, L
), !,
54 simplified
(B
, C
, E
, F
, M
).
56 simplify
([A
|B
], [C
|D
]) :-
59 ; builtins
:negate_b
(A
, E
),
70 ; format
(' ERROR: entailment checker: this is not supposed to happen.\n', [])
76 lookup
([], [], A
, B
) :-
78 lookup
([A
|B
], [C
|D
], E
, F
) :-
83 add_args_unif
([], [], true
).
84 add_args_unif
([A
|B
], [C
|D
], (A
=C
, E
)) :-
85 add_args_unif
(B
, D
, E
).
86 add_args_nunif
([], [], fail
).
87 add_args_nunif
([A
|B
], [C
|D
], (A\
=C
;E
)) :-
88 add_args_nunif
(B
, D
, E
).
89 add_args_nmatch
([], [], fail
).
90 add_args_nmatch
([A
|B
], [C
|D
], (A\
==C
;E
)) :-
91 add_args_nmatch
(B
, D
, E
).
92 all_unique_vars
(A
, B
) :-
93 all_unique_vars
(A
, B
, []).
94 all_unique_vars
([], A
, B
).
95 all_unique_vars
([A
|B
], C
, D
) :-
99 all_unique_vars
(B
, [A
|D
]).
100 :-use_module
(chr(chr_runtime
)).
101 :-use_module
(chr(chr_hashtable_store
)).
102 'attach_known/1'([], A
).
103 'attach_known/1'([A
|B
], C
) :-
104 ( get_attr
(A
, guard_entailment
, D
)
107 -> put_attr
(A
, guard_entailment
, v
(E
, [C
|F
], G
))
109 put_attr
(A
, guard_entailment
, v
(H
, [C
], G
))
111 ; put_attr
(A
, guard_entailment
, v
(1, [C
], [C
]))
113 'attach_known/1'(B
, C
).
114 'detach_known/1'([], A
).
115 'detach_known/1'([A
|B
], C
) :-
116 ( get_attr
(A
, guard_entailment
, D
)
119 -> 'chr sbag_del_element'(F
, C
, H
),
123 -> del_attr
(A
, guard_entailment
)
124 ; put_attr
(A
, guard_entailment
, v
(I
, [], G
))
126 ; put_attr
(A
, guard_entailment
, v
(E
, H
, G
))
132 'detach_known/1'(B
, C
).
133 'attach_variables/1'([], A
).
134 'attach_variables/1'([A
|B
], C
) :-
135 ( get_attr
(A
, guard_entailment
, D
)
138 -> put_attr
(A
, guard_entailment
, v
(E
, F
, [C
|G
]))
140 put_attr
(A
, guard_entailment
, v
(H
, F
, [C
]))
142 ; put_attr
(A
, guard_entailment
, v
(2, [C
], [C
]))
144 'attach_variables/1'(B
, C
).
145 'detach_variables/1'([], A
).
146 'detach_variables/1'([A
|B
], C
) :-
147 ( get_attr
(A
, guard_entailment
, D
)
150 -> 'chr sbag_del_element'(G
, C
, H
),
154 -> del_attr
(A
, guard_entailment
)
155 ; put_attr
(A
, guard_entailment
, v
(I
, F
, []))
157 ; put_attr
(A
, guard_entailment
, v
(E
, F
, H
))
163 'detach_variables/1'(B
, C
).
164 '$indexed_variables'(A
, B
) :-
166 term_variables
(A
, B
).
167 '$indexed_variables'(A
, B
) :-
169 term_variables
(A
, B
).
170 attach_increment
([], A
).
171 attach_increment
([A
|B
], v
(C
, D
, E
)) :-
173 ( get_attr
(A
, guard_entailment
, F
)
176 'chr merge_attributes'(D
, J
, K
),
178 'chr merge_attributes'(E
, L
, M
),
180 put_attr
(A
, guard_entailment
, v
(N
, K
, M
))
181 ; put_attr
(A
, guard_entailment
, v
(C
, D
, E
))
183 attach_increment
(B
, v
(C
, D
, E
)).
184 attr_unify_hook
(v
(A
, B
, C
), D
) :-
188 -> ( get_attr
(D
, guard_entailment
, G
)
191 'chr merge_attributes'(E
, K
, L
),
193 'chr merge_attributes'(F
, M
, N
),
195 put_attr
(D
, guard_entailment
, v
(O
, L
, N
)),
196 'chr run_suspensions_loop'([L
, N
])
197 ; put_attr
(D
, guard_entailment
, v
(A
, E
, F
)),
198 'chr run_suspensions_loop'([E
, F
])
201 -> term_variables
(D
, P
),
202 attach_increment
(P
, v
(A
, E
, F
))
205 'chr run_suspensions_loop'([E
, F
])
207 activate_constraint
(A
, B
, C
, D
) :-
210 'chr update_mutable'(active
, E
),
216 'chr update_mutable'(D
, G
)
219 -> term_variables
(F
, B
),
220 'chr none_locked'(B
),
223 -> chr_indexed_variables
(C
, B
),
228 remove_constraint_internal
(A
, B
, C
) :-
231 'chr update_mutable'(removed
, D
),
239 chr_indexed_variables
(A
, B
)
241 allocate_constraint
(A
, B
, C
, D
) :-
242 B
=..[suspension
, E
, F
, A
, G
, H
, C
|D
],
244 'chr empty_history'(I
),
246 chr_indexed_variables
(B
, J
),
247 F
=mutable
(passive
(J
)),
249 insert_constraint_internal
(yes
, A
, B
, C
, D
, E
) :-
250 B
=..[suspension
, F
, G
, C
, H
, I
, D
|E
],
251 chr_indexed_variables
(B
, A
),
252 'chr none_locked'(A
),
256 'chr empty_history'(J
),
258 chr_indexed_variables
(A
, B
) :-
259 A
=..[C
, D
, E
, F
, G
, H
, I
|J
],
260 '$indexed_variables'(I
, B
).
261 '$insert_in_store_known/1'(A
) :-
263 'chr global_term_ref_1'(B
),
264 ( get_attr
(B
, guard_entailment
, C
)
267 -> put_attr
(B
, guard_entailment
, v
(D
, [A
|E
], F
))
269 put_attr
(B
, guard_entailment
, v
(G
, [A
], F
))
271 ; put_attr
(B
, guard_entailment
, v
(1, [A
], [A
]))
273 '$delete_from_store_known/1'(A
) :-
275 'chr global_term_ref_1'(B
),
276 ( get_attr
(B
, guard_entailment
, C
)
279 -> 'chr sbag_del_element'(E
, A
, G
),
283 -> del_attr
(B
, guard_entailment
)
284 ; put_attr
(B
, guard_entailment
, v
(H
, [], F
))
286 ; put_attr
(B
, guard_entailment
, v
(D
, G
, F
))
292 '$insert_in_store_variables/1'(A
) :-
294 'chr global_term_ref_1'(B
),
295 ( get_attr
(B
, guard_entailment
, C
)
298 -> put_attr
(B
, guard_entailment
, v
(D
, E
, [A
|F
]))
300 put_attr
(B
, guard_entailment
, v
(G
, E
, [A
]))
302 ; put_attr
(B
, guard_entailment
, v
(2, [A
], [A
]))
304 '$delete_from_store_variables/1'(A
) :-
306 'chr global_term_ref_1'(B
),
307 ( get_attr
(B
, guard_entailment
, C
)
310 -> 'chr sbag_del_element'(F
, A
, G
),
314 -> del_attr
(B
, guard_entailment
)
315 ; put_attr
(B
, guard_entailment
, v
(H
, E
, []))
317 ; put_attr
(B
, guard_entailment
, v
(D
, E
, G
))
323 '$enumerate_suspensions'(A
) :-
324 ( 'chr global_term_ref_1'(B
),
325 get_attr
(B
, guard_entailment
, C
),
327 'chr sbag_member'(A
, D
)
328 ; 'chr global_term_ref_1'(E
),
329 get_attr
(E
, guard_entailment
, F
),
331 'chr sbag_member'(A
, G
)
335 'known/1__0'(A
, B
) :-
337 get_attr
(C
, guard_entailment
, D
),
340 'chr sbag_member'(H
, F
),
341 H
=suspension
(I
, J
, K
, L
, M
, N
, O
),
346 ; remove_constraint_internal
(B
, P
, Q
),
348 -> '$delete_from_store_known/1'(B
),
349 'detach_known/1'(P
, B
)
353 'known/1__0'(A
, B
) :-
358 ; remove_constraint_internal
(B
, E
, F
),
360 -> '$delete_from_store_known/1'(B
),
361 'detach_known/1'(E
, B
)
366 'known/1__0'(A
, B
) :-
371 ; remove_constraint_internal
(B
, E
, F
),
373 -> '$delete_from_store_known/1'(B
),
374 'detach_known/1'(E
, B
)
379 'known/1__0'(A
, B
) :-
384 ; remove_constraint_internal
(B
, E
, F
),
386 -> '$delete_from_store_known/1'(B
),
387 'detach_known/1'(E
, B
)
393 'known/1__0'(A
, B
) :-
398 ; remove_constraint_internal
(B
, E
, F
),
400 -> '$delete_from_store_known/1'(B
),
401 'detach_known/1'(E
, B
)
406 'known/1__0'(A
, B
) :-
410 -> allocate_constraint
(guard_entailment
:'known/1__0'(A
, B
), B
, known
(A
), [A
])
413 'chr novel_production'(B
, 21),
415 'chr extend_history'(B
, 21),
416 activate_constraint
(E
, F
, B
, G
),
418 -> '$insert_in_store_known/1'(B
),
419 'attach_known/1'(F
, B
)
423 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
426 -> 'chr update_mutable'(inactive
, I
),
430 'known/1__0'(A
, B
) :-
432 -> allocate_constraint
(guard_entailment
:'known/1__0'(A
, B
), B
, known
(A
), [A
])
436 'known/1__1'(A
, B
) :-
439 'chr novel_production'(B
, 22),
441 'chr extend_history'(B
, 22),
442 activate_constraint
(E
, F
, B
, G
),
444 -> '$insert_in_store_known/1'(B
),
445 'attach_known/1'(F
, B
)
449 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
452 -> 'chr update_mutable'(inactive
, I
),
456 'known/1__1'(A
, B
) :-
458 'known/1__2'(A
, B
) :-
461 'chr novel_production'(B
, 23),
463 'chr extend_history'(B
, 23),
464 activate_constraint
(E
, F
, B
, G
),
466 -> '$insert_in_store_known/1'(B
),
467 'attach_known/1'(F
, B
)
471 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
474 -> 'chr update_mutable'(inactive
, I
),
478 'known/1__2'(A
, B
) :-
480 'known/1__3'(A
, B
) :-
483 'chr novel_production'(B
, 24),
485 'chr extend_history'(B
, 24),
486 activate_constraint
(E
, F
, B
, G
),
488 -> '$insert_in_store_known/1'(B
),
489 'attach_known/1'(F
, B
)
493 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
496 -> 'chr update_mutable'(inactive
, I
),
500 'known/1__3'(A
, B
) :-
502 'known/1__4'(A
, B
) :-
503 'chr global_term_ref_1'(C
),
504 get_attr
(C
, guard_entailment
, D
),
507 'chr sbag_member'(H
, F
),
508 H
=suspension
(I
, J
, K
, L
, M
, N
, O
),
513 ; remove_constraint_internal
(B
, P
, Q
),
515 -> '$delete_from_store_known/1'(B
),
516 'detach_known/1'(P
, B
)
520 'known/1__4'(A
, B
) :-
522 'chr global_term_ref_1'(C
),
523 get_attr
(C
, guard_entailment
, D
),
526 'known/1__4__0'(F
, A
, B
).
527 'known/1__4__0'([], A
, B
) :-
529 'known/1__4__0'([A
|B
], C
, D
) :-
530 ( A
=suspension
(E
, F
, G
, H
, I
, J
, K
),
532 -> remove_constraint_internal
(A
, L
, M
),
534 -> '$delete_from_store_known/1'(A
),
535 'detach_known/1'(L
, A
)
538 'known/1__4__0'(B
, C
, D
)
539 ; 'known/1__4__0'(B
, C
, D
)
541 'known/1__4'(A
, B
) :-
543 'known/1__5'(A
, B
) :-
548 ; remove_constraint_internal
(B
, E
, F
),
550 -> '$delete_from_store_known/1'(B
),
551 'detach_known/1'(E
, B
)
557 'known/1__5'(A
, B
) :-
563 ; remove_constraint_internal
(B
, E
, F
),
565 -> '$delete_from_store_known/1'(B
),
566 'detach_known/1'(E
, B
)
570 'known/1__5'(A
, B
) :-
576 ; remove_constraint_internal
(B
, E
, F
),
578 -> '$delete_from_store_known/1'(B
),
579 'detach_known/1'(E
, B
)
583 'known/1__5'(A
, B
) :-
589 ; remove_constraint_internal
(B
, E
, F
),
591 -> '$delete_from_store_known/1'(B
),
592 'detach_known/1'(E
, B
)
596 'known/1__5'(A
, B
) :-
602 ; remove_constraint_internal
(B
, E
, F
),
604 -> '$delete_from_store_known/1'(B
),
605 'detach_known/1'(E
, B
)
609 'known/1__5'(A
, B
) :-
615 ; remove_constraint_internal
(B
, E
, F
),
617 -> '$delete_from_store_known/1'(B
),
618 'detach_known/1'(E
, B
)
623 'known/1__5'(A
, B
) :-
629 ; remove_constraint_internal
(B
, E
, F
),
631 -> '$delete_from_store_known/1'(B
),
632 'detach_known/1'(E
, B
)
637 'known/1__5'(A
, B
) :-
645 chr_runtime
:unlock
(C
),
646 chr_runtime
:unlock
(D
), !,
649 ; remove_constraint_internal
(B
, E
, F
),
651 -> '$delete_from_store_known/1'(B
),
652 'detach_known/1'(E
, B
)
657 'known/1__5'(A
, B
) :-
665 chr_runtime
:unlock
(C
),
666 chr_runtime
:unlock
(D
), !,
669 ; remove_constraint_internal
(B
, E
, F
),
671 -> '$delete_from_store_known/1'(B
),
672 'detach_known/1'(E
, B
)
677 'known/1__5'(A
, B
) :-
683 'chr global_term_ref_1'(F
),
684 get_attr
(F
, guard_entailment
, G
),
687 'chr sbag_member'(K
, J
),
688 K
=suspension
(L
, M
, N
, O
, P
, Q
, R
),
689 M
=mutable
(active
), !,
690 remove_constraint_internal
(K
, S
, T
),
692 -> '$delete_from_store_variables/1'(K
),
693 'detach_variables/1'(S
, K
)
698 ; remove_constraint_internal
(B
, U
, V
),
700 -> '$delete_from_store_known/1'(B
),
701 'detach_known/1'(U
, B
)
710 'known/1__5'(A
, B
) :-
718 chr_runtime
:unlock
(C
),
719 chr_runtime
:unlock
(D
),
720 chr_runtime
:unlock
(E
), !,
723 ; remove_constraint_internal
(B
, F
, G
),
725 -> '$delete_from_store_known/1'(B
),
726 'detach_known/1'(F
, B
)
731 'known/1__5'(A
, B
) :-
741 chr_runtime
:unlock
(D
),
742 chr_runtime
:unlock
(E
),
743 chr_runtime
:unlock
(F
), !,
746 ; remove_constraint_internal
(B
, G
, H
),
748 -> '$delete_from_store_known/1'(B
),
749 'detach_known/1'(G
, B
)
754 'known/1__5'(A
, B
) :-
760 get_attr
(F
, guard_entailment
, G
),
763 'chr sbag_member'(K
, I
),
764 K
=suspension
(L
, M
, N
, O
, P
, Q
, R
),
771 remove_constraint_internal
(K
, V
, W
),
773 -> '$delete_from_store_known/1'(K
),
774 'detach_known/1'(V
, K
)
779 ; remove_constraint_internal
(B
, X
, Y
),
781 -> '$delete_from_store_known/1'(B
),
782 'detach_known/1'(X
, B
)
787 'known/1__5'(A
, B
) :-
793 ; remove_constraint_internal
(B
, E
, F
),
795 -> '$delete_from_store_known/1'(B
),
796 'detach_known/1'(E
, B
)
801 'known/1__5'(A
, B
) :-
806 chr_runtime
:unlock
(C
), !,
809 ; remove_constraint_internal
(B
, G
, H
),
811 -> '$delete_from_store_known/1'(B
),
812 'detach_known/1'(G
, B
)
821 'known/1__5'(A
, B
) :-
829 chr_runtime
:unlock
(D
), !,
832 ; remove_constraint_internal
(B
, G
, H
),
834 -> '$delete_from_store_known/1'(B
),
835 'detach_known/1'(G
, B
)
842 add_args_nunif
(J
, I
, L
),
843 M
= (\
+functor
(C
, E
, F
);C
=K
, L
),
845 'known/1__5'(A
, B
) :-
852 chr_runtime
:unlock
(C
), !,
855 ; remove_constraint_internal
(B
, G
, H
),
857 -> '$delete_from_store_known/1'(B
),
858 'detach_known/1'(G
, B
)
865 add_args_nunif
(I
, J
, K
),
869 'known/1__5'(A
, B
) :-
872 'chr novel_production'(B
, 43), !,
873 'chr extend_history'(B
, 43),
874 activate_constraint
(E
, F
, B
, G
),
876 -> '$insert_in_store_known/1'(B
),
877 'attach_known/1'(F
, B
)
881 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
884 -> 'chr update_mutable'(inactive
, I
),
888 'known/1__5'(A
, B
) :-
890 'known/1__6'(A
, B
) :-
898 ; remove_constraint_internal
(B
, E
, F
),
900 -> '$delete_from_store_known/1'(B
),
901 'detach_known/1'(E
, B
)
906 'known/1__6'(A
, B
) :-
911 get_attr
(E
, guard_entailment
, F
),
914 'chr sbag_member'(J
, H
),
915 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
924 ; remove_constraint_internal
(B
, T
, U
),
926 -> '$delete_from_store_known/1'(B
),
927 'detach_known/1'(T
, B
)
931 'known/1__6'(A
, B
) :-
935 get_attr
(E
, guard_entailment
, F
),
938 'known/1__6__0'(H
, A
, B
, C
, D
).
939 'known/1__6__0'([], A
, B
, C
, D
) :-
941 'known/1__6__0'([A
|B
], C
, D
, E
, F
) :-
942 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
950 -> remove_constraint_internal
(A
, P
, Q
),
952 -> '$delete_from_store_known/1'(A
),
953 'detach_known/1'(P
, A
)
956 'known/1__6__0'(B
, C
, D
, E
, F
)
957 ; 'known/1__6__0'(B
, C
, D
, E
, F
)
959 'known/1__6'(A
, B
) :-
961 'known/1__7'(A
, B
) :-
966 get_attr
(E
, guard_entailment
, F
),
969 'chr sbag_member'(J
, H
),
970 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
979 ; remove_constraint_internal
(B
, T
, U
),
981 -> '$delete_from_store_known/1'(B
),
982 'detach_known/1'(T
, B
)
986 'known/1__7'(A
, B
) :-
990 get_attr
(E
, guard_entailment
, F
),
993 'known/1__7__0'(H
, A
, B
, C
, D
).
994 'known/1__7__0'([], A
, B
, C
, D
) :-
996 'known/1__7__0'([A
|B
], C
, D
, E
, F
) :-
997 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1005 -> remove_constraint_internal
(A
, P
, Q
),
1007 -> '$delete_from_store_known/1'(A
),
1008 'detach_known/1'(P
, A
)
1011 'known/1__7__0'(B
, C
, D
, E
, F
)
1012 ; 'known/1__7__0'(B
, C
, D
, E
, F
)
1014 'known/1__7'(A
, B
) :-
1016 'known/1__8'(A
, B
) :-
1019 'chr via_2'(D
, C
, E
),
1020 get_attr
(E
, guard_entailment
, F
),
1023 'chr sbag_member'(J
, H
),
1024 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
1030 remove_constraint_internal
(J
, T
, U
),
1032 -> '$delete_from_store_known/1'(J
),
1033 'detach_known/1'(T
, J
)
1038 ; remove_constraint_internal
(B
, V
, W
),
1040 -> '$delete_from_store_known/1'(B
),
1041 'detach_known/1'(V
, B
)
1046 'known/1__8'(A
, B
) :-
1050 get_attr
(E
, guard_entailment
, F
),
1053 'known/1__8__0'(H
, A
, B
, C
, D
).
1054 'known/1__8__0'([], A
, B
, C
, D
) :-
1056 'known/1__8__0'([A
|B
], C
, D
, E
, F
) :-
1057 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1063 'chr novel_production'(D
, P
),
1064 'chr novel_production'(A
, P
)
1065 -> 'chr extend_history'(D
, P
),
1066 activate_constraint
(Q
, R
, D
, S
),
1068 -> '$insert_in_store_known/1'(D
),
1069 'attach_known/1'(R
, D
)
1073 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1076 -> 'chr update_mutable'(inactive
, U
),
1077 'known/1__8__0'(B
, C
, D
, E
, F
)
1080 ; 'known/1__8__0'(B
, C
, D
, E
, F
)
1082 'known/1__8'(A
, B
) :-
1084 'known/1__9'(A
, B
) :-
1088 get_attr
(E
, guard_entailment
, F
),
1091 'known/1__9__0'(H
, A
, B
, C
, D
).
1092 'known/1__9__0'([], A
, B
, C
, D
) :-
1093 'known/1__10'(A
, B
).
1094 'known/1__9__0'([A
|B
], C
, D
, E
, F
) :-
1095 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1101 'chr novel_production'(A
, P
),
1102 'chr novel_production'(D
, P
)
1103 -> 'chr extend_history'(D
, P
),
1104 activate_constraint
(Q
, R
, D
, S
),
1106 -> '$insert_in_store_known/1'(D
),
1107 'attach_known/1'(R
, D
)
1111 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1114 -> 'chr update_mutable'(inactive
, U
),
1115 'known/1__9__0'(B
, C
, D
, E
, F
)
1118 ; 'known/1__9__0'(B
, C
, D
, E
, F
)
1120 'known/1__9'(A
, B
) :-
1121 'known/1__10'(A
, B
).
1122 'known/1__10'(A
, B
) :-
1126 get_attr
(E
, guard_entailment
, F
),
1129 'known/1__10__0'(H
, A
, B
, C
, D
).
1130 'known/1__10__0'([], A
, B
, C
, D
) :-
1131 'known/1__11'(A
, B
).
1132 'known/1__10__0'([A
|B
], C
, D
, E
, F
) :-
1133 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1138 'chr via_2'(F
, O
, P
),
1139 get_attr
(P
, guard_entailment
, Q
),
1142 -> 'known/1__10__1'(S
, O
, A
, B
, C
, D
, E
, F
)
1143 ; 'known/1__10__0'(B
, C
, D
, E
, F
)
1145 'known/1__10__1'([], A
, B
, C
, D
, E
, F
, G
) :-
1146 'known/1__10__0'(C
, D
, E
, F
, G
).
1147 'known/1__10__1'([A
|B
], C
, D
, E
, F
, G
, H
, I
) :-
1148 ( A
=suspension
(J
, K
, L
, M
, N
, O
, P
),
1154 'chr via_2'(H
, I
, S
),
1155 get_attr
(S
, guard_entailment
, T
),
1158 -> 'known/1__10__2'(V
, A
, B
, C
, D
, E
, F
, G
, H
, I
)
1159 ; 'known/1__10__1'(B
, C
, D
, E
, F
, G
, H
, I
)
1161 'known/1__10__2'([], A
, B
, C
, D
, E
, F
, G
, H
, I
) :-
1162 'known/1__10__1'(B
, C
, D
, E
, F
, G
, H
, I
).
1163 'known/1__10__2'([A
|B
], C
, D
, E
, F
, G
, H
, I
, J
, K
) :-
1164 ( A
=suspension
(L
, M
, N
, O
, P
, Q
, R
),
1171 U
=t
(49, I
, A
, F
, C
),
1172 'chr novel_production'(I
, U
),
1173 'chr novel_production'(A
, U
),
1174 'chr novel_production'(F
, U
),
1175 'chr novel_production'(C
, U
)
1176 -> 'chr extend_history'(I
, U
),
1177 activate_constraint
(V
, W
, I
, X
),
1179 -> '$insert_in_store_known/1'(I
),
1180 'attach_known/1'(W
, I
)
1184 ( I
=suspension
(Y
, Z
, A1
, B1
, C1
, D1
, E1
),
1187 -> 'chr update_mutable'(inactive
, Z
),
1188 'known/1__10__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1191 ; 'known/1__10__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1193 'known/1__10'(A
, B
) :-
1194 'known/1__11'(A
, B
).
1195 'known/1__11'(A
, B
) :-
1199 get_attr
(E
, guard_entailment
, F
),
1202 'known/1__11__0'(H
, A
, B
, C
, D
).
1203 'known/1__11__0'([], A
, B
, C
, D
) :-
1204 'known/1__12'(A
, B
).
1205 'known/1__11__0'([A
|B
], C
, D
, E
, F
) :-
1206 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1211 'chr via_2'(F
, O
, P
),
1212 get_attr
(P
, guard_entailment
, Q
),
1215 -> 'known/1__11__1'(S
, O
, A
, B
, C
, D
, E
, F
)
1216 ; 'known/1__11__0'(B
, C
, D
, E
, F
)
1218 'known/1__11__1'([], A
, B
, C
, D
, E
, F
, G
) :-
1219 'known/1__11__0'(C
, D
, E
, F
, G
).
1220 'known/1__11__1'([A
|B
], C
, D
, E
, F
, G
, H
, I
) :-
1221 ( A
=suspension
(J
, K
, L
, M
, N
, O
, P
),
1227 'chr via_2'(H
, I
, S
),
1228 get_attr
(S
, guard_entailment
, T
),
1231 -> 'known/1__11__2'(V
, A
, B
, C
, D
, E
, F
, G
, H
, I
)
1232 ; 'known/1__11__1'(B
, C
, D
, E
, F
, G
, H
, I
)
1234 'known/1__11__2'([], A
, B
, C
, D
, E
, F
, G
, H
, I
) :-
1235 'known/1__11__1'(B
, C
, D
, E
, F
, G
, H
, I
).
1236 'known/1__11__2'([A
|B
], C
, D
, E
, F
, G
, H
, I
, J
, K
) :-
1237 ( A
=suspension
(L
, M
, N
, O
, P
, Q
, R
),
1244 U
=t
(49, A
, I
, F
, C
),
1245 'chr novel_production'(A
, U
),
1246 'chr novel_production'(I
, U
),
1247 'chr novel_production'(F
, U
),
1248 'chr novel_production'(C
, U
)
1249 -> 'chr extend_history'(I
, U
),
1250 activate_constraint
(V
, W
, I
, X
),
1252 -> '$insert_in_store_known/1'(I
),
1253 'attach_known/1'(W
, I
)
1257 ( I
=suspension
(Y
, Z
, A1
, B1
, C1
, D1
, E1
),
1260 -> 'chr update_mutable'(inactive
, Z
),
1261 'known/1__11__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1264 ; 'known/1__11__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1266 'known/1__11'(A
, B
) :-
1267 'known/1__12'(A
, B
).
1268 'known/1__12'(A
, B
) :-
1272 get_attr
(E
, guard_entailment
, F
),
1275 'known/1__12__0'(H
, A
, B
, C
, D
).
1276 'known/1__12__0'([], A
, B
, C
, D
) :-
1277 'known/1__13'(A
, B
).
1278 'known/1__12__0'([A
|B
], C
, D
, E
, F
) :-
1279 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1284 'chr via_2'(E
, F
, P
),
1285 get_attr
(P
, guard_entailment
, Q
),
1288 -> 'known/1__12__1'(S
, N
, A
, B
, C
, D
, E
, F
)
1289 ; 'known/1__12__0'(B
, C
, D
, E
, F
)
1291 'known/1__12__1'([], A
, B
, C
, D
, E
, F
, G
) :-
1292 'known/1__12__0'(C
, D
, E
, F
, G
).
1293 'known/1__12__1'([A
|B
], C
, D
, E
, F
, G
, H
, I
) :-
1294 ( A
=suspension
(J
, K
, L
, M
, N
, O
, P
),
1301 'chr via_2'(C
, H
, S
),
1302 get_attr
(S
, guard_entailment
, T
),
1305 -> 'known/1__12__2'(V
, A
, B
, C
, D
, E
, F
, G
, H
, I
)
1306 ; 'known/1__12__1'(B
, C
, D
, E
, F
, G
, H
, I
)
1308 'known/1__12__2'([], A
, B
, C
, D
, E
, F
, G
, H
, I
) :-
1309 'known/1__12__1'(B
, C
, D
, E
, F
, G
, H
, I
).
1310 'known/1__12__2'([A
|B
], C
, D
, E
, F
, G
, H
, I
, J
, K
) :-
1311 ( A
=suspension
(L
, M
, N
, O
, P
, Q
, R
),
1317 U
=t
(49, A
, F
, I
, C
),
1318 'chr novel_production'(A
, U
),
1319 'chr novel_production'(F
, U
),
1320 'chr novel_production'(I
, U
),
1321 'chr novel_production'(C
, U
)
1322 -> 'chr extend_history'(I
, U
),
1323 activate_constraint
(V
, W
, I
, X
),
1325 -> '$insert_in_store_known/1'(I
),
1326 'attach_known/1'(W
, I
)
1330 ( I
=suspension
(Y
, Z
, A1
, B1
, C1
, D1
, E1
),
1333 -> 'chr update_mutable'(inactive
, Z
),
1334 'known/1__12__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1337 ; 'known/1__12__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1339 'known/1__12'(A
, B
) :-
1340 'known/1__13'(A
, B
).
1341 'known/1__13'(A
, B
) :-
1345 get_attr
(E
, guard_entailment
, F
),
1348 'known/1__13__0'(H
, A
, B
, C
, D
).
1349 'known/1__13__0'([], A
, B
, C
, D
) :-
1350 'known/1__14'(A
, B
).
1351 'known/1__13__0'([A
|B
], C
, D
, E
, F
) :-
1352 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1357 'chr via_2'(E
, F
, P
),
1358 get_attr
(P
, guard_entailment
, Q
),
1361 -> 'known/1__13__1'(S
, N
, A
, B
, C
, D
, E
, F
)
1362 ; 'known/1__13__0'(B
, C
, D
, E
, F
)
1364 'known/1__13__1'([], A
, B
, C
, D
, E
, F
, G
) :-
1365 'known/1__13__0'(C
, D
, E
, F
, G
).
1366 'known/1__13__1'([A
|B
], C
, D
, E
, F
, G
, H
, I
) :-
1367 ( A
=suspension
(J
, K
, L
, M
, N
, O
, P
),
1373 'chr via_2'(C
, H
, S
),
1374 get_attr
(S
, guard_entailment
, T
),
1377 -> 'known/1__13__2'(V
, A
, B
, C
, D
, E
, F
, G
, H
, I
)
1378 ; 'known/1__13__1'(B
, C
, D
, E
, F
, G
, H
, I
)
1380 'known/1__13__2'([], A
, B
, C
, D
, E
, F
, G
, H
, I
) :-
1381 'known/1__13__1'(B
, C
, D
, E
, F
, G
, H
, I
).
1382 'known/1__13__2'([A
|B
], C
, D
, E
, F
, G
, H
, I
, J
, K
) :-
1383 ( A
=suspension
(L
, M
, N
, O
, P
, Q
, R
),
1390 U
=t
(49, A
, F
, C
, I
),
1391 'chr novel_production'(A
, U
),
1392 'chr novel_production'(F
, U
),
1393 'chr novel_production'(C
, U
),
1394 'chr novel_production'(I
, U
)
1395 -> 'chr extend_history'(I
, U
),
1396 activate_constraint
(V
, W
, I
, X
),
1398 -> '$insert_in_store_known/1'(I
),
1399 'attach_known/1'(W
, I
)
1403 ( I
=suspension
(Y
, Z
, A1
, B1
, C1
, D1
, E1
),
1406 -> 'chr update_mutable'(inactive
, Z
),
1407 'known/1__13__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1410 ; 'known/1__13__2'(B
, C
, D
, E
, F
, G
, H
, I
, J
, K
)
1412 'known/1__13'(A
, B
) :-
1413 'known/1__14'(A
, B
).
1414 'known/1__14'(A
, B
) :-
1422 ; remove_constraint_internal
(B
, E
, F
),
1424 -> '$delete_from_store_known/1'(B
),
1425 'detach_known/1'(E
, B
)
1430 'known/1__14'(A
, B
) :-
1438 ; remove_constraint_internal
(B
, E
, F
),
1440 -> '$delete_from_store_known/1'(B
),
1441 'detach_known/1'(E
, B
)
1446 'known/1__14'(A
, B
) :-
1452 ; remove_constraint_internal
(B
, E
, F
),
1454 -> '$delete_from_store_known/1'(B
),
1455 'detach_known/1'(E
, B
)
1460 'known/1__14'(A
, B
) :-
1463 'chr via_2'(C
, D
, E
),
1464 get_attr
(E
, guard_entailment
, F
),
1467 'chr sbag_member'(J
, H
),
1468 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
1474 remove_constraint_internal
(J
, T
, U
),
1476 -> '$delete_from_store_known/1'(J
),
1477 'detach_known/1'(T
, J
)
1482 ; remove_constraint_internal
(B
, V
, W
),
1484 -> '$delete_from_store_known/1'(B
),
1485 'detach_known/1'(V
, B
)
1490 'known/1__14'(A
, B
) :-
1493 'chr via_2'(C
, D
, E
),
1494 get_attr
(E
, guard_entailment
, F
),
1497 'chr sbag_member'(J
, H
),
1498 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
1504 remove_constraint_internal
(J
, T
, U
),
1506 -> '$delete_from_store_known/1'(J
),
1507 'detach_known/1'(T
, J
)
1512 ; remove_constraint_internal
(B
, V
, W
),
1514 -> '$delete_from_store_known/1'(B
),
1515 'detach_known/1'(V
, B
)
1520 'known/1__14'(A
, B
) :-
1524 get_attr
(E
, guard_entailment
, F
),
1527 'known/1__14__0'(H
, A
, B
, C
, D
).
1528 'known/1__14__0'([], A
, B
, C
, D
) :-
1529 'known/1__15'(A
, B
).
1530 'known/1__14__0'([A
|B
], C
, D
, E
, F
) :-
1531 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1537 'chr novel_production'(D
, P
),
1538 'chr novel_production'(A
, P
),
1540 -> 'chr extend_history'(D
, P
),
1541 activate_constraint
(Q
, R
, D
, S
),
1543 -> '$insert_in_store_known/1'(D
),
1544 'attach_known/1'(R
, D
)
1548 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1551 -> 'chr update_mutable'(inactive
, U
),
1552 'known/1__14__0'(B
, C
, D
, E
, F
)
1555 ; 'known/1__14__0'(B
, C
, D
, E
, F
)
1557 'known/1__14'(A
, B
) :-
1558 'known/1__15'(A
, B
).
1559 'known/1__15'(A
, B
) :-
1563 get_attr
(E
, guard_entailment
, F
),
1566 'known/1__15__0'(H
, A
, B
, C
, D
).
1567 'known/1__15__0'([], A
, B
, C
, D
) :-
1568 'known/1__16'(A
, B
).
1569 'known/1__15__0'([A
|B
], C
, D
, E
, F
) :-
1570 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1576 'chr novel_production'(A
, P
),
1577 'chr novel_production'(D
, P
),
1579 -> 'chr extend_history'(D
, P
),
1580 activate_constraint
(Q
, R
, D
, S
),
1582 -> '$insert_in_store_known/1'(D
),
1583 'attach_known/1'(R
, D
)
1587 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1590 -> 'chr update_mutable'(inactive
, U
),
1591 'known/1__15__0'(B
, C
, D
, E
, F
)
1594 ; 'known/1__15__0'(B
, C
, D
, E
, F
)
1596 'known/1__15'(A
, B
) :-
1597 'known/1__16'(A
, B
).
1598 'known/1__16'(A
, B
) :-
1601 'chr novel_production'(B
, 55), !,
1602 'chr extend_history'(B
, 55),
1603 activate_constraint
(E
, F
, B
, G
),
1605 -> '$insert_in_store_known/1'(B
),
1606 'attach_known/1'(F
, B
)
1610 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
1613 -> 'chr update_mutable'(inactive
, I
),
1617 'known/1__16'(A
, B
) :-
1618 'known/1__17'(A
, B
).
1619 'known/1__17'(A
, B
) :-
1622 'chr novel_production'(B
, 56), !,
1623 'chr extend_history'(B
, 56),
1624 activate_constraint
(E
, F
, B
, G
),
1626 -> '$insert_in_store_known/1'(B
),
1627 'attach_known/1'(F
, B
)
1631 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
1634 -> 'chr update_mutable'(inactive
, I
),
1638 'known/1__17'(A
, B
) :-
1639 'known/1__18'(A
, B
).
1640 'known/1__18'(A
, B
) :-
1647 ; remove_constraint_internal
(B
, D
, E
),
1649 -> '$delete_from_store_known/1'(B
),
1650 'detach_known/1'(D
, B
)
1655 'known/1__18'(A
, B
) :-
1662 ; remove_constraint_internal
(B
, D
, E
),
1664 -> '$delete_from_store_known/1'(B
),
1665 'detach_known/1'(D
, B
)
1670 'known/1__18'(A
, B
) :-
1677 ; remove_constraint_internal
(B
, D
, E
),
1679 -> '$delete_from_store_known/1'(B
),
1680 'detach_known/1'(D
, B
)
1685 'known/1__18'(A
, B
) :-
1688 'chr novel_production'(B
, 60), !,
1689 'chr extend_history'(B
, 60),
1690 activate_constraint
(D
, E
, B
, F
),
1692 -> '$insert_in_store_known/1'(B
),
1693 'attach_known/1'(E
, B
)
1697 ( B
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1700 -> 'chr update_mutable'(inactive
, H
),
1704 'known/1__18'(A
, B
) :-
1705 'known/1__19'(A
, B
).
1706 'known/1__19'(A
, B
) :-
1709 'chr novel_production'(B
, 61), !,
1710 'chr extend_history'(B
, 61),
1711 activate_constraint
(D
, E
, B
, F
),
1713 -> '$insert_in_store_known/1'(B
),
1714 'attach_known/1'(E
, B
)
1718 ( B
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1721 -> 'chr update_mutable'(inactive
, H
),
1725 'known/1__19'(A
, B
) :-
1726 'known/1__20'(A
, B
).
1727 'known/1__20'(A
, B
) :-
1729 get_attr
(C
, guard_entailment
, D
),
1732 'chr sbag_member'(H
, F
),
1733 H
=suspension
(I
, J
, K
, L
, M
, N
, O
),
1738 remove_constraint_internal
(H
, Q
, R
),
1740 -> '$delete_from_store_known/1'(H
),
1741 'detach_known/1'(Q
, H
)
1746 ; remove_constraint_internal
(B
, S
, T
),
1748 -> '$delete_from_store_known/1'(B
),
1749 'detach_known/1'(S
, B
)
1754 'known/1__20'(A
, B
) :-
1758 get_attr
(D
, guard_entailment
, E
),
1761 'chr sbag_member'(I
, G
),
1762 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
1765 remove_constraint_internal
(I
, Q
, R
),
1767 -> '$delete_from_store_known/1'(I
),
1768 'detach_known/1'(Q
, I
)
1773 ; remove_constraint_internal
(B
, S
, T
),
1775 -> '$delete_from_store_known/1'(B
),
1776 'detach_known/1'(S
, B
)
1781 'known/1__20'(A
, B
) :-
1784 'chr via_2'(C
, D
, E
),
1785 get_attr
(E
, guard_entailment
, F
),
1788 'chr sbag_member'(J
, H
),
1789 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
1795 remove_constraint_internal
(J
, T
, U
),
1797 -> '$delete_from_store_known/1'(J
),
1798 'detach_known/1'(T
, J
)
1803 ; remove_constraint_internal
(B
, V
, W
),
1805 -> '$delete_from_store_known/1'(B
),
1806 'detach_known/1'(V
, B
)
1811 'known/1__20'(A
, B
) :-
1814 'chr via_2'(C
, D
, E
),
1815 get_attr
(E
, guard_entailment
, F
),
1818 'chr sbag_member'(J
, H
),
1819 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
1825 remove_constraint_internal
(J
, T
, U
),
1827 -> '$delete_from_store_known/1'(J
),
1828 'detach_known/1'(T
, J
)
1833 ; remove_constraint_internal
(B
, V
, W
),
1835 -> '$delete_from_store_known/1'(B
),
1836 'detach_known/1'(V
, B
)
1841 'known/1__20'(A
, B
) :-
1845 get_attr
(E
, guard_entailment
, F
),
1848 'known/1__20__0'(H
, A
, B
, C
, D
).
1849 'known/1__20__0'([], A
, B
, C
, D
) :-
1850 'known/1__21'(A
, B
).
1851 'known/1__20__0'([A
|B
], C
, D
, E
, F
) :-
1852 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1858 'chr novel_production'(D
, P
),
1859 'chr novel_production'(A
, P
)
1860 -> 'chr extend_history'(D
, P
),
1861 activate_constraint
(Q
, R
, D
, S
),
1863 -> '$insert_in_store_known/1'(D
),
1864 'attach_known/1'(R
, D
)
1868 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1871 -> 'chr update_mutable'(inactive
, U
),
1872 'known/1__20__0'(B
, C
, D
, E
, F
)
1875 ; 'known/1__20__0'(B
, C
, D
, E
, F
)
1877 'known/1__20'(A
, B
) :-
1878 'known/1__21'(A
, B
).
1879 'known/1__21'(A
, B
) :-
1883 get_attr
(E
, guard_entailment
, F
),
1886 'known/1__21__0'(H
, A
, B
, C
, D
).
1887 'known/1__21__0'([], A
, B
, C
, D
) :-
1888 'known/1__22'(A
, B
).
1889 'known/1__21__0'([A
|B
], C
, D
, E
, F
) :-
1890 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1896 'chr novel_production'(A
, P
),
1897 'chr novel_production'(D
, P
)
1898 -> 'chr extend_history'(D
, P
),
1899 activate_constraint
(Q
, R
, D
, S
),
1901 -> '$insert_in_store_known/1'(D
),
1902 'attach_known/1'(R
, D
)
1906 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1909 -> 'chr update_mutable'(inactive
, U
),
1910 'known/1__21__0'(B
, C
, D
, E
, F
)
1913 ; 'known/1__21__0'(B
, C
, D
, E
, F
)
1915 'known/1__21'(A
, B
) :-
1916 'known/1__22'(A
, B
).
1917 'known/1__22'(A
, B
) :-
1921 get_attr
(E
, guard_entailment
, F
),
1924 'known/1__22__0'(H
, A
, B
, C
, D
).
1925 'known/1__22__0'([], A
, B
, C
, D
) :-
1926 'known/1__23'(A
, B
).
1927 'known/1__22__0'([A
|B
], C
, D
, E
, F
) :-
1928 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1934 'chr novel_production'(D
, P
),
1935 'chr novel_production'(A
, P
)
1936 -> 'chr extend_history'(D
, P
),
1937 activate_constraint
(Q
, R
, D
, S
),
1939 -> '$insert_in_store_known/1'(D
),
1940 'attach_known/1'(R
, D
)
1944 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1947 -> 'chr update_mutable'(inactive
, U
),
1948 'known/1__22__0'(B
, C
, D
, E
, F
)
1951 ; 'known/1__22__0'(B
, C
, D
, E
, F
)
1953 'known/1__22'(A
, B
) :-
1954 'known/1__23'(A
, B
).
1955 'known/1__23'(A
, B
) :-
1959 get_attr
(E
, guard_entailment
, F
),
1962 'known/1__23__0'(H
, A
, B
, C
, D
).
1963 'known/1__23__0'([], A
, B
, C
, D
) :-
1964 'known/1__24'(A
, B
).
1965 'known/1__23__0'([A
|B
], C
, D
, E
, F
) :-
1966 ( A
=suspension
(G
, H
, I
, J
, K
, L
, M
),
1972 'chr novel_production'(A
, P
),
1973 'chr novel_production'(D
, P
)
1974 -> 'chr extend_history'(D
, P
),
1975 activate_constraint
(Q
, R
, D
, S
),
1977 -> '$insert_in_store_known/1'(D
),
1978 'attach_known/1'(R
, D
)
1982 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
1985 -> 'chr update_mutable'(inactive
, U
),
1986 'known/1__23__0'(B
, C
, D
, E
, F
)
1989 ; 'known/1__23__0'(B
, C
, D
, E
, F
)
1991 'known/1__23'(A
, B
) :-
1992 'known/1__24'(A
, B
).
1993 'known/1__24'(A
, B
) :-
1996 'chr novel_production'(B
, 66), !,
1997 'chr extend_history'(B
, 66),
1998 activate_constraint
(E
, F
, B
, G
),
2000 -> '$insert_in_store_known/1'(B
),
2001 'attach_known/1'(F
, B
)
2005 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
2008 -> 'chr update_mutable'(inactive
, I
),
2012 'known/1__24'(A
, B
) :-
2013 'known/1__25'(A
, B
).
2014 'known/1__25'(A
, B
) :-
2017 'chr novel_production'(B
, 67), !,
2018 'chr extend_history'(B
, 67),
2019 activate_constraint
(E
, F
, B
, G
),
2021 -> '$insert_in_store_known/1'(B
),
2022 'attach_known/1'(F
, B
)
2026 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
2029 -> 'chr update_mutable'(inactive
, I
),
2033 'known/1__25'(A
, B
) :-
2034 'known/1__26'(A
, B
).
2035 'known/1__26'(A
, B
) :-
2039 'chr novel_production'(B
, 68), !,
2040 'chr extend_history'(B
, 68),
2041 activate_constraint
(E
, F
, B
, G
),
2043 -> '$insert_in_store_known/1'(B
),
2044 'attach_known/1'(F
, B
)
2048 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
2051 -> 'chr update_mutable'(inactive
, I
),
2055 'known/1__26'(A
, B
) :-
2056 'known/1__27'(A
, B
).
2057 'known/1__27'(A
, B
) :-
2064 chr_runtime
:unlock
(C
), !,
2067 ; remove_constraint_internal
(B
, G
, H
),
2069 -> '$delete_from_store_known/1'(B
),
2070 'detach_known/1'(G
, B
)
2077 add_args_nmatch
(I
, J
, K
),
2081 'known/1__27'(A
, B
) :-
2084 'chr novel_production'(B
, 70), !,
2085 'chr extend_history'(B
, 70),
2086 activate_constraint
(E
, F
, B
, G
),
2088 -> '$insert_in_store_known/1'(B
),
2089 'attach_known/1'(F
, B
)
2093 ( B
=suspension
(H
, I
, J
, K
, L
, M
, N
),
2096 -> 'chr update_mutable'(inactive
, I
),
2100 'known/1__27'(A
, B
) :-
2101 'known/1__28'(A
, B
).
2102 'known/1__28'(A
, B
) :-
2105 'chr novel_production'(B
, 71), !,
2106 'chr extend_history'(B
, 71),
2107 activate_constraint
(D
, E
, B
, F
),
2109 -> '$insert_in_store_known/1'(B
),
2110 'attach_known/1'(E
, B
)
2114 ( B
=suspension
(G
, H
, I
, J
, K
, L
, M
),
2117 -> 'chr update_mutable'(inactive
, H
),
2121 'known/1__28'(A
, B
) :-
2122 'known/1__29'(A
, B
).
2123 'known/1__29'(A
, B
) :-
2126 'chr novel_production'(B
, 72), !,
2127 'chr extend_history'(B
, 72),
2128 activate_constraint
(D
, E
, B
, F
),
2130 -> '$insert_in_store_known/1'(B
),
2131 'attach_known/1'(E
, B
)
2135 ( B
=suspension
(G
, H
, I
, J
, K
, L
, M
),
2138 -> 'chr update_mutable'(inactive
, H
),
2142 'known/1__29'(A
, B
) :-
2143 'known/1__30'(A
, B
).
2144 'known/1__30'(A
, B
) :-
2147 'chr novel_production'(B
, 73), !,
2148 'chr extend_history'(B
, 73),
2149 activate_constraint
(D
, E
, B
, F
),
2151 -> '$insert_in_store_known/1'(B
),
2152 'attach_known/1'(E
, B
)
2156 ( B
=suspension
(G
, H
, I
, J
, K
, L
, M
),
2159 -> 'chr update_mutable'(inactive
, H
),
2163 'known/1__30'(A
, B
) :-
2164 'known/1__31'(A
, B
).
2165 'known/1__31'(A
, B
) :-
2168 'chr novel_production'(B
, 74), !,
2169 'chr extend_history'(B
, 74),
2170 activate_constraint
(D
, E
, B
, F
),
2172 -> '$insert_in_store_known/1'(B
),
2173 'attach_known/1'(E
, B
)
2177 ( B
=suspension
(G
, H
, I
, J
, K
, L
, M
),
2180 -> 'chr update_mutable'(inactive
, H
),
2184 'known/1__31'(A
, B
) :-
2185 'known/1__32'(A
, B
).
2186 'known/1__32'(A
, B
) :-
2189 'chr novel_production'(B
, 75), !,
2190 'chr extend_history'(B
, 75),
2191 activate_constraint
(D
, E
, B
, F
),
2193 -> '$insert_in_store_known/1'(B
),
2194 'attach_known/1'(E
, B
)
2198 ( B
=suspension
(G
, H
, I
, J
, K
, L
, M
),
2201 -> 'chr update_mutable'(inactive
, H
),
2205 'known/1__32'(A
, B
) :-
2206 'known/1__33'(A
, B
).
2207 'known/1__33'(A
, B
) :-
2211 get_attr
(D
, guard_entailment
, E
),
2214 'chr sbag_member'(I
, G
),
2215 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2220 remove_constraint_internal
(I
, R
, S
),
2222 -> '$delete_from_store_known/1'(I
),
2223 'detach_known/1'(R
, I
)
2228 ; remove_constraint_internal
(B
, T
, U
),
2230 -> '$delete_from_store_known/1'(B
),
2231 'detach_known/1'(T
, B
)
2236 'known/1__33'(A
, B
) :-
2240 get_attr
(D
, guard_entailment
, E
),
2243 'chr sbag_member'(I
, G
),
2244 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2249 remove_constraint_internal
(I
, R
, S
),
2251 -> '$delete_from_store_known/1'(I
),
2252 'detach_known/1'(R
, I
)
2257 ; remove_constraint_internal
(B
, T
, U
),
2259 -> '$delete_from_store_known/1'(B
),
2260 'detach_known/1'(T
, B
)
2265 'known/1__33'(A
, B
) :-
2271 get_attr
(F
, guard_entailment
, G
),
2274 'chr sbag_member'(K
, I
),
2275 K
=suspension
(L
, M
, N
, O
, P
, Q
, R
),
2280 ; remove_constraint_internal
(B
, S
, T
),
2282 -> '$delete_from_store_known/1'(B
),
2283 'detach_known/1'(S
, B
)
2288 'known/1__33'(A
, B
) :-
2290 get_attr
(C
, guard_entailment
, D
),
2293 'known/1__33__0'(F
, A
, B
).
2294 'known/1__33__0'([], A
, B
) :-
2295 'known/1__34'(A
, B
).
2296 'known/1__33__0'([A
|B
], C
, D
) :-
2297 ( A
=suspension
(E
, F
, G
, H
, I
, J
, K
),
2304 -> remove_constraint_internal
(A
, O
, P
),
2306 -> '$delete_from_store_known/1'(A
),
2307 'detach_known/1'(O
, A
)
2310 activate_constraint
(Q
, R
, D
, S
),
2312 -> '$insert_in_store_known/1'(D
),
2313 'attach_known/1'(R
, D
)
2317 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
2320 -> 'chr update_mutable'(inactive
, U
),
2321 'known/1__33__0'(B
, C
, D
)
2324 ; 'known/1__33__0'(B
, C
, D
)
2326 'known/1__33'(A
, B
) :-
2327 'known/1__34'(A
, B
).
2328 'known/1__34'(A
, B
) :-
2336 get_attr
(H
, guard_entailment
, I
),
2339 'chr sbag_member'(M
, K
),
2340 M
=suspension
(N
, O
, P
, Q
, R
, S
, T
),
2345 ; remove_constraint_internal
(B
, U
, V
),
2347 -> '$delete_from_store_known/1'(B
),
2348 'detach_known/1'(U
, B
)
2353 'known/1__34'(A
, B
) :-
2355 get_attr
(C
, guard_entailment
, D
),
2358 'known/1__34__0'(F
, A
, B
).
2359 'known/1__34__0'([], A
, B
) :-
2360 'known/1__35'(A
, B
).
2361 'known/1__34__0'([A
|B
], C
, D
) :-
2362 ( A
=suspension
(E
, F
, G
, H
, I
, J
, K
),
2371 -> remove_constraint_internal
(A
, Q
, R
),
2373 -> '$delete_from_store_known/1'(A
),
2374 'detach_known/1'(Q
, A
)
2377 activate_constraint
(S
, T
, D
, U
),
2379 -> '$insert_in_store_known/1'(D
),
2380 'attach_known/1'(T
, D
)
2384 ( D
=suspension
(V
, W
, X
, Y
, Z
, A1
, B1
),
2387 -> 'chr update_mutable'(inactive
, W
),
2388 'known/1__34__0'(B
, C
, D
)
2391 ; 'known/1__34__0'(B
, C
, D
)
2393 'known/1__34'(A
, B
) :-
2394 'known/1__35'(A
, B
).
2395 'known/1__35'(A
, B
) :-
2399 get_attr
(E
, guard_entailment
, F
),
2402 'chr sbag_member'(J
, H
),
2403 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
2410 ; remove_constraint_internal
(B
, S
, T
),
2412 -> '$delete_from_store_known/1'(B
),
2413 'detach_known/1'(S
, B
)
2418 'known/1__35'(A
, B
) :-
2422 get_attr
(D
, guard_entailment
, E
),
2425 'known/1__35__0'(G
, A
, B
, C
).
2426 'known/1__35__0'([], A
, B
, C
) :-
2427 'known/1__36'(A
, B
).
2428 'known/1__35__0'([A
|B
], C
, D
, E
) :-
2429 ( A
=suspension
(F
, G
, H
, I
, J
, K
, L
),
2434 -> remove_constraint_internal
(A
, O
, P
),
2436 -> '$delete_from_store_known/1'(A
),
2437 'detach_known/1'(O
, A
)
2440 activate_constraint
(Q
, R
, D
, S
),
2442 -> '$insert_in_store_known/1'(D
),
2443 'attach_known/1'(R
, D
)
2447 ( D
=suspension
(T
, U
, V
, W
, X
, Y
, Z
),
2450 -> 'chr update_mutable'(inactive
, U
),
2451 'known/1__35__0'(B
, C
, D
, E
)
2454 ; 'known/1__35__0'(B
, C
, D
, E
)
2456 'known/1__35'(A
, B
) :-
2457 'known/1__36'(A
, B
).
2458 'known/1__36'(A
, B
) :-
2464 get_attr
(G
, guard_entailment
, H
),
2467 'chr sbag_member'(L
, J
),
2468 L
=suspension
(M
, N
, O
, P
, Q
, R
, S
),
2475 ; remove_constraint_internal
(B
, U
, V
),
2477 -> '$delete_from_store_known/1'(B
),
2478 'detach_known/1'(U
, B
)
2483 'known/1__36'(A
, B
) :-
2487 get_attr
(D
, guard_entailment
, E
),
2490 'known/1__36__0'(G
, A
, B
, C
).
2491 'known/1__36__0'([], A
, B
, C
) :-
2492 'known/1__37'(A
, B
).
2493 'known/1__36__0'([A
|B
], C
, D
, E
) :-
2494 ( A
=suspension
(F
, G
, H
, I
, J
, K
, L
),
2501 -> remove_constraint_internal
(A
, Q
, R
),
2503 -> '$delete_from_store_known/1'(A
),
2504 'detach_known/1'(Q
, A
)
2507 activate_constraint
(S
, T
, D
, U
),
2509 -> '$insert_in_store_known/1'(D
),
2510 'attach_known/1'(T
, D
)
2514 ( D
=suspension
(V
, W
, X
, Y
, Z
, A1
, B1
),
2517 -> 'chr update_mutable'(inactive
, W
),
2518 'known/1__36__0'(B
, C
, D
, E
)
2521 ; 'known/1__36__0'(B
, C
, D
, E
)
2523 'known/1__36'(A
, B
) :-
2524 'known/1__37'(A
, B
).
2525 'known/1__37'(A
, B
) :-
2531 ; remove_constraint_internal
(B
, E
, F
),
2533 -> '$delete_from_store_known/1'(B
),
2534 'detach_known/1'(E
, B
)
2539 'known/1__37'(A
, B
) :-
2545 ; remove_constraint_internal
(B
, E
, F
),
2547 -> '$delete_from_store_known/1'(B
),
2548 'detach_known/1'(E
, B
)
2553 'known/1__37'(A
, B
) :-
2561 get_attr
(I
, guard_entailment
, J
),
2564 'chr sbag_member'(N
, L
),
2565 N
=suspension
(O
, P
, Q
, R
, S
, T
, U
),
2572 ; remove_constraint_internal
(B
, Y
, Z
),
2574 -> '$delete_from_store_known/1'(B
),
2575 'detach_known/1'(Y
, B
)
2579 'known/1__37'(A
, B
) :-
2583 get_attr
(F
, guard_entailment
, G
),
2586 'known/1__37__0'(I
, A
, B
, C
).
2587 'known/1__37__0'([], A
, B
, C
) :-
2588 'known/1__38'(A
, B
).
2589 'known/1__37__0'([A
|B
], C
, D
, E
) :-
2590 ( A
=suspension
(F
, G
, H
, I
, J
, K
, L
),
2599 -> remove_constraint_internal
(A
, S
, T
),
2601 -> '$delete_from_store_known/1'(A
),
2602 'detach_known/1'(S
, A
)
2605 'known/1__37__0'(B
, C
, D
, E
)
2606 ; 'known/1__37__0'(B
, C
, D
, E
)
2608 'known/1__37'(A
, B
) :-
2609 'known/1__38'(A
, B
).
2610 'known/1__38'(A
, B
) :-
2622 chr_runtime
:unlock
(F
),
2623 chr_runtime
:unlock
(G
),
2624 chr_runtime
:unlock
(H
), !,
2627 ; remove_constraint_internal
(B
, I
, J
),
2629 -> '$delete_from_store_known/1'(B
),
2630 'detach_known/1'(I
, B
)
2635 'known/1__38'(A
, B
) :-
2645 ; remove_constraint_internal
(B
, I
, J
),
2647 -> '$delete_from_store_known/1'(B
),
2648 'detach_known/1'(I
, B
)
2652 'known/1__38'(A
, B
) :-
2653 activate_constraint
(C
, D
, B
, E
),
2655 -> '$insert_in_store_known/1'(B
),
2656 'attach_known/1'(D
, B
)
2660 'chr global_term_ref_1'(B
),
2661 get_attr
(B
, guard_entailment
, C
),
2664 'chr sbag_member'(G
, E
),
2665 G
=suspension
(H
, I
, J
, K
, L
, M
, N
),
2670 get_attr
(B
, guard_entailment
, C
),
2673 'chr sbag_member'(G
, E
),
2674 G
=suspension
(H
, I
, J
, K
, L
, M
, N
),
2688 chr_runtime
:unlock
(C
), !,
2692 add_args_nmatch
(H
, G
, J
),
2693 K
= (\
+functor
(B
, D
, E
);functor
(B
, D
, E
), B
=I
, J
),
2698 'chr via_2'(B
, C
, D
),
2699 get_attr
(D
, guard_entailment
, E
),
2702 'chr sbag_member'(I
, G
),
2703 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2714 get_attr
(D
, guard_entailment
, E
),
2717 'chr sbag_member'(I
, G
),
2718 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2730 get_attr
(D
, guard_entailment
, E
),
2733 'chr sbag_member'(I
, G
),
2734 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2746 get_attr
(D
, guard_entailment
, E
),
2749 'chr sbag_member'(I
, G
),
2750 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2762 get_attr
(D
, guard_entailment
, E
),
2765 'chr sbag_member'(I
, G
),
2766 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2778 get_attr
(D
, guard_entailment
, E
),
2781 'chr sbag_member'(I
, G
),
2782 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2794 get_attr
(D
, guard_entailment
, E
),
2797 'chr sbag_member'(I
, G
),
2798 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2816 test
((B
=<C
, B
=\
=C
)).
2837 chr_runtime
:unlock
(B
),
2838 chr_runtime
:unlock
(C
), !,
2857 'chr global_term_ref_1'(D
),
2858 get_attr
(D
, guard_entailment
, E
),
2861 'chr sbag_member'(I
, H
),
2862 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2869 \
+all_unique_vars
(S
, P
),
2870 chr_runtime
:unlock
(C
),
2871 chr_runtime
:unlock
(P
), !,
2872 T
= (functor
(B
, Q
, R
), B
=C
),
2882 chr_runtime
:unlock
(C
), !,
2892 chr_runtime
:unlock
(C
), !,
2895 add_args_unif
(G
, F
, H
),
2900 'chr global_term_ref_1'(D
),
2901 get_attr
(D
, guard_entailment
, E
),
2904 'chr sbag_member'(I
, H
),
2905 I
=suspension
(J
, K
, L
, M
, N
, O
, P
),
2914 chr_runtime
:unlock
(C
),
2915 chr_runtime
:unlock
(P
),
2916 chr_runtime
:unlock
(B
), !,
2924 'chr global_term_ref_1'(E
),
2925 get_attr
(E
, guard_entailment
, F
),
2928 'chr sbag_member'(J
, I
),
2929 J
=suspension
(K
, L
, M
, N
, O
, P
, Q
),
2933 \
+memberchk_eq
(B
, Q
),
2934 chr_runtime
:unlock
(B
),
2935 chr_runtime
:unlock
(Q
), !,
2995 chr_runtime
:unlock
(B
),
2996 chr_runtime
:unlock
(C
),
2997 chr_runtime
:unlock
(D
), !.
3044 chr_runtime
:unlock
(C
),
3045 chr_runtime
:unlock
(D
),
3046 chr_runtime
:unlock
(E
), !,
3109 builtins
:negate_b
(B
, D
),
3110 builtins
:negate_b
(C
, E
),
3117 'chr global_term_ref_1'(B
),
3118 get_attr
(B
, guard_entailment
, C
),
3121 'chr sbag_member'(G
, E
),
3122 G
=suspension
(H
, I
, J
, K
, L
, M
, N
),
3126 remove_constraint_internal
(G
, Q
, R
),
3128 -> '$delete_from_store_known/1'(G
),
3129 'detach_known/1'(Q
, G
)
3133 builtins
:negate_b
(O
, S
),
3139 'chr global_term_ref_1'(A
),
3140 get_attr
(A
, guard_entailment
, B
),
3143 'cleanup/0__0__0'(D
).
3144 'cleanup/0__0__0'([]) :-
3146 'cleanup/0__0__0'([A
|B
]) :-
3147 ( A
=suspension
(C
, D
, E
, F
, G
, H
, I
),
3149 -> remove_constraint_internal
(A
, J
, K
),
3151 -> '$delete_from_store_known/1'(A
),
3152 'detach_known/1'(J
, A
)
3155 'cleanup/0__0__0'(B
)
3156 ; 'cleanup/0__0__0'(B
)
3161 'chr global_term_ref_1'(A
),
3162 get_attr
(A
, guard_entailment
, B
),
3165 'cleanup/0__1__0'(E
).
3166 'cleanup/0__1__0'([]) :-
3168 'cleanup/0__1__0'([A
|B
]) :-
3169 ( A
=suspension
(C
, D
, E
, F
, G
, H
, I
),
3171 -> remove_constraint_internal
(A
, J
, K
),
3173 -> '$delete_from_store_variables/1'(A
),
3174 'detach_variables/1'(J
, A
)
3177 'cleanup/0__1__0'(B
)
3178 ; 'cleanup/0__1__0'(B
)
3184 'variables/1__0'(A
, B
).
3185 'variables/1__0'(A
, B
) :-
3186 'chr global_term_ref_1'(C
),
3187 get_attr
(C
, guard_entailment
, D
),
3190 'chr sbag_member'(H
, F
),
3191 H
=suspension
(I
, J
, K
, L
, M
, N
, O
),
3198 remove_constraint_internal
(H
, S
, T
),
3200 -> '$delete_from_store_known/1'(H
),
3201 'detach_known/1'(S
, H
)
3206 ; remove_constraint_internal
(B
, U
, V
),
3208 -> '$delete_from_store_variables/1'(B
),
3209 'detach_variables/1'(U
, B
)
3218 'variables/1__0'(A
, B
) :-
3220 -> insert_constraint_internal
(C
, D
, B
, guard_entailment
:'variables/1__0'(A
, B
), variables
(A
), [A
])
3221 ; activate_constraint
(C
, D
, B
, E
)
3224 -> '$insert_in_store_variables/1'(B
),
3225 'attach_variables/1'(D
, B
)
3228 :-multifile
chr:'$chr_module'/1.
3229 chr:'$chr_module'(guard_entailment
).