Native compare/3 has violations for both ground and non-ground terms.
If you filter ground/1 you get fewer tested cases, and you get a smaller count.
So that it drops from F≈7
to F≈2
is not unlikely. Also every test run might show
a different number, since the random number generator might not hit
the same test cases in each run. But for use cases such as term_factorized/3,
which uses rbtrees in turn, I guess you need a compare/3 that can also
deal with non-ground terms.
Do you have a semi_lex_compare/3
that also works for non-ground terms?
The proposals of @ridgeworks and my proposal are supposed to both work
for non-ground terms as well, but they depend on term_factorized/3,
which seems to be buggy at the moment:
Glitch in term_factorized/3, stack overflow
https://swi-prolog.discourse.group/t/glitch-in-term-factorized-3-stack-overflow/6433
Edit 01.04.2023
Currently the fuzzer does not sample non-ground terms very well, for
example it would not generate s(X,X)
as a test case, i.e. multiple occurence
of the same variable. Maybe should work on a new version of the fuzzer.
Variables are rather generated by accident as a special case of a circular term.
X = X, is a circle of length zero, if I remove randomly generated subterms,
that are variables, the fuzzer would generate only ground terms.