Did you know ... Search Documentation:
Predicate mode_db/3
 mode_db(+Structural, +SCCs, -ModeDB) is det[private]
ModeDB is an assoc mapping the directly recursive predicates of SCCs that recurse on a proper subterm to their mode declarations, a non-empty list of terms Name(Ind, ...), where Ind is a mode indicator such as +, - or ?. Mode declarations are taken from the first of these sources that provides them:
  1. A mode/1 declaration, as reported by the predicate property mode(Head). This also covers XSB :- mode declarations (see library(dialect/xsb)).
  2. PlDoc structured comments. If PlDoc was active while loading, these are available as '$mode'/2 facts. Otherwise the source file is cross-referenced using xref_source/2.