Generating Optimal Linear Temporal Logic Monitors by Coinduction

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Model Checking Lecture 2. Three important decisions when choosing system properties: 1automata vs. logic 2branching vs. linear time 3safety vs. liveness.
1 Reasoning with Promela Safety properties bad things do not happen can check by inspecting finite behaviours Liveness properties good things do eventually.
Auto-Generation of Test Cases for Infinite States Reactive Systems Based on Symbolic Execution and Formula Rewriting Donghuo Chen School of Computer Science.
Modeling and Analyzing Periodic Distributed Computations Anurag Agarwal Vijay Garg Vinit Ogale The University.
An Abstract Interpretation Framework for Refactoring P. Cousot, NYU, ENS, CNRS, INRIA R. Cousot, ENS, CNRS, INRIA F. Logozzo, M. Barnett, Microsoft Research.
A Survey of Runtime Verification Jonathan Amir 2004.
Translation-Based Compositional Reasoning for Software Systems Fei Xie and James C. Browne Robert P. Kurshan Cadence Design Systems.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Runtime Verification Ali Akkaya Boğaziçi University.
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
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.
UPPAAL Introduction Chien-Liang Chen.
Timed Automata.
/ PSWLAB Efficient Decentralized Monitoring of Safety in Distributed System K Sen, A Vardhan, G Agha, G Rosu 20 th July 2007 Presented by.
Spin Tutorial (some verification options). Assertion is always executable and has no other effect on the state of the system than to change the local.
CSE 555 Protocol Engineering Dr. Mohammed H. Sqalli Computer Engineering Department King Fahd University of Petroleum & Minerals Credits: Dr. Abdul Waheed.
Embedded Systems Laboratory Department of Computer and Information Science Linköping University Sweden Formal Verification and Model Checking Traian Pop.
System Design Research Laboratory Model-based Testing and Monitoring for Hybrid Embedded Systems Li Tan Jesung Kim Oleg Sokolsky Insup Lee University of.
Automata and Formal Lanugages Büchi Automata and Model Checking Ralf Möller based on slides by Chang-Beom Choi Provable Software Lab, KAIST.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Flavio Lerda 1 LTL Model Checking Flavio Lerda. 2 LTL Model Checking LTL –Subset of CTL* of the form: A f where f is a path formula LTL model checking.
1 Carnegie Mellon UniversitySPINFlavio Lerda Bug Catching SPIN An explicit state model checker.
15-820A 1 LTL to Büchi Automata Flavio Lerda A 2 LTL to Büchi Automata LTL Formulas Subset of CTL* –Distinct from CTL AFG p  LTL  f  CTL. f.
Chapter 4.1 Solving Systems of Linear Equations in two variables.
Survey on Trace Analyzer (2) Hong, Shin /34Survey on Trace Analyzer (2) KAIST.
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
1 Monitoring Extended Regular Expressions Grigore Rosu University of Illinois at Urbana-Champaign, USA Joint work with Mahesh Viswanathan and Koushik Sen.
Checking Reachability using Matching Logic Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Safety-Critical Systems 5 Testing and V&V T
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
From Hoare Logic to Matching Logic Reachability Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
Constraints Assisted Modeling and Validation Presented in CS294-5 (Spring 2007) Thomas Huining Feng Based on: [1]Constraints Assisted Modeling and Validation.
Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
1 Equality of Streams is a Problem Grigore Rosu University of Illinois at Urbana-Champaign.
Certifying and Synthesizing Membership Equational Proofs Patrick Lincoln (SRI) joint work with Steven Eker (SRI), Jose Meseguer (Urbana) and Grigore Rosu.
Basic concepts of Model Checking
CSCE 355 Foundations of Computation
Matching Logic An Alternative to Hoare/Floyd Logic
Behavioral Rewrite Systems and Behavioral Productivity
Program Synthesis is a Game
(One-Path) Reachability Logic
runtime verification Brief Overview Grigore Rosu
Parametric Trace Slicing and Monitoring
State your reasons or how to keep proofs while optimizing code
CSCE 355 Foundations of Computation
Efficient Decentralized Monitoring of Safety in Distributed Systems
Koushik Sen Abhay Vardhan Gul Agha Grigore Rosu
Monitoring Programs using Rewriting
CSCI1600: Embedded and Real Time Software
Non-Deterministic Finite Automata
Grigore Rosu Mahesh Viswanathan
Program Monitoring with LTL in EAGLE
Statistical Model-Checking of “Black-Box” Probabilistic Systems VESTA
CSCI1600: Embedded and Real Time Software
Chapter 1 Regular Language - 02
Finite-Trace Linear Temporal Logic: Coinductive Completeness
CSCI1600: Embedded and Real Time Software
Producing short counterexamples using “crucial events”
A Refinement Calculus for Promela
Instructor: Aaron Roth
Towards a Unified Theory of Operational and Axiomatic Semantics
Translating Linear Temporal Logic into Büchi Automata
Chapter 2: Analysis and Verification of Non-Real-Time Systems
Runtime Safety Analysis of Multithreaded Programs
Presentation transcript:

Generating Optimal Linear Temporal Logic Monitors by Coinduction Koushik Sen University of Illinois at Urbana-Champaign, USA Co-authors: Grigore Rosu and Gul Agha.

Increasing Software Reliability Current solutions Human review of code and testing Most used in practice Usually ad-hoc, intensive human support (Advanced) Static analysis Often scales up False positives and negatives, annotations (Traditional) Formal methods Model checking and theorem proving General, good confidence, do not always scale up 12/4/2018

Runtime Verification Merge testing and temporal logic specification Specify safety properties in temporal logic. Monitor safety properties against a run of the program. Examples: JPaX (NASA Ames), Upenn's Java MaC analyzes the observed run. JMPaX (UIUC) predicts errors by analyzing all consistent runs. 12/4/2018

Specification Based Monitoring predicate red = (Light.color == 1); predicate yellow = (Light.color == 2); predicate green = (Light.color == 3); Instrumentation Script class Light{ int color; void goRed(){ color = 1; } … Program property p = [](green -> !red U yellow); Specification 12/4/2018

Monitoring Future Time LTL Syntax – Propositional Calculus plus o F (next)  F (always)  F (eventually) F UF’ (until) Executable Semantics – Rewriting _{_} : Formula x State -> Formula (“consume” state s) F{s} formula that should hold after processing s p{s}  is the atomic predicate p true on s ? (F op F’){s}  F{s} op F’{s} (o F){s}  F ( F){s}  F{s}  ( F) ( F){s}  F{s}  ( F) (F U F’){s}  F’{s}  (F{s}  (F U F’)) 12/4/2018

Future Time LTL - Example Event stream: red yellow green yellow green red … X * ((red U yellow)  (green  red U yellow)) X * ((red U yellow)  (green  red U yellow)) Event red has been consumed! X * (green  red U yellow) X X * (green  red U yellow) X Formula was violated! (green  red U yellow) Formula: {red} {yellow}  (green  red U yellow){red}  (green  red U yellow) {green} (green{red}  (yellow{red}  red{red}  red U yellow))  … * {yellow} (false  (false  false  red U yellow))  … * {green} * true  (green  red U yellow) {red}  (green  red U yellow) (yellow{red}  red{red}  red U yellow)  … * * false  … * false 12/4/2018

Problem… Previous algorithm is not synchronous ! (°  p) Æ (°  : p ) Unless we check for validity after processing each event, which is very expensive How to generate a minimal monitor for LTL to detect bad and good prefixes? Deterministic Finite Automaton called GB-Automaton Solution: Circular Coinduction? Related work for ERE (Extended Regular Expressions) 12/4/2018

Good and Bad Prefixes  is a bad prefix for   is a good prefix for  ) 8 infinite traces  . . 2   is a good prefix for  ) 8 infinite traces  . . ²   is a minimal good (or bad) prefix  is a good (or bad) prefix there is no prefix ’ of  that is good (or bad) p.p.p.: p is a minimal bad prefix for  p 12/4/2018

Good and Bad Prefix Equivalence 1 ´G 2 (good prefix equivalent) iff both 1 and 2 have the exactly same set of good prefixes. 1 ´B 2 (bad prefix equivalent) iff both 1 and 2 have the exactly same set of bad prefixes. 1 ´GB 2 (good-bad prefix equivalent) iff both 1 and 2 have the exactly same set of good and bad prefixes. 12/4/2018

Hidden Logic Behavioral Specification Tuple (V, H, Γ, Σ, E), or simply (Γ, Σ, E) Sorts S = V  H V = visible sorts (stay for data: integers, reals, chars, etc.) H = hidden sorts (stay for states, objects, blackboxes, etc.) Operations Γ  Σ Σ is an S-signature Γ is a subsignature of Σ of behavioral operations E is a set of Σ-equations 12/4/2018

Contexts and Experiments Γ-context is a Γ-term with a hidden “slot” Γ-experiment is a Γ-context of visible result visible if Γ-experiment operations in Γ z : h 12/4/2018

Behavioral Equivalence Models called hidden Σ-algebras; A, A’, … Behavioral equivalence on A: a ≡ a’ Identity on visible carriers a ≡h a’ iff Aξ(a) = Aξ(a’) for any Γ-experiment ξ Γ a a’ visible Aξ(a) Aξ(a’) = Γ Γ 12/4/2018

Circular Coinduction in a Nutshell “Derive” the original proof goal until end up in circles All possibilities to distinguish the two are exhaustively explored Moreover, all the behavioral equalities on the proof graph are true: lemma descovery! Modulo substitutions, “special” contexts and equational reasoning ▲ = ♥ a m1 m2 ☺ = ☼ ♣ = ► 5 = 5 ♣ = ► a m1 m2 ♣ = ► ☺ = ☼ 9 = 9 ☺ = ☼ a m1 m2 0 = 0 12/4/2018

Behavioral Specification of LTL B = (V, H, Γ, Σ, E) where V contains State and Bool H contains LTL Σ contains true,false,_Æ_,_Ç_, _U_, _○_, _, ◊_ E contains all equations defined before Γ contains GB : LTL -> {0,1,?} _{_} : LTL State -> LTL Theorem: B beh. satisfies F = F’ iff F ´GB F’ 12/4/2018

Moreover, all the equivalences in the proof graph below are true! (p Ç q) ´GB (p U q) Theorem: Circular Coinduction is a decision procedure for LTL good-bad prefix equivalence (p Ç q) = (p U q) _{p,q} GB (p Ç q) = (p U q) ? = ? _{;} _{q} _{p} false = false (p Ç q) = (p U q) (p Ç q) = (p U q) Æ (p U q) _{p,q} GB _{;} (p Ç q) = (p U q) ? = ? _{q} _{p} false = false (p Ç q) = (p U q) (p Ç q) = (p U q) Æ (p U q) 12/4/2018

Generating Minimal DFAs (GB-Automaton) for LTL F’{s} F F{s} F{s’} …… F’’ …… s s’ …… F’ …… equivalent? Maintain a set C of pairs of good-bad prefix equivalent LTLs Check each new LTL formula for good-bad prefix equivalence with already existing LTL formulas in the DFA First in C Then by CC. If equivalent LTL formula found, then add new circularities to C 12/4/2018

Complexity The size of the GB-automaton accepting good and bad prefixes of an LTL formula of size m is O(22m) (22m½) Space and time requirement of the algorithm is 2O(m) 12/4/2018

Implementation BOBJ cannot be used because it does not return the set of circularities Can be implemented as a specialized circular coinduction algorithm in Maude Implementation of the algorithm adapted to EREs available online at http://fsl.cs.uiuc.edu/rv/ 12/4/2018

Conclusion and Future Work Behavioral specification of LTL Two LTL formulae are monitoring equivalent iff they are indistinguishable under chosen experiments Optimal monitors are generated by co-induction in a single go. To be part of NASA Ames’s Java PathExplorer (JPaX) tool. Replace edges from a state by Binary Decision Diagrams. Future work to apply coinductive techniques to generate monitors for other logics such as NASA Ames Eagle 12/4/2018