Symbolic Model Checking of Domain Models. for Autonomous Spacecrafts

Similar documents
Verification of Diagnosability using Model Checking (and why NASA cares)

Lecture 2: Symbolic Model Checking With SAT

Binary Decision Diagrams and Symbolic Model Checking

CTL Model checking. 1. finite number of processes, each having a finite number of finite-valued variables. Model-Checking

Model checking the basic modalities of CTL with Description Logic

Model Checking: An Introduction

Boolean decision diagrams and SAT-based representations

Formal Methods Lecture VII Symbolic Model Checking

Postprint.

Double Header. Model Checking. Model Checking. Overarching Plan. Take-Home Message. Spoiler Space. Topic: (Generic) Model Checking

Formal Verification of Diagnosability via Symbolic Model Checking

State-Space Exploration. Stavros Tripakis University of California, Berkeley

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Undergraduate work. Symbolic Model Checking Using Additive Decomposition by. Himanshu Jain. Joint work with Supratik Chakraborty

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

Software Verification using Predicate Abstraction and Iterative Refinement: Part 1

Revising Specifications with CTL Properties using Bounded Model Checking

Model Checking. Boris Feigin March 9, University College London

Model Checking with CTL. Presented by Jason Simas

SMV the Symbolic Model Verifier. Example: the alternating bit protocol. LTL Linear Time temporal Logic

Verification. Arijit Mondal. Dept. of Computer Science & Engineering Indian Institute of Technology Patna

COMPRESSED STATE SPACE REPRESENTATIONS - BINARY DECISION DIAGRAMS

SBMC : Symmetric Bounded Model Checking

Binary Decision Diagrams

A Brief Introduction to Model Checking

Bounded Model Checking with SAT/SMT. Edmund M. Clarke School of Computer Science Carnegie Mellon University 1/39

Reduced Ordered Binary Decision Diagrams

Symbolic Trajectory Evaluation (STE): Orna Grumberg Technion, Israel

CS357: CTL Model Checking (two lectures worth) David Dill

Model Checking I. What are LTL and CTL? dack. and. dreq. and. q0bar

CTL Model Checking. Wishnu Prasetya.

A brief history of model checking. Ken McMillan Cadence Berkeley Labs

Abstractions and Decision Procedures for Effective Software Model Checking

Symbolic Model Checking with ROBDDs

Temporal Logic. Stavros Tripakis University of California, Berkeley. We have designed a system. We want to check that it is correct.

QBF Encoding of Temporal Properties and QBF-based Verification

Computation Tree Logic

EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving III & Binary Decision Diagrams. Sanjit A. Seshia EECS, UC Berkeley

1 Algebraic Methods. 1.1 Gröbner Bases Applied to SAT

Temporal Formula Specifications of Asynchronous Control Module in Model Checking

Model Checking I. What are LTL and CTL? dack. and. dreq. and. q0bar

Polynomial Methods for Component Matching and Verification

Bounded Model Checking Using Satisfiability Solving

3-Valued Abstraction-Refinement

Applications of Craig Interpolants in Model Checking

MODEL CHECKING. Arie Gurfinkel

Lecture 16: Computation Tree Logic (CTL)

Predicate Abstraction in Protocol Verification

Formal Verification of the CRC Algorithm Properties

Non-linear Quantification Scheduling in Image Computation

Symbolic Model Checking Property Specification Language*

Finite-State Model Checking

Groebner Bases in Boolean Rings. for Model Checking and. Applications in Bioinformatics

Diagnosability Testing with Satisfiability Algorithms

Temporal Logic Model Checking

Basing Decisions on Sentences in Decision Diagrams

Compressing BMC Encodings with QBF

Reduced Ordered Binary Decision Diagrams

Model checking, verification of CTL. One must verify or expel... doubts, and convert them into the certainty of YES [Thomas Carlyle]

Bounded LTL Model Checking with Stable Models

Symbolic Model Checking without BDDs

On Boolean Encodings of Transition Relation for Parallel Compositions of Transition Systems

Semantic Equivalences and the. Verification of Infinite-State Systems 1 c 2004 Richard Mayr

New Complexity Results for Some Linear Counting Problems Using Minimal Solutions to Linear Diophantine Equations

Model Update for System Modifications. Yulin Ding. A thesis submitted for the degree of Doctor of Philosophy at University of Western Sydney

Towards an Efficient Tableau Method for Boolean Circuit Satisfiability Checking

Computation Tree Logic (CTL) & Basic Model Checking Algorithms

Symbolic Model Checking

Model Checking. Temporal Logic. Fifth International Symposium in Programming, volume. of concurrent systems in CESAR. In Proceedings of the

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

IC3 and Beyond: Incremental, Inductive Verification

SAT in Formal Hardware Verification

Summary. Computation Tree logic Vs. LTL. CTL at a glance. KM,s =! iff for every path " starting at s KM," =! COMPUTATION TREE LOGIC (CTL)

Digital Systems. Validation, verification. R. Pacalet January 4, 2018

Binary Decision Diagrams Boolean Functions

GROEBNER BASES COMPUTATION IN BOOLEAN RINGS

Algorithmic verification

SAT-Based Verification of Safe Petri Nets

Verification Using Temporal Logic

Chapter 4: Computation tree logic

Computation Tree Logic (CTL)

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

Reduced Ordered Binary Decision Diagrams

SAT-Based Verification with IC3: Foundations and Demands

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

SAT-based Model-Checking

19. Extending the Capacity of Formal Engines. Bottlenecks for Fully Automated Formal Verification of SoCs

Verifying Safety Properties of a PowerPC TM Microprocessor Using Symbolic Model Checking without BDDs

Linear Temporal Logic and Büchi Automata

Symmetry Reductions. A. Prasad Sistla University Of Illinois at Chicago

Detecting Support-Reducing Bound Sets using Two-Cofactor Symmetries 1

3. Temporal Logics and Model Checking

Automata-based Verification - III

COEN6551: Formal Hardware Verification

COMPLEXITY ANALYSIS OF THE PRESBURGER REACHABILITY PROBLEM FOR DISCRETE TIMED AUTOMATA CHENG LI

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

THEORY OF SYSTEMS MODELING AND ANALYSIS. Henny Sipma Stanford University. Master class Washington University at St Louis November 16, 2006

Automata-Theoretic Model Checking of Reactive Systems

EAHyper: Satisfiability, Implication, and Equivalence Checking of Hyperproperties

High Level Reduction Technique for Multiway Decision Graphs Based Model Checking

Transcription:

Raisonnement sur modèles Intelligence artificielle Symbolic Model Checking of Domain Models Vérification symbolique for Autonomous Spacecrafts Charles Pecheur (RIACS / NASA Ames) Autonomie Logiciel spatial Charles Pecheur 1

Introduction Past: Time-stamped control sequences Future: On-board intelligence Remote Agent In flight on DS-1, May 99 + Can respond to unanticipated scenarios! How do we verify all those scenarios? Charles Pecheur 2

Outline Model-Based Autonomy and Livingstone Symbolic Model Checking and SMV Verification of Livingstone Models Charles Pecheur 3

Model-Based Autonomy Goal: "intelligent" autonomous spacecrafts cheaper (smaller ground control) more capable (delays, blackouts) General reasoning engine + application-specific model Use model to respond to unanticipated situations For planning, diagnosis Huge state space, reliability is critical Autonomous controller commands Reasoning Engine status Spacecraft Model model of Charles Pecheur 4

Livingstone Remote Agent's model-based diagnosis sub-system High level operational plan Model Discretized Observations Mode updates Plan Execution System Goals MI current state Livingstone MR Reconfig Command Command Courtesy Autonomous Systems Group, NASA Ames Charles Pecheur 5

Outline Model-Based Autonomy and Livingstone Symbolic Model Checking and SMV Verification of Livingstone Models Charles Pecheur 6

Model... Modeling Abstraction Verification Controller Planner Exec MIR Charles Pecheur 7

Model Checking Modeling Abstraction Verification Controller Planner Exec MIR Valve is closed when Tank is empty AG (tank=empty => valve=closed) Charles Pecheur 8

Symbolic Model Checking Instead of considering each individual state, Symbolic model checking... 0 1 2... 0 1... y x Charles Pecheur 9

Symbolic Model Checking Instead of considering each individual state, Symbolic model checking... Manipulates sets of states, 0 1 2... 0 1... y x Charles Pecheur 10

Symbolic Model Checking Instead of considering each individual state, Symbolic model checking... Manipulates sets of states, 0 1 2... 0 1... y x Represented as boolean formulas, x=2 y=1 Charles Pecheur 11

Symbolic Model Checking Instead of considering each individual state, Symbolic model checking... Manipulates sets of states, 0 1 2... 0 1... y x Represented as boolean formulas, x=2 y=1 x=2 Encoded as binary decision diagrams. y=1 1 0 Charles Pecheur 12

Symbolic Model Checking Instead of considering each individual state, Symbolic model checking... Manipulates sets of states, Can handle very large state spaces (10 50 +) Represented as boolean formulas, Suited for boolean/abstract models Encoded as binary decision diagrams. The limit is BDD size (hard to control) 0 1 2... 0 1... y x=2 y=1 x=2 y=1 1 0 x Charles Pecheur 13

Boolean Functions Represent a state as boolean variables s = b 1,..., b n Non-boolean variables => use boolean encoding A set of states as a boolean function s in S iff f(b 1,..., b n ) = 1 A transition relation as a boolean function over two states s s' iff f(b 1,..., b n, b' 1,..., b' n ) = 1 Charles Pecheur 14

Binary Decision Trees Encoding for boolean functions a Notational convention: c b e c e' = if c then e else e' = (c? e : e') 1 0 1 c 0 1 Always exists but not unique (a b) => c Charles Pecheur 15

From Trees to Diagrams Fixed variable ordering "layered" tree a b b c c c c 1 0 1 0 1 0 1 1 (a b) => c Charles Pecheur 16

From Trees to Diagrams Fixed variable ordering "layered" tree a Merge equal subtrees b b c c c c 1 0 1 0 1 0 1 1 (a b) => c Charles Pecheur 17

From Trees to Diagrams Fixed variable ordering "layered" tree Merge equal subtrees b a b c c Remove nodes with equal subtrees 1 0 (a b) => c => Ordered Binary Decision Diagram Charles Pecheur 18

[Ordered] Binary Decision Diagrams [O]BDDS for short Unique normal form for a given ordering and up to isomorphism => compare in constant time (using hash table) a b c 1 0 (a b) => c Charles Pecheur 19

Computations with BDDs All needed operations can be efficiently computed using BDDS Example: boolean combinator f&g: (b? f' : f'') & (b? g' : g'') = (b? f'&g' : f''&g'') cache results > O( f. g ) time Other operations: Negation!f Instantiation f[b=1], f[b=0] Quantifiers exists b. f, forall b. f Charles Pecheur 20

Transition Systems with BDDs Given boolean state variables v = b 1,..., b n a set of states as a BDD p(v) a transition relation as a BDD T(v, v') we can compute the predecessors and successors of p as BDDs: (pred p)(v) = exists v'. T(v, v') & p(v') (succ p)(v) = exists v'. p(v') & T(v', v) pred p p succ p Charles Pecheur 21

CTL temporal logic Computation Tree Logic (branching): Consider the tree of possible executions... Next p... Globally p... Finally p... p Until q Always... In all states Sometimes... AX p AG p AF p A[p U q] duals In some state EX p EG p EF p E[p U q] Charles Pecheur 22

Evaluating CTL with BDDS Example: compute EF p from p with BDDs: EF p = lfp U. (p EX U) = least solution of U = p EX U U 0 = 0 U 1 = p EX U 0 = p... U n+1 = p EX U n = p EX p... EX n p until U n = U n+1 = EF p Convergence assured because finite domain Backward search from p to EF p EF p p EX (p EX p) p EX p p 0 Charles Pecheur 23

Variable Ordering Must be the same for all BDDs Size of BDDs depends critically on ordering Worst case: exponential w.r.t. #variables sometimes exponential for any ordering e.g. middle output bit of n-bit multiplier Finding optimum is hard (NP-complete) => optimization uses heuristics Charles Pecheur 24

SMV SMV = Symbolic Model Verifier. Modeling language based on parallel assignments. Specifications in temporal logic CTL. BDD-based symbolic model checking. Several versions: (CMU) SMV: original work by McMillan (Carnegie Mellon) NuSMV: clean re-writing, faster (ITC-IRST and CMU) Cadence SMV: following McMillan (Cadence Berkeley Labs) Charles Pecheur 25

What SMV Does mutex.smv Model MODULE user(...)... MODULE main VAR turn: {1, 2}; user1: user(...);... SPEC AG!( (user1.state = c) & (user2.state = c)) Specification smv mutex.smv <stdout> -- specification AG... is false -- as demonstrated by... state 1.1: turn = 1 user1.state = n user2.state = n state 1.2:... resources used:... Counter-example Charles Pecheur 26

SMV Program Example (1/2) MODULE user(turn,id,other) VAR state: {n, t, c}; DEFINE my_turn := (other=n) ((other=t) & (turn=id)); ASSIGN init(state) := n; next(state) := case (state = n) : {n, t}; (state = t) & my_turn: c; t (state = c) : n; 1 : state; esac; SPEC AG((state = t) -> AF (state = c)) n c my_turn!my_turn Charles Pecheur 27

SMV Program Example (2/2) MODULE main VAR turn: {1, 2}; user1: user(turn, 1, user2.state); user2: user(turn, 2, user1.state); ASSIGN init(turn) := 1; next(turn) := case (user1.state=n) & (user2.state=t): 2; (user2.state=n) & (user1.state=t): 1; 1: turn; esac; SPEC AG!((user1.state=c) & (user2.state=c)) SPEC AG!(user1.state=c) -- false! Charles Pecheur 28

Diagnostic Trace Example -- specification AG (state = t -> AF state = c) (in module user1) is true -- specification AG (state = t -> AF state = c) (in module user2) is true -- specification AG (!(user1.state = c & user2.state = c)... is true -- specification AG (!user1.state = c) is false -- as demonstrated by the following execution sequence state 1.1: turn = 1 user1.state = n user2.state = n state 1.2: user1.state = t state 1.3: user1.state = c Charles Pecheur 29

The Essence of SMV The SMV program defines: a finite transition model M (Kripke structure), a set of possible initial states I (may be several), specifications P 1.. P m (CTL formulas). SMV checks that each specification P is satisfied in all initial states s o of model M. s o I. M, s o = P Charles Pecheur 30

Outline Model-Based Autonomy and Livingstone Symbolic Model Checking and SMV Verification of Livingstone Models Charles Pecheur 31

Livingstone Models concurrent transition systems (components) synchronous product enumerated types => finite state Essentially SMV model + nominal/fault modes, commands/monitors (I/O), probabilities on faults,... inflow, outflow : {zero,low,high} Open Closed Open Valve Close inflow = outflow Stuck open p=0.001 p=0.01 Stuck closed inflow = outflow = zero Courtesy Autonomous Systems Group, NASA Ames Diagnosis = find the most likely assumptions (modes) that are consistent with the observations (commands/monitors) Charles Pecheur 32

Large State Space? Example: model of ISPP = 7.16 10 55 states This is only the Livingstone model a complete verification model could be Exec driver (10-100 states) x Spacecraft simulator (10 55 states) x Livingstone system (keeps history 10 n 55 states) Verify a system that analyzes a large state space! Approach: the model is the program Verify it (using symbolic model checking) Assume Livingstone correct (and complete) Charles Pecheur 33

MPL2SMV Autonomy Verification Livingstone Livingstone Model Livingstone Requirement M P L 2 SMV Model SMV Requirement SMV Livingstone Trace S M V SMV Trace Charles Pecheur 34

Translator from Livingstone to SMV Co-developed with CMU (Reid Simmons) Similar semantics => translation is easy Properties in temporal logic + pre-defined patterns Initially for Livingstone 1 (Lisp), upgraded to Livingstone 2 (C++/Java) Charles Pecheur 35

Principle of Operations Lisp shell (load "mpl2smv.lisp") ;; load the translator ;; Livingstone not needed! (defcomponent (defcomponent heater heater ) ispp.lisp ) (defmodule (defmodule valve-mod valve-mod ) ) (defverify (defverify :structure :structure (ispp) (ispp) :specification :specification (all (all (globally (globally ))) ))) (translate "ispp.lisp" "ispp.smv") ;; do the translation MODULE MODULE Mheater Mheater MODULE MODULE Mvalve-mod Mvalve-mod MODULE MODULE main main VAR VAR Xispp:Mispp Xispp:Mispp SPEC SPEC AG AG (smv "ispp.smv") ;; call SMV ;; (as a sub-process) ispp.smv Specification Specification AG AG is is false false as as shown shown State State 1.1: 1.1: State State 1.2: 1.2: SMV output Charles Pecheur 36

Simple Properties Supported by the translator: syntax sugar iterate over model elements (e.g. all component modes) Examples Reachability (no dead code) EF heater.mode = on Path Reachability (scenario) AG (s1 > EF (s2 & EF (s3 & EF s4))) Charles Pecheur 37

Probabilistic Properties Use probabilities associated to failure transitions Use order of magnitude: -log(p), rounded to a small integer Combine additively, OK for BDD computations Approximate but so are the proba. values heater.mode = overheat -> heater.proba = 2; (p = 0.01) proba = heater.proba + valve.proba + sensor.proba; SPEC AG (broken & proba < 3 > EF working) Charles Pecheur 38

Functional Dependency Check that y=f(x) for some unknown f Use universally quantified variables in CTL = undetermined constants in SMV VAR x0,y0 : {a,b,c}; TRANS next(x0) = x0 TRANS next(y0) = y0 x0, y0 SPEC (EF x=x0 & y=y0) > (AG x=x0 > y=y0) Limitation: counter-example needs two traces, SMV gives only one => instantiate second half by hand, re-run SMV Charles Pecheur 39

Temporal Queries Temporal Query = CTL formula with a hole: AG (? > EF working) Search (canonical) condition for? that satisfies the formula (computable for useful classes of queries) Recent research, interrupted (William Chan, 1999) Problem: visualize solutions (CNF, projections,...) Core algorithm implemented in NuSMV (Wolfgang Heinle) Deceptive initial results, to probe further Charles Pecheur 40

SMV with Macro Expansion Custom version of SMV (Bwolen Yang, CAV 99) Eliminates variables by Macro Expansion: analyzes static constraints of the model (invariants), find dependent variables x=f(x1,...,xn), substitute f(x1,...,xn) for x everywhere, eliminate x from the set of BDD variables. For models with lots of invariants => useful for Livingstone models Full ISPP model in < 1 min, vs. SMV runs out of memory. Charles Pecheur 41

ISPP Model Statistics In Situ Propellant Production (ISPP) = turn Mars atmosphere into rocket fuel (NASA KSC) Original model state = 530 bits (trans. = 1060 bits) Total BDD vars Macro expanded Reduced BDD vars 588 bits -209 bits 379 bits Reachable state space 7.16 10 55 = 2 185.5 Total state space 1.06 10 81 = 2 269.16 Reachability of all modes (163): 29.14" CPU time in 63.6 Mb RAM Charles Pecheur 42

Diagnosis Properties Can fault F always be diagnosed? (assuming perfect diagnosis and accurate model) = is F unambiguously observable? obs0. (EF F & obs=obs0) > (AG F > obs=obs0) Similar to functional dependency obs = observable variables (many of them) Static variant (ignore transitions): SAT on two states S, S' such that F &! F' & obs=obs' Charles Pecheur 43

Diagnosis Properties Revisited Very recent (yesterday), with Alessandro Cimatti Can fault F be diagnosed knowing the last n steps? Apply SAT to: x0 T T x1 cmd obs x1' T T x2 cmd obs x2' T T...... T T xn cmd obs xn' F! F Variants are possible (e.g. fork at n-1 intead of 0) Charles Pecheur 44

Diagnosis Properties (cont'd) Does it work? Computational cost of extra variables Has it been done? Similar work in hardware testability? Is it useful? It is unrealistic to expect all faults to be immediately observable (e.g. valve closed vs. stuck-closed) What weaker properties? Are they verifiable? To be explored Charles Pecheur 45

Summary Verification of model-based diagnosis: Space flight => safety critical. Huge state space (w.r.t. fixed command sequence). Focus on models (the model is the program) Quite different from executable programs Loose coupling, no threads of control, passive. Huge but shallow state spaces. Symbolic model checking is very appropriate Verify well-formedness + validity w.r.t. hardware Verify suitability for diagnosis: to be explored Charles Pecheur 46

Thank You Charles Pecheur 47

Symbolic Model Checking References R. E. Bryant. Graph-based algorithms for boolean function manipulation. IEEE Transactions on Computers, C-35(8):677-691, 1986. The seminal paper on Binary Decision Diagrams. J. R. Burch, E. M. Clarke, K. L. McMillan, D. L. Dill, and J. Hwang. Symbolic model checking: 10^20 states and beyond. Information and Computation, vol. 98, no. 2, 1992. Survey paper on the principles of symbolic model checking. Armin Biere, Alessandro Cimatti, Edmund Clarke, and Yunshan Zhu. Symbolic model checking without BDDs. In W. R. Cleaveland, ed., Tools and Algorithms for the Construction and Analysis of Systems (TACAS), Amsterdam, March 1999. Paper on SAT-based bounded model checking. Charles Pecheur 48

Symbolic Model Checking References (cont'd) J. R. Burch, E. M. Clarke, K. L. McMillan, and D. L. Dill. Sequential circuit verification using symbolic model checking. In 27th ACM/IEEE Design Automation Conference, 1990. Symbolic model checking of CTL with fairness. E. Clarke, O. Grumberg, H. Hamaguchi. Another Look at LTL Model Checking. Formal Methods in System Design, Volume 10, Number 1, February 1997. Verifying LTL using symbolic model checking. Charles Pecheur 49

SMV References Ken McMillan. Symbolic Model Checking. Kluwer Academic Publishers, 1993. Based on Ken McMillan's PhD thesis on SMV. Ken L. McMillan. The SMV System (draft). February 1992. http://www.cs.cmu.edu/~modelcheck/smv/smvmanual.r2.2.ps The (old) user manual provided with the SMV program. A. Cimatti, E. Clarke, F. Giunchiglia, and M. Roveri. NuSMV: A New Symbolic Model Verifier. In N. Halbwachs and D. Peled, eds., Proceedings of International Conference on Computer-Aided Verification (CAV'99), LNCS 1633:495-499, Springer Verlag. Survey paper on NuSMV. Charles Pecheur 50