Hi,
The same example values also create fishy EfEf
sorting using native sorting in Scryer Prolog:
/* Scryer Prolog 0.9.4-417 */
?- values([z,x,y], A), sort(A, B),
-a-a values([x,y,z], C), sort(C, D), B == D.
-a-a false. /* fishy EfEf */
Or using native sorting in SWI-Prolog:
/* SWI-Prolog 9.3.25 */
?- values([z,x,y], A), sort(A, B),
-a-a values([x,y,z], C), sort(C, D), B == D.
false. /* fishy EfEf */
Bye
Mild Shock schrieb:
I checked that your examples are not counter
examples for my compare_with_stack/3.
What makes you think the values I show, X, Y
and Z, are possible in a total linear ordering?
The values also break predsort/3, you can easily
verify that sort([x,y,z]) =\= sort([y,x,z]):
value(x, X) :- X = X-0-9-7-6-5-4-3-2-1.
value(y, Y) :- Y = Y-7-5-8-2-4-1.
value(z, Z) :- H = H-9-7-6-5-4-3-2-1-0, Z = H-9-7-6-5-4-3-2-1.
values(L, R) :- maplist(value, L, R).
?- values([x,y,z], A), predsort(compare_with_stack, A, B),
-a-a-a values([y,x,z], C), predsort(compare_with_stack, C, D),
-a-a-a B == D.
false.
But expectation would be sort([x,y,z]) ==
sort([y,x,z]) since sort/2 should be immune
to permutation. If this isnrCOt enough proof that
there is something fishy in compare_with_stack/3 ,
well then I donrCOt know, maybe the earth is indeed flat?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 59 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 21:02:19 |
| Calls: | 810 |
| Calls today: | 1 |
| Files: | 1,287 |
| D/L today: |
11 files (21,026K bytes) |
| Messages: | 194,568 |