Decalf: A Directed, Effectful Cost-Aware Logical Framework

07/12/2023
by   Harrison Grodin, et al.
0

We present decalf, a directed, effectful cost-aware logical framework for studying quantitative aspects of functional programs with effects. Like calf, the language is based on a formal phase distinction between the extension and the intension of a program, its pure behavior as distinct from its cost measured by an effectful step-counting primitive. The type theory ensures that the behavior is unaffected by the cost accounting. Unlike calf, the present language takes account of effects, such as probabilistic choice and mutable state; this extension requires a reformulation of calf's approach to cost accounting: rather than rely on a "separable" notion of cost, here a cost bound is simply another program. To make this formal, we equip every type with an intrinsic preorder, relaxing the precise cost accounting intrinsic to a program to a looser but nevertheless informative estimate. For example, the cost bound of a probabilistic program is itself a probabilistic program that specifies the distribution of costs. This approach serves as a streamlined alternative to the standard method of isolating a recurrence that bounds the cost in a manner that readily extends to higher-order, effectful programs. The development proceeds by first introducing the decalf type system, which is based on an intrinsic ordering among terms that restricts in the extensional phase to extensional equality, but in the intensional phase reflects an approximation of the cost of a program of interest. This formulation is then applied to a number of illustrative examples, including pure and effectful sorting algorithms, simple probabilistic programs, and higher-order functions. Finally, we justify decalf via a model in the topos of augmented simplicial sets.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/09/2021

A cost-aware logical framework

We present calf, a cost-aware logical framework for studying quantitativ...
research
06/12/2022

Divergences on Monads for Relational Program Logics

Several relational program logics have been introduced for integrating r...
research
02/17/2020

Denotational semantics as a foundation for cost recurrence extraction for functional languages

A standard method for analyzing the asymptotic complexity of a program i...
research
03/29/2019

Fooling the Parallel Or Tester with Probability 8/27

It is well-known that the higher-order language PCF is not fully abstrac...
research
06/26/2020

Denotational recurrence extraction for amortized analysis

A typical way of analyzing the time complexity of functional programs is...
research
12/10/2018

Relational Cost Analysis for Functional-Imperative Programs

Relational cost analysis aims at formally establishing bounds on the dif...
research
06/16/2020

A Hybrid Approach to Formal Verification of Higher-Order Masked Arithmetic Programs

Side-channel attacks, which are capable of breaking secrecy via side-cha...

Please sign up or login with your details

Forgot password? Click here to reset