DeepAI
Log In Sign Up

Relational Cost Analysis for Functional-Imperative Programs

12/10/2018
by   Weihao Qu, et al.
0

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 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 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 which imperatively update their data.

READ FULL TEXT

page 1

page 2

page 3

page 4

06/12/2022

Divergences on Monads for Relational Program Logics

Several relational program logics have been introduced for integrating r...
04/02/2022

Differential Cost Analysis with Simultaneous Potentials and Anti-potentials

We present a novel approach to differential cost analysis that, given a ...
03/12/2021

Reasoning about the garden of forking paths

Lazy evaluation is a powerful tool for functional programmers. It enable...
12/12/2018

Bidirectional Type Checking for Relational Properties

Relational type systems have been designed for several applications incl...
03/20/2019

Quantum Relational Hoare Logic with Expectations

We present a variant of the quantum relational Hoare logic from (Unruh, ...
06/26/2020

Denotational recurrence extraction for amortized analysis

A typical way of analyzing the time complexity of functional programs is...
02/17/2022

Scheduling Complexity of Interleaving Search

miniKanren is a lightweight embedded language for logic and relational p...