Skip to main content

Compiling Constraint Handling Rules for Efficient Tabled Evaluation

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2007)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4354))

Included in the following conference series:

Abstract

Tabled resolution, which alleviates some of Prolog’s termination problems, makes it possible to create practical applications from high-level declarative specifications. Constraint Handling Rules (CHR) is an elegant framework for implementing constraint solvers from high-level specifications, and is available in many Prolog systems. However, applications combining the power of these two declarative paradigms have been impractical since traditional CHR implementations interact poorly with tabling. In this paper we present a new (set-based) semantics for CHR which enables efficient integration with tabling. The new semantics coincides with the traditional (multi-set-based) semantics for a large class of CHR programs. We describe CHRd, an implementation based on the new semantics. CHRd uses a distributed constraint store that can be directly represented in tables. Although motivated by tabling, CHRd works well also on non-tabled platforms. We present experimental results which show that, relative to traditional implementations, CHRd performs significantly better on tabled programs, and yet shows comparable results on non-tabled benchmarks.

This research was supported in part by NSF grants CCR-0205376, CNS-0627447 and EIA-0000433, and ONR grant N00014-01-1-0744.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abdennadher, S.: Operational Semantics and Confluence of Constraint Propagation Rules. In: Smolka, G. (ed.) CP 1997. LNCS, vol. 1330, pp. 252–266. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  2. Anderson, L.O.: Program Analysis and Specialization for the C Programming Language. Ph.D thesis, DIKU, Unversity of Copenhagen (1994)

    Google Scholar 

  3. Becker, M.Y., Sewell, P.: Cassandra: Flexible trust management, applied to electronic health records. In: IEEE Computer Security Foundations Workshop (CSFW), pp. 139–154 (2004)

    Google Scholar 

  4. Chen, W., Warren, D.S.: Tabled evaluation with delaying for general logic programs. Journal of the ACM 43(1), 20–74 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  5. Dawson, S., Ramakrishnan, C.R., Warren, D.S.: Practical program analysis using general purpose logic programming systems — a case study. In: ACM PLDI. ACM Press, New York (1996)

    Google Scholar 

  6. Delzanno, G., Bultan, T.: Constraint-based verification of client-server protocols. In: Walsh, T. (ed.) CP 2001. LNCS, vol. 2239, pp. 286–301. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  7. Delzanno, G., Podelski, A.: Model checking in CLP. In: Cleaveland, W.R. (ed.) TACAS 1999. LNCS, vol. 1579, pp. 223–239. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  8. Demoen, B.: hProlog, http://www.cs.kuleuven.ac.be/~bmd/hProlog/

  9. Duck, G.J., Stuckey, P.J., de la Banda, M.J.G., 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)

    Chapter  Google Scholar 

  10. Frühwirth, T.: Theory and Practice of Constraint Handling Rules. Journal of Logic Programming, Special Issue on Constraint Logic Programming 37(1–3), 95–138 (1998)

    MATH  Google Scholar 

  11. Holzbaur, C.: Metastructures versus Attributed Variables in the Context of Extensible Unification. In: Bruynooghe, M., Wirsing, M. (eds.) PLILP 1992. LNCS, vol. 631, pp. 260–268. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  12. Holzbaur, C., de la Banda, M.G., Jeffery, D., Stuckey, P.J.: Optimizing Compilation of Constraint Handling Rules. In: Codognet, P. (ed.) ICLP 2001. LNCS, vol. 2237. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  13. Holzbaur, C., et al.: Optimizing compilation of constraint handling rules in HAL. Theory and Practice of Logic Programming, Special Issue on Constraint Handling Rules 5(4-5), 503–531 (2005)

    Article  MATH  Google Scholar 

  14. Holzbaur, C., Frühwirth, T.W.: Compiling Constraint Handling Rules into Prolog with Attributed Variables. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 117–133. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  15. Li, N., Mitchell, J.C.: Datalog with constraints: A foundation for trust management languages. In: Dahl, V., Wadler, P. (eds.) PADL 2003. LNCS, vol. 2562, pp. 58–73. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  16. Lloyd, J.W.: Foundations of Logic Programming. Springer, Heidelberg (1984)

    MATH  Google Scholar 

  17. Pemmasani, G., Ramakrishnan, C.R., Ramakrishnan, I.V.: Efficient model checking of real time systems using tabled logic programming and constraints. In: Stuckey, P.J. (ed.) ICLP 2002. LNCS, vol. 2401. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  18. Ramakrishnan, C.R., Ramakrishnan, I.V., Smolka, S.A., Dong, Y., Du, X., Roychoudhury, A., Venkatakrishnan, V.N.: XMC: A logic-programming-based verification toolset. In: Emerson, E.A., Sistla, A.P. (eds.) CAV 2000. LNCS, vol. 1855, pp. 576–580. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  19. Sagonas, K., Swift, T., Warren, D.S., Rao, P., Friere, J.: The XSB logic programming system, http://xsb.sourceforge.net

  20. Sarna-Starosta, B., Ramakrishnan, C.R.: Constraint-based model checking of data-independent systems. In: Dong, J.S., Woodcock, J. (eds.) ICFEM 2003. LNCS, vol. 2885, pp. 579–598. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  21. Sarna-Starosta, B., Stirewalt, R.E.K., Dillon, L.K.: A model-based design-for-verification approach to checking for deadlock in multi-threaded systems. In: 18th International Conference on Software Engineering and Knowledge Engineering (SEKE) (2006)

    Google Scholar 

  22. Schrijvers, T.: Analyses, optimizations and extensions of Constraint Handling Rules. Ph.D thesis, K.U.Leuven (2005)

    Google Scholar 

  23. Schrijvers, T., Demoen, B.: The K.U.Leuven CHR system: Implementation and application. In: First workshop on constraint handling rules: selected contributions, pp. 1–5 (2004); Published as technical report: Ulmer Informatik-Berichte Nr. 2004-01

    Google Scholar 

  24. Schrijvers, T., Warren, D.S.: Constraint handling rules and tabled execution. In: ICLP, pp. 120–136 (2004)

    Google Scholar 

  25. Sneyers, J., Schrijvers, T., Demoen, B.: The Computational Power and Complexity of Constraint Handling Rules. In: CHR 2005 (2005)

    Google Scholar 

  26. Sneyers, J., Schrijvers, T., Demoen, B.: Memory reuse for CHR. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  27. Swedish Institute of Computer Science. SICStus Prolog System, http://www.sics.se/isl/sicstuswww/site/index.html

  28. Tamaki, H., Sato, T.: OLDT resolution with tabulation. In: Shapiro, E. (ed.) ICLP 1986. LNCS, vol. 225, pp. 84–98. Springer, Heidelberg (1986)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sarna-Starosta, B., Ramakrishnan, C.R. (2006). Compiling Constraint Handling Rules for Efficient Tabled Evaluation. In: Hanus, M. (eds) Practical Aspects of Declarative Languages. PADL 2007. Lecture Notes in Computer Science, vol 4354. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69611-7_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-69611-7_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-69608-7

  • Online ISBN: 978-3-540-69611-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics