[mercury-users] Getting 'any' insts to ground
Bas de Bakker
basde.bakker at pica.nl
Tue Nov 11 19:01:58 AEDT 1997
>>>>> "Lee" == Lee Naish <lee at cs.mu.OZ.AU> writes:
Lee> I suggest a semidet procedure only_solution and a det
Lee> procedure one_and_only_solution. The "_solution" could be
Lee> dropped from both if you want things more concise.
Lee> Only_solution could have a det mode(s) if its argument has a
Lee> mode which guarantees at least one solution.
Lee> One_and_only_solution can be implemented using only_solution
Lee> and error.
Two more points:
only_solution as a means of verifying groundness won't work if (as in
my previous message) I actually want more solutions from a
nondeterministic predicate. What I could use in that case would be a
version of solutions (and friends like unsorted_aggregate) that aborts
as soon as the predicate returns with its variable non-ground.
An only_solution that fails (instead of aborts) as soon as the
predicate called returns with a non-ground variable would have to
check that the type of the free variable is one that allows more than
More information about the users