prechac / prechacthis

5 stars 5 forks source link

Port to SWI Prolog 6 #6

Open flowma opened 10 years ago

flowma commented 10 years ago

Apparently, PrechacThis does not run on the current version 6 of SWI-Prolog. That means no installation the desktop, no cross compiling.

flowma commented 10 years ago

Engine seams to work

swipl siteswap_engine.pl
?- siteswap(3, 9, 4, 1, 2, [A,B,C,D]).
A = p(8 rdiv 3, 2, 4),
B = p(4 rdiv 3, 1, 4),
C = D, D = p(4, 0, 4)
imccoy commented 10 years ago

It might be worth taking another slightly-closer look. I've just tracked down a bug in the android version where patterns weren't being rotated correctly. The siteswap/14 predicate was returning both 42p11p and 2p11p4 (for example). It was because is_biggest compares the result of compare/3 with the atoms 'lt' and 'gt', but compare/3 actually produces the atoms '<' and '>'. Changing the test "Order \= lt" to "Order \= <" (and similarly for gt) got all the rotations to work correctly (I hope).

havarpan commented 8 months ago

just got this codebase to work here with swi-prolog 9.2.1 on ubuntu... or maybe it works... at least it seems to work on first sight

jjochen commented 8 months ago

Nice 🎉 Found one issue when pressing the back to results link on the details page.

havarpan commented 8 months ago

yeah i found it too... just commented out the link haha... but i'll cleanup a bit and publish the updated codebase next week... only one patch in there... the dcg_whitespace didn't work properly

havarpan commented 8 months ago

done