Subject: Re: handling small numbers

From: Nicos Angelopoulos <[email-masked]>
Date: Wed, 10 May 2000 09:52:53 +0100

On Wed, 10 May 2000, Richard A. O'Keefe wrote:

> Considering the goal
>     J is I + 1
> where integer(I) is known to be true, Paul Sephton says
> 
> 	It's not a wrong answer if you fail the goal- it's no answer at all 
> 	within the confines of the implementation.
> 
> That doesn't make sense to me.  The plain fact of the matter is that
> if I is an integer in Prolog, then the goal J is I+1 ***has*** a
> solution.  To fail the goal is to say that there is no solution,
> but that is totally wrong.  There *is* a solution.
> 

	personaly i have a problem with the semantics of exceptions, 
	if you use prolog as an approximation to logic this might be
	an important issue, 

	in the end of the day no matter what you do it is impossible to
	represent, even, N on a finite computer,

	treating integer (and other number) arithmetic as approximations
   	of the _real_ thing is the best known approach to getting 
	_clean_ implementations

	btw, it is thought that failure is a better semantic notion than
	exception, 

	in the example  J is I + I 

	your output depends on you input. ie 
	depends where J and I come from, 

	if you want to pretent that the are drawn from the set of
	_integers_ please by all means do so, 

	on the other hand you might want to admit that the 
	underlying abstract machine can only do MININT to MAXINT

	finally from a programmer's point of view i think it is a matter
	of taste and habbit

	from an implementor's point of view, i really dont know
	and honestly i dont want to know, that is why i use 
	prolog and not an algorithmic language

regards

nicos