Combining Static and Dynamic Contract Checking for Curry

09/14/2017
by   Michael Hanus, et al.
0

Static type systems are usually not sufficient to express all requirements on function calls. Hence, contracts with pre- and postconditions can be used to express more complex constraints on operations. Contracts can be checked at run time to ensure that operations are only invoked with reasonable arguments and return intended results. Although such dynamic contract checking provides more reliable program execution, it requires execution time and could lead to program crashes that might be detected with more advanced methods at compile time. To improve this situation for declarative languages, we present an approach to combine static and dynamic contract checking for the functional logic language Curry. Based on a formal model of contract checking for functional logic programming, we propose an automatic method to verify contracts at compile time. If a contract is successfully verified, dynamic checking of it can be omitted. This method decreases execution time without degrading reliable program execution. In the best case, when all contracts are statically verified, it provides trust in the software since crashes due to contract violations cannot occur during program execution.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/08/2019

Manifest Contracts with Intersection Types

We present a manifest contract system PCFvΔH with intersection types. A ...
research
11/12/2019

Smart Contract Interactions in Coq

We present a model/executable specification of smart contract execution ...
research
11/23/2019

Seamless Object-Oriented Requirements

Design by Contract enables seamless software development by unifying sof...
research
05/18/2022

Realizability Checking of Contracts with Kind 2

We present a new feature of the open-source model checker Kind 2 which c...
research
07/26/2023

What Kinds of Contracts Do ML APIs Need?

Recent work has shown that Machine Learning (ML) programs are error-pron...
research
09/04/2018

An automatic tool for checking multi-party contracts

Contracts play an important role in business where relationships among d...
research
06/19/2018

Reasoning about Polymorphic Manifest Contracts

Manifest contract calculi, which integrate cast-based dynamic contract c...

Please sign up or login with your details

Forgot password? Click here to reset