Skip to main content

Analysing and Compiling Coroutines with Abstract Conjunctive Partial Deduction

  • Conference paper
  • First Online:
Logic-Based Program Synthesis and Transformation (LOPSTR 2014)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8981))

Abstract

We provide an approach to formally analyze the computational behavior of coroutines in Logic Programs and to compile these computations into new programs, not requiring any support for coroutines. The problem was already studied near to 30 years ago, in an analysis and transformation technique called Compiling Control. However, this technique had a strong ad hoc flavor: the completeness of the analysis was not well understood and its symbolic evaluation was also very ad hoc. We show how Abstract Conjunctive Partial Deduction, introduced by Leuschel in 2004, provides an appropriate setting to redefine Compiling Control. Leuschel’s framework is more general than the original formulation, it is provably correct, and it can easily be applied for simple examples. We also show that the Abstract Conjunctive Partial Deduction framework needs some further extension to be able to deal with more complex examples.

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 EPUB and 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

References

  • Annex.: Definitions, concepts and elaboration of an example (2014). https://perswww.kuleuven.be/~u0055408/tag/lopstr14.html

  • Boulanger, D., Bruynooghe, M., De Schreye, D.: Compiling control revisited: a new approach based upon abstract interpretation for constraint logic programs. In: LPE, pp. 39–51 (1993)

    Google Scholar 

  • Bruynooghe, M.: A practical framework for the abstract interpretation of logic programs. J. Logic Program. 10(2), 91–124 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  • Bruynooghe, M., De Schreye, D., Krekels, B.: Compiling control. In: Proceedings of the 1986 Symposium on Logic Programming. IEEE Society Press, Salt Lake City (1986)

    Google Scholar 

  • Bruynooghe, M., De Schreye, D., Krekels, B.: Compiling control. J. Logic Program. 6(1), 135–162 (1989)

    Article  MATH  Google Scholar 

  • De Schreye, D., Glück, R., Jørgensen, J., Leuschel, M., Martens, B., Sørensen, M.H.: Conjunctive partial deduction: foundations, control, algorithms, and experiments. J. Logic Program. 41(2), 231–277 (1999)

    Article  MATH  Google Scholar 

  • Gallagher, J.P.: Transforming logic programs by specialising interpreters. In: ECAI, pp. 313–326 (1986)

    Google Scholar 

  • Hruza, J., Stepanek, P.: Speedup of logic programs by binarization and partial deduction. arXiv preprint arXiv:cs/0312026 (2003)

  • Leuschel, M.: A framework for the integration of partial evaluation and abstract interpretation of logic programs. ACM Trans. Program. Lang. Syst. (TOPLAS) 26(3), 413–463 (2004)

    Article  Google Scholar 

  • Lloyd, J.: Foundations of Logic Programming. Springer-Verlag, Berlin (1987)

    Book  MATH  Google Scholar 

  • Lloyd, J.W., Shepherdson, J.C.: Partial evaluation in logic programming. J. Logic Program. 11(3), 217–242 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  • Pettorossi, A., Proietti, M.: Transformation of logic programs: foundations and techniques. J. Logic Program. 19, 261–320 (1994)

    Article  MathSciNet  Google Scholar 

  • Pettorossi, A., Proietti, M.: The list introduction strategy for the derivation of logic programs. Formal Aspects Comput. 13(3–5), 233–251 (2002)

    Article  MATH  Google Scholar 

  • Puebla, G., de la Banda, M.J.G., Marriott, K., Stuckey, P.J.: Optimization of logic programs with dynamic scheduling.In: ICLP, vol. 97, pp. 93–107 (1997)

    Google Scholar 

  • Vidal, G.: A hybrid approach to conjunctive partial evaluation of logic programs. In: Alpuente, M. (ed.) LOPSTR 2010. LNCS, vol. 6564, pp. 200–214. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  • Vidal, G.: Annotation of logic programs for independent and-parallelism by partial evaluation. Theor. Pract. Logic Program. 12(4–5), 583–600 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  • Wiggins, G.A.: The improvement of prolog program efficiency by compiling control: a proof-theoretic view. Department of Artificial Intelligence, University of Edinburgh (1990)

    Google Scholar 

Download references

Acknowledgements

We thank the anonymous reviewers for their very useful suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Vincent Nys .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

De Schreye, D., Nys, V., Nicholson, C. (2015). Analysing and Compiling Coroutines with Abstract Conjunctive Partial Deduction. In: Proietti, M., Seki, H. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2014. Lecture Notes in Computer Science(), vol 8981. Springer, Cham. https://doi.org/10.1007/978-3-319-17822-6_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-17822-6_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-17821-9

  • Online ISBN: 978-3-319-17822-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics