Hostname: page-component-6766d58669-bp2c4 Total loading time: 0 Render date: 2026-05-21T13:20:51.075Z Has data issue: false hasContentIssue false

Relational cost analysis in a functional-imperative setting

Published online by Cambridge University Press:  02 November 2021

WEIHAO QU
Affiliation:
Boston University, Computer Science Department, Boston, MA 02215, USA (e-mail: weihaoqu@bu.edu)
MARCO GABOARDI
Affiliation:
Boston University, Computer Science Department, Boston, MA 02215, USA (e-mail: gaboardi@bu.edu)
DEEPAK GARG
Affiliation:
Max Planck Institute for Software Systems, Saarbrücken, Germany (e-mail: dg@mpi-sws.org)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Relational cost analysis aims at formally establishing bounds on the difference in the evaluation costs of two programs. As a particular case, one can also use relational cost analysis to establish bounds on the difference in the evaluation cost of the same program on two different inputs. One way to perform relational cost analysis is to use a relational type-and-effect system that supports reasoning about relations between two executions of two programs. Building on this basic idea, we present a type-and-effect system, called ARel, for reasoning about the relative cost (the difference in the evaluation cost) of array-manipulating, higher order functional-imperative programs. The key ingredient of our approach is a new lightweight type refinement discipline that we use to track relations (differences) between two mutable arrays. This discipline combined with Hoare-style triples built into the types allows us to express and establish precise relative costs of several interesting programs that imperatively update their data. We have implemented ARel using ideas from bidirectional type checking.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
© The Author(s), 2021. Published by Cambridge University Press
Supplementary material: PDF

Qu et al. supplementary material

Appendix

Download Qu et al. supplementary material(PDF)
PDF 617.1 KB
Submit a response

Discussions

No Discussions have been published for this article.