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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
Anderson, L.O.: Program Analysis and Specialization for the C Programming Language. Ph.D thesis, DIKU, Unversity of Copenhagen (1994)
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)
Chen, W., Warren, D.S.: Tabled evaluation with delaying for general logic programs. Journal of the ACM 43(1), 20–74 (1996)
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)
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)
Delzanno, G., Podelski, A.: Model checking in CLP. In: Cleaveland, W.R. (ed.) TACAS 1999. LNCS, vol. 1579, pp. 223–239. Springer, Heidelberg (1999)
Demoen, B.: hProlog, http://www.cs.kuleuven.ac.be/~bmd/hProlog/
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)
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)
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)
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)
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)
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)
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)
Lloyd, J.W.: Foundations of Logic Programming. Springer, Heidelberg (1984)
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)
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)
Sagonas, K., Swift, T., Warren, D.S., Rao, P., Friere, J.: The XSB logic programming system, http://xsb.sourceforge.net
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)
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)
Schrijvers, T.: Analyses, optimizations and extensions of Constraint Handling Rules. Ph.D thesis, K.U.Leuven (2005)
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
Schrijvers, T., Warren, D.S.: Constraint handling rules and tabled execution. In: ICLP, pp. 120–136 (2004)
Sneyers, J., Schrijvers, T., Demoen, B.: The Computational Power and Complexity of Constraint Handling Rules. In: CHR 2005 (2005)
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)
Swedish Institute of Computer Science. SICStus Prolog System, http://www.sics.se/isl/sicstuswww/site/index.html
Tamaki, H., Sato, T.: OLDT resolution with tabulation. In: Shapiro, E. (ed.) ICLP 1986. LNCS, vol. 225, pp. 84–98. Springer, Heidelberg (1986)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)