Reasoning about Polymorphic Manifest Contracts

06/19/2018
by   Taro Sekiyama, et al.
0

Manifest contract calculi, which integrate cast-based dynamic contract checking and refinement type systems, have been studied as foundations for hybrid contract checking. In this article, we study techniques to reasoning about a polymorphic manifest contract calculus, including a few program transformations related to static contract verification. We first define a polymorphic manifest contract calculus F_H, which is much simpler than a previously studied one with delayed substitution, and a logical relation for it and prove that the logical relation is sound with respect to contextual equivalence. Next, we show that the upcast elimination property, which has been studied as correctness of subtyping-based static cast verification, holds for F_H. More specifically, we give a subtyping relation (which is not part of the calculus) for F_H types and prove that a term obtained by eliminating upcasts---casts from one type to a supertype of it---is logically related and so contextually equivalent to the original one. We also justify two other program transformations for casts: selfification and static cast decomposition, which help upcast elimination. A challenge is that, due to the subsumption-free approach to manifest contracts, these program transformations do not always preserve well-typedness of terms. To address it, the logical relation and contextual equivalence in this work are defined as semityped relations: only one side of the relations is required to be well typed and the other side may be ill typed.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/02/2021

Detecting Logical Relation In Contract Clauses

Contracts underlie most modern commercial transactions defining define t...
research
11/06/2018

Gradual Type Theory (Extended Version)

Gradually typed languages are designed to support both dynamically typed...
research
08/08/2019

Manifest Contracts with Intersection Types

We present a manifest contract system PCFvΔH with intersection types. A ...
research
10/17/2022

ConReader: Exploring Implicit Relations in Contracts for Contract Clause Extraction

We study automatic Contract Clause Extraction (CCE) by modeling implicit...
research
09/14/2017

Combining Static and Dynamic Contract Checking for Curry

Static type systems are usually not sufficient to express all requiremen...
research
08/23/2018

Runtime verification in Erlang by using contracts

During its lifetime, a program suffers several changes that seek to impr...
research
11/22/2022

Contract Strengthening through Constrained Horn Clause Verification

The functional properties of a program are often specified by providing ...

Please sign up or login with your details

Forgot password? Click here to reset