scispace - formally typeset
Search or ask a question

Showing papers on "Hoare logic published in 2006"


Journal ArticleDOI
TL;DR: The basic calculus is developed, the most interesting models are presented, and applicability is demonstrated by two examples: algebraic reconstructions of Noethericity and propositional Hoare logic based on equational reasoning.
Abstract: We propose Kleene algebra with domain (KAD), an extension of Kleene algebra by simple equational axioms for a domain and a codomain operation. KAD considerably augments the expressiveness of Kleene algebra, in particular for the specification and analysis of programs and state transition systems. We develop the basic calculus, present the most interesting models and discuss some related theories. We demonstrate applicability by two examples: algebraic reconstructions of Noethericity and propositional Hoare logic based on equational reasoning.

170 citations


Proceedings ArticleDOI
11 Jan 2006
TL;DR: This paper specifies, via a Hoare-like logic, an interprocedural and flow sensitive (but termination insensitive) information flow analysis for object-oriented programs that employs independence assertions to describe the noninterference property that formalizes confidentiality, and employs region assertions to describes possible aliasing.
Abstract: This paper specifies, via a Hoare-like logic, an interprocedural and flow sensitive (but termination insensitive) information flow analysis for object-oriented programs. Pointer aliasing is ubiquitous in such programs, and can potentially leak confidential information. Thus the logic employs independence assertions to describe the noninterference property that formalizes confidentiality, and employs region assertions to describe possible aliasing. Programmer assertions, in the style of JML, are also allowed, thereby permitting a more fine-grained specification of information flow policy.The logic supports local reasoning about state in the style of separation logic. Small specifications are used; they mention only the variables and addresses relevant to a command. Specifications are combined using a frame rule. An algorithm for the computation of postconditions is described: under certain assumptions, there exists a strongest postcondition which the algorithm computes.

162 citations


Dissertation
01 Jan 2006
TL;DR: A general language model is proposed, which is independent of a concrete programming language but expressive enough to cover all common language features: mutually recursive procedures, abrupt termination and exceptions, runtime faults, local and global variables, pointers and heap, expressions with side effects, pointers to procedures, partial application and closures, dynamic method invocation and also unbounded nondeterminism.
Abstract: The purpose of this thesis is to create a verification environment for sequential imperative programs. First a general language model is proposed, which is independent of a concrete programming language but expressive enough to cover all common language features: mutually recursive procedures, abrupt termination and exceptions, runtime faults, local and global variables, pointers and heap, expressions with side effects, pointers to procedures, partial application and closures, dynamic method invocation and also unbounded nondeterminism. For this language a Hoare logic for both partial and total correctness is developed and on top of it a verification condition generator is implemented. The Hoare logic is designed to allow the integration of program analysis or software model checking into the verification. To demonstrate the continuity to a real programming language a subset of C is embedded into the verification environment. The whole work is developed in the theorem prover Isabelle. Therefore the correctness is machine-checked and in addition the rich infrastructure of the general purpose theorem prover Isabelle can be employed for the verification of imperative programs.

159 citations


Proceedings ArticleDOI
16 Sep 2006
TL;DR: It is shown that the addition of polymorphism alone is sufficient for capturing modular state specifications in the style of Separation Logic, and argued that polymorphism is an essential ingredient of the extension, as the treatment of higher-order functions requires operations not encodable via the spatial connectives of Sep separation Logic.
Abstract: In previous work, we proposed a Hoare Type Theory (HTT) which combines effectful higher-order functions, dependent types and Hoare Logic specifications into a unified framework. However, the framework did not support polymorphism, and ailed to provide a modular treatment of state in specifications. In this paper, we address these shortcomings by showing that the addition of polymorphism alone is sufficient for capturing modular state specifications in the style of Separation Logic. Furthermore, we argue that polymorphism is an essential ingredient of the extension, as the treatment of higher-order functions requires operations not encodable via the spatial connectives of Separation Logic.

148 citations


Proceedings ArticleDOI
11 Jan 2006
TL;DR: A simple and general technique for solving the ECP problem for Hoare-logic-based PCC systems by adding a small amount of syntax to the assertion language and showing how to combine semantic consequence relation with syntactic proof techniques is presented.
Abstract: Embedded code pointers (ECPs) are stored handles of functions and continuations commonly seen in low-level binaries as well as functional or higher-order programs. ECPs are known to be very hard to support well in Hoare-logic style verification systems. As a result, existing proof-carrying code (PCC) systems have to either sacrifice the expressiveness or the modularity of program specifications, or resort to construction of complex semantic models. In Reynolds's LICS'02 paper, supporting ECPs is listed as one of the main open problems for separation logic.In this paper we present a simple and general technique for solving the ECP problem for Hoare-logic-based PCC systems. By adding a small amount of syntax to the assertion language, we show how to combine semantic consequence relation with syntactic proof techniques. The result is a new powerful framework that can perform modular reasoning on ECPs while still retaining the expressiveness of Hoare logic. We show how to use our techniques to support polymorphism, closures, and other language extensions and how to solve the ECP problem for separation logic. Our system is fully mechanized. We give its complete soundness proof and a full verification of Reynolds's CPS-style "list-append" example in the Coq proof assistant.

113 citations


Journal ArticleDOI
10 Nov 2006
TL;DR: This article presents a mathematical characterization of object-oriented concepts by defining an observation-oriented semantics for a relational object-based language with a rich variety of features including subtypes, visibility, inheritance, type casting, dynamic binding and polymorphism.
Abstract: This article presents a mathematical characterization of object-oriented concepts by defining an observation-oriented semantics for a relational object-based language with a rich variety of features including subtypes, visibility, inheritance, type casting, dynamic binding and polymorphism. The language can be used to specify object-oriented designs as well as programs. We present a calculus that supports both structural and behavioural refinement of object-oriented designs. The design calculus is based on the predicate logic in Hoare and He's Unifying Theories of Programming (UTP).

112 citations


Proceedings ArticleDOI
12 Aug 2006
TL;DR: A logic, free of side conditions, is defined, which permits more precise statements of a program's use of variables, and it is shown that it admits translations of proofs in Hoare logic, thereby showing that nothing is lost.
Abstract: Hoare logic is bedevilled by complex but coarse side conditions on the use of variables. We define a logic, free of side conditions, which permits more precise statements of a program’s use of variables. We show that it admits translations of proofs in Hoare logic, thereby showing that nothing is lost, and also that it admits proofs of some programs outside the scope of Hoare logic. We include a treatment of reference parameters and global variables in procedure call (though not of parameter aliasing). Our work draws on ideas from separation logic: program variables are treated as resource rather than as logical variables in disguise. For clarity we exclude a treatment of the heap.

81 citations


Journal ArticleDOI
21 Feb 2006
TL;DR: Modal Kleene algebras provide a unifying semantics for various program calculi and enhance efficient cross-theory reasoning in this class, often in a very concise pointfree style.
Abstract: Modal Kleene algebras are Kleene algebras enriched by forward and backward box and diamond operators. We formalise the symmetries of these operators as Galois connections, complementarities and dualities. We study their properties in the associated operator algebras and show that the axioms of relation algebra are theorems at the operator level. Modal Kleene algebras provide a unifying semantics for various program calculi and enhance efficient cross-theory reasoning in this class, often in a very concise pointfree style. This claim is supported by novel algebraic soundness and completeness proofs for Hoare logic and by connecting this formalism with an algebraic decision procedure.

77 citations


Journal ArticleDOI
TL;DR: Separation logic gives a complete formal treatment of critical sections (for the first time, so far as I is aware) in Hoare logic and allows a resource treatment of variables.

75 citations


Journal ArticleDOI
TL;DR: The state logic is used to provide a sound Hoare-style calculus for quantum imperative programs and the calculus is illustrated by proving the correctness of the Deutsch algorithm.

66 citations


Book ChapterDOI
01 Nov 2006
TL;DR: In this article, the authors present a library for separation logic, an extension of Hoare logic to deal with pointers, and verify the C source code of the Topsy heap manager.
Abstract: In order to ensure memory properties of an operating system, it is important to verify the implementation of its heap manager. In the case of an existing operating system, this is a difficult task because the heap manager is usually written in a low-level language that makes use of pointers, and it is usually not written with verification in mind. In this paper, our main contribution is the formal verification of the heap manager of an existing embedded operating system, namely Topsy. For this purpose, we develop in the Coq proof assistant a library for separation logic, an extension of Hoare logic to deal with pointers. Using this library, we were able to verify the C source code of the Topsy heap manager, and to find and correct bugs.

Journal ArticleDOI
TL;DR: A new workflow model based on Hoare semantics is proposed that allows to automatically check if the desired outcome of a workflow can be produced by its actual implementation, and automatically synthesize a workflow implementation from the workflow specification and a given task library.

Book ChapterDOI
10 Jul 2006
TL;DR: In this paper, the authors extend a Probabilistic Hoare-style logic to formalize game-based cryptographic proofs, and demonstrate their technique by proving semantic security of ElGamal.
Abstract: We extend a Probabilistic Hoare-style logic to formalize game-based cryptographic proofs. Our approach provides a systematic and rigorous framework, thus preventing errors from being introduced. We illustrate our technique by proving semantic security of ElGamal

Journal Article
TL;DR: The earlier general soundness and relative completeness proof for Hoare logic in modal Kleene algebra can be re-used for wp, which links the recursive definition of the do od loop with a combination of the Kleene star and a convergence operator.
Abstract: Using only a simple transition relation one cannot model commands that may or may not terminate in a given state. In a more general approach commands are relations enriched with termination vectors. We reconstruct this model in modal Kleene algebra. This links the recursive definition of the do od loop with a combination of the Kleene star and a convergence operator. Moreover, the standard wp operator coincides with the wip operator in the modal Kleene algebra of commands. Therefore our earlier general soundness and relative completeness proof for Hoare logic in modal Kleene algebra can be re-used for wp. Although the definition of the loop semantics is motivated via the standard Egli-Milner ordering, the actual construction does not depend on Egli-Milner-isotony of the constructs involved.

Proceedings ArticleDOI
10 Nov 2006
TL;DR: This note shows how to use higher-order separation logic to reason abstractly about an iterator protocol.
Abstract: Separation logic is an extension of Hoare logic which permits reasoning about imperative programs that use shared mutable heap structure. In this note, we show how to use higher-order separation logic to reason abstractly about an iterator protocol.

Book ChapterDOI
25 Sep 2006
TL;DR: This paper introduces an extension of the logic and proves it sound, including the Frame Rule that enables specifications of code to be extended by invariants on parts of the heap that are not accessed, and introduces the benefits of local reasoning available to languages with higher-order store.
Abstract: Separation Logic is a sub-structural logic that supports local reasoning for imperative programs. It is designed to elegantly describe sharing and aliasing properties of heap structures, thus facilitating the verification of programs with pointers. In past work, separation logic has been developed for heaps containing records of basic data types. Languages like C or ML, however, also permit the use of code pointers. The corresponding heap model is commonly referred to as “higher-order store” since heaps may contain commands which in turn are interpreted as partial functions between heaps. In this paper we make Separation Logic and the benefits of local reasoning available to languages with higher-order store. In particular, we introduce an extension of the logic and prove it sound, including the Frame Rule that enables specifications of code to be extended by invariants on parts of the heap that are not accessed.

Journal ArticleDOI
TL;DR: This work takes it seriously that, differently from statements of a high-level language, pieces of low-level code are multiple-entry and multiple-exit, and defines a piece of code to consist of either a single labelled instruction or a finite union of pieces of code, and obtains a compositional natural semantics and a matching Hoare logic for a basic low- level language with jumps.

Book ChapterDOI
06 Dec 2006
TL;DR: This paper proposes an original encoding of machine integers, an extension of the MIPS instruction set for smartcards, and explains the formal verification of an optimized implementation of the Montgomery multiplication, a de facto-standard for the implementation of many cryptosystems.
Abstract: It is customary to write performance-critical parts of arithmetic functions in assembly: this enables finely-tuned algorithms that use specialized processor instructions. However, such optimizations make formal verification of arithmetic functions technically challenging, mainly because of many bit-level manipulations of data. In this paper, we propose an approach for formal verification of arithmetic functions in assembly. It consists in the implementation in the Coq proof assistant of (1) a Hoare logic for assembly programs augmented with loops and (2) a certified translator to ready-to-run assembly with jumps. To properly handle formal verification of bit-level manipulations of data, we propose an original encoding of machine integers. For concreteness, we use the SmartMIPS assembly language, an extension of the MIPS instruction set for smartcards, and we explain the formal verification of an optimized implementation of the Montgomery multiplication, a de facto-standard for the implementation of many cryptosystems.

Journal ArticleDOI
TL;DR: A formal proof of the same program in the system Coq, using the recent tactic of the system developed to establish the total correctness of imperative programs, demonstrates the adequacy of theSystem Coq in the process of certifying imperative programs.

01 Jan 2006
TL;DR: This work presents a version of separation logic that permits effective, modular reasoning about typed, higherorder functional programs that use aliased mutable heap data, including pointers to code.
Abstract: Separation logic is an extension of Hoare logic which permits reasoning about low-level imperative programs that use shared mutable heap structure. In this work, we present a version of separation logic that permits effective, modular reasoning about typed, higherorder functional programs that use aliased mutable heap data, including pointers to code. Furthermore, we show how to use predicates in higher-order separation logic to modularly and abstractly specify the sharing behavior of programs.

Journal ArticleDOI
TL;DR: Embedded code pointers (ECP) are stored handles of functions and continuations commonly seen in low-level binaries as well as functional or higher-order programs as mentioned in this paper, and are known to be very hard to find.
Abstract: Embedded code pointers (ECPs) are stored handles of functions and continuations commonly seen in low-level binaries as well as functional or higher-order programs. ECPs are known to be very hard to...

01 Jan 2006
TL;DR: A datatype package is presented that enables the use of shallow embedding technique to object-oriented specification and programming languages and correctness of a Hoare logic with respect to an operational semantics is proven.
Abstract: We present a datatype package that enables the use of shallow embedding technique to object-oriented specification and programming languages. The package incrementally compiles an object-oriented data model to a theory containing object-universes, constructors, and accessor functions, coercions between dynamic and static types, characteristic sets, their relations reflecting inheritance, and the necessary class invariants. The package is conservative, i.e., all properties are derived entirely from axiomatic definitions. As an application, we use the package for an object-oriented core-language called IMPOO, for which correctness of a Hoare logic with respect to an operational semantics is proven.

Journal Article
TL;DR: In this article, the authors present a framework for reasoning about geometric algorithms in Isabelle and show how Hoare logic can be used to prove the correctness of such algorithms, in particular for convex hull problems.
Abstract: Algorithms for solving geometric problems are widely used in many scientific disciplines. Applications range from computer vision and robotics to molecular biology and astrophysics. Proving the correctness of these algorithms is vital in order to boost confidence in them. By specifying the algorithms formally in a theorem prover such as Isabelle, it is hoped that rigorous proofs showing their correctness will be obtained. This paper outlines our current framework for reasoning about geometric algorithms in Isabelle. It focuses on our case study of the convex hull problem and shows how Hoare logic can be used to prove the correctness of such algorithms.

Journal Article
TL;DR: This paper studies the compositional definition and behaviour of properties that arise in pointer structures, and the technique of parameterising a combinator derives from the definition of parallel-by-merge in ‘Unifying Theories of Programming'.
Abstract: This paper studies the compositional definition and behaviour of properties that arise in pointer structures. A pointer structure is represented as a (pointer) graph. A pointer property is a set of pointer structures. A parameterised binary combinator is defined that enables important properties (like acyclicity, canonicity and reachability) to be defined in a compositional manner. The technique of parameterising a combinator derives from the definition of parallel-by-merge in 'Unifying Theories of Programming'. It is applied here to the study of disjointness combinators that extend the separating conjunction of Separation Logic. A case study is provided to demonstrate how these ideas are used, in the form of rules of Hoare logic, to verify the correctness of an Object-Oriented program.

Proceedings Article
01 Jan 2006
TL;DR: This work defines a compositional natural semantics and Hoare logic for this language and goes on to show that, in addition to Hoare logics, one can also derive compositional type systems as weaker specification languages with the same method.
Abstract: It is widely believed that low-level languages with jumps must be difficult to reason about by being inherently non-modular. We have recently argued that this in untrue and proposed a novel method for developing compositional natural semantics and Hoare logics for low-level languages and demonstrated its viability on the example of a simple low-level language with expressions (Saabas & Uustalu 2005). The central idea is to use the implicit structure of finite disjoint unions present in low-level code as an (ambiguous) phrase structure.Here we apply our method to a stack-based language and develop it further. We define a compositional natural semantics and Hoare logic for this language and go then on to show that, in addition to Hoare logics, one can also derive compositional type systems as weaker specification languages with the same method. We describe type systems for stack-error freedom and secure information flow.

Book ChapterDOI
03 Jul 2006
TL;DR: In this article, the compositional definition and behaviour of properties that arise in pointer structures are studied in the form of disjointness combinators that extend separation logic to verify the correctness of an Object-Oriented program.
Abstract: This paper studies the compositional definition and behaviour of properties that arise in pointer structures A pointer structure is represented as a (pointer) graph A pointer property is a set of pointer structures A parameterised binary combinator is defined that enables important properties (like acyclicity, canonicity and reachability) to be defined in a compositional manner The technique of parameterising a combinator derives from the definition of parallel-by-merge in ‘Unifying Theories of Programming' It is applied here to the study of disjointness combinators that extend the separating conjunction of Separation Logic A case study is provided to demonstrate how these ideas are used, in the form of rules of Hoare logic, to verify the correctness of an Object-Oriented program

Book ChapterDOI
25 Sep 2006
TL;DR: An abstraction of Hoare logic to traced symmetric monoidal categories, a very general framework for the theory of systems, is presented and a single soundness and completeness theorem is proved for Hoare triples.
Abstract: We present an abstraction of Hoare logic to traced symmetric monoidal categories, a very general framework for the theory of systems. We first identify a particular class of functors – which we call ‘verification functors’ – between traced symmetric monoidal categories and subcategories of Preord (the category of preordered sets and monotone mappings). We then give an abstract definition of Hoare triples, parametrised by a verification functor, and prove a single soundness and completeness theorem for such triples. In the particular case of the traced symmetric monoidal category of while programs we get back Hoare’s original rules. We discuss how our framework handles extensions of the Hoare logic for while programs, e.g. the extension with pointer manipulations via separation logic. Finally, we give an example of how our theory can be used in the development of new Hoare logics: we present a new sound and complete set of Hoare-logic-like rules for the verification of linear dynamical systems, modelled via stream circuits.

Journal ArticleDOI
TL;DR: This article applies mathematical logic to obtain a rigorous foundation for previous inherently nonrigorous results and also extends those previous results to find the main theorem, which avoids infallibility assumptions on both the agent and the software.
Abstract: This article applies mathematical logic to obtain a rigorous foundation for previous inherently nonrigorous results and also extends those previous results. Roughly speaking, our main theorem states: any agent A that comprehends the correctness-related properties of software S also comprehends an intelligence-related limitation of S. The theorem treats the output of S, if any, as an attempt at solving a halting problem. Previous nonrigorous attempts to obtain similar theorems depend on infallibility assumptions on both the agent and the software. The hypothesis that intelligent agents and intelligent software must be infallible has been widely questioned. In addition, recent work by others has determined that well-known previous attempts use a fallacious form of reasoning; that is, the same form of reasoning can yield paradoxical results. Our main theorem avoids infallibility assumptions on both the agent and the software. In addition, our proof is rigorous, in the sense that in principle one can carry it out in Zermelo-Fraenkel set theory. The software correctness framework considered in the main theorem is that of Hoare logic.

Proceedings ArticleDOI
11 Jan 2006
TL;DR: A type system for a fragment of an assembly language that deals with code pointers and jumps is defined, which addresses an interaction between separation and answer types: frame rules for local reasoning in the presence of jumps are recovered by instantiating the answer type.
Abstract: We define a type system, which may also be considered as a simple Hoare logic, for a fragment of an assembly language that deals with code pointers and jumps. The typing is aimed at local reasoning in the sense that only the type of a code pointer is needed, and there is no need to know the whole code itself. The main features of the type system are separation logic connectives for describing the heap, and polymorphic answer types of continuations for keeping track of jumps. Specifically, we address an interaction between separation and answer types: frame rules for local reasoning in the presence of jumps are recovered by instantiating the answer type. However, the instantiation of answer types is not sound for all types. To guarantee soundness, we restrict instantiation to closed types, where the notion of closedness arises from biorthogonality (in a sense inspired by Krivine and Pitts). A machine state is orthogonal to a disjoint heap if their combination does not lead to a fault. Closed types are sets of machine states that are orthogonal to a set of heaps. We use closed types as well-behaved answer types.

Journal ArticleDOI
TL;DR: It is shown that, in two cases, the with-Goto programming styles are more suitable for proving correctness in Hoare Logic than the corresponding without-goto ones; that is, in each of two cases the without- goto style requires more complicated assertions in the proof-outline than the with -goto one.