An instantiation error occurs in Prolog when an argument is insufficiently instantiated. It is frequently encountered with (is)/2 and the built-ins for arithmetical comparison like (>)/2 and (=:=)/2 that all expect variable free expressions.
An "instantiation" error occurs in prolog when an argument is insufficiently instantiated. It is frequently encountered with (is)/2
and the built-ins for arithmetical comparison like (>)/2
, (=:=)/2
that all expect fully instantiated, ground terms (i.e. without uninstantiated logical variables in them) as arguments.
In many cases, there are more general predicates available that work also if their arguments are not fully instantiated. For example, many Prolog systems support the CLP(FD) constraints (#=)/2
and (#>)/2
which can be used as pure alternatives.
Another course of action is to delay the call until such time that all arguments become instantiated, with such tools as freeze/2
of SWI Prolog (as can be seen e.g. in this answer).