Formal Verification/Methods

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Semantics Static semantics Dynamic semantics attribute grammars
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
(c) 2007 Mauro Pezzè & Michal Young Ch 7, slide 1 Symbolic Execution and Proof of Properties.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
CS 355 – Programming Languages
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Temporal Logic of Actions (TLA) Leslie Lamport
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Software Verification Bertrand Meyer Chair of Software Engineering Lecture 2: Axiomatic semantics.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec17 1 Lecture 17: Formal Modeling Methods Formal Modeling Techniques.
1 Program Correctness CIS 375 Bruce R. Maxim UM-Dearborn.
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: Chapter 3.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Verification Formal Verification & Formal Evaluation Derived from Purdue: Cerias.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Requirements Engineering Methods for Requirements Engineering Lecture-31.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
C HAPTER 3 Describing Syntax and Semantics. D YNAMIC S EMANTICS Describing syntax is relatively simple There is no single widely acceptable notation or.
IS 2620: Developing Secure Systems Formal Verification/Methods Lecture 9 March 15, 2012.
Advanced programming language theory. week 2. Attribute grammars and semantics.
Model Checking Early Requirements Specifications in Tropos Presented by Chin-Yi Tsai.
Principles of Programming & Software Engineering
IS 2150 / TEL 2810 Introduction to Security
Formal Techniques (CS340 © John C. Knight 2004)
Propositional Calculus: Boolean Algebra and Simplification
Logical architecture refinement
IS 2935: Developing Secure Systems
Programming Languages 2nd edition Tucker and Noonan
IS 2150 / TEL 2810 Introduction to Security
Semantics In Text: Chapter 3.
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Computer Security: Art and Science, 2nd Edition
IS 2150 / TEL 2810 Information Security & Privacy
Computer Security: Art and Science, 2nd Edition
IS 2150 / TEL 2810 Introduction to Security
Programming Languages and Compilers (CS 421)
Programming Languages 2nd edition Tucker and Noonan
IS 2150 / TEL 2810 Introduction to Security
Presentation transcript:

Formal Verification/Methods IS 2620 Formal Verification/Methods Lecture 9 Feb 26, 2013

Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems to be analyzed, and Verification techniques showing requirements are met by system description Rely on underlying mathematical logic system and the proof theory of that system

Formal Approach Formal Models use language of mathematics Specification languages For policies, models and system descriptions Well-defined syntax and semantics – based on maths Current trends - two general categories Inductive techniques Model checking techniques Differences based on Intended use, degree of automation, underlying logic systems, etc.

Verification techniques – Criteria for classifying Proof-based vs model-based Proof-based Formula define premises : embody the system description Conclusions: what needs to be proved Proof shows how to reach conclusions from premises Intermediate formulas need to found to reach conclusions Model-based: Premises and conclusions have same truth table values Degree of automation manual or automated (degree) & inbetween

Propositional logic Propositional Axioms Inference rules Boolean And Or Not Implies

Verification techniques – Criteria for classifying Full verification vs property verification Does methodology model full system? Or just prove certain key properties? Examples? Intended domain of application HW/SW, reactive, concurrent Predevelopment vs post development As design aid or after design

Inductive verification Typically more general Uses theorem provers E.g., uses predicate/propositional calculus A sequence of proof steps starting with premises of the formula and eventually reaching a conclusion May be used To find flaws in design To verify the properties of computer programs

Model-checking Systems modeled as state transition systems Formula may be true in some states and false in others Formulas may change values as systems evolve Properties are formulas in logic Truth values are dynamic (Temporal logic) Show: Model and the desired properties are semantically equivalent Model and properties express the same truth table Often used after development is complete but before a product is released to the general market Primarily for reactive, concurrent systems

Formal Verification: Components Formal Specification Defined in unambiguous (mathematical) language Restricted syntax, and well-defined semantics based on established mathematical concepts Example:? Implementation Language Generally somewhat constrained Formal Semantics relating the two Methodology to ensure implementation ensures specifications met

Specification Languages Specify WHAT, not HOW Valid states of system Pre/Post-conditions of operations Non-Procedural Typical Examples: Propositional / Predicate Logic Temporal Logic (supports before/after conditions) Set-based models (e.g., formal Bell-LaPadula)

Example: Primitive commands (HRU) Create subject s Creates new row, column in ACM; s does not exist prior to this Create object o Creates new column in ACM o does not exist prior to this Enter r into a[s, o] Adds r right for subject s over object o Ineffective if r is already there Delete r from a[s, o] Removes r right from subject s over object o Destroy subject s Deletes row, column from ACM; Destroy object o Deletes column from ACM

Example: Primitive commands (HRU) Create subject s Creates new row, column in ACM; s does not exist prior to this Precondition: s  S Postconditions: S´ = S { s }, O´ = O { s } (y  O´)[a´[s, y] = ] (row entries for s) (x  S´)[a´[x, s] = ] (column entries for s) (x  S)(y  O)[a´[x, y] = a[x, y]] Safety Theorems

Specification Languages Must support machine processing Strong typing Model input/output/errors Example: SPECIAL (from SRI) First order logic based Strongly typed VFUN: describes variables (state) OFUN/OVFUN: describe state transitions

Example: SPECIAL MODULE Bell_LaPadula_Model Give_read Types Functions Subject_ID: DESIGNATOR; Object_ID: DESIGNATOR; Access_Mode: {READ, APPEND, WRITE}; Access: STRUCT_OF(Subject_ID subject; Object_ID object; Access_Mode mode); Functions VFUN active (Object_ID object) -> BOOLEAN active: HIDDEN; INITIALLY TRUE; VFUN access_matrix() -> Accesses accesses: HIDDEN; INITIALLY FORALL Access a: a INSET accesses => active(a.object); OFUN give_access(Subject_ID giver; Access access); ASSERTIONS active(access.object) = TRUE; EFFECTS `access_matrix() = access_matrix() UNION (access); END_MODULE

Example: Enhanced Hierarchical Development Methodology Based on HDM A general purpose design and implementation methodology Goal was To mechanize and formalize the entire development process Design specification and verification + implementation specification and verification Successive refinement of specification Proof-based method Uses Boyer-Moore Theorem Prover

Example: Enhanced Hierarchical Development Methodology Hierarchical approach Abstract Machines defined at each level Hierarchy specification in in Hierarchy Specification Language (HSL) AM specification written in SPECIAL Mapping Specifications in SPECIAL define functionality in terms of machines at next lower layers Hierarchy Consistency Checker validates consistency of HS, Module Spec and Mapping Spec Compiler : programs for each AM in terms of calls to lower level that maps a program into a Common Internal Form (CIF) for HDM tools Two levels of spec – translated to CIF  correctness is verified (BMT) Successfully used on MLS systems Few formal policy specifications outside MLS domain

Formal Top Level Spec (FTLS) Levels of Abstraction Formal Top Level Spec (FTLS)

HDM Verification Used for MLS Using the mapping 2 level specifications Translated to intermediate form

Boyer-Moore Theorem Prover Fully automated No interface for comments or directions User provides all the theorems, axioms, lemmata, assertions LISP like notation Very difficult for proving complex theorems Key idea Used extended propositional calculus Efficiency – to find a proof.

Boyer-Moore Theorem Prover Steps: Simplify the formula Apply axioms, lemmata, theorems Reformulate the formula with equivalent terms E.g., replace x-1, x by y and y+1 Substitute equalities Generalize the formula by introducing variables Eliminate irrelevant terms Induct to prove

Gypsy verification environment (GVE) Based on Pascal Formal proof and runtime validation support Focused on Implementation proofs rather than design proofs verification of specification and its implementation Also to support incremental development Specifications defined on procedures Entry conditions, Exit conditions, Assertions Proof techniques ensure exit conditions / assertions met given entry conditions Also run-time checking

Other Examples Prototype Verification System (PVS) Based on EHDM Interactive theorem-prover Symbolic Model Verifier Temporal logic based / Control Tree Logic Notion of “path” – program represented as tree Statements that condition must hold at a future state, all future states, all states on one path, etc.

Other Examples Formal verification of protocols Naval Research Laboratory Protocol Analyzer For Crypto protocols Key management (distribution) Authentication protocols Verification of libraries Entire system not verified But components known okay High risk subsystems

Protocol Verification Generating protocols that meet security specifications BAN Logic Believes, sees, once said Assumes cryptography secure But cryptography is not enough