By default, calling an undefined predicate is considered to be an error unless that predicate is known to be dynamic (see bas-run-dpr for an explanation of dynamic predicates). For example,
| ?- f(x). ! Existence error in f/1 ! procedure user:f/1 does not exist ! goal: f(x)
You can change this behavior to make undefined predicates fail quietly
by means of the built-in predicate unknown/2
. There is also a
facility, which allows you to have a predicate of your own called whenever
an undefined predicate is called: see unknown_predicate_handler/3
.