Representation Errors

A representation error occurs when your program calls for the computation of some well-defined value that cannot be represented.

Most representation errors are some sort of overflow:

     functor(T, f, 1000)             % maximum arity is 255
     X is 16'7fffffff, Y is X+1      % 32-bit signed integers
     atom_chars(X, L)                % if length of L > 1024
     

are all representation errors. Floating-point overflow is a representation error.

The exception code for a representation error is

     representation_error(Goal, ArgNo, Message)
     

ArgNo
identifies the argument of the goal that cannot be constructed.
Message
further classifies the problem. A message of 0 or '' provides no further information.