Plausible sealing for gradual parametricity

Author:

Labrada Elizabeth1ORCID,Toro Matías1ORCID,Tanter Éric1ORCID,Devriese Dominique2ORCID

Affiliation:

1. University of Chile, Chile

2. KU Leuven, Belgium

Abstract

Graduality and parametricity have proven to be extremely challenging notions to bring together. Intuitively, enforcing parametricity gradually requires possibly sealing values in order to detect violations of uniform behavior. Toro et al. (2019) argue that the two notions are incompatible in the context of System F, where sealing is transparently driven by potentially imprecise type information, while New et al. (2020) reconcile both properties at the cost of abandoning the syntax of System F and requiring user-provided sealing annotations that are not subject to graduality guarantees. Furthermore, all current proposals rely on a global form of dynamic sealing in order to enforce parametric behavior at runtime, which weakens parametric reasoning and breaks equivalences in the static language. Based on the observation that the tension between graduality and parametricity comes from the early commitment to seal values based on type information, we propose plausible sealing as a new intermediate language mechanism that allows postponing such decisions to runtime. We propose an intermediate language for gradual parametricity, Funky, which supports plausible sealing in a simplified setting where polymorphism is restricted to instantiations with base and variable types. We prove that Funky satisfies both parametricity and graduality, mechanizing key lemmas in Agda. Additionally, we avoid global dynamic sealing and instead propose a novel lexically-scoped form of sealing realized using a representation of evidence inspired by the category of spans. As a consequence, Funky satisfies a standard formulation of parametricity that does not break System F equivalences. In order to show the practicality of plausible sealing, we describe a translation from Funk, a source language without explicit sealing, to Funky, that takes care of inserting plausible sealing forms. We establish graduality of Funk, subject to a restriction on type applications, and explain the source-level parametric reasoning it supports. Finally, we provide an interactive prototype along with illustrative examples both novel and from the literature.

Funder

Agencia Nacional de Investigación y Desarrollo

United States Air Force Office of Scientific Research

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference32 articles.

1. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types

2. Amal Ahmed , Robert Bruce Findler , Jacob Matthews , and Philip Wadler . 2009 . Blame for All. In Workshop on Script to Program Evolution (STOP) . Genova, Italy. Amal Ahmed, Robert Bruce Findler, Jacob Matthews, and Philip Wadler. 2009. Blame for All. In Workshop on Script to Program Evolution (STOP). Genova, Italy.

3. Amal Ahmed Dustin Jamner Jeremy G. Siek and Philip Wadler. 2017. Theorems for Free for Free: Parametricity with and Without Types. 39:1–39:28. Amal Ahmed Dustin Jamner Jeremy G. Siek and Philip Wadler. 2017. Theorems for Free for Free: Parametricity with and Without Types. 39:1–39:28.

4. An indexed model of recursive types for foundational proof-carrying code

5. Abstracting Gradual Typing Moving Forward;Schwerter Felipe Bañados;Precise and Space-Efficient.,2021

Cited by 4 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. GTP Benchmarks for Gradual Typing Performance;Proceedings of the 2023 ACM Conference on Reproducibility and Replicability;2023-06-27

2. Pragmatic Gradual Polymorphism with References;Programming Languages and Systems;2023

3. Gradual System F;Journal of the ACM;2022-10-28

4. Two Parametricities Versus Three Universal Types;ACM Transactions on Programming Languages and Systems;2022-09-21

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3