An instantiation error occurs when a predicate or command is called with one of its input arguments insufficiently instantiated.
The SICStus_Error term associated with an instantiation error is
instantiation_error(Goal, ArgNo)
where ArgNo is a non-negative integer indicating which argument caused the problem. ArgNo=0 means that the problem could not be localized to a single argument.
Note that the ArgNoth argument of Goal might well be a non-variable: the error is in that argument. For example, the goal
X is Y+1
where Y is uninstantiated raises the exception
instantiation_error(_2298 is _2301+1,2)
because the second argument to is/2
contains a variable.