CHRAnimation: An Animation Tool for Constraint Handling Rules

  • Nada SharafEmail author
  • Slim Abdennadher
  • Thom Frühwirth
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8981)


Visualization tools of different languages offer its users with a needed set of features allowing them to animate how programs of such languages work. Constraint Handling Rules (CHR) is currently used as a general purpose language. This results in having complex programs with CHR. Nevertheless, CHR is still lacking on visualization tools. With Constraint Handling Rules (CHR) being a high-level rule-based language, animating CHR programs through animation tools demonstrates the power of the language. Such tools are useful for beginners to the language as well as programmers of sophisticated algorithms. This paper continues upon the efforts made to have a generic visualization platform for CHR using source-to-source transformation. It also provides a new visualization feature that enables viewing all the possible solutions of a CHR program instead of the don’t care nondeterminism used in most CHR implementations.


Constraint Handling Rules Algorithm visualization  Algorithm animation Source-to-source transformation 

Supplementary material


  1. 1.
    Frühwirth, T.: Theory and practice of constraint handling rules, special issue on constraint logic programming. J. Logic Program. 37, 95–138 (1998)CrossRefzbMATHGoogle Scholar
  2. 2.
    Abdennadher, S., Sharaf, N.: Visualization of CHR through source-to-source transformation. In: Dovier, A., Costa, V.S. (eds.) ICLP (Technical Communications). LIPIcs, vol. 17, pp. 109–118. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2012)Google Scholar
  3. 3.
    Rodger, S.H.: Introducing computer science through animation and virtual worlds. In: Gersting, J.L., Walker, H.M., Grissom, S. (eds.) SIGCSE, pp. 186–190. ACM (2002)Google Scholar
  4. 4.
    Duck, G.J., Stuckey, P.J., García de la Banda, M., Holzbaur, C.: The refined operational semantics of constraint handling rules. In: Demoen, B., Lifschitz, V. (eds.) ICLP 2004. LNCS, vol. 3132, pp. 90–104. Springer, Heidelberg (2004) CrossRefGoogle Scholar
  5. 5.
    Frühwirth, T.: Constraint Handling Rules. Cambridge University Press, Cambridge (2009) CrossRefzbMATHGoogle Scholar
  6. 6.
    Abdennadher, S., Saft, M.: A visualization tool for constraint handling rules. In: Kusalik, A.J. (ed.) WLPE (2001)Google Scholar
  7. 7.
    Schmauss, M.: An Implementation of CHR in Java, Master Thesis, Institute of Computer Science, LMU, Munich, Germany (1999)Google Scholar
  8. 8.
    Ismail, A.: Visualization of Grid-based and Fundamental CHR Algorithms, bachelor thesis, the Institute of Software Engineering and Compiler Construction, Ulm University, Germany (2012)Google Scholar
  9. 9.
    Said, M.A.: Animation of Mathematical and Graph-based Algorithms expressed in CHR, bachelor thesis, the Institute of Software Engineering and Compiler Construction, Ulm University, Germany (2012)Google Scholar
  10. 10.
    Stasko, J.: Animating algorithms with xtango. SIGACT News 23, 67–71 (1992)CrossRefGoogle Scholar
  11. 11.
    Brown, M.H., Sedgewick, R.: A system for algorithm animation. In: Proceedings of the 11th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 1984, pp. 177–186. ACM, New York (1984)Google Scholar
  12. 12.
    Brown, M.: Zeus: a system for algorithm animation and multi-view editing. In: Proceedings of the 1991 IEEE Workshop on Visual Languages, pp. 4–9 (1991)Google Scholar
  13. 13.
    Baecker, R.M.: Sorting Out Sorting: A Case Study of Software Visualization for Teaching Computer Science, chap. 24, pp. 369–381. MIT Press, Cambridge (1998) Google Scholar
  14. 14.
    Smolka, G.: The definition of kernel oz. In: Podelski, A. (ed.) Constraint Programming: Basics and Trends. LNCS, vol. 910. Springer, Heidelberg (1995) Google Scholar
  15. 15.
    Meier, M.: Debugging constraint programs. In: Montanari, U., Rossi, F. (eds.) CP 1995. LNCS, vol. 976. Springer, Heidelberg (1995) Google Scholar
  16. 16.
    Frühwirth, T., Holzbaur, C.: Source-to-source transformation for a class of expressive rules. In: Buccafurri, F. (ed.) APPIA-GULP-PRODE, pp. 386–397 (2003)Google Scholar
  17. 17.
    Kerren, A., Stasko, J.T.: Algorithm animation. In: Diehl, S. (ed.) Dagstuhl Seminar 2001. LNCS, vol. 2269, pp. 1–17. Springer, Heidelberg (2002) CrossRefGoogle Scholar
  18. 18.
    Sharaf, N., Abdennadher, S., Frühwirth, T. W.: Visualization of Constraint Handling Rules, CoRR, vol. abs/1405.3793 (2014)Google Scholar
  19. 19.
    Abdennadher, S., Frühwirth, T., Meuss, H.: On confluence of constraint handling rules. In: Freuder, E.C. (ed.) CP 1996. LNCS, vol. 1118. Springer, Heidelberg (1996) Google Scholar
  20. 20.
    Zaki, A., Frühwirth, T.W., Abdennadher, S.: Towards inverse execution of constraint handling rules. TPLP 13(4-5) (2013) Online-SupplementGoogle Scholar
  21. 21.
    Abdennadher, S., Fakhry, G., Sharaf, N.: Implementation of the operational semantics for CHR with user-defined rule priorities. In: Christiansen, H., Sneyers, J. (eds.) Proceedings of the 10th Workshop on Constraint Handling Rules, pp. 1–12, Technical report CW 641, (2013)Google Scholar
  22. 22.
    Fakhry, G., Sharaf, N., Abdennadher, S.: Towards the implementation of a source-to-source transformation tool for CHR operational semantics. In: Gupta, G., Peña, R. (eds.) LOPSTR 2013, LNCS 8901. LNCS, vol. 8901, pp. 145–163. Springer, Heidelberg (2014) CrossRefGoogle Scholar
  23. 23.
    Abdennadher, S., Schütz, H.: CHRv: a flexible query language. In: Andreasen, T., Christiansen, H., Larsen, H.L. (eds.) FQAS 1998. LNCS (LNAI), vol. 1495, pp. 1–14. Springer, Heidelberg (1998) CrossRefGoogle Scholar
  24. 24.
    Hundhausen, C., Douglas, S., Stasko, J.: A meta-study of algorithm visualization effectiveness. J. Vis. Lang. Comput. 13(3), 259–290 (2002)CrossRefGoogle Scholar
  25. 25.
    Bistarelli, S., Frühwirth, T., Marte, M.: Soft constraint propagation and solving in chrs. In: Proceedings of the 2002 ACM Symposium on Applied Computing, pp. 1–5. ACM (2002)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Nada Sharaf
    • 1
    Email author
  • Slim Abdennadher
    • 1
  • Thom Frühwirth
    • 2
  1. 1.The German University in CairoCairoEgypt
  2. 2.Ulm UniversityUlmGermany

Personalised recommendations