Applicative Intersection Types

被引:1
作者
Xue, Xu [1 ]
Oliveira, Bruno C. d. S. [1 ]
Xie, Ningning [2 ]
机构
[1] Univ Hong Kong, Hong Kong, Peoples R China
[2] Univ Cambridge, Cambridge, England
来源
PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2022 | 2022年 / 13658卷
关键词
D O I
10.1007/978-3-031-21037-2_8
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Calculi with intersection types have been used over the years to model various features, including: overloading, extensible records and, more recently, nested composition and return type overloading. Nevertheless no previous calculus supports all those features at once. In this paper we study expressive calculi with intersection types and a merge operator. Our first calculus supports an unrestricted merge operator, which is able to support all the features, and is proven to be type sound. However, the semantics is non-deterministic. In the second calculus we employ a previously proposed disjointness restriction, to make the semantics deterministic. Some forms of overloading are forbidden, but all other features are supported. The main challenge in the design is related to the semantics of applications and record projections. We propose an applicative subtyping relation that enables the inference of result types for applications and projections. Correspondingly, there is an applicative dispatching relation that is used for the dynamic semantics. The two calculi and their proofs are formalized in the Coq theorem prover.
引用
收藏
页码:155 / 174
页数:20
相关论文
共 29 条
[1]   Disjoint Polymorphism [J].
Alpuim, Joao ;
Oliveira, Bruno C. d S. ;
Shi, Zhiyuan .
PROGRAMMING LANGUAGES AND SYSTEMS (ESOP 2017): 26TH EUROPEAN SYMPOSIUM ON PROGRAMMING, 2017, 10201 :1-28
[2]  
[Anonymous], 2022, ZENODO, DOI [10.5281/zenodo.7004695, DOI 10.5281/ZENODO.7004695]
[3]   A FILTER LAMBDA-MODEL AND THE COMPLETENESS OF TYPE ASSIGNMENT [J].
BARENDREGT, H ;
COPPO, M ;
DEZANI-CIANCAGLINI, M .
JOURNAL OF SYMBOLIC LOGIC, 1983, 48 (04) :931-940
[4]  
Bi X., 2018, 32 EUROPEAN C OBJECT
[5]  
Bobrow D. G., 1988, SIGPLAN Notices, V23, P1, DOI 10.1145/885631.885632
[6]   A CALCULUS FOR OVERLOADED FUNCTIONS WITH SUBTYPING [J].
CASTAGNA, G ;
GHELLI, G ;
LONGO, G .
INFORMATION AND COMPUTATION, 1995, 117 (01) :115-135
[7]   FUNCTIONAL CHARACTERS OF SOLVABLE TERMS [J].
COPPO, M ;
DEZANICIANCAGLINI, M ;
VENNERI, B .
ZEITSCHRIFT FUR MATHEMATISCHE LOGIK UND GRUNDLAGEN DER MATHEMATIK, 1981, 27 (01) :45-58
[8]   Intersection types and computational effects [J].
Davies, R ;
Pfenning, F .
ACM SIGPLAN NOTICES, 2000, 35 (09) :198-208
[9]   Bidirectional Typing [J].
Dunfield, Jana ;
Krishnaswami, Neel .
ACM COMPUTING SURVEYS, 2021, 54 (05)
[10]   Elaborating intersection and union types [J].
Dunfield, Joshua .
JOURNAL OF FUNCTIONAL PROGRAMMING, 2014, 24 (2-3) :133-165