🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1386

Re: The Craft of Prolog, pp. 126-30

#1386
From: Anjo Anjewierden
Date: Thu, 08 Nov 1990 10:01
34 lines
1777 bytes
Richard A. O'Keefe writes:

> Answer:  we have a number with 9 decimal digits.  I am aware of Prolog
> systems with 14-bit, 16-bit, 17-bit, 18-bit, 20-bit, 24-bit, 28-bit,
> 29-bit, and 32-bit integer arithmetic, as well as logical arithmetic
> (by which I mean arithmetic with no stupid bit bound).  How large can
> an integer with 9 distinct decimal digits get?
>       987654321
> How many bits does this need?
>       30
> Will that _work_ in the Prolog systems I was using at the time?
>       a certain Prolog interpreter on a Sun-3/50      : NO
>       a certain Prolog compiler on a Sun-3/50         : NO
>       a certain Prolog compiler on a PC               : NO
>       another Prolog compiler on a PC                 : NO
> So _could_ I have used Anjewierden's method?
>       No.
>
> Recite after me:  "not every Prolog system provides 32-bit integers".

Doesn't the last sentence follow *logically* (if worded
appropriately) from the previous sentences?  A positive reading of my
message is: apparently there is nothing wrong with the programs up to
page 126.

I agree the considerations above are reasonable from a practical point
of view.  To avoid confusion, it is a good idea to state why
a number is represented as a list of digits.

I'm about to conclude every program in ``The Craft of Prolog'' will
run on Prolog implementations with 14-bit integer arithmetic.  Is
this right?

:- Anjo, !.
Technical Details
Message-ID: <4492@swi.swi.psy.uva.nl>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!swi.psy.uva.nl!anjo

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!swi.psy.uva.nl!anjo
From: anjo@swi.psy.uva.nl (Anjo Anjewierden)
Newsgroups: comp.lang.prolog
Subject: Re: The Craft of Prolog, pp. 126-30
Message-ID: <4492@swi.swi.psy.uva.nl>
Date: 8 Nov 90 10:01:50 GMT
Reply-To: anjo@swi.psy.uva.nl ()
Organization: SWI, UvA, Amsterdam
Lines: 34