CLP(FD) animations in SWISH
triska opened this issue · 0 comments
Currently, a practical and portable way to show real-time animations of search strategies is to use constraint reification in connection with freeze/2
, and to pipe resulting drawing instructions to an external program like GhostScript.
An example of this approach, visualizing the search process for N-queens with CLP(FD) constraints, is available from:
http://www.metalevel.at/queens/queens.html
Recent advances make it possible to use client-side JavaScript to achieve a similar effect. A proof-of-concept, showing the result for 80 queens using the search strategy ff
, is available from:
http://www.metalevel.at/queens/queens80.html
Such animations clearly illustrate the effect of different CLP(FD) search strategies and are therefore a valuable tool when teaching Prolog and constraints.
Using chunked transfers of compressed drawing instructions could make it possible to integrate such animations in SWISH. Ideally, the framework should be flexible enough to accommodate many kinds of animations for different scheduling tasks. Please contact me or write to the SWI mailing list if you want to work on this item and have any questions. All contributions are welcome!