:-mode p(M1,...,Mn).
where Mi is c (or +), f (or -), nv, d (or ?), or a
structured mode. The mode c means a closed term that cannot be changed
by the predicate; f means a free variable; nv means a
non-variable term; and d means a don't-know term. The structured mode
l(M1,M2) means a list whose head and tail have modes M1 and M2
respectively; the structured mode s(M1,..., Mn) means a compound
term whose arguments have modes M1, ..., and Mn respectively.
You must declare correct modes. Wrong mode declarations can be a source of vague bugs., e.g., causing interpreted and compiled programs to give different results.