% Demostrate the use of 'subsumed'
% The predicate is subsumed by a KB-fact if the KB-fact is the same or
%    more general.
:- eval(test021()).

test021() :-
	println(["==========test021=========="]),
	subsumed(symmetric(f)),
	println(["Rule A: symmetric(f) is subsumed by a fact in the KB."]),
	subsumed(symmetric(Y)),
	println(["Rule A: symmetric(Y) is subsumed by a fact in the KB."]).
test021() :-
	retract(symmetric(_)),
	print_symmetric(),
	subsumed(symmetric(Y)),
	% The code below should be unreachable
	println(["Rule B: symmetric(Y) is subsumed by a fact in the KB."]).

print_symmetric() :-
	fact(symmetric(X)),
	println(["symmetric(",X,")"]),
	fail().
print_symmetric().

symmetric(g).
symmetric(_).

symmetric(X) :-
	5=X.

