scryer-prolog
scryer-prolog copied to clipboard
Correct and optimize setof/3 and bagof/3
Use variant hashing and equivalence checking in Rust to replace the special purpose constant variable keysort, which produced incorrect solutions for #3151 and #3187 as @jjtolton showed in #3176. Performance is now much faster, a factor of O(N) in the solution size (#3186).
A variable safety bug was exposed in the course of implementing these corrections, which this PR also corrects.