Autumn Challenge 2023: Lion and Unicorn

Here is a test, yesterday/2 symbolic is faster:

/* SWI-Prolog 9.1.17 */
?- L=[sunday,monday,tuesday,wednesday,thursday,friday,saturday], 
    time((between(1,1000000,_), member(X,L), yesterday(X,Y), fail; true)).
% 15,999,998 inferences, 0.609 CPU in 0.604 seconds
(101% CPU, 26256407 Lips)
L = [sunday, monday, tuesday, wednesday, thursday, friday, saturday].

?- L=[0,1,2,3,4,5,6], time((between(1,1000000,_), member(X,L), 
Y is (X-1) mod 7, fail; true)).
% 15,999,998 inferences, 1.141 CPU in 1.146 seconds
(100% CPU, 14027396 Lips)
L = [0, 1, 2, 3, 4, 5, 6].

Amazing! Was using SWI-Prolog with default settings.

Maybe this doesn’t hold for all Prolog systems?

Edit 11.11.2023
How would a novel CLP(FD) or ZZD library look like, that
can directly work symbolic. It hasn’t been yet invented, or has it?
What would it do to the Lion and Unicorn example? You could

view the Bruce Ramsey solution as a form of spare matrices
in FORTRAN. A predicate is a kind of spare matrice, since it
only “stores” 1 and omits 0, and negation as failure which

flips 1 to 0 and 0 to 1 based on spare matrices. ZDD since it
zero supresses has also some potential. But what can constraints
programming do in the Lion and Unicorn example?