🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3643

Re: rule/2

#3643
From: Richard A. O'Keefe
Date: Wed, 07 Sep 1988 07:10
34 lines
2177 bytes
In article <1431@kulcs.kulcs.uucp> bimbart@kulcs.UUCP (Bart Demoen) writes:
>In article <619@ecrcvax.UUCP> bruno@ecrcvax.UUCP (Bruno Poterie) writes:
>>This may be alright if you seek only efficiency, but:
>>	o  you increase the size of your database by a non-negligible factor
>>	o  you fill up your dictionary with functors 
>[Demoen also included "repr1" and "repr2" again]

>I tested your second remark, on the database size, in BIMprolog, but the
>result might be the same for other implementations as well; and the result
>is not that surprising:

>repr2 uses 8 WAM instructions LESS than repr1
>repr2 uses 260 native code bytes LESS than repr1

Demoen has recently been attacking my tutorial as being dialect-specific.
In the current version of Quintus Prolog,
	repr2	occupies 412 bytes (clauses + procedure records)
	repr1	occupies 312 bytes (clauses + procedure records)
	rule/3	occupies 300 bytes (clauses + procedure records)
where rule/3 is the representation which looks like e.g.
	rule(append([H|T],L,[H|R]), [append(T,L,R)|Goals], Goals).

When making a comparison like this, it is important to make sure that
no other storage is being consumed, so I first compiled a dummy file
which mentioned all the atoms that appeared in Demoen's examples.

There is at least one otherwise sensible Prolog system for PCs which
has a rather low limit on the number of predicates a user can define.
That's not my reason for not having described the method Demoen refers
to as 'repr2', but it does show that Poterie is complaining about a
real problem.  (The real problem is such low limits, of course.)

I don't expect these figures for Quintus Prolog to generalise to other
systems, and I was surprised by them myself.
Technical Details
Message-ID: <360@quintus.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!quintus!ok
References: <1431@kulcs.kulcs.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!quintus!ok
From: ok@quintus.uucp (Richard A. O'Keefe)
Newsgroups: comp.lang.prolog
Subject: Re: rule/2
Message-ID: <360@quintus.UUCP>
Date: 7 Sep 88 07:10:39 GMT
References: <1431@kulcs.kulcs.uucp>
Sender: news@quintus.UUCP
Reply-To: ok@quintus.UUCP (Richard A. O'Keefe)
Organization: Quintus Computer Systems, Inc.
Lines: 34