B. Fernández, D. Darvas, E. Blanco Formal methods appliedto PLC code verification Automation seminar CERN – IFAC (CEA) 02/06/2014.

Slides:



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

Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Formal Methods and Testing Goal: software reliability Use software engineering methodologies to develop the code. Use formal methods during code development.
M ODEL CHECKING -Vasvi Kakkad University of Sydney.
Efficient representation for formal verification of PLC programs Vincent Gourcuff, Olivier de Smet and Jean-Marc Faure LURPA – ENS de Cachan.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
An Evaluation of MC/DC Coverage for Pair-wise Test Cases By David Anderson Software Testing Research Group (STRG)
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
1/20 Generalized Symbolic Execution for Model Checking and Testing Charngki PSWLAB Generalized Symbolic Execution for Model Checking and Testing.
LIFE CYCLE MODELS FORMAL TRANSFORMATION
Presenter: PCLee – This paper outlines the MBAC tool for the generation of assertion checkers in hardware. We begin with a high-level presentation.
Software Reliability CIS 640 Adapted from the lecture notes by Doron Pelel (
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
Automated creation of verification models for C-programs Yury Yusupov Saint-Petersburg State Polytechnic University The Second Spring Young Researchers.
An Automata-based Approach to Testing Properties in Event Traces H. Hallal, S. Boroday, A. Ulrich, A. Petrenko Sophia Antipolis, France, May 2003.
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
May 11, ACL2 Panel: What is the Future of Theorem Proving? Arvind Computer Science & Artificial Intelligence Laboratory.
1 Static Analysis Methods CSSE 376 Software Quality Assurance Rose-Hulman Institute of Technology March 20, 2007.
VERTAF: An Application Framework for Design and Verification of Embedded Real-Time Software Pao-Ann Hsiung, Shang-Wei Lin, Chih-Hao Tseng, Trong-Yen Lee,
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Towards a HOL Framework for the Deductive Analysis of Hybrid Control Systems ADPM’2000 Norbert Völker University of Essex, England.
1 Advanced Material The following slides contain advanced material and are optional.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Formal verification Marco A. Peña Universitat Politècnica de Catalunya.
Application of Formal Verification Methods to the analysis of Bearings-only Ballistic Missile Interception Algorithms Eli Bendersky Michael Butvinnik Supervisor:
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
By D. Beyer et. al. Simon Fraser University (Spring 09) Presentation By: Pashootan Vaezipoor.
Presenter : Cheng-Ta Wu Vijay D’silva, S. Ramesh Indian Institute of Technology Bombay Arcot Sowmya University of New South Wales, Sydney.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Balancing Practices: Inspections, Testing, and Others JAXA scenario (formal method) Masa Katahira Japanese Space Agency.
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
Institute e-Austria in Timisoara 1 Author: prep. eng. Calin Jebelean Verification of Communication Protocols using SDL ( )
Yang Liu, Jun Sun and Jin Song Dong School of Computing National University of Singapore.
Framework for the Development and Testing of Dependable and Safety-Critical Systems IKTA 065/ Supported by the Information and Communication.
CS6133 Software Specification and Verification
Joseph Cordina 1/11 The Use of Model-Checking for the Verification of Concurrent Algorithms Joseph Cordina Department of C.S.&A.I.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
Safety-Critical Systems 5 Testing and V&V T
QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs By Koen Claessen, Juhn Hughes ME: Mike Izbicki.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
CSE Winter 2008 Introduction to Program Verification January 15 tautology checking.
Verification & Validation By: Amir Masoud Gharehbaghi
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
Properties Incompleteness Evaluation by Functional Verification IEEE TRANSACTIONS ON COMPUTERS, VOL. 56, NO. 4, APRIL
Introduction to Hardware Verification ECE 598 SV Prof. Shobha Vasudevan.
Automated Formal Verification of PLC (Programmable Logic Controller) Programs
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
Whole Test Suite Generation. Abstract Not all bugs lead to program crashes, and not always is there a formal specification to check the correctness of.
Compositional Verification for System-on-Chip Designs SRC Student Symposium Paper 16.5 Nishant Sinha Edmund Clarke Carnegie Mellon University.
Dániel Darvas (CERN BE-ICS-PCS / TU Budapest) DSL tools for formal verification Spoofax meeting 19/01/2016, CERN Joint work with B. Fernández, E. Blanco,
Symbolic Model Checking of Software Nishant Sinha with Edmund Clarke, Flavio Lerda, Michael Theobald Carnegie Mellon University.
The PLA Model: On the Combination of Product-Line Analyses 강태준.
Model Checking Early Requirements Specifications in Tropos Presented by Chin-Yi Tsai.
Formal verification of industrial control systems
Improving the quality of PLC programs
Input Space Partition Testing CS 4501 / 6501 Software Testing
IS 2935: Developing Secure Systems
Formal Methods in software development
Group Truck Technology, Powetrain Engineering, Control Systems dept.
Automated Extraction of Inductive Invariants to Aid Model Checking
A Trusted Safety Verifier for Process Controller Code
Presentation transcript:

B. Fernández, D. Darvas, E. Blanco Formal methods appliedto PLC code verification Automation seminar CERN – IFAC (CEA) 02/06/2014

Outline  Context  Formal verification  Methodology overview  Some results  Conclusions

Context  CERN: European Organization for Nuclear Research The biggest particle physics research institute  PLCs at CERN:  Widely used in many different systems.  E.g.: cryogenics, vacuum systems, gas systems, C&V.  Common structure (UNICOS framework).

IEC 61508: Software design and develp. (table A.2) Even for SIL1 is recommended to use [Semi]-formal methods

Verification of CERN’s PLC programs  Currently: manual and automated testing  Useful, but not efficient for every type of requirements  Difficult to test safety requirements: “if out1 is true, out2 should be false”  Model checking can complement testing  Can check large amount of combinations.  Formal method.  But…  Why Formal Verification is not widely used in industry yet?  How can we fill the gap between the automation and formal verification worlds?

About formal verification

How to classify model checking? Verification Formal methods Formal verification Model checking Model checking Testing Formal specification (B, Z, Alloy, …) Formal specification (B, Z, Alloy, …) Verif. based on theorem proving Static analysis Formalisms: Automata, Petri Nets, Temporal Logic

Model checking Formal Model Formal Requirement Model checker satisfiednot satisfied Counter- example Specifications Real System (hardware, software)

Testing vs. model checking Requirement If I0.0 is FALSE and I0.1 is FALSE, then Q0.0 is FALSE (Incomplete) testing may answer that this property is correct. Model checking will answer that this property is not correct and it will provide a counterexample: Var1 == 1 Q0.0 := (I0.0 AND I0.1) OR Var1

Testing vs. model checking Safety Requirement If Q0.0 is TRUE, then Q0.1 is FALSE It’s a extremely complicated task for Testing. Model checking will explore all input combinations and will verify the safety property PLC program … Q0.0 Q0.1 I0.0 IW2 I0.1 IW3

Model checking 1.How to build the formal models? Automata, Petri nets, Timed automata, … 2.How to build the formal requirement? Temporal Logic Temporal logic Boolean logic operators AND, OR, NOT predicates input=TRUE, temp>100 + Temporal operators in the future … always … once … until…

Model checking  MC checks the specifications against a model instead of the real system.  Allows to check properties that are almost impossible to test (e.g. liveness properties)  Checks all possible combinations  Gives a counterexample when a discrepancy is found.  Possible to automatize (can be used by non-formal method experts)  State space explosion

About our methodology

Why is not model checking widely used in automation? Formal Model Formal Requirement Model checker satisfiednot satisfied Counter- example How to get models? How to formalize requirements? Which model checker should be used? How to make it efficient? Patterns Automated generation Analysis & Demonstration Reductions Multiple (general meth.) Multiple (general meth.) Specifications Real System (hardware, software) How to proceed with a counterexample?

Our approach: methodology overview  General method for applying formal verification:  Generate formal models automatically out of PLC code.  Includes several input PLC languages (IEC : SFC, ST, IL, Ladder, FBD).  Easy integration of different formal verification tools

Intermediate model (IM)  Automata-based formalism  Simple: but strong enough to represent any PLC feature.  General and close to the modelling language used by the verification tools.

Model example

Automatic generation tool

Some results

Results with the UNICOS library  CERN PLC programs developed with the UNICOS Framework:  Library of objects (representing the logic of real equipment)  Expressed in PLC code: ST language.  Metrics of the PLC program MetricOnOff PLC code Lines of code600 Input variables60 Output variables62 Data typesBooleans, integers, floats, time, etc. Timers3

Results with the UNICOS library Metric Non-reduced model Reduced model Specific Model * Potential state space ~ ~10 36 ~10 10 # Variables Generation0.3 s11.3 s12.6 s NuSMV Verification (with cex.) –160.8 s0.5 s * Based on a real requirement about the mode manager of the OnOff object Cone of Influence algorithm (property preserving reduction techniques)

Results with an UNICOS control system QSDN control system PLC code  110 FBs and FCs  17,500 lines of code Formal model  302 automata  PSS = ~ Goal: Verify the specific logic of the application

Example of a variable dependency graph Reduced variable dependency graph * Using property preserving reduction techniques ** Using non-property preserving reduction techniques Results with an UNICOS control system MetricNon-reduced model Reduced Model* Abstract Model ** PSS ~ ~ ~10 13 # Variables31, Generation4.2 s15.3 s5.4 s NuSMV Verification ––0.25 s MetricNon-reduced model Reduced Model* PSS ~ ~ # Variables31, Generation4.2 s15.3 s NuSMV Verification –– Safety req. If Seq.Stop.x → Valve1.AuOffR

Conclusion and summary  Model checking can be applied to PLC programs.  Difficulty can be hidden from the control engineers:  Automated model generation, requirement patterns, automatic reduction techniques and counterexample analysis.  We have found discrepancies in our systems. Sources of problems:  Incomplete or incorrect specification.  Mistake in the implementation.  Bugs can be proved and “help” is provided to find the source of the bug.  Future work: Concurrency + formal specifications + improvement of reduction techniques.