Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!conway
From: conway@munta.cs.mu.OZ.AU (Thomas Charles CONWAY)
Subject: Re: Indexing (was Re: Help!! union without cut!?)
Message-ID: <9512021.14586@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU (CS-Usenet)
Organization: Computer Science, University of Melbourne, Australia
References: <3ldruq$fka@cpccux0.cityu.edu.hk> <3lejg1$djm@irix.uci.kun.nl> <3lo84f$4rk@goanna.cs.rmit.edu.au> <HSCHOTEL-0304951429060001@atdmac10.let.kun.nl> <3m34ll$304@gaudi.ac.upc.es> <3mfo2q$jc@goanna.cs.rmit.edu.au> <9510618.27288@mulga.cs.mu.OZ.AU> <3nfpb6$s8j@goanna.cs.rmit.edu.au>
Date: Sun, 30 Apr 1995 11:11:23 GMT
Lines: 24

ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) writes:

>>In the Mercury implementation ...
>
>Yes, but Mercury has strict modes (unlike Prolog) and block compilation
>(unlike Edinburgh Prologs).
>
>>we merge the multiple clauses of a
>>predicate into a single clause with an explicit disjunction
>
>Yes, that's easy.  In effect Kliger did the same thing for FCP.
>I did it for my (unfinished) Prolog-D.  It helps a treat *IF* you
>have compile-time information about modes *AND* block compilation.

From my limited experience, it appears that the strict types and
modes used by Mercury are well worth the restrictions they impose.
Not only do they enable efficient indexing (In many cases, the
Mercury implementation is able to achieve indexing that is quicker
than switches in C), but they enable the compiler to warn about
many errors that often occur and can take ages of tedious debugging
to find such as missing or duplicate clauses. (Duplicate clauses
are mainly a problem if they cause choice points to hang around.)

Thomas
