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

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


On 07-Jul-2000, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Fri, Jul 07, 2000 at 11:53:50AM +1000, David Overton wrote:
> > +/* Define a macro to disguise pointers that we want to hide from the
> > + * collector.
> > + */
> > +#define MUNGE_(p) (~(p))
> > +#define MUNGE(p) ((node *) MUNGE_((Word) p))
> 
> I think it would be worth mentioning why you want to hide robdd nodes from
> GC.
> 
> Also, bitwise negation is a cute way to munge things, but may not be a
> appropriate on some architectures.  Anyway, using the same macro for munging
> and unmunging is a bit confusing.  I think you should have separate macros
> for each, and use them appropriately.  To test that you've done it right,
> you might try munging by adding 1.

The best way to do the munging is probably by

	#ifdef CONSERVATIVE_GC
	  #define GC_I_HIDE_POINTERS
	  #include "gc.h"
	#else
	  #define HIDE_POINTER(p) (p)
	  #define REVEAL_POINTER(p) (p)
	#endif

> > +% File: robdd.m.
> > +% Main author: dmo
> > +% Stability: low
> > +
> > +% This module contains a Mercury interface to Peter Schachte's C implementation
> > +% of Reduced Ordered Binary Decision Diagrams (ROBDDs).
> > +% ROBDDs are an efficent representation for Boolean functions.
> 
> You might want to say "Boolean constraints" instead, as I think more people
> would understand that.
> 
> Also, if this is to be added to the library, I think a couple of paragraphs
> explaining what it is about and how to use it, ideally with a simple example
> or two, is important.

Same goes even if it is to be added to the extras...

-- 
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