[mercury-users] Help: generic tree predicates; modules
Bob McKay
bob_mckay at mac.com
Thu May 9 15:37:24 AEST 2002
Hi folks; I'm just getting my feet wet(ter) with mercury, and I have
a couple of questions which I can solve, but maybe there are easier
ways (this is in the context of a generic evolutionary computation
system that Raymee Chau and Daryl Essam have previously posted about).
.I'd like to be able to write some generic tree manipulation
predicates, such as count_nodes(T,N), which would be passed
an instantiated tree T, and would return the number of nodes.
And I need it to be determinate. This is straightforward if I
know the set of functors, but I want this to be part of a library
for a GP system, so the set of functors won't be known until the
time that a particular problem is being defined. Is there a
straightforward way to do this? The way I can half-see, defining
a higher-order predicate and passing it a list of allowed
functors, looks a bit scary...
.I'd like to segment the source into different directories (currently
it's all in one flat directory structure). I'm doing it using
libraries, but this involves creating libraries (for
example, for the problem-specific code) whose only purpose
is to permit the code to reside in a separate directory.
Is this the intended method for splitting up Mercury code?
Best Wishes
Bob McKay
Signature: I am using this email account for efficiency reasons while
travelling. It is not my primary account. Please send replies for
preference to rim at cs.adfa.edu.au (mac mail does not appear to have a
mechanism to set the reply-to field)
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list