[m-users.] A predicate taking a lists of predicates as input?

Anders Lundstedt mercury-users at anderslundstedt.se
Thu Sep 25 01:35:50 AEST 2025


> % gives compilation error, but not if the both the determinism of ? and of
> % this predicate is changed to semidet, in which case we get warnings about
> % too loose determinism for ?
> :- pred test_1(list(char)::in, list(char)::out) is det.
> test_1 --> ?([['a'], ?([['b']])]).

Sorry, tried to simplify too much. Here is a correct example:

:- pred r_a(list(char)::in, list(char)::out) is semidet.
:- pred r_b(list(char)::in, list(char)::out) is semidet.
r_a --> ['a'].
r_b --> ['b'].
% gives compilation error, but not if the both the determinism of ? and of
% this predicate is changed to semidet, in which case we get warnings about
% too loose determinism for ?
:- pred test_1(list(char)::in, list(char)::out) is det.
test_1 --> ?([r_a, ?([r_b])]).


More information about the users mailing list