print attributes of variables when attribute_goals/2 is not defined

This commit is contained in:
Mark Thom
2019-10-02 17:01:03 -06:00
parent a623061a1a
commit 04bc8ec084
3 changed files with 13 additions and 2 deletions

View File

@@ -9,6 +9,17 @@
:- op(1199, fx, attribute).
% represent the list of attributes belonging to a variable,
% of a particular module, as a list of terms of the form
% Module:put_atts(V, ListOfAtts).
'$default_attr_list'(Module, V, ListOfAtts) :-
Module:get_atts(V, Attributes),
'$default_attr_list'(Attributes, Module, V, ListOfAtts).
'$default_attr_list'([PG | PGs], Module, AttrVar, [Module:put_atts(AttrVar, PG) | Gs]) :-
'$default_attr_list'(PGs, Module, AttrVar, Gs).
'$default_attr_list'([], _, _, []).
'$absent_attr'(V, Attr) :-
'$get_attr_list'(V, Ls),
'$absent_from_list'(Ls, Attr).