[go: up one dir, main page]

Skip to main content

Implementing Cut Elimination: A Case Study of Simulating Dependent Types in Haskell

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3057))

Included in the following conference series:

Abstract

Gentzen’s Hauptsatz – cut elimination theorem – in sequent calculi reveals a fundamental property on logic connectives in various logics such as classical logic and intuitionistic logic. In this paper, we implement a procedure in Haskell to perform cut elimination for intuitionistic sequent calculus, where we use types to guarantee that the procedure can only return a cut-free proof of the same sequent when given a proof of a sequent that may contain cuts. The contribution of the paper is two-fold. On the one hand, we present an interesting (and somewhat unexpected) application of the current type system of Haskell, illustrating through a concrete example how some typical use of dependent types can be simulated in Haskell. On the other hand, we identify several problematic issues with such a simulation technique and then suggest some approaches to addressing these issues in Haskell.

Partially supported by the NSF Grants No. CCR-0224244 and No. CCR-0229480

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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. Baars, A.I., Swierstra, S.D.: Typing Dynamic Typing. In: Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming (ICFP 2002), Pittsburgh, PA (October 2002)

    Google Scholar 

  2. Chen, C., Xi, H.: Implementing Typeful Program Transformations. In: Proceedings of ACM SIGPLAN Workshop on Partial Evaluation and Semantics Based Program Manipulation, San Diego, CA, June 2003, pp. 20–28 (2003)

    Google Scholar 

  3. Chen, C., Zhu, D., Xi, H.: Implementing Cut Elimination: A Case Study of Simulating Dependent Types in Haskell (October 2003), Available at http://www.cs.bu.edu/~hwxi/academic/papers/CutElim

  4. Cheney, J., Hinze, R.: A Lightweight Implementation of Generics and Dynamics. In: Proceedings of Haskell Workshop, Pittsburgh, PA, October 2002, pp. 90–104. ACM Press, New York (2002)

    Chapter  Google Scholar 

  5. Cheney, J., Hinze, R.: Phantom Types. Technical Report CUCIS-TR2003-1901, Cornell University, Available as Dienst/UI/1.0/Display/cul.cis/TR2003-1901 (2003), http://techreports.library.cornell.edu:8081/

  6. Fridlender, D., Indrika, M.: Do we need dependent types? Functional Pearl in the Journal of Functional Programming 10(4), 409–415 (2000)

    Article  MATH  Google Scholar 

  7. Gentzen, G.: Untersuchungen über das logische Schlieβen. Mathematische Zeitschrift 39, 176–210, 405–431 (1935)

    Article  MathSciNet  Google Scholar 

  8. Hall, C.V., Hammond, K., Jones, S.L.P., Wadler, P.L.: Type Classes in Haskell. ACM Transactions on Programming Languages and Systems 18(2), 109–138 (1996)

    Article  Google Scholar 

  9. Harper, R.W., Honsell, F., Plotkin, G.D.: A framework for defining logics. Journal of the ACM 40(1), 143–184 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  10. Hinze, R.: Manufacturing Datatypes. Journal of Functional Programming 11(5), 493–524 (2001); Also available as Technical Report IAI-TR-99-5, Institut für Informatik III, Universität Bonn

    Article  MATH  MathSciNet  Google Scholar 

  11. Jones, M.P.: Type Classes with Functional Dependencies. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, pp. 230–244. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  12. McBride, C.: Faking It. Journal of Functional Programming 12(4&5), 375–392 (2002)

    MATH  MathSciNet  Google Scholar 

  13. Milner, R.: A theory of type polymorphism in programming. Journal of Computer and System Sciences 17(3), 348–375 (1978)

    Article  MATH  MathSciNet  Google Scholar 

  14. Okasaki, C.: From Fast Exponentiation to Square Matrices: An Adventure in Types. In: Proceedings of the 4th ACM SIGPLAN International Conference on Functional Programming (September 1999)

    Google Scholar 

  15. Pfenning, F.: Computation and Deduction. Cambridge University Press, Cambridge (to appear)

    Google Scholar 

  16. Pfenning, F.: Logic programming in the LF logical framework. In: Huet, I.G., Plotkin, G. (eds.) Logical Frameworks, pp. 149–181. Cambridge University Press, Cambridge (1991)

    Chapter  Google Scholar 

  17. Pfenning, F.: Structural Cut Elimination. In: Proceedings of the Tenth Annual IEEE Symposium on Logic in Computer Science, San Diego, CA, June 1995, pp. 156–166 (1995)

    Google Scholar 

  18. Pfenning, F.: Structural Cut Elimination I: intuitionistic and classical logic. Information and Computation 157(1/2), 84–141 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  19. Xi, H., Chen, C., Chen, G.: Guarded Recursive Datatype Constructors. In: Proceedings of the 30th ACM SIGPLAN Symposium on Principles of Programming Languages, New Orleans, LA, January 2003, pp. 224–235.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chen, C., Zhu, D., Xi, H. (2004). Implementing Cut Elimination: A Case Study of Simulating Dependent Types in Haskell. In: Jayaraman, B. (eds) Practical Aspects of Declarative Languages. PADL 2004. Lecture Notes in Computer Science, vol 3057. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24836-1_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24836-1_17

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22253-8

  • Online ISBN: 978-3-540-24836-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics