Abstract

Design by Contract is a programming methodology by which it is possible to annotate program codes with contracts in order to increase the safety of the program. The contracts represent the speci-fication of the software and are categorized into three groups: pre-condition, post-condition, and invariant. The idea of Design by Contract provides the correctness of a program code, satisfying that the caller of each procedure assumes the responsibility for the pre-condition and the callee assumes the responsibility for the post-condition. Findler et al. proposed a formal system based on the typed lambda calculus in which contracts are verified dynamically, that is, in run-time. Flanagan et al. introduced a formal system in which both static and dynamic checking of contracts are possible. In their system, it is possible to represent a contract as static, typing information using refinement type and dependent type. In our paper, we introduce the typed lambda calculus with dependent type and refinement type in the style of Flanagan and study a static analysis in the calculus. The static analysis provides refining of contracts and code optimization based on the contracts. We implement the analyzer using an SMT (Satisfiability Modulo Theory) server.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call