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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)
Barendregt, H.P.: The Lambda Calculus: Its Syntax and Semantics. North Holland, Amsterdam (1984)
Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proceedings of POPL 1982, pp. 207–212 (1982)
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)
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
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
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
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
Hamana, M.: Higher-order semantic labelling for inductive datatype systems. In: Proceedings of PPDP 2007, pp. 97–108. ACM Press (2007)
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
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
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)
Huet, G.: Confluent reductions: abstract properties and applications to term rewriting systems. J. ACM 27(4), 797–821 (1980)
Jouannaud, J.-P., Rubio, A.: Polymorphic higher-order recursive path orderings. J. ACM 54(1), 2:1–2:48 (2007)
Jouannaud, J.-P., Rubio, A.: Normal higher-order termination. ACM Trans. Comput. Log. 16(2), 13:1–13:38 (2015)
Knuth, D., Bendix, P.: Simple word problems in universal algebras. In: Computational Problem in Abstract Algebra, pp. 263–297. Pergamon Press, Oxford (1970)
Lindley, S., Stark, I.: Reducibility and \(\top \top \) for computation types. In: Proceedings of TLCA 2005, pp. 262–277 (2005)
Maraist, J., Odersky, M., Wadler, P.: The call-by-need lambda calculus. J. Funct. Program. 8(3), 275–317 (1998)
Mayr, R., Nipkow, T.: Higher-order rewrite systems and their confluence. Theor. Comput. Sci. 192(1), 3–29 (1998)
Miller, D.: A logic programming language with lambda-abstraction, function variables, and simple unification. J. Log. Comput. 1(4), 497–536 (1991)
Moggi, E.: Computational lambda-calculus and monads. LFCS ECS-LFCS-88-66, University of Edinburgh (1988)
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
Nipkow, T.: Higher-order critical pairs. In: Proceedings of 6th IEEE Symposium Logic in Computer Science, pp. 342–349 (1991)
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
Onozawa, K., Kikuchi, K., Aoto, T., Toyama, Y.: ACPH: System description. In: 6th Confluence Competition (CoCo 2017)(2017)
Sabry, A., Wadler, P.: A reflection on call-by-value. ACM Trans. Program. Lang. Syst. 19(6), 916–941 (1997)
Sheard, T., Jones, S.P.: Template metaprogramming for Haskell. In: Proceedings of Haskell Workshop 2002 (2002)
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
Staton, S.: Instances of computational effects: an algebraic perspective. In: Proceedings of LICS 2013, p. 519 (2013)
Staton, S.: Algebraic effects, linearity, and quantum programming languages. In: Proceedings of POPL 2015, pp. 395–406 (2015)
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
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG, part of Springer Nature
About this paper
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)