고려대학교 정형기법연구실 safety critical mission critical security...
TRANSCRIPT
-
고려대학교정형기법 연구실
2011년 6월 26일
최진영
1
정형 기법 적용 분야정형 기법 적용 분야
Safety Critical
Mission Critical
Security Critical
정형 기법 소개
건축 설계 구조 해석
- 지진시의 내진성- 하중에 관한 안전율- 고온에서의 내열성
안전한 건축물
- 위험 요소에 대한 안전성- 외부 공격에 대한 보안성- 요구 조건에 대한 부합성
정형 명세/코드 정형 검증안전한 시스템
기능/보안 오류의 원인
• (자연어) 요구사항• 구조 설계• 상세 설계• 코딩• 테스트• 시스템 구성• HW • HW/SW interface • Platform• 사용자 오작동, 매뉴얼, 정상사고, ….
4
-
정형 기법이란?
• 정형 기법– 수학이나 논리 기반의 명세와 설계의 기술을 사용하여 컴퓨터
시스템이나 소프트웨어를 설계/구현하는 기법
– 정형 명세 (Formal Specification)• 수리논리 등을 이용하여 시스템의 동작 환경, 시스템 요구사항,
시스템의 설계 등을 기술하는 것.• 요구 명세, 설계 명세• 논리 기반, 상태 기계 기반, algebra 기반
– 정형 검증 (Formal Verification)• 수학적, 논리적 증명방법을 통해 시스템의 설계와 시스템 요구사항의 만족
여부를 증명• 정리 증명, 모델 검사
정형 검증의 종류
• 모델 검사 ( Model Checking )– 시스템 모델이 특정 속성을 만족하는지 “상태를 추적하여” 확인– 완전 자동화 가능– 만족하지 않을 경우 반례 제시– 도구 : SMV, SPIN, VIS
• 정리 증명 ( Theorem Proving )– 시스템 모델이 특정 속성을 만족하는지 “구문적 규칙을 적용하여” 증명– 상태 규모에 무관 (상태 폭발 없음)– 사람의 직관이 개입해야 함 (완전 자동화 불가능)– 도구 : PVS, HOL, Zeves
• Satisfiability Solver (SAT) / Satisfiability Modulo Theories (SMT)– 주어진 명제식을 참으로 만들어 주는 값이 있는가를 찾는다– 모델 검사로 하기 힘든 큰 시스템을 자동적으로 빠르게 찾을 수 있다– 도구 : GRASP, miniSAT, BerkMin, YICES
검증 속성
• Safety property– “nothing bad ever happens”– invariant
• x is always less than 5– deadlock freedom
• the system never reaches a state where no actions are possible– find a trace leading to the “bad” thing. If there is not such a trace, the property is satisfied.
• Liveness property– “something good will eventually happen”– termination
• the system will eventually terminate– response
• if action X occurs then eventually action Y will occur– find a (infinite) loop in which the “good” thing does not happen. If there is not such a loop, the
property is satisfied.
• Security property
8
-
정형기법 연구실에서는
• 정형 명세/검증– Hybird System 명세/검증– Security Protocol 명세/검증– Hierarchical Real-Time System 명세/검증
• Formal Verification & Validation– 원자력 발전소 관련 제어 내장코드 V&V
• Secure Software 관련– Dependability, Trustworthiness, Survivabilility– Secure Coding– Secure Software Development Life Cycle (Secure
SDLC)– Secure Software Assurance/Certification
9
Cyber Physical Systems
Cyber Physical Systems
Transportation
Defense
Energy and Industrial Automation
Health and Biomedical
Agriculture
Critical Infrastructure
하이브리드 시스템
• 시스템의 행위가 시간에 흐름에 따른 연속적, 이산적 상태 변화로 표현됨
Bouncing Ball
하이브리드 시스템의 종류
• Continuous systems with phased operation– Bouncing ball– Circuits with diodes– Switching circuits
• Continuous systems controlled by discrete inputs– Thermostat– Water tank– Engine control systems– Embedded control systems
• Coordinating processes– air and ground transportation systems– swarms of micro-air vehicles
-
Networked embedded systems… 연속적 시스템 모델링
연속적 시스템 모델링 연속적 시스템 모델링
-
이산 시스템 모델링 임베디드 제어 시스템의 설계 및 구현 도구
연속상태(Continuous State)
이산 상태(Discrete State)
모델Differential Equations, Transfer Functions, etc
Automata, Petri-net, Statecharts, etc
수학적 분석도구Lyapunov functions,
eigenspace analysis, etc.Boolean algebra, formal logics, etc.
소프트웨어 도구MATLAB, MatrixX,
VisSim, etc.,SCADE, Statemate, SMV,
SAT, etc.
하이브리드 모델링의 필요성
• 연속상태 모델링방법과 이산상태 모델링방법의 이론적 배경이 다름
• 모델 자체가 다르기 때문에 검증 가능한 속성도 달라짐– 연속상태 모델 : 안정성(Stability), 제어 성능 특정 조건 혹은 특정 명령에 대한 분석만이 가능
– 이산상태 모델 : Reachability Analysis (Liveness, safety Property) 모든 상태를 검증할 수 있으나, 성능이나 시간 관련 속성은 추상화됨
• 부분적인 검증 후 통합 시 예기치 않은 오류가 발생할 수 있음.
• 기존의 모델링 방법으로는 부분적인 검증만이 가능함 통합적인 하이브리드 모델 이론 및 언어의 필요
각 분야에서의 다른 접근
-
하이브리드 오토마타 하이브리드 오토마타의 예시
하이브리드 시스템 모델링 & 검증 도구 SIMULINK/STATEFLOW• Developed by MathWorks.• Integrated within the MATLAB environment• SIMULINK
– An interactive tool for modeling and simulating nonlinear dynamical systems.
– Work with linear, nonlinear, continuous-time, discrete-time, multi-variable, and multi-rate systems.
• STATEFLOW– An interactive design and development tool
for complex control and supervisory logic problems.
– Supports visual modeling and simulation of complex reactive systems by simultaneously using finite state machine (FSM) concepts, STATECHARTS formalisms, and flow diagram notations.
• The de facto design-capture standard in academia and industry
• The semantics of the language is not formally defined
-
MODELICA• Developed by Modelica Association
– 80 "individual" and 11 "organizational members“ from Europe, U.S.A. and Canada
• An object-oriented, equation based language for hierarchical physical modeling
• Targeting efficient simulation
• A large set of models are available – Contains about 920 model components and
620 functions from many domains
• Supports non-causal modeling.
• Applications – Automotive companies : Audi, BMW, Daimler,
Ford, Toyota, VW– Power plant providers : ABB, EDF, Siemens
model MotorDrivePI controller;Ramp ramp;Motor motor;Gearbox gear(ratio = 100);Inertia inertia(J = 10);SpeedSensor tacho;
equationconnect(controller.y , motor.i_ref);connect(motor.flange , gearbox.flange_a);connect(gearbox.flange_b, inertia.flange_a);connect(inertia.flange_b, tacho.flange);connect(tacho.w , controller.u_m);connect(ramp.y , controller.u_r);
end MotorDrive;
CHARON• Developed at the University of Pennsylvania
• Supports the hierarchical modeling of hybrid systems
– Agent - Architectural level – Mode - Behavioral level
• Support for discrete and continuous behavior– Discrete behavior : weak preemption, history
retention, invoking externally defined JAVA functions.
– Continuous behavior : differential constraints, algebraic constraints, invariants
• Well-defined formal semantics
• Applications – automotive power trains, vehicle-to-vehicle
control systems, biological cell networks, multi-agent systems, medical infusion, pump and inverted pendulum systems
하이브리드 시스템의 검증
• Traditional verification– simulation and emulation– fast, simple, scales well– no guarantees, diminishing
coverage
• Formal verification– mathematical proof of
correctness– complete - exercises design
in systematic way– hard to learn, works only
small/medium sized designs
정리• 하이브리드 시스템 :
– 상태가 이산적으로 변하는 측면과 연속적으로 변하는 측면이 유기적으로 혼재하는 시스템
– CPS의 핵심적인 요소 중 하나• 하이브리드 오토마타 :
– 하이브리드 시스템에 잘 대응하는 대표적인 모델– 이산적 변화는 유한 상태 기계로 표현:
• 유한 상태 기계의 한 상태는 시스템의 연속적 변화가 일정한 지배식에 의존하는영역
• 유한 상태 기계의 전이는 시스템의 연속적 변화를 지배하는 지배식이 바뀌는 것– 연속적 변화는 시간에 대한 미분방정식으로 표현
• 하이브리드 시스템의 모델링을 위한 다양한 언어들– Charon, Simulink/Stateflow, Modelica 등
• 정형 기법과 정형 검증– 수학과 논리학을 기반으로 모호함 없이 표현하고 엄밀한 증명을 통해
(사용된 전제가 만족되는 한) 결론을 확고하게 보장
-
A Process Algebraic Approach to the Schedulability Analysis of Hierarchical Real-Time Systems
29
Hierarchical Real-Time System:Motivating Example
LLF: Least Laxity FirstFPS: Fixed Priority SchedulingLRTF: Least Remaining Time First
30
Problem 1: Schedulability Analysis of Hierarchical Real-Time System
31
Problem 2: Real-Time Abstraction of Hierarchical Real-Time System
? ?
? ?
?
32
-
ACSR
• Algebra of Communicating Shared Resources– Timed Process Algebra
• Timed Actions• Timeouts• Interrupts
– Resource-Bound Process Algebra• Resources• Priorities
– Tool supported by VERSA
33
Definition of RTS and Hierarchical RTS (HRTS)
• Real Time System RS is a (W, R, A)– W: Workload Model– R: Resource Model– A: Scheduling Algorithm
• HRTS HS is either– a real-time system, or– (W, R, A)
• W: set of Hierarchical workload {HS1, …, HSn}• R: Resource Model• A: Scheduling Algorithm
34
Example of HRTS
35
Task Model
• A periodic independent task (a, p, e, d)– a: start time– p: period– e: maximum execution time– d: relative deadline
36
-
Workload Model
• A set of tasks running in parallel W = {T1, …, Tn)}
37
Scheduling Algorithm
• EDF encoding:
• Other scheduling algorithms
38
Resource Model
• Given a task T(a,p,e,d), R(T) is a resource model.
• ACSR specification of R
39
Schedulability
40
-
Schedulability Relation
41
Example
42
Schedulability Relation Checking as Deadlock Checking
• To check S |= P– Translate S to some ACSR process T(S)– Check deadlock of the process [T(S) || P]{cpu}
• Translation function
43
Schedulability Relation Checking as Deadlock Checking (cont’)
44
-
Periodic and EDP Abstraction
45
Experiment 1
• Given scheduling algorithm and periodic workload set, generate periodic abstraction.
46
EDF
(P1, C1) || (P2, C2)
Periodic interface?
Given a task set {T(5,1), T(7,1)} under a EDF scheduler
PCARTS (PERIODIC) ACSR/VERSA
C (raw) C (ceiling) C Time(sec) Mem(KB)
1 0.3571 1 1 0.13 5124
2 0.75 1 1 0.05 5392
3 1.3333 2 2 0.08 5392
4 2.0 2 2 0.08 5524
5 3.0 3 3 0.10 5392
6 4.0 4 4 0.14 5788
7 5.0 5 5 0.16 5392
8 6.0 6 6 0.21 5392
9 7.0 7 7 0.25 6448
10 8.0 8 8 0.25 5656
47
Experiment 2
48
DM
(O1, J1, T1, C1, D1) || (O2, J2, T2, C2, D2)
Explicit deadline periodic interface ?
-
Result: T(5,1),T(7,1),DM,EDP
PCARTS (EDP) ACSR/VERSA
C(Exec. Time) D(Deadline) C D
1 0.4 0.4 1 1
2 1 2 1 2
3 1.5 2 2 3
4 2 3 2 3
5 2 2 2 2
6 3 3 3 4
7 3 3 3 3
8 4 4 4 4
9 5 5 5 5
10 6 6 6 6
30 26 26 15 2549
Experiment 3
50
Distance Control Module (DCM) on a Real-time Operating System
Periodic interface (P, C) ?
DCM model is described in the following paper: J. Park et al., “Model Checking of Real-Time Properties of Resource-Bound Process Algebra” IEICE TRANS. FUNDAMENTALS (2009)
P C1 12 13 24 25 36 37 48 49 510 6
Conclusion
• ACSR/VERSA can solve compositional scheduling problems of hierarchical real-time systems:– Schedulability Analysis– Real-Time Abstraction
• Future Work– Multiprocessor– Demand Centric Scheduling– Efficient Tool support
51