Path: csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock Newsgroups: comp.lang.javascript Subject: Porting Railgun CLP(FD) to SWI-Prolog (Re: Lean CLP for Dogelog Player) Date: Sun, 11 Jan 2026 23:07:05 +0100 Message-ID: <10k16u8$32itq$3@solani.org> References: <10g1dmr$hf3g$3@solani.org> <10gc7p1$od7n$4@solani.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 11 Jan 2026 22:07:04 -0000 (UTC) Injection-Info: solani.org; logging-data="3230650"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.22 Cancel-Lock: sha1:aVEytxAn9iDzxmF7jRl18YlpikA= In-Reply-To: <10gc7p1$od7n$4@solani.org> X-User-ID: eJwFwYEBwCAIA7CXQCjDc2qV/09YgigvfVmoxGD6HvPwnFoi7fBdCBPzXNqq2MGT6qWavegE3GLa7BGe/AFxIxX8 Xref: csiph.com comp.lang.javascript:124419 We recently presented a fast constraint solver termed Railgun CLP(FD) that modelled attributed variables simply via ‘$ATTR’/2 compounds and could deal with integer dif/2 constraints. In this instalment we allow (#\=)2 constraints and demonstrate that it can be ported to SWI-Prolog. Using polyfill for ‘$SEQ’/2 from Dogelog Player, we observed that running Railgun CLP(FD) inside SWI-Prolog gives a 2–3x speed-up for the Queens example, on both 32-bit and 64-bit. On the other hand the price tag for big integer flexibility seems to be a factor 35x slow down. See also: Porting Railgun CLP(FD) to SWI-Prolog https://medium.com/2989/e9f2ef4e6878 Mild Shock schrieb: > > Hi, > > Many existing and evolving constraint logic > programming projects resemble some ancient > invention of gunpowder. For example SWI-Prologs > 9.3.35 corouting for delayed goals is mainly > based on unify hooks. We show how verify hooks, > already used in formerly Jekejeke Prolog, can > be braught to Dogelog Player in a 100% Prolog fashion. > > Since the recent version of Dogelog Player > supports cyclic terms, we could let the Jini > out of the bottle, and provide the experimental > library(edge/railgun) to model delayed goals with > nothing else than Alain Colmerauers rational trees. > The result is a Lean CLP of ca. 100 lines of code, > that already provides a simple constraint (#\=)/2 > and a global constraint all_different/1. > > The results are encouraging. For problems that > are not over constrained, Dogelog Player leaves > existing Prolog systems clearly behind, showing > a 2-3x times speed-up against SWI-Prolog and a > 20-30x times speed-up against Trealla Prolog. > For more constrained problems we suggest ommiting > forward checking in favor of a form of ahead of > time (AOT) variable ordering. With this approach > and for Sudoku problems we are then in the midfield > between SWI-Prolog and Trealla Prolog. > > Bye > > See also: > > Lean CLP for Dogelog Player > https://qiita.com/j4n_bur53/items/addf1fc86856dd682dcb