% - list
% - octet_character
% - octet_chars
+% - pair
% - term
must_be(Type, Term) :-
must_be_(list, Term) :- check_(error:ilist, list, Term).
must_be_(type, Term) :- check_(error:type, type, Term).
must_be_(boolean, Term) :- check_(error:boolean, boolean, Term).
+must_be_(pair, Term) :- check_(error:pair, pair, Term).
must_be_(term, Term) :-
( acyclic_term(Term) ->
( ground(Term) -> true
; type_error(Type, Term, must_be/2)
).
+
+pair(_-_).
+
boolean(B) :- ( B == true ; B == false ).
character(C) :-
type(boolean).
type(term).
type(not_less_than_zero).
+type(pair).
%% can_be(Type, Term)
%
).
can_(list, Term) :- list_or_partial_list(Term).
can_(boolean, Term) :- boolean(Term).
+can_(pair, Term) :- pair(Term).
can_(term, Term) :-
( acyclic_term(Term) ->
true