[m-rev.] for pre-commit review: add nondet_member/2
Zoltan Somogyi
zoltan.somogyi at runbox.com
Sun Mar 2 14:21:05 AEDT 2025
On Sun, 2 Mar 2025 13:53:17 +1100, Julien Fischer <jfischer at opturion.com> wrote:
> In particular, I am looking for opinions on the first two issues below.
>
> 1. Should the new predicate be called nondet_member/2 (as per ranges.m)
> or one_member/2 (as per set_ctree234)?
nondet_member is fine. As I expect you already intend, we should change
one_member in all the modules that have that predicate to also be called
nondet_member, after a transition period.
> 2. On backtracking the (out, in) mode of set_unordlist.member/2 (and
> consequently nondet_member/2) returns all of the elements in the
> representation of the set including duplicates. I think we should
> sort and remove duplicates here as we do for other operations on this
> type of set (e.g. folds).
Agreed.
> 3. Test coverage of many of the set modules in the test suite is quite
> sparse, indeed non-existent in a number of cases.
Agreed. The historical reason for this is that many of those modules were
first tested by making them the default implementation in set.m, which makes
the entire compiler into a single giant test case.
The diff itself is fine.
Zoltan.
More information about the reviews
mailing list