🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #914

Are the wrong races being run?

#914
From: Robin Popplestone
Date: Thu, 14 Jun 1990 17:01
51 lines
2010 bytes
                  Are the wrong races being run?

The main potential advantage of Prolog is as a symbolic programming
language. Of all domains of symbolic processing, perhaps the one which is at
once both firmly founded in mathematics and which outperforms people is
computer algebra (e.g. factorising polynomials over the rationals). For this
fast, arbitrary precision integer and rational arithmetic is essential.

POPLOG timings for successive runs of the call of time in the program below
which tests arbitrary precision multiplication are given:

define factorial(n);
  if n=0 then 1 else n*factorial(n-1)
  endif
enddefine

prolog
:- library(time).
:- time((X is factorial(1000)/factorial(999),print(X))).


 (I put the print in to show the system got the exact integer answer):                 

1000Time for ,
    1.97 secs (CPU)
    0 secs (GC)
1000Time for ,
    1.85 secs (CPU)
    0 secs (GC)
1000Time for ,
    3.31 secs (CPU)
    1.49 secs (GC)
1000Time for ,
    1.7 secs (CPU)
    0 secs (GC)
1000Time for ,
    1.63 secs (CPU)
    0 secs (GC)
1000Time for ,
    3.9 secs (CPU)
    2.12 secs (GC)  [big elapsed time for this GC because of net traffic]

8 Megabyte discless Sun 3/60, some basic POPLOG utilities loaded, various
suntools running. The elapsed-time for the garbage collections varied widely,
depending on net traffic.

I don't have available other Prologs to test, but would be interested to 
hear about timings.

Robin Popplestone.
Technical Details
Message-ID: <15581@dime.cs.umass.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bu.edu!xylogics!transfer!crackers!m2c!umvlsi!dime!cs.umass.edu!pop

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bu.edu!xylogics!transfer!crackers!m2c!umvlsi!dime!cs.umass.edu!pop
From: pop@cs.umass.edu (Robin Popplestone)
Newsgroups: comp.lang.prolog
Subject: Are the wrong races being run?
Message-ID: <15581@dime.cs.umass.edu>
Date: 14 Jun 90 17:01:21 GMT
Sender: news@dime.cs.umass.edu
Reply-To: pop@cs.umass.edu ()
Organization: University of Massachusetts, Amherst
Lines: 51