I agree that is/2 should throw an exception on that cases.
I argument my opinion with the following:
?- a is a.
ERROR: is/2: Arithmetic: `a/0' is not a function
So, since is/2 expect a number or a function (whose result is a number) as its second argument, it has to expect a number as a result of the arithmetic unification.
Indeed, a call like "?- a is 3" should simply be a non-sense goal.
On the other hand, consider the following:
?- pi is pi.
Perhaps one should want such a goal to succeed.
So, since I cannot find a situation in which silent failure could be useful (as in the last case), and since one cannot speak rigorously of a domain error (see, "pi is pi"), I propose a simple type error.
Last edited by mauro
on Wed May 23, 2007 2:56 pm, edited 1 time in total.