relation module redesign

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Mar 6 16:59:38 AEDT 1998


Hi,

Andrew and I just spent some time discussion the relation module.

The interface to the relation module is a little annoying,
because of the distinction it makes between ordinary values
and relation keys.  Whenever you add anything to the relation,
you need to first add it to the relation's domain (the operation
which does this will give you back a relation_key), and similarly
whenever you want to get anything back you need to explicitly
convert from keys to values.

The aim of this distinction was to cater for operations such as
reflexive transitive closure, which need to know the domain of
the relation.  However, it might be better for the relation module
to keep track of the domain internally, and provide an operation
for adding an element to the domain (for the case where the element
has no links).

Another thing that we discussed was that using the `object' module
(see ~fjh/src/mercury/robdd/object.m) would be a better way of
implementing the key<->value mapping.  Currently it uses `int'
as relation keys, and keeps a pair of maps to map from keys to
values and vice versa, but it could instead use the `object(T)' type
(which is basically just a pointer) obtained from `canonical_object'.

Anyway, I'm just mailing this off so we don't forget about this...
we don't plan to do anything about it in a hurry.

Cheers,
	Fergus (and Andrew).

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



More information about the developers mailing list