SWI-Prolog / roadmap

Discuss future development
21 stars 3 forks source link

CLP(FD) animations in SWISH #21

Closed triska closed 4 years ago

triska commented 9 years ago

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!