错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Foundations of Haskell’s Rewrite Rules Based on Higher-Kinded Polymorphic Rewrite Systems

  • Makoto Hamana

摘要

The aim of this paper is to establish theoretical foundations of GHC’s rewrite rules. The Glasgow Haskell Compiler (GHC) has the feature of rewrite rules to specify optimising transformations. Rewrite rules have been widely used in many libraries. However, there has been no theory to formalise the rules and establish their correctness. We present System \(\textrm{F}_\textrm{RE}\) —the polymorphic \({\lambda }\) -calculus System \(\textrm{F}_\omega \) extended with higher-order term rewriting and equational reasoning to model GHC’s rewrite rules. We develop a theory and methods for verifying correctness of rewrite rules. The key to our method is to guarantee the rewriting properties of local confluence and strong normalisation. We prove the Rule Meaning Preservation Theorem that gives a simple criterion for establishing correctness of rewrite rules, which is suited for mechanical checking.