Article View: comp.lang.prolog
Article #2146Re: Occurs check
From: Bruno Dumant
Date: Mon, 21 Dec 1992 10:48
Date: Mon, 21 Dec 1992 10:48
38 lines
2246 bytes
2246 bytes
Saumya Debray writes:
>
> Fernando Pereira writes:
> > Nonetheless, the efficiency reasons that led to Prolog's
> > unification not having the check are pretty compelling, so I do not advocate
> > adding it to Prolog in all cases.
>
> While I believe this statement, it would be interesting to actually see some
> numbers (preferably for programs other than nrev) showing how much more
> expensive unification becomes with the occurs check. Do the implementors
> of Sepia, NU-Prolog, and other systems that provide both kinds of
> unification have any numbers they'd care to post?
Some benchmarks were published in a paper presenting an architecture design of
a RISC processor for Prolog, in which the occur-check is always performed if
necessary. They use the WAM, and take advantage of the fact that only
get_value instructions really need to call the occur-check routine. According
to their results, 5 % of the time is spent performing the occur-check... It's
not that much !! Their benchmark programs include quite large programs, up to
5600 lines.
With some analysis (even a simple groundness analysis can be useful, but there
are also some more sophisticated analysis schemes), I'm sure that on most
programs, the overhead of the occur-check on a compiled Prolog can be negligible.
Reference:
@inproceedings{ DRSW-89,
author = "Peter Dreussen and Wolfgang Rosentiel and Klaus Erik Schauser and
J{\"{o}}rg Wedeck",
Title = "{Architecture Design of a RISC Processor for Prolog}",
Booktitle = "Euromicro 89",
Year = 1989 }
B. Dumant
Technical Details
Message-ID:
<1992Dec21.104802.11246@prl.dec.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!decuac!pa.dec.com!decprl!decprl!dumantReferences:
<1992Dec13.173016.8849@nntp.hut.fi> <1992Dec17.111142.24450@dcs.qmw.ac.uk> <24435@alice.att.com> <1992Dec17.185017.17766@cs.uoregon.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!decuac!pa.dec.com!decprl!decprl!dumant From: dumant@prl.dec.com (Bruno Dumant) Subject: Re: Occurs check Message-ID: <1992Dec21.104802.11246@prl.dec.com> Sender: news@prl.dec.com (USENET News System) Nntp-Posting-Host: prl304.prl.dec.com Organization: Digital Equipment Corporation - Paris Research Laboratory References: <1992Dec13.173016.8849@nntp.hut.fi> <1992Dec17.111142.24450@dcs.qmw.ac.uk> <24435@alice.att.com> <1992Dec17.185017.17766@cs.uoregon.edu> Date: Mon, 21 Dec 1992 10:48:02 GMT Lines: 38