Inductive and Coinductive Predicate Liftings for Effectful Programs

12/28/2021
by   Niccolò Veltri, et al.
0

We formulate a framework for describing behaviour of effectful higher-order recursive programs. Examples of effects are implemented using effect operations, and include: execution cost, nondeterminism, global store and interaction with a user. The denotational semantics of a program is given by a coinductive tree in a monad, which combines potential return values of the program in terms of effect operations. Using a simple test logic, we construct two sorts of predicate liftings, which lift predicates on a result type to predicates on computations that produce results of that type, each capturing a facet of program behaviour. Firstly, we study inductive predicate liftings which can be used to describe effectful notions of total correctness. Secondly, we study coinductive predicate liftings, which describe effectful notions of partial correctness. The two constructions are dual in the sense that one can be used to disprove the other. The predicate liftings are used as a basis for an endogenous logic of behavioural properties for higher-order programs. The program logic has a derivable notion of negation, arising from the duality of the two sorts of predicate liftings, and it generates a program equivalence which subsumes a notion of bisimilarity. Appropriate definitions of inductive and coinductive predicate liftings are given for a multitude of effect examples. The whole development has been fully formalized in the Agda proof assistant.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/12/2019

Program Equivalence for Algebraic Effects via Modalities

This dissertation is concerned with the study of program equivalence and...
research
08/16/2023

Learning Logic Programs by Discovering Higher-Order Abstractions

Discovering novel abstractions is important for human-level AI. We intro...
research
08/04/2020

Trace Logic for Inductive Loop Reasoning

We propose trace logic, an instance of many-sorted first-order logic, to...
research
02/19/2018

Transforming Proof Tableaux of Hoare Logic into Inference Sequences of Rewriting Induction

A proof tableau of Hoare logic is an annotated program with pre- and pos...
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
04/18/2019

Behavioural Equivalence via Modalities for Algebraic Effects

The paper investigates behavioural equivalence between programs in a cal...
research
11/30/2021

A framework to measure the robustness of programs in the unpredictable environment

Due to the diffusion of IoT, modern software systems are often thought t...

Please sign up or login with your details

Forgot password? Click here to reset