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 条
  • [41] Checking Chase Termination: Cyclicity Analysis and Rewriting Techniques
    Greco, Sergio
    Spezzano, Francesca
    Trubitsyna, Irina
    IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, 2015, 27 (03) : 621 - 635
  • [42] Uberland: How Algorithms Are Rewriting the Rules of Work
    Posada, Julian
    INTERNATIONAL JOURNAL OF COMMUNICATION, 2019, 13 : 1681 - 1683
  • [43] REWRITING THE RULES WITH CURRENT-MODE AMPLIFIERS
    ALHASHIMI, B
    ELECTRONICS WORLD & WIRELESS WORLD, 1993, (1691): : 843 - 846
  • [44] Tissue P systems with contextual and rewriting rules
    Krishna, SN
    Lakshmanan, K
    Rama, R
    MEMBRANE COMPUTING, 2003, 2597 : 339 - 351
  • [45] METHOD OF FORMULATING RULES IN CASE OF SPEECH RECOGNITION USING REWRITING RULES
    KUREMATS.A
    TAKEDA, M
    INOUE, S
    ELECTRONICS & COMMUNICATIONS IN JAPAN, 1972, 55 (02): : 112 - 120
  • [46] WOMEN LAWYERS - REWRITING THE RULES - HARRINGTON,M
    KESSLERHARRIS, A
    NEW YORK TIMES BOOK REVIEW, 1994, : 14 - 15
  • [47] AGRICULTURE AND THE GATT - REWRITING THE RULES - HATHAWAY,DE
    EDWARDS, G
    ECONOMIC RECORD, 1989, 65 (189) : 190 - 191
  • [48] WOMEN LAWYERS - REWRITING THE RULES - HARRINGTON,M
    COTT, NF
    AMERICAN QUARTERLY, 1995, 47 (02) : 343 - 348
  • [49] Rewriting Rules for Arithmetics in Alternate Base Systems
    Masakova, Zuzana
    Pelantova, Edita
    Studenicova, Katarina
    DEVELOPMENTS IN LANGUAGE THEORY, DLT 2023, 2023, 13911 : 195 - 207
  • [50] XPath Query Relaxation through Rewriting Rules
    Fazzinga, Bettina
    Flesca, Sergio
    Furfaro, Filippo
    IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, 2011, 23 (10) : 1583 - 1600