Title: Automated Refinement Checking of Concurrent Systems
1Automated Refinement Checking of Concurrent
Systems
Sudipta Kundu, Sorin Lerner, Rajesh
Gupta Department of Computer Science and
Engineering, University of California, San Diego
2Hardware Design Methodology
Algorithmic Description
Functionally Equivalent
High Level Synthesis
Behavior Description
RTL Description
3The Model
- Properties of interest
- Concurrency
- Visible events
- Model both the specification and implementation
- Formal semantics
- Various modeling languages
- Process Algebra CSP, CCS
- Petri Nets
- SpecC/SystemC
4The Problem
CSP Program (Specification)
Transformed CSP Program (Implementation)
Refinements
5Previous Work
Previous work in Refinement Checking of CSP
programs
State Space
Relational Approach Josephs 88
Interactive Theorem Provers Dutertre 97 Tej
97 Isobe 05
Infinite
Our Approach
FDR Model Checker FDR 05, Roscoe 95
Finite
Level of Automation
Semi Automatic
Fully Automatic
Manual
- Inspired by translation validation Necula 00
Pnueli 98
6Outline
- Motivation and Problem definition
- Algorithms
- Checking Algorithm
- Inference Algorithm
- Experiments and Results
- Conclusion
7An Example of Refinement
Specification
right
left
Link
v1
4v1
v1
v1
v1
4v1
2v1
2v1
8CFGs for the Example
Simulation Relation
- A relation R that matches a given program state
in the implementation with the corresponding
state in the specification. - The simulation relation is a set of entries of
the form (p1, p2, ?). - p1 program point in Specification
- p2 program point in Implementation
- ? formula that relates the data
- Split state space in two parts
- control flow state, which is finite.
- gt explored by traversing the CFG
- dataflow state, which may be infinite.
- gt explored using Automated Theorem Prover (ATP)
9Checking Algorithm
Spec Impl
C1 True C1 True
left ? a left ? x
C2 a x C2 a x
C1 True
Spec Impl
C3 w z C3 w z
right!w right!z
left?a _ 1
left?a left?x
C2 a x C2 a x
Spec Spec Impl
C2 a x C2 a x C2 a x
w a4 y x2 y x2
w a4 u y (mid?u mid!y) u y (mid?u mid!y)
w a4 z u2 z u2
C3 w z C3 w z C3 w z
C2 a x
ATPC1 gt WP(C2)
C3 w z
ATP(C3) gt WP(C2)
ATP(C2) gt WP(C3)
10Outline
- Motivation and Problem definition
- Algorithms
- Checking Algorithm
- Inference Algorithm
- Experiments and Results
- Conclusion
11Inference Algorithm
- It works in two steps.
- Forward pass collect local condition for
externally visible events to be matched. - Backward pass propagate local conditions
backward, using weakest preconditions. - May not terminate
- Loops - iterate to a fixed point
- In practice it can find the required simulation
relation.
12Inference Algorithm Forward Pass
Spec Impl
C1 -gt C2 C1 -gt C2
left ? a left ? x
C2 -gt C3
w a4 y x2
w a4 u y
w a4 z u2
C3 -gt C2
right!w right!z
left?a _ 1
left?a left?x
13Inference Algorithm Backward Pass
Spec Impl
C1 True
C1 True
ATPC2 -gt WP(C3)
left ? a left ? x
C2 True
C2 a x
C2 C2 WP(C3)
w a4 y x2
w a4 u y
w a4 z u2
C2 True
C2 a x
ATPC1 -gt WP(C2)
ATPC3 -gt WP(C2)
C3 w z
C3 w z
right!w right!z
left?a _ 1
left?a left?x
C2 a x
14Outline
- Motivation and Problem definition
- Algorithms
- Checking Algorithm
- Inference Algorithm
- Experiments and Results
- Conclusion
15Prototype Implementation - ARCCoS
16Results from ARCCoS
Descriptions Process Process Process Time (no PO) (minsec) Time (PO) (minsec)
Descriptions Spec Impl Total Time (no PO) (minsec) Time (PO) (minsec)
Simple buffer 3 4 7 0000 0000
Simple vending machine 1 1 2 0000 0000
Cyclic scheduler 3 3 6 0101 0049
College student tracking system 1 2 3 0001 0001
Single communication link 3 8 11 0001 0001
2 parallel communication links 6 12 18 0128 0004
3 parallel communication links 9 16 25 51452 0021
4 parallel communication links 12 20 32 DNT 0111
5 parallel communication links 15 24 39 DNT 0232
6 parallel communication links 18 28 46 DNT 0829
7 parallel communication links 21 32 53 DNT 3728
Hardware refinement 3 5 8 0000 0000
EP2 System 1 2 3 0151 0147
17Outline
- Motivation and Problem definition
- Algorithms
- Checking Algorithm
- Inference Algorithm
- Experiments and Results
- Conclusion
18Conclusion and Future Directions
- We have presented an automated algorithm for
checking trace refinement of CSP programs that
has infinite state spaces. - Checking Algorithm
- Inference Algorithm
- The work presented here is only the first step in
a broader research plan whose goal is to check
the refinement of SystemC.
19