[m-dev.] for review: add ROBDD interface to Mercury

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 13 21:41:45 AEDT 2000


On 07-Jul-2000, David Overton <dmo at cs.mu.OZ.AU> wrote:
> Peter Schachte, would you please have a look at this.
> 
> Also Tyson or Fergus, when you get a chance, I would appreciate your
> comments, particularly on the GC stuff in `robdd/bryant.c' and the
> configuration management issues.
> 
> At the moment I have included `robdd.m' as part of the standard
> library.  I'm not sure if this is appropriate, but I wanted to use it
> in the compiler so this seemed like a convenient place to put it.  Is
> this okay or should I move somewhere else, e.g. `extras/'?

My first impressions is that I don't think ROBDDs are sufficiently
widely used to warrant inclusion in the standard library.
`extras' would be more appropriate, IMHO.

There is a configuration management problem with using something
in extras in the compiler.  Currently we don't have a good solution
for that.  Probably the right thing to do is to put the cvs copy
somewhere in the compiler distribution, and have the Mmake rule which
creates the extras distribution copy the relevant files into somewhere
in the extras subdirectory before creating the tar.gz file.
(This problem also applies to browser/dl.m and extras/dynamic_linking/dl.m.)

For the copy in the compiler distribution, I think putting the robdd
stuff in its own directory as you have done, like we do with the Boehm gc,
is a good decision.

> +++ robdd/bryant.c	2000/07/07 00:56:41
> @@ -91,6 +91,12 @@
>  
>  *****************************************************************/
>  
> +#ifdef CONSERVATIVE_GC
> +	/* We need to include mercury_imp.h to get the definition of `Word'. */
> +#	include <mercury_imp.h>
> +#	define BRYANT_CONSERVATIVE_GC
> +#endif

You should use `#include "mercury_imp.h"' -- the angle brackets should
only be used for system header files.

If you're following the Mercury group's C coding guidelines, the indentation here
should be two spaces rather than one tab, and the `#' should be indented too.

> +/* Define a macro to disguise pointers that we want to hide from the
> + * collector.
> + */

Likewise the comment layout style here doesn't match the Mercury group's C
coding guidelines.

robdd.m:
> +:- pragma c_header_code("#include <bryant.h>\n").

s/</""/
s/>/""/

> +% make_node(Var, Then, Else).
> +% The make_node() function.  WARNING!! If you use this function you are
> +% responsible for making sure that the ROBDD invariant holds that all the
> +% variables in both the Then and Else sub graphs are > Var.

s/holds that/holds, i.e. that/ ?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list