[m-users.] A predicate taking a lists of predicates as input?
Tomas By
tomas at basun.net
Thu Sep 25 02:09:19 AEST 2025
On Wed, 24 Sep 2025 17:32:05 +0200, Anders Lundstedt wrote:
> Thanks everyone for the help! Now another, related, issue.
So `?' applies a list of rules, and then you are nesting them?
First, you could look at list:all_true/1 and related preds.
Then it might be better if you try to explain what it is all about.
If you want to parse a limited, static formalism, like some variant of
predicate logic, then DCG may not be the best solution.
If you really want to use DCG, ie experiment with the grammar and have
something that is easy to work with, then just declare everything
nondet and be done with it.
You just need a top-level call that handles the nondeterminism (calls
solution/2 and picks the first in the list of results).
/Tomas
More information about the users
mailing list