1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % Author
: Tom Schrijvers
3 % Email
: Tom
.Schrijvers
@cs.kuleuven
.ac
.be
4 % Copyright
: K
.U
.Leuven
2004
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 :- use_module
(hprolog
).
15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18 negate_b
(X
=< Y
, Y
< X
).
19 negate_b
(X
> Y
, Y
>= X
).
20 negate_b
(X
>= Y
, Y
> X
).
21 negate_b
(X
< Y
, Y
=< X
).
22 negate_b
(var
(X
),nonvar
(X
)).
23 negate_b
(nonvar
(X
),var
(X
)).
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 entails
(A
,C
,History
) :-
39 \
+ hprolog
:memberchk_eq
(B
,History
),
40 entails
(B
,C
,[B
|History
]).
42 entails_
(X
> Y
, X
>= Y
).
43 entails_
(X
> Y
, Y
< X
).
44 entails_
(X
>= Y
, Y
=< X
).
45 entails_
(X
< Y
, Y
> X
).
46 entails_
(X
< Y
, X
=< Y
).
47 entails_
(X
> Y
, X \
== Y
).
48 entails_
(X \
== Y
, Y \
== X
).
49 entails_
(X
== Y
, Y
== X
).
50 entails_
(ground
(X
),nonvar
(X
)).
51 entails_
(compound
(X
),nonvar
(X
)).
52 entails_
(atomic
(X
),nonvar
(X
)).
53 entails_
(number
(X
),nonvar
(X
)).
54 entails_
(atom
(X
),nonvar
(X
)).
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 binds_
(nonvar
(_
),L
,L
).
62 binds_
(ground
(_
),L
,L
).
63 binds_
(compound
(_
),L
,L
).
64 binds_
(number
(_
),L
,L
).
66 binds_
(atomic
(_
),L
,L
).
67 binds_
(integer
(_
),L
,L
).
79 binds_
(X is _
,[X
|L
],L
).
80 binds_
((G1
,G2
),L
,T
) :-
83 binds_
((G1
;G2
),L
,T
) :-
86 binds_
((G1
->G2),L
,T
) :-