Specification, Verification, and Interactive Proof

Similar documents
A Brief Overview of PVS

Random Testing in PVS

The Prototype Verification System PVS

DISCRETE MATHEMATICS

Recursion and Induction

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Discrete Mathematics Lecture 4. Harper Langston New York University

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

Numerical Computations and Formal Methods

About the Author. Dependency Chart. Chapter 1: Logic and Sets 1. Chapter 2: Relations and Functions, Boolean Algebra, and Circuit Design

DEPARTMENT - Mathematics. Coding: N Number. A Algebra. G&M Geometry and Measure. S Statistics. P - Probability. R&P Ratio and Proportion

Coq, a formal proof development environment combining logic and programming. Hugo Herbelin

LOGIC AND DISCRETE MATHEMATICS

Typed Racket: Racket with Static Types

Adam Chlipala University of California, Berkeley ICFP 2006

Refinements for free! 1

Algebraic Processors

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

Data types for mcrl2

type classes & locales

Pierce Ch. 3, 8, 11, 15. Type Systems

CSE 20 DISCRETE MATH. Fall

Discrete Mathematics SECOND EDITION OXFORD UNIVERSITY PRESS. Norman L. Biggs. Professor of Mathematics London School of Economics University of London

Integration of SMT Solvers with ITPs There and Back Again

Local Specialization in Open-Axiom

Basic Foundations of Isabelle/HOL

CSE 20 DISCRETE MATH. Winter

Functional Programming with Isabelle/HOL

Computing Fundamentals 2 Introduction to CafeOBJ

Appendix G: Some questions concerning the representation of theorems

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

Semantic Subtyping with an SMT Solver

Curriculum Map: Mathematics

COS 320. Compiling Techniques

Why. an intermediate language for deductive program verification

Introductory Combinatorics

Inductive datatypes in HOL. lessons learned in Formal-Logic Engineering

LECTURE 16. Functional Programming

Deductive Program Verification with Why3, Past and Future

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

Programming Languages Third Edition

the Common Algebraic Specification Language

EXTENSIONS OF FIRST ORDER LOGIC

Scheme Quick Reference

Coq projects for type theory 2018

The Typed Racket Guide

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

Scheme Quick Reference

ACL2 Challenge Problem: Formalizing BitCryptol April 20th, John Matthews Galois Connections

Formal Verification in Industry

ALGEBRAIC PROCESSORS

CPS 506 Comparative Programming Languages. Programming Language Paradigm

10. EXTENDING TRACTABILITY

Arithmetic universes as generalized point-free spaces

Satisfiability Modulo Theories. DPLL solves Satisfiability fine on some problems but not others

Lee Pike. June 3, 2005

SMT-LIB for HOL. Daniel Kroening Philipp Rümmer Georg Weissenbacher Oxford University Computing Laboratory. ITP Workshop MSR Cambridge 25 August 2009

CURRICULUM STRUCTURE Topics Covered Term 1: Term 2: Term 3:

Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols

CS 320: Concepts of Programming Languages

MATHEMATICAL STRUCTURES FOR COMPUTER SCIENCE

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.

Formally Certified Satisfiability Solving

Chapter 15. Functional Programming Languages

Recursion and Induction: Haskell; Primitive Data Types; Writing Function Definitions

Compiler Construction I

Types. Type checking. Why Do We Need Type Systems? Types and Operations. What is a type? Consensus

CS 61A Interpreters, Tail Calls, Macros, Streams, Iterators. Spring 2019 Guerrilla Section 5: April 20, Interpreters.

From Types to Sets in Isabelle/HOL

11/6/17. Functional programming. FP Foundations, Scheme (2) LISP Data Types. LISP Data Types. LISP Data Types. Scheme. LISP: John McCarthy 1958 MIT

Functional Programming. Big Picture. Design of Programming Languages

Types Summer School Gothenburg Sweden August Dogma oftype Theory. Everything has a type

Appendix A OCL 2.0 Grammar

Why3 where programs meet provers

Programming Languages

Embedding logics in Dedukti

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

Automated Reasoning. Natural Deduction in First-Order Logic

Introduction to Homotopy Type Theory

Streams. CS21b: Structure and Interpretation of Computer Programs Spring Term, 2004

An Annotated Language

The SMT-LIB 2 Standard: Overview and Proposed New Theories

Functional Programming in Haskell Part I : Basics

Subtyping. Lecture 13 CS 565 3/27/06

Contents. Program 1. Java s Integral Types in PVS (p.4 of 37)

CS6702 GRAPH THEORY AND APPLICATIONS QUESTION BANK

Denotational Semantics. Domain Theory

Overview of SRI s. Lee Pike. June 3, 2005 Overview of SRI s. Symbolic Analysis Laboratory (SAL) Lee Pike

A heuristic method for formally verifying real inequalities

Com S 541. Programming Languages I

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

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

Software Verification for Java 5

Deductive Program Verification with Why3

Induction and Semantics in Dafny

The type system of Axiom

Programming with (co-)inductive types in Coq

Polymorphic Algebraic Data Type Reconstruction

Transcription:

Specification, Verification, and Interactive Proof SRI International May 23, 2016

PVS PVS - Prototype Verification System PVS is a verification system combining language expressiveness with automated tools. It features an interactive theorem prover with powerful commands and user-definable strategies PVS has been available since 1993 It has hundreds of users It is open source (GitHub)

PVS Language The PVS language is based on higher-order logic (type theory) Many other systems use higher-order logic including Coq, HOL, Isabelle/HOL, Nuprl, Agda, Lean PVS uses classical (non-constructive) logic It has a set-theoretic semantics

PVS Theories Theories contain declarations, importings Theories may be parameterized with types, constants, and other theories Theories and theory instances may be imported Theory interpretations may be given, using mappings to interpret uninterpreted types, constants, and theories Theories may have assumptions on the parameters Theories may state what is visible, through exportings

Declarations PVS supports a number of kinds of declarations Declarations may themselves have formal parameters (types) Types Constants, definitions, macros Recursive definitions Inductive and coinductive definitions Formulas and axioms Assumptions on formal parameters Judgements, including recursive judgements Conversions Auto-rewrites

Types PVS has a rich type system Basic types: number, boolean, etc. New basic types may be introduced Enumeration types: {red, green, blue} Function, record, tuple, and cotuple types: [number -> number] [\# flag:\ boolean, value:\ number \#] [boolean, number] [boolean + number]

Recursive Types Datatype list[t: TYPE]: DATATYPE BEGIN null: null? cons(car: T, cdr: list): cons? END DATATYPE Codatatype colist[t: TYPE]: CODATATYPE BEGIN cnull: cnull? ccons(car: T, cdr: list): ccons? END CODATATYPE

Subtypes PVS has two notions of subtype: Predicate Subtypes {x: real x /= 0} {f: [real -> real] injective?(f)} The type {x: T P(x)} may be abbreviated as (P). Structural Subtypes [# x, y: real, c: color #] <: [# x, y: real #] Class hierarchy may be captured with this Update is structural subtype polymorphic: {r WITH [`x := 0]}

Dependent types Function, tuple, record, and (co)datatypes may be dependent: Dependent Types [n: nat -> {m: nat m <= n}] [n: nat, {m: nat m <= n}] [# n: nat, m: {k: nat k <= n} #] dt: DATATYPE BEGIN b: b? c(n: nat, d: {d: dt d /= b}): c? END DATATYPE

Expressions Logic: TRUE, FALSE, AND, OR, NOT, IMPLIES, FORALL, EXISTS, = Arithmetic: +, -, *, /, <, <=, >, >=, 0, 1, 2, Function application, abstraction, and update Binder macro: the! (x: nat) p(x) Coercions Record construction, selection, and update Tuple construction, projection, and update IF-THEN-ELSE, COND CASES: Pattern matching on (co)datatypes Tables

Names Names may be heavily overloaded All names have an identifier; in addition, they may have: a theory identifier actual parameters a library identifier a mapping giving a theory interpretation For example, a reference to a may internally be equivalent to the form Expanded name lib@th[int, 0][nat]{{T := real, c := 1}}.a

Prover The PVS prover is interactive, but with powerful automation It supports exploration, design, implementation, and maintenance of proofs The prover was designed to preserve correspondence with an informal argument Support for user defined strategies and rules Based on the sequent calculus

PVS Libraries Any directory containing PVS files (.pvscontext) may be used as a library Libraries may contain pvs-strategies, pvs-lib.lisp, and pvs-lib.el files - automatically loaded PVS_LIBRARY_PATH is a colon-separated set of paths to search M-x load-prelude-library has the effect of extending the prelude so that the library theories do not need to be explicitly imported

NASA Libraries NASA has a large and growing set of libraries at (google for nasalib) About 140,000 lines of PVS code, over 23,000 theorems (including TCCs) affine_arith algebra analysis analysis_ax Bernstein calculus complex co_structures a model for self-validated numerical analysis groups, monoids, rings, etc real analysis, limits, continuity, derivatives, integrals fundamental_theorem, integrals, taylor expansions, chain_rule solver for polynomial inequalities axiomatic version of calculus complex numbers sequences of countable length defined as coalgebra datatypes

NASA Libraries digraphs directed graphs: circuits, maximal subtrees, paths, dags fault_tolerance consensus protocols, clock synchronization float floating point numbers and arithmetic graphs graph theory: connectedness, walks, trees, Menger s Theorem ints integer division, gcd, mod, prime factorization, min, max interval_arith interval bounds and numerical approximations lnexp logarithm, exponential and hyperbolic functions lnexp_fnd foundational definitions of logarithm, exponential, and hyperbolic functions matrices inverse, determinants, upper-triangular,diagonal

NASA Libraries MetiTarski PVS with MetiTarski numbers primes, sqrt(2) irr, chinese remainder, Fermats little theorem orders abstract orders, lattices, fixedpoints power roots, powers and generalized logs reals summations, sup, inf, sqrt over the reals, abs lemmas scott Theories for reasoning about compiler correctness series power series, comparison test, ratio test, Taylor s theorem sets_aux powersets, orders, cardinality over infinite sets sigma_set summations over countably infinite sets structures bounded arrays, finite sequences and bags Sturm Sturm sequences Tarski generalizes Sturm

NASA Libraries topology trig trig_fnd vectors vect_analysis while continuity, homeomorphisms, connected and compact spaces, Borel sets/functions trigonometry: definitions, identities, approximations foundational development of trigonometry: proofs of trig axioms basic properties of vectors vector analysis semantics for the programming language while