Abstract
The cogen approach to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success. This paper demonstrates that the cogen approach is also applicable to the specialisation of constraint logic programs and leads to effective specialisers. We present the basic specialisation technique for CLP(Q) programs and show how we can handle non-declarative features as well. We present an implemented system along with experimental results.
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
Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen (May 1994) (DIKU report 94/19)
Beckman, L., Haraldson, A., Oskarsson, Ö., Sandewall, E.: A partial evaluator and its use as a programming tool. Artificial Intelligence 7, 319–357 (1976)
Birkedal, L., Welinder, M.: Hand-writing program generator generators. In: Hermenegildo, M., Penjam, J. (eds.) PLILP 1994. LNCS, vol. 844, pp. 198–214. Springer, Heidelberg (1994)
Fioravanti, F., Pettorossi, A., Proietti, M.: Automated strategies for specializing constraint logic programs. In: Lau, K.-K. (ed.) LOPSTR 2000. LNCS, vol. 2042, pp. 125–146. Springer, Heidelberg (2001)
Fioravanti, F., Pettorossi, A., Proietti, M.: Verifying ctl properties of infinite-state systems by specializing constraint logic programs. In: Proceedings of VCL 2001, Florence, Italy (September 2001)
Holst, C.K., Launchbury, J.: Handwriting cogen to avoid problems with static typing. In: Draft Proceedings, Fourth Annual Glasgow Workshop on Functional Programming, Skye, Scotland, pp. 210–218. Glasgow University (1991)
Holst, C.K.: Syntactic currying: yet another approach to partial evaluation. Technical report, DIKU, Department of Computer Science, University of Copenhagen (1989)
Jaffar, J., Michaylov, S., Yap, R.H.C.: A methodology for managing hard constraints in CLP systems. In: Proceedings of the ACM SIGPLAN 1991 Conference on Programming Language Design and Implementation, Toronto, Ontario, Canada, June 1991, vol. 26, pp. 306–316 (1991)
Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)
Leuschel, M.: The ecce partial deduction system and the dppd library of benchmarks. Obtainable via (1996-2002), http://www.ecs.soton.ac.uk/~mal
Leuschel, M., Jørgensen, J., Vanhoof, W., Bruynooghe, M.: Offline specialisation in Prolog using a hand-written compiler generator. In: Theory and Practice of Logic Programming, p. 52 (2003) (to appear)
Marriott, K., Stuckey, P.: The 3 r’s of optimizing constraint logic programs: Refinement, removal, and reordering. In: Proceedings of POPL 1993, pp. 334–344. ACM Press, New York (1993)
Mesnard, F., Ruggieri, S.: On proving left termination of constraint logic programs. ACM Transactions on Computational Logic (2003) (to appear)
Peralta, J.C., Gallagher, J.P.: Convex hull abstractions in specialization of clp programs. In: Leuschel, M. (ed.) LOPSTR 2002. LNCS, vol. 2664. Springer, Heidelberg (2002)
Peralta, J.C.: Analysis and Specialisation of Imperative Programs: An approach using CLP. PhD thesis, Department of Computer Science, University of Bristol (2000)
Prestwich, S.: The PADDY partial deduction system. Technical Report ECRC- 92-6, ECRC, Munich, Germany (1992)
Romanenko, S.A.: A compiler generator produced by a self-applicable specializer can have a surprisingly natural and understandable structure. In: Bjørner, D., Ershov, A.P., Jones, N.D. (eds.) Partial Evaluation and Mixed Computation, pp. 445–463. North-Holland, Amsterdam (1988)
Sahlin, D.: Mixtus: An automatic partial evaluator for full Prolog. New Generation Computing 12(1), 7–51 (1993)
Smith, D.A.: Partial evaluation of pattern matching in constraint logic programming languages. In: Jones, N.D., Hudak, P. (eds.) ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation. Sigplan Notices 26(9), pp. 62–71. ACM Press, New York (1991)
Smith, D.A., Hickey, T.: Partial evaluation of a CLP language. In: Debray, S.K., Hermenegildo, M. (eds.) Proceedings of the North American Conference on Logic Programming, pp. 119–138. MIT Press, Cambridge (1990)
Tao, Y., Grosky, W., Liu, C.: An automatic partial deduction system for constraint logic programs. In: 9th International Conference on Tools with Artificial Intelligence (ICTAI 1997), Newport Beach, CA, USA, November 1997, pp. 149–157. IEEE Computer Society, Los Alamitos (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Craig, SJ., Leuschel, M. (2004). A Compiler Generator for Constraint Logic Programs. In: Broy, M., Zamulin, A.V. (eds) Perspectives of System Informatics. PSI 2003. Lecture Notes in Computer Science, vol 2890. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39866-0_17
Download citation
DOI: https://doi.org/10.1007/978-3-540-39866-0_17
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-20813-6
Online ISBN: 978-3-540-39866-0
eBook Packages: Springer Book Archive