has developed a specication of portions of the IEEE 854 oating-point standard in PVS [7]. In PVS, the injective function space injection can be dened

Similar documents
valid abstract descriptions or to justify that a given abstraction is valid. In this paper, we propose a practical verication methodology that is, bas

for his support. Development of PVS was funded entirely by SRI International.

Program Design in PVS. Eindhoven University of Technology. Abstract. Hoare triples (precondition, program, postcondition) have

S. Owre, J. M. Rushby, N. Shankar and M. K. Srivas. fowre, rushby, shankar,

Random Testing in PVS

implement several algorithms useful for digital signal processing [6]. Others verications involve a stack of veried systems [2], an operating system k

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

This article was processed using the LaT E X macro package with LLNCS style

fcyrluk, sree, shankar, verication lies in their generality. The major practical challenge

the application rule M : x:a: B N : A M N : (x:a: B) N and the reduction rule (x: A: B) N! Bfx := Ng. Their algorithm is not fully satisfactory in the

capture cumulative changes over an interval, while in the HIOA model, the evolution of the continuous state variables over time is modeled using traje

An LCF-Style Interface between HOL and First-Order Logic

Subtypes for Specications John Rushby Science Laboratory Computer International SRI Menlo Park, CA J. Rushby FSE97: Subtypes for Specications 1

First Order Logic in Practice 1 First Order Logic in Practice John Harrison University of Cambridge Background: int

The Prototype Verification System PVS

[12] Sam Owre, John Rushby, Natarajan Shankar, and Friedrich von Henke. Formal

Computer Arithmetic: Logic, Calculation, and Rewriting

Higher-Order Conditional Term Rewriting. In this paper, we extend the notions of rst-order conditional rewrite systems

Lee Pike. June 3, 2005

Recursion and Induction

MACHINE golfclub (maxmembers, maxhandicap) CONSTRAINTS maxmembers : NAT & maxhandicap : NAT SETS PERSON members, handicaps INVARIANT members <: PERSON

NASA Technical Memorandum A Bitvectors Library For PVS. Ricky W. Butler. Paul S. Miner. Langley Research Center, Hampton, Virginia

Lecture1: Symbolic Model Checking with BDDs. Edmund M. Clarke, Jr. Computer Science Department Carnegie Mellon University Pittsburgh, PA 15213

Specification, Verification, and Interactive Proof

SCR*: A Toolset for Specifying and. Analyzing Software Requirements? Constance Heitmeyer, James Kirby, Bruce Labaw and Ramesh Bharadwaj

An Annotated Language

Dynamic Logic David Harel, The Weizmann Institute Dexter Kozen, Cornell University Jerzy Tiuryn, University of Warsaw The MIT Press, Cambridge, Massac

A Proof of Correctness of a Processor Implementing Tomasulo s Algorithm without a Reorder Buffer

,, 1{48 () c Kluwer Academic Publishers, Boston. Manufactured in The Netherlands. Optimal Representations of Polymorphic Types with Subtyping * ALEXAN

Cooperating Theorem Provers: A Case Study Combining HOL-Light and CVC Lite

Myla Archer, Constance Heitmeyer, and Steve Sims. farcher, heitmeyer, Abstract

Provably Correct Software

The Maude LTL Model Checker and Its Implementation

Towards certification of TLA + proof obligations with SMT solvers

An ACL2 Tutorial. Matt Kaufmann and J Strother Moore

M. Benini and D. Nowotka ({marcob, Department of Computer Science, University of Warwick, Coventry, CV4 7AL, United Kingdom

The design of a programming language for provably correct programs: success and failure

Proving the Correctness of Distributed Algorithms using TLA

Batch Proving and Proof Scripting in PVS

A Framework for the Formal Verification of Time-Triggered Systems

Thunks (continued) Olivier Danvy, John Hatcli. Department of Computing and Information Sciences. Kansas State University. Manhattan, Kansas 66506, USA

Model Checking VHDL with CV

How to Make a Correct Multiprocess Program Execute Correctly on a Multiprocessor

PVS, SAL, and the ToolBus

Extracting the Range of cps from Affine Typing

KeyNote: Trust Management for Public-Key. 180 Park Avenue. Florham Park, NJ USA.

Polymorphism. Lecture 19 CS 565 4/17/08

tempo2hsal: Converting Tempo Models into HybridSal Tool Description

Proof Pearl: The Termination Analysis of Terminator

Inductive Proof Outlines for Multithreaded Java with Exceptions

Lambda Calculus and Type Inference

Leslie Lamport: The Specification Language TLA +

System Description: Twelf A Meta-Logical Framework for Deductive Systems

MOCHA: Modularity in Model Checking??? Computing Science Research Center, Bell Laboratories.

SOFTWARE VERIFICATION RESEARCH CENTRE DEPARTMENT OF COMPUTER SCIENCE THE UNIVERSITY OF QUEENSLAND. Queensland 4072 Australia TECHNICAL REPORT. No.

of m clauses, each containing the disjunction of boolean variables from a nite set V = fv 1 ; : : : ; vng of size n [8]. Each variable occurrence with

Com S 541. Programming Languages I

Verification Condition Generation via Theorem Proving

Specification Centered Testing

Regression Verification - a practical way to verify programs

The initial development of PVS was funded by SRI International. Subsequent enhancements were partially funded by SRI and by NASA Contracts NAS

Formally Certified Satisfiability Solving

Taxonomic Syntax for First Order Inference. Abstract: We identify a new polynomial time decidable fragment of rst order

Inductive Definitions, continued

State Identification In The Hybrid Automata Description Of Dynamical Systems

The ight schedule database shall store the scheduling associated with all departing and arriving information In particular the database shall contain:

NuSMV: a reimplementation of SMV. A. Cimatti, E. Clarke, F. Giunchiglia, M. Roveri

Model Checking: Back and Forth Between Hardware and Software

LOGIC AND DISCRETE MATHEMATICS

B vs. Coq to prove a Garbage Collector

Introduction to dependent types in Coq

Edinburgh Research Explorer

Formal Verification in Industry

Introduction to SML Getting Started

Simplifying subtyping constraints Francois Pottier Ecole Normale Superieure { INRIA Abstract This paper studies type inferen

argo-lib: A Generic Platform for Decision Procedures

Programming Languages Third Edition

On Meaning Preservation of a Calculus of Records

Lecture 15 CIS 341: COMPILERS

Elf: A Meta-Language for Deductive Systems (System Description)

An Integration of Model Checking with Automated Proof Checking*

Distributed Systems Programming (F21DS1) Formal Verification

Constrained Types and their Expressiveness

Abstract. We present a systematic approach to decompose and incrementally build the proof of correctness

PVS System Guide Version 2.4 December 2001

Generic tools for verifying concurrent systems

The Mobility Workbench User's Guide. Polyadic version Bjorn Victor. October 9, Introduction 2. 2 Input syntax 2

An Introduction to ProofPower

Static and User-Extensible Proof Checking. Antonis Stampoulis Zhong Shao Yale University POPL 2012

Computational inductive denability

Lectures 20, 21: Axiomatic Semantics

Combining Symbolic Model Checking with Uninterpreted Functions for Out-of-Order Processor Verification?

Z Notation. June 21, 2018

Towards a Customizable PVS

c constructor P, Q terms used as propositions G, H hypotheses scope identifier for a notation scope M, module identifiers t, u arbitrary terms

Coq quick reference. Category Example Description. Inductive type with instances defined by constructors, including y of type Y. Inductive X : Univ :=

VS 3 : SMT Solvers for Program Verification

Arbitrary-rank polymorphism in (GHC) Haskell

A Tutorial Introduction to PVS. Presented at WIFT '95: Workshop on Industrial-Strength Formal. Specication Techniques, Boca Raton, Florida, April 1995

F-Soft: Software Verification Platform

Transcription:

PVS: Combining Specication, Proof Checking, and Model Checking? To appear in CAV'96 S. Owre, S. Rajan, J. M. Rushby, N. Shankar, and M. Srivas Computer Science Laboratory, SRI International, Menlo Park CA 94025 USA fowre, sree, rushby, shankar, srivasg@csl.sri.com URL: http://www.csl.sri.com/pvs.html Phone: +1 (415) 859-5272 Fax: +1 (415) 859-2844 PVS (Prototype Verication System) is an environment for constructing clear and precise specications and for developing readable proofs that have been mechanically veried. It is designed to exploit the synergies between language and deduction, automation and interaction, and theorem proving and model checking. For example, the type system of PVS requires the use of theorem proving to establish type correctness, and conversely, type information is used extensively during a proof. Similarly, decision procedures are heavily used in order to simplify the tedious and obvious steps in a proof leaving the user to interactively supply the high-level steps in a verication. Model checking is one such decision procedure that is used to discharge temporal properties of specic nite-state systems. A variety of examples from functional programming, fault tolerance, and real time computing have been veried using PVS [8]. The most substantial use of PVS has been in the verication of the microcode for selected instructions of a commercial-scale microprocessor called AAMP5 designed by Rockwell-Collins and containing about 500,000 transistors [6]. Most recently, PVS has been applied to the verication of the design of an SRT divider [10]. The key elements of the PVS design are described below in greater detail below. 1 Combining Theorem Proving and Typechecking The PVS specication language is based on classical, simply typed higher-order logic, but the type system has been augmented with subtypes and dependent types. Though typechecking is undecidable for the PVS type system, the PVS typechecker automatically checks for simple type correctness and generates proof obligations corresponding to predicate subtypes. These proof obligations can be discharged through the use of the PVS proof checker. PVS also has parametric theories so that it is possible to capture, say, the notion of sorting with respect to arbitrary sizes, types, and ordering relations. By exploiting subtyping, dependent typing, and parametric theories, researchers at NASA Langley Research Center and SRI have developed a very general bit-vector library. Paul Miner at NASA? The development of PVS was funded by SRI International through IR&D funds. Various applications and customizations have been funded by NSF Grant CCR- 930044, NASA, ARPA contract A721, and NRL contract N00015-92-C-2177.

has developed a specication of portions of the IEEE 854 oating-point standard in PVS [7]. In PVS, the injective function space injection can be dened as a higherorder predicate subtype using the higher-order predicate injective? as shown below. The notation (injective?) is an abbreviation for ff j injective?(f)g which is the subtype of functions from D to R for which the predicate injective? holds. functions [D, R: TYPE]: THEORY BEGIN f, g: VAR [D -> R] x, x1, x2: VAR D injective?(f): bool = (FORALL x1, x2: (f(x1) = f(x2) => (x1 = x2))) injection: TYPE = (injective?) END functions We can also dene the subtype even of even numbers and declare a function double as an injective function from the type of natural numbers nat to the subtype even. even: TYPE = fi : nat EXISTS (j : nat): i = 2 * jg double : injection[nat, even] = (LAMBDA (i : nat): 2 * i) When the declaration of double is typechecked, the typechecker generates two proof obligations or type correctness conditions (TCCS). The rst TCC checks that the result computed by double is an even number. The second TCC checks that the denition of double is injective. Both TCCs are proved quickly and automatically using the default TCC strategy employed by the PVS proof checker. Proofs of more complicated TCCs can be constructed interactively. The PVS specication language has a number of other features that exploit the interaction between theorem proving and typechecking. Conversely, type information is used heavily within a PVS proof so that predicate subtype constraints are automatically asserted to the decision procedures, and quantier instantiations are typechecked and can generate TCC subgoals during a proof attempt. The practical experience with PVS has been that the type system does rapidly detect a lot of common specication errors. 2 Combining Decision Procedures with Interactive Proof Decision Procedures. PVS employs decision procedures include the congruence closure algorithm for equality reasoning along with various decision procedures for various theories such as linear arithmetic, arrays, and tuples, in the presence of uninterpreted function symbols [11]. PVS does not merely make use of decision procedures to prove theorems but also to record type constraints and to 2

simplify subterms in a formula using any assumptions that govern the occurrence of the subterm. These governing assumptions can either be the test parts of surrounding conditional (IF-THEN-ELSE) expressions or type constraints on governing bound variables. Such simplications typically ensure that formulas do not become too large in the course of a proof. Also important, is the fact that automatic rewriting is closely coupled with the use of decision procedures, since many of the conditions and type correctness conditions that must be discharged in applying a rewrite rule succumb rather easily to the decision procedures. Strategies. The PVS proof checker provides powerful primitive inference steps that make heavy use of decision procedures, but proof construction solely in terms of even these inference steps can be quite tedious. PVS therefore provides a language for dening high-level inference strategies (which are similar to tactics in LCF [3]). This language includes recursion, a let binding construct, a backtracking try strategy construction, and a conditional if strategy construction. Typical strategies include those for heuristic instantiation of quantiers, repeated skolemization, simplication, rewriting, and quantifer instantiation, and induction followed by simplication and rewriting. There are about a hundred strategies currently in PVS but only about thirty of these are commonly used. The others are used as intermediate steps in dening more powerful strategies. The use of powerful primitive inference steps makes it possible to dene a small number of robust and exible strategies that usually suce for productive proof construction. 3 Integrating Model Checking and Theorem Proving In the theorem proving approach to program verication, one veries a property P of a program M by proving M P. The model checking approach veries the same program by showing that the state machine for M is a satisfying model of P, namely M j= P. For control-intensive approaches over small nite states, model checking is very eective since a more traditional Hoare logic style proof involves discovering a suciently strong invariant. These two approaches have traditionally been seen as incompatible ways of viewing the verication problem. In recent work [9], we were able to unify the two views and incorporate a model checker as decision procedure for a well-dened fragment of PVS. This integration uses the mu-calculus as a medium for communicating between PVS and a model checker for the propositional mu-calculus. We have used this integration to verify a complicated communication protocol by means of abstraction and model checking [4], and also to prove the correctness of an N-process mutual exclusion protocol in such a way that the induction step used the correctness of the 2-process version of the protocol as veried by the model checker. The general mu-calculus over a given state type essentially provides operators for dening least and greatest xpoints of monotone predicate transformers. In Park's mu-calculus, the state type is restricted to n-tuple of booleans and extends quantied boolean formulas (i.e., propositional logic with boolean quantication) 3

to include the application of n-ary boolean predicates to n argument formulas. The relational terms can constructed by means of lambda-abstraction, or by taking the least xpoint Q:F [Q] where Q is an n-ary predicate variable and F is a monotone predicate transformer. The greatest xpoint operation can be written as Q:F [Q] and dened as :Q::F [:Q]. The mu-calculus can be easily dened in PVS. The temporal operators of the branching time temporal logic CTL can be dened using the mu-calculus [1]. An ecient model checking algorithm for the propositional mu-calculus was presented by Emerson and Lei [2], and the symbolic variant employing BDDs was presented by Burch, et al [1]. PVS employs a BDD-based mu-calculus validity checker due to Janssen [5]. When the state type is nite, i.e., constructed inductively from the booleans and scalar types using records, tuples, or arrays over subranges, the mu-calculus over such nite types (and the corresponding CTL) can be translated into the Boolean mu-calculus and model checking can be used as a decision procedure for this fragment. We do not discuss the details of this encoding here (see [9]). References 1. J. R. Burch, E. M. Clarke, K. L. McMillan, D. L. Dill, and L. J. Hwang. Symbolic model checking: 10 20 states and beyond. Information and Computation, 98(2):142{ 170, June 1992. 2. E.A. Emerson and C.L Lei. Ecient model checking in fragments of the propositional mu-calculus. In Proceedings of the 10th Symposium on Principles of Programming Languages, pages 84{96, New Orleans, LA, January 1985. Association for Computing Machinery. 3. M. Gordon, R. Milner, and C. Wadsworth. Edinburgh LCF: A Mechanized Logic of Computation, volume 78 of Lecture Notes in Computer Science. Springer-Verlag, 1979. 4. Klaus Havelund and N. Shankar. Experiments in theorem proving and model checking for protocol verication. In Formal Methods Europe FME '96, number 1051 in Lecture Notes in Computer Science, pages 662{681, Oxford, UK, March 1996. Springer-Verlag. 5. G. L. J. M. Janssen. ROBDD Software. Department of Electrical Engineering, Eindhoven University of Technology, October 1993. 6. Steven P. Miller and Mandayam Srivas. Formal verication of the AAMP5 microprocessor: A case study in the industrial use of formal methods. In WIFT '95: Workshop on Industrial-Strength Formal Specication Techniques, pages 2{ 16, Boca Raton, FL, 1995. IEEE Computer Society. 7. Paul S. Miner. Dening the IEEE-854 oating-point standard in PVS. Technical Memorandum 110167, NASA Langley Research Center, 1995. 8. Sam Owre, John Rushby, Natarajan Shankar, and Friedrich von Henke. Formal verication for fault-tolerant architectures: Prolegomena to the design of PVS. IEEE Transactions on Software Engineering, 21(2):107{125, February 1995. 9. S. Rajan, N. Shankar, and M.K. Srivas. An integration of model-checking with automated proof checking. In Pierre Wolper, editor, Computer-Aided Verication, CAV '95, volume 939 of Lecture Notes in Computer Science, pages 84{97, Liege, Belgium, June 1995. Springer-Verlag. 10. H. Ruess, M. K. Srivas, and N. Shankar. Modular verication of SRT division. In Rajeev Alur and Tom Henzinger, editors, Computer-Aided Verication, CAV 4

'96, Lecture Notes in Computer Science, New Brunswick, NJ, July 1996. Springer- Verlag. To appear. 11. Robert E. Shostak. Deciding combinations of theories. Journal of the ACM, 31(1):1{12, January 1984. 5