Affiliation:
1. Chalmers University of Technology
2. Oxford University Computing Laboratory
Abstract
Functional programmers often reason about programs as if they were written in a total language, expecting the results to carry over to non-total (partial) languages. We justify such reasoning.Two languages are defined, one total and one partial, with identical syntax. The semantics of the partial language includes partial and infinite values, and all types are lifted, including the function spaces. A partial equivalence relation (PER) is then defined, the domain of which is the total subset of the partial language. For types not containing function spaces the PER relates equal values, and functions are related if they map related values to related values.It is proved that if two closed terms have the same semantics in the total language, then they have related semantics in the partial language. It is also shown that the PER gives rise to a bicartesian closed category which can be used to reason about values in the domain of the relation.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
25 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. A Cartesian Closed Category for Random Variables;Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science;2024-07-08
2. Spectacular: Finding Laws from 25 Trillion Terms;2023 IEEE Conference on Software Testing, Verification and Validation (ICST);2023-04
3. Engaging, Large-Scale Functional Programming Education in Physical and Virtual Space;Electronic Proceedings in Theoretical Computer Science;2022-07-26
4. Extensional equality preservation and verified generic programming;Journal of Functional Programming;2021
5. Recovering purity with comonads and capabilities;Proceedings of the ACM on Programming Languages;2020-08-02