Skip to main content

Lazy and Enforceable Assertions for Functional Logic Programs

  • Conference paper
Functional and Constraint Logic Programming (WFLP 2010)

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

Included in the following conference series:

Abstract

Assertions or contracts are an important technique to improve the quality of software. Thus, assertions are also desirable for functional logic programming. Unfortunately, there is no established meaning of assertions in languages with a demand-driven evaluation strategy. Strict assertions are immediately checked but may influence the behavior of programs. Lazy assertions do not modify the behavior but may not be faithful since some assertions might not be checked at all. In order to avoid the disadvantages of strict and lazy assertions, we propose enforceable assertions that are delayed as lazy assertions but can be explicitly enforced at some point where faith is required, e.g., at the end of the program execution or before irrevocable I/O actions. We describe a prototypical implementation of this idea in the functional logic language Curry where the programmer can choose between lazy and enforceable assertions.

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.

Similar content being viewed by others

References

  1. Antoy, S.: Optimal Non-Deterministic Functional Logic Computations. In: Hanus, M., Heering, J., Meinke, K. (eds.) ALP 1997 and HOA 1997. LNCS, vol. 1298, pp. 16–30. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  2. Antoy, S., Echahed, R., Hanus, M.: A Needed Narrowing Strategy. Journal of the ACM 47(4), 776–822 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  3. Antoy, S., Hanus, M.: Declarative Programming with Function Patterns. In: Hill, P.M. (ed.) LOPSTR 2005. LNCS, vol. 3901, pp. 6–22. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  4. Antoy, S., Hanus, M.: Functional Logic Programming. Communications of the ACM 53(4), 74–85 (2010)

    Article  Google Scholar 

  5. Braßel, B., Chitil, O., Hanus, M., Huch, F.: Observing Functional Logic Computations. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 193–208. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  6. Chitil, O., Huch, F.: Monadic, Prompt Lazy Assertions in Haskell. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 38–53. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  7. Chitil, O., Huch, F.: A Pattern Logic for Prompt Lazy Assertions in Haskell. In: Horváth, Z., Zsók, V., Butterfield, A. (eds.) IFL 2006. LNCS, vol. 4449, pp. 126–144. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  8. Chitil, O., McNeill, D., Runciman, C.: Lazy assertions. In: Trinder, P., Michaelson, G.J., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, pp. 1–19. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  9. Degen, M., Thiemann, P., Wehr, S.: True Lies: Lazy Contracts for Lazy Languages (Faithfulness is Better than Laziness). In: 4. Arbeitstagung Programmiersprachen (ATPS 2009). LNI, vol. 154, pp. 370; 2946–2959. Springer, Heidelberg (2009)

    Google Scholar 

  10. Findler, R.B., Felleisen, M.: Contracts for Higher-Order Functions. In: Proceedings of the 7th ACM SIGPLAN international conference on Functional programming ICFP 2002, pp. 48–59. ACM Press, New York (2002)

    Google Scholar 

  11. Gill, A.: Debugging Haskell by Observing Intermediate Data Structures. Electr. Notes Theor. Comput. Sci. 41(1) (2000)

    Google Scholar 

  12. Hanus, M.: A Unified Computation Model for Functional and Logic Programming. In: Proc. of the 24th ACM Symposium on Principles of Programming Languages (Paris), pp. 80–93 (1997)

    Google Scholar 

  13. Hanus, M.: A Functional Logic Programming Approach to Graphical User Interfaces. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, pp. 47–62. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  14. Hanus, M.: High-Level Server Side Web Scripting in Curry. In: Ramakrishnan, I.V. (ed.) PADL 2001. LNCS, vol. 1990, pp. 76–92. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  15. Hanus, M.: Multi-paradigm Declarative Languages. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 45–75. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  16. Hanus, M., Antoy, S., Braßel, B., Engelke, M., Höppner, K., Koj, J., Niederau, P., Sadre, R., Steiner, F.: PAKCS: The Portland Aachen Kiel Curry System (2010), http://www.informatik.uni-kiel.de/~pakcs/

  17. Hanus, M. (ed.): Curry: An Integrated Functional Logic Language, Vers. 0.8.2 (2006), http://www.curry-language.org

  18. Hinze, R., Jeuring, J., Löh, A.: Typed Contracts for Functional Programming. In: Hagiya, M. (ed.) FLOPS 2006. LNCS, vol. 3945, pp. 208–225. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  19. López-Fraguas, F.J., Sánchez-Hernández, J.: TOY: A Multiparadigm Declarative System. In: Narendran, P., Rusinowitch, M. (eds.) RTA 1999. LNCS, vol. 1631, pp. 244–247. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  20. Mera, E., Lopez-García, P., Hermenegildo, M.: Integrating Software Testing and Run-Time Checking in an Assertion Verification Framework. In: Hill, P.M., Warren, D.S. (eds.) ICLP 2009. LNCS, vol. 5649, pp. 281–295. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  21. Meyer, B.: Object-oriented Software Construction, 2nd edn. Prentice Hall, Englewood Cliffs (1997)

    MATH  Google Scholar 

  22. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)

    MATH  Google Scholar 

  23. Puebla, G., Bueno, F., Hermenegildo, M.: An Assertion Language for Constraint Logic Programs. In: Deransart, P., Małuszyński, J. (eds.) DiSCiPl 1999. LNCS, vol. 1870, pp. 23–62. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hanus, M. (2011). Lazy and Enforceable Assertions for Functional Logic Programs. In: Mariño, J. (eds) Functional and Constraint Logic Programming. WFLP 2010. Lecture Notes in Computer Science, vol 6559. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-20775-4_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-20775-4_5

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-20774-7

  • Online ISBN: 978-3-642-20775-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics