Facilities of Mercury

Fergus Henderson fjh at cs.mu.oz.au
Thu Mar 6 02:02:48 AEDT 1997


Serap Yilmaz, you wrote:
> 
> My aim is to find the "most specific generalization" of two terms. I need
> this, because I am working on an automatic programming system that induces
> recursive logic programs. At one step of this system, I need to find that
> most spec. generalization of two terms.

OK, so my initial advice was right -- the standard library module `term',
and its companion `varset', were designed for exactly this sort of thing.

> I thought on using ground representation, however as far as I can see it
> is not possible to use in finding the msgs of two terms. I need to
> distinguish between variables and constants.

You can do that quite easily using the standard library `term' type, e.g.

	foo(term__variable(V), ...) :- ...
	foo(term__functor(Functor, Args, _Context), ...) :- ...

-- 
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 users mailing list