[mercury-users] unsorted_solutions_foldl... ?

Ralph Becket rafe at cs.mu.OZ.AU
Thu Oct 17 09:56:04 AEST 2002


Ondrej Bojar, Wednesday, 16 October 2002:
> 
> Now I wish to collect a log of the rewriting process, so that it would be
> easy for the author of the rules to debug the rules. The log is
> a directed graph with nodes to represent important states of
> calculation (...and now I applied the rule 14 to the input ABC and got
> the solutions X, Y and Z. Further application of rule 1,2,.. to the
> solution X was not successfull...) I've already written a simple
> 'explorer' of this directed graph.

So far it sounds like solutions over a non-det predicate computing
{Rewrite, Log} pairs should be sufficient.

> I know I could simply rewrite my nondet predicate, so that it would manage
> to deterministically collect all the solutions and pass the log through
> the stages of calculation. But I tried to do the already for three times
> and never succeeded. (There are like four perpendicular options and
> variable limits on the number of times a rule can be applied...) So I
> wanted Mercury to do the job. :-)

Another idea is that if you really need all solutions, why use
non-determinism at all?  You could simply change your representation to
construct the entire rewrite tree and just explore that.

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