Type Checking with Rewriting Rules

被引:0
|
作者
Racordon, Dimi [1 ]
机构
[1] Ecole Polytech Fed Lausanne, LAMP, Lausanne, Switzerland
基金
瑞士国家科学基金会;
关键词
type class; type checking; rewriting system; LANGUAGE SUPPORT;
D O I
10.1145/3687997.3695640
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Type classes support the implementation of highly reusable algorithms and data structures without loss of efficiency. Initially developed in Haskell, they have become central to the design of several modern programming languages, including Swift, Rust, Hylo, and Carbon. A key part of their success is the ability to express sophisticated abstractions using constraints on the types associated with their operations. However, this expressiveness invites thorny theoretical and engineering questions. In particular, the support of recursive constraints-i.e., constraints specifying that an associated type of an abstraction must be a model of that abstraction leaves type equivalence undecidable. This paper studies a semi-decidable technique to tackle this problem that was first developed in Swift's compiler. The core idea is to encode constraints into a term rewriting system and use normalization to answer type checking queries. We describe this approach formally through the lens of F-G , a calculus originally designed to capture generic programming best practices; and discuss an implementation in the context of Hylo, a language inspired by Swift and Rust.
引用
收藏
页码:171 / 183
页数:13
相关论文
共 50 条
  • [31] China: Rewriting the rules of the automotive industry
    2018, F and L Asia Inc. (24):
  • [32] Rewriting rules on CD-ROMs
    Fox, B
    NEW SCIENTIST, 1997, 153 (2072) : 23 - 23
  • [33] Labour Market Deregulation: Rewriting the Rules
    Pyman, Amanda
    INDUSTRIAL RELATIONS JOURNAL, 2007, 38 (03) : 271 - 274
  • [34] From Chemical Rules to Term Rewriting
    Bournez, Olivier
    Ibanescu, Liliana
    Kirchner, Helene
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2006, 147 (01) : 113 - 134
  • [35] Seeing Tomorrow: Rewriting the Rules of Risk
    Denis Smith
    Risk Management, 2000, 2 (1) : 60 - 60
  • [36] ENERGY ECONOMICS - IS REWRITING DESIGN RULES
    CHIUSANO, M
    DESIGN NEWS, 1975, 30 (11) : 23 - 27
  • [37] Consistency Checking of Compliance Rules
    Awad, Ahmed
    Weidlich, Matthias
    Weske, Mathias
    BUSINESS INFORMATION SYSTEMS, PROCEEDINGS, 2010, 47 : 106 - 118
  • [38] Calibration with many checking rules
    Sandroni, A
    Smorodinsky, R
    Vohra, RV
    MATHEMATICS OF OPERATIONS RESEARCH, 2003, 28 (01) : 141 - 153
  • [39] Autowrite: A tool for checking properties of term rewriting systems
    Durand, I
    REWRITING TECHNIQUES AND APPLICATIONS, 2002, 2378 : 371 - 375
  • [40] Stratification Criteria and Rewriting Techniques for Checking Chase Termination
    Greco, Sergio
    Spezzano, Francesca
    Trubitsyna, Irina
    PROCEEDINGS OF THE VLDB ENDOWMENT, 2011, 4 (11): : 1158 - 1168