[PPL-devel] [Xsb-development] Arithmetic evaluation bug in the CVS HEAD version of XSB

Bart Demoen Bart.Demoen at cs.kuleuven.ac.be
Sun Sep 23 21:32:42 CEST 2007


> I'm interested in why you think this (especially as this is what we
> do anyway :-)

A bunch of small reasons:

- how much time goes into explaining to new users of Prolog this
  particular feature of Prolog ? just too much to be worth its while


- lot's of existing code has the form:

       loop(0) :- !.
       loop(N) :-
               M is N - 1,
               loop(M).

also in libraries.
Try to explain to users that ?- loop(0). finishes (quickly) but that
?- loop(1-1). loops.

- try giving a type to predicates that use ISO arithmetic - you must
  cater for the arithmetic expressions; suddenly, lists that were
  supposed to have only numbers, are typed as list of arit_expression
  and this propagates in places you don't want


- I find it inconsistent that some builtins but not all, accept
  besides numbers also arithmetic expressions (similar for library
  predicates); why is ?- length([1,2,3],1+2). in SWI an error, but
  succeeds in Yap ? Why did ISO decide to flag ?- functor(foo(1),_,2-1).
  as an error ? How about ?- put(97+1). ? Not ISO I know, but Yap and
  SICStus (3.*) are fine with it, while SWI (5.6.39) says Type error.

- how much time goes into maintaining besides a compilation schema for
  arithmetic, also an interpreter ? just too much to be worthwhile


> Unfortunately, it is still the same in 3.1 (unless you use 64-bit
> compilation).
But I would then just use larger numbers and have the same problems,
right ?


Cheers

Bart Demoen



More information about the PPL-devel mailing list