Skip to main content

Polymorphic Rewrite Rules: Confluence, Type Inference, and Instance Validation

  • Conference paper
  • First Online:

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

Abstract

We present a new framework of polymorphic rewrite rules having predicates to restrict their instances. It is suitable for formulating and analysing fundamental calculi of programming languages. A type inference algorithm and a criterion to check local confluence property of polymorphic rules are also given, with demonstration of the effectiveness of our methodology by examinination of sample program calculi. It includes the call-by-need \({\lambda }\)-calculus and Moggi’s computational lambda-calculus.

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

Buying options

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

Learn about institutional subscriptions

References

  1. Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)

    Book  Google Scholar 

  2. Barendregt, H.P.: The Lambda Calculus: Its Syntax and Semantics. North Holland, Amsterdam (1984)

    MATH  Google Scholar 

  3. Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proceedings of POPL 1982, pp. 207–212 (1982)

    Google Scholar 

  4. Fiore, M., Hamana, M.: Multiversal polymorphic algebraic theories: syntax, semantics, translations, and equational logic. In: 28th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2013, pp. 520–529 (2013)

    Google Scholar 

  5. Fiore, M., Hur, C.-K.: Second-order equational logic (Extended Abstract). In: Dawar, A., Veith, H. (eds.) CSL 2010. LNCS, vol. 6247, pp. 320–335. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15205-4_26

    Chapter  MATH  Google Scholar 

  6. Fiore, M., Mahmoud, O.: Second-order algebraic theories. In: Hliněný, P., Kučera, A. (eds.) MFCS 2010. LNCS, vol. 6281, pp. 368–380. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15155-2_33

    Chapter  Google Scholar 

  7. Hamana, M.: Free \(\Sigma \)-monoids: a higher-order syntax with metavariables. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 348–363. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-30477-7_23

    Chapter  Google Scholar 

  8. Hamana, M.: Universal algebra for termination of higher-order rewriting. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 135–149. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-32033-3_11

    Chapter  MATH  Google Scholar 

  9. Hamana, M.: Higher-order semantic labelling for inductive datatype systems. In: Proceedings of PPDP 2007, pp. 97–108. ACM Press (2007)

    Google Scholar 

  10. Hamana, M.: Semantic labelling for proving termination of combinatory reduction systems. In: Escobar, S. (ed.) WFLP 2009. LNCS, vol. 5979, pp. 62–78. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-11999-6_5

    Chapter  Google Scholar 

  11. Hamana, M.: Polymorphic abstract syntax via grothendieck construction. In: Hofmann, M. (ed.) FoSSaCS 2011. LNCS, vol. 6604, pp. 381–395. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-19805-2_26

    Chapter  Google Scholar 

  12. Hamana, M.: How to prove your calculus is decidable: practical applications of second-order algebraic theories and computation. Proc. ACM Program. Lang. 1(22), 1–28 (2017)

    Article  Google Scholar 

  13. Huet, G.: Confluent reductions: abstract properties and applications to term rewriting systems. J. ACM 27(4), 797–821 (1980)

    Article  MathSciNet  Google Scholar 

  14. Jouannaud, J.-P., Rubio, A.: Polymorphic higher-order recursive path orderings. J. ACM 54(1), 2:1–2:48 (2007)

    Article  MathSciNet  Google Scholar 

  15. Jouannaud, J.-P., Rubio, A.: Normal higher-order termination. ACM Trans. Comput. Log. 16(2), 13:1–13:38 (2015)

    Article  MathSciNet  Google Scholar 

  16. Knuth, D., Bendix, P.: Simple word problems in universal algebras. In: Computational Problem in Abstract Algebra, pp. 263–297. Pergamon Press, Oxford (1970)

    MATH  Google Scholar 

  17. Lindley, S., Stark, I.: Reducibility and \(\top \top \) for computation types. In: Proceedings of TLCA 2005, pp. 262–277 (2005)

    Google Scholar 

  18. Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. J. Funct. Program. 8(3), 275–317 (1998)

    Article  MathSciNet  Google Scholar 

  19. Mayr, R., Nipkow, T.: Higher-order rewrite systems and their confluence. Theor. Comput. Sci. 192(1), 3–29 (1998)

    Article  MathSciNet  Google Scholar 

  20. Miller, D.: A logic programming language with lambda-abstraction, function variables, and simple unification. J. Log. Comput. 1(4), 497–536 (1991)

    Article  MathSciNet  Google Scholar 

  21. Moggi, E.: Computational lambda-calculus and monads. LFCS ECS-LFCS-88-66, University of Edinburgh (1988)

    Google Scholar 

  22. Nagele, J., Felgenhauer, B., Middeldorp, A.: CSI: new evidence – a progress report. In: de Moura, L. (ed.) CADE 2017. LNCS (LNAI), vol. 10395, pp. 385–397. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-63046-5_24

    Chapter  Google Scholar 

  23. Nipkow, T.: Higher-order critical pairs. In: Proceedings of 6th IEEE Symposium Logic in Computer Science, pp. 342–349 (1991)

    Google Scholar 

  24. Ohta, Y., Hasegawa, M.: A terminating and confluent linear lambda calculus. In: Pfenning, F. (ed.) RTA 2006. LNCS, vol. 4098, pp. 166–180. Springer, Heidelberg (2006). https://doi.org/10.1007/11805618_13

    Chapter  MATH  Google Scholar 

  25. Onozawa, K., Kikuchi, K., Aoto, T., Toyama, Y.: ACPH: System description. In: 6th Confluence Competition (CoCo 2017)(2017)

    Google Scholar 

  26. Sabry, A., Wadler, P.: A reflection on call-by-value. ACM Trans. Program. Lang. Syst. 19(6), 916–941 (1997)

    Article  Google Scholar 

  27. Sheard, T., Jones, S.P.: Template metaprogramming for Haskell. In: Proceedings of Haskell Workshop 2002 (2002)

    Google Scholar 

  28. Staton, S.: An algebraic presentation of predicate logic. In: Pfenning, F. (ed.) FoSSaCS 2013. LNCS, vol. 7794, pp. 401–417. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37075-5_26

    Chapter  MATH  Google Scholar 

  29. Staton, S.: Instances of computational effects: an algebraic perspective. In: Proceedings of LICS 2013, p. 519 (2013)

    Google Scholar 

  30. Staton, S.: Algebraic effects, linearity, and quantum programming languages. In: Proceedings of POPL 2015, pp. 395–406 (2015)

    Article  Google Scholar 

Download references

Acknowledgments

I am grateful to Masahito Hasegawa for his question on how to check confluence of Moggi’s computational \({\lambda }\)-calculus by my previous tool SOL. It opened my eyes to the necessity of proper treatment of call-by-value calculi and led me to the notion of instance validation developped in this paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Makoto Hamana .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hamana, M. (2018). Polymorphic Rewrite Rules: Confluence, Type Inference, and Instance Validation. In: Gallagher, J., Sulzmann, M. (eds) Functional and Logic Programming. FLOPS 2018. Lecture Notes in Computer Science(), vol 10818. Springer, Cham. https://doi.org/10.1007/978-3-319-90686-7_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-90686-7_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-90685-0

  • Online ISBN: 978-3-319-90686-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics