Just a small redundant explanation concerning:
% NOTHING IS BROKEN. You will see scary red messages.
% THEY DO NOT EXIST ON MY WINDOWS MACHINE AT ALL.
% And nothing is broken. I checked. It all works. I don't know what's up.
% But it works on my computer, and you can even query the things SWISH
% says doesn't exist and they WILL exist. Okay?
Red predicates are entry points. That is predicates that are
not called by other predicates. But the analyzer that decides the
color, doesn’t understand what expand_term/2 does, and that
in fact trait/4 is indirectly called by has_trait/1, has_trait_type/2, etc..
Maybe red is a little bit too agressive color for the purpose of
an entry point. It has also a double meaning, if its red, and it is not the
head of a clause, but a goal of the body, it means missing definition
But also the same problem here, the analyzer cannot extrapolate what
term expansion will do. I don’t know whether there is some notebook
technique that could avoid both. Except you could try at the top of the file:
:- dynamic(asserted/1).
The color now changes from red to pink for body occurences. And it
also changes the operational semantic of the expanded predicates a little bit,
since dynamic might be differently compiled than static. I don’t know whether
there is a directive static/1 that would say, hey I will be expanded?