Hostname: page-component-78c5997874-m6dg7 Total loading time: 0 Render date: 2024-11-10T16:55:28.270Z Has data issue: false hasContentIssue false

Unfolding for CHR programs

Published online by Cambridge University Press:  08 October 2013

MAURIZIO GABBRIELLI
Affiliation:
Department of Computer Science/Focus, Università di Bologna/INRIA Mura Anteo Zamboni 7, 40127 Bologna, Italy (email: gabbri@cs.unibo.it)
MARIA CHIARA MEO
Affiliation:
Dipartimento di Economia, Università di Chieti-Pescara Viale Pindaro 42, 65127 Pescara, Italy (email: cmeo@unich.it)
PAOLO TACCHELLA
Affiliation:
Università di Bologna, Mura Anteo Zamboni 7, 40127 Bologna, Italy (email: Paolo.Tacchella@cs.unibo.it)
HERBERT WIKLICKY
Affiliation:
Imperial College London, 180 Queen's Gate, London SW7 2BZ, UK (email: herbert@doc.ic.ac.uk)

Abstract

Program transformation is an appealing technique which allows to improve run-time efficiency, space-consumption, and more generally to optimize a given program. Essentially, it consists of a sequence of syntactic program manipulations which preserves some kind of semantic equivalence. Unfolding is one of the basic operations used by most program transformation systems and consists of the replacement of a procedure call by its definition. While there is a large body of literature on the transformation and unfolding of sequential programs, very few papers have addressed this issue for concurrent languages. This paper defines an unfolding system for Constraint Handling Rules programs. We define an unfolding rule, show its correctness and discuss some conditions that can be used to delete an unfolded rule while preserving the program meaning. We also prove that, under some suitable conditions, confluence and termination are preserved by the above transformation.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2013 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Abdennadher, S. 1997. Operational semantics and confluence of constraint propagation rules. In Principles and Practice of Constraint Programming (CP97), Smolka, G., Ed., Lecture Notes in Computer Science, vol. 1330. Springer, Berlin, Germany, 252266.Google Scholar
Abdennadher, S. and Frühwirth, T. 2004. Integration and organization of rule-based constraint solvers. In Logic Based Program Synthesis and Transformation (LOPSTR 2003), Bruynooghe, M., Ed., Lecture Notes in Computer Science, vol. 3018/2004. Springer-Verlag, Berlin, Germany, 198231.Google Scholar
Duck, G. J., Stuckey, P. J., Garca de la Banda, M. and Holzbaur, C. 2004. The refined operational semantics of constraint handling rules. In Logic Programming, Demoen, B. and Lifschitz, V., Eds., Lecture Notes in Computer Science, vol. 3132. Springer, Berlin, Germany, 269304.Google Scholar
Etalle, S., Gabbrielli, M. and Meo, M. C. 2001. Transformations of CCP programs. ACM Transactions on Programming Languages and Systems (TOPLAS) 23, 3, 304395.Google Scholar
Frühwirth, T. 1998. Theory and practice of constraint handling rules. Journal of Logic Programming 37, 1–3 (October), 95138. (Special Issue on Constraint Logic Programming.)Google Scholar
Frühwirth, T. 2005. Specialization of concurrent guarded multi-set transformation rules. In Logic Based Program Synthesis and Transformation, Etalle, S., Ed., Lecture Notes in Computer Science, vol. 3573. Springer, Berlin, Germany, 133148.CrossRefGoogle Scholar
Frühwirth, T. 2009. Constraint Handling Rules. Cambridge University Press, Cambridge, UK.CrossRefGoogle Scholar
Frühwirth, T. and Abdennadher, S. 2003. Essentials of Constraint Programming. Springer, Berlin, Germany.Google Scholar
Frühwirth, T., Di Pierro, A. and Wiklicky, H. 2002. Probabilistic constraint handling rules. In Selected Papers of WFLP'02 – 11th International Workshop on Functional and (Constraint) Logic Programming, Comini, M. and Falaschi, M., Eds., Electronic Notes in Theoretical Computer Science, vol. 76. Elsevier, Amsterdam, Netherlands, 115130.Google Scholar
Frühwirth, T. and Holzbaur, C. 2003. Source-to-source transformation for a class of expressive rules. In APPIA-GULP-PRODE. Pub Zone, Reggio Calabria, Italy, 386397.Google Scholar
Lloyd, J. W. 1984. Foundations of Logic Programming. Springer-Verlag, New York, NY.Google Scholar
Raiser, F., Betz, H. and Frühwirth, T. 2009. Equivalence of CHR states revisited. In Proceedings of the 6th International Workshop on Constraint Handling Rules (CHR), Kaiser, F. and Sneyers, J., Eds., Report CW555 of Katholieke Universiteit Leuven, Department of Computer Science, Heverlee, Belgium, 3448.Google Scholar
Sarna-Starosta, B. and Schrijvers, T. 2009. Attributed Data for CHR Indexing. In Proceedings of the 25th International Conference on Logic Programming (ICLP 2009), Hill, P. M. and Warren, D. S., Eds., Lecture Notes in Computer Science, vol. 5649. Springer, Berlin, Germany, 357371.Google Scholar
Schrijvers, T. and Sulzmann, M. 2008. Transactions in constraint handling rules. In Proceedings of the 24th International Conference on Logic Programming (ICLP 2008), de la Banda, M. G. and Pontelli, E., Eds., Lecture Notes in Computer Science, vol. 5366. Springer, Berlin, Germany, 516530.Google Scholar
Sneyers, J., Meert, W., Vennekens, J., Kameya, Y. and Sato, T. 2010. CHR(PRISM)-based probabilistic logic learning. Theory and Practice of Logic Programming 10, 4–6, 433447.Google Scholar
Sneyers, J., Schrijvers, T. and Demoen, B. 2005. Guard and continuation optimization for occurrence representations of CHR. In Proceedings of the 21st International Conference (ICLP 2005), Gabbrielli, M. and Gupta, G., Eds., Lecture Notes in Computer Science, vol. 3668. Springer, Berlin, Germany, 8397.Google Scholar
Tacchella, P. 2008. Constraint Handling Rules. Compositional Semantics and Program Transformation, PhD thesis, Università di Bologna, Bologna, Italy.Google Scholar
Tacchella, P., Meo, M. C. and Gabbrielli, M. 2007. Unfolding in CHR. In Proceedings of the 9th ACM SIGPLAN International Symposium on Principles and Practice of Declarative Programming (PPDP '07), Leuschel, M. and Podelski, A., Eds., Heverlee, Belgium, 179186.Google Scholar
Tamaki, H. and Sato, T. 1984. Unfold/fold transformations of logic programs. In Proceedings of the International Conference on Logic Programming, Tärnlund, Sten-Åke, Ed., Uppsala University, Uppsala, Sweden, 127138.Google Scholar
Ueda, K. and Furukawa, K. 1988. Transformation rules for GHC programs. In Proceedings of the International Conference on Fifth Generation Computer Systems 1988 (FGCS'88). ICOT Press, Tokyo, Japan, 582591.Google Scholar