[comp.lang.prolog] PROLOG Digest V5 #21

PROLOG-REQUEST@SUSHI.STANFORD.EDU.UUCP (03/23/87)

PROLOG Digest            Tuesday, 24 Mar 1987      Volume 5 : Issue 21

Today's Topics:
                      Programming - Use of Cut,
     Implementation - Stack Allocation & Opinion & Microcomputers
----------------------------------------------------------------------

Date: Fri, 20 Mar 87 08:44:17 PST
From: Fernando Pereira <pereira@sri-candide.ARPA> 
Subject: Save the cuts

A recent posting of a Prolog coding of the 91 function was

        foo(X,Z) :-
          X > 100,
          Z is X - 10.
        foo(X,Z) :-
          X < 101,
          T is X + 11,
          foo(T,Z),
          !.          % <<<<<<< Unnecessary cut

I've seen this kind of unecessary use of cut more times than I care to
remember. Is there no hope for logic programming in Prolog? We are all
painfully aware of the gap between the ideal of logic programming and
the limited tools we have, but MANY interesting and important programs
can be written in Prolog without a single extralogical operation.
Logic programming IS possible in Prolog (and functional programming in
Lisp!) Please, don't let the need for extralogical operations in SOME
problems poison your ability to write pure Prolog when that is possible
(and superior even on efficiency grounds!)

-- Fernando Pereira

------------------------------

Date: Fri, 6 Mar 87 17:01:31+0900
From: Kiyeol Ryu <kyryu%csd.kaist.ac.kr@RELAY.CS.NET>
Subject: Stack Allocation

You can specify the allocation of stack areas in C-Prolog 1.5 as follows.

   prolog -h N -g N -l -N -t N -a N -x N

   where -h means the heap allocation of N K bytes,
         -g means the global stack allocation of N K bytes,
         -l means the local stack allocation of N K bytes,
         -t means the trail allocation of N K bytes,
         -a means the atom area allocation of N K bytes, and
         -x means the auxiliary allocation of N K bytes.

These parameters are defined in parms.c as like below.

  #define AtomSize       128*K
  #define AuxSize          8*K
  #define TrailSize       64*K
  #define HeapSize       256*K
  #define GlobalSize     256*K
  #define LocalSize      128*K

I'm not sure why your version does not allow the allocation of stack
areas. The above parameters returned from "prolog" command are processed
in main.c and you may fix the bugs by correcting the routine.

-- D.W. Shin

------------------------------

Date: Wed, 18 Mar 87 13:01:17 EST
From: Ken Bowen <kabowen%syr-sutcase.csnet@RELAY.CS.NET>
Subject: PC-Prologs

Of late there has been a surge of discussion about PC-Prologs.

Anyone wanting a really good PC Prolog compiler should look hard at
ALS Prolog.  It is a true Edinburgh Prolog, implemented as an
incremental interactive compiler, which means it looks & feels like an
interpreter, but EVERYTHING (including assertable,retractable
predicates) is compiled (with NO declarations required).  It is FAST:
Naive Reverse (length=100,iterations=30) on PC:3400, on AT:10,000, on
AT with 8MHz clock:14,000, on COMPAQ386: 31,000. Has 4-port debugger,
listing, etc.  Has a fearsome complete garbage collector: lists of
length 2,000+ can be reversed; versions of the UNIX Worms program
implemented tail-recursively & generating garbage can run for days,
etc., etc.  [Worms & many other non-trivial example programs are
shipped on the disks.  Bratko's book is included.]  Has ALL
higher-level constructs (call, univ, etc.).  Unfortunately, it isn't
the cheapest, but the programmers need to eat & don't have the $$ to
blow like Borland.  The Personal Version is $199, the Professional
Version is $499 (volume & educ. discounts avail.).

        Both versions are the same core system.  The Professional has lots
of bells & whistles for serious applications development: access to BIOS,
C-interface (currently to Aztec C, extension to MS-C in progress), access
to the compiler's code generator for Warren Machine instructions, etc.
Version 1.05 (in extended beta-test) of the Professional allows absolutely
unbounded program size (terabytes if you have a hard disk that big) by doing
complete procedure swapping.  It will be shipped this spring as a free
upgrade to Professional Version users.  Also available shortly will be
interface products allowing the data in dBase or R:Base files to be viewed
as VIRTUAL fact predicates (No dumping of the data into Prolog facts).
Purchasers of the Personal Version can upgrade to the Professional for
the difference in price.

------------------------------

End of PROLOG Digest
********************