04.05.2015 Views

AADL Formal Analysis in Maude, PALS, and Synchronous AADL

AADL Formal Analysis in Maude, PALS, and Synchronous AADL

AADL Formal Analysis in Maude, PALS, and Synchronous AADL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>AADL</strong> <strong>Formal</strong> <strong>Analysis</strong> <strong>in</strong> <strong>Maude</strong>, <strong>PALS</strong>, <strong>and</strong><br />

<strong>Synchronous</strong> <strong>AADL</strong><br />

José Meseguer<br />

University of Ill<strong>in</strong>ois at Urbana-Champaign


Outl<strong>in</strong>e<br />

1 Part I (<strong>Maude</strong> <strong>and</strong> <strong>AADL</strong>2<strong>Maude</strong>)<br />

2 Part II (<strong>PALS</strong> <strong>and</strong> its Correctness)<br />

3 Part III (Towards a <strong>Synchronous</strong> <strong>AADL</strong> Annex)


<strong>Maude</strong> <strong>and</strong> <strong>AADL</strong> to <strong>Maude</strong><br />

Acks: Jo<strong>in</strong>t work with Artur Boronat <strong>and</strong> Peter Ölveczky


<strong>Formal</strong> Model-Based Systems Eng<strong>in</strong>eer<strong>in</strong>g<br />

Model-based systems development<br />

<strong>in</strong>tuitive (graphical) model<strong>in</strong>g language<br />

support for code generation to go from model to code


<strong>Formal</strong> Model-Based Systems Eng<strong>in</strong>eer<strong>in</strong>g<br />

Model-based systems development<br />

<strong>in</strong>tuitive (graphical) model<strong>in</strong>g language<br />

support for code generation to go from model to code<br />

need for precise semantics <strong>and</strong> formal analysis


<strong>Formal</strong> Model-Based Systems Eng<strong>in</strong>eer<strong>in</strong>g<br />

Model-based systems development<br />

<strong>in</strong>tuitive (graphical) model<strong>in</strong>g language<br />

support for code generation to go from model to code<br />

need for precise semantics <strong>and</strong> formal analysis<br />

<strong>Formal</strong> model-based systems eng<strong>in</strong>eer<strong>in</strong>g<br />

def<strong>in</strong>e formal semantics for model<strong>in</strong>g language


<strong>Formal</strong> Model-Based Systems Eng<strong>in</strong>eer<strong>in</strong>g<br />

Model-based systems development<br />

<strong>in</strong>tuitive (graphical) model<strong>in</strong>g language<br />

support for code generation to go from model to code<br />

need for precise semantics <strong>and</strong> formal analysis<br />

<strong>Formal</strong> model-based systems eng<strong>in</strong>eer<strong>in</strong>g<br />

def<strong>in</strong>e formal semantics for model<strong>in</strong>g language<br />

use code gen <strong>in</strong>frastructure to synthesize verification model


<strong>Formal</strong> Model-Based Systems Eng<strong>in</strong>eer<strong>in</strong>g<br />

Model-based systems development<br />

<strong>in</strong>tuitive (graphical) model<strong>in</strong>g language<br />

support for code generation to go from model to code<br />

need for precise semantics <strong>and</strong> formal analysis<br />

<strong>Formal</strong> model-based systems eng<strong>in</strong>eer<strong>in</strong>g<br />

def<strong>in</strong>e formal semantics for model<strong>in</strong>g language<br />

use code gen <strong>in</strong>frastructure to synthesize verification model<br />

should allow system analysis without know<strong>in</strong>g target formalism


Real-Time <strong>Maude</strong> (I)<br />

Real-Time <strong>Maude</strong> : formal analysis tool for real-time systems<br />

formalism emphasizes expressiveness <strong>and</strong> ease of specification


Real-Time <strong>Maude</strong> (I)<br />

Real-Time <strong>Maude</strong> : formal analysis tool for real-time systems<br />

formalism emphasizes expressiveness <strong>and</strong> ease of specification<br />

object-oriented specification<br />

nested objects


Real-Time <strong>Maude</strong> (I)<br />

Real-Time <strong>Maude</strong> : formal analysis tool for real-time systems<br />

formalism emphasizes expressiveness <strong>and</strong> ease of specification<br />

object-oriented specification<br />

nested objects<br />

high-performance simulation <strong>and</strong> model check<strong>in</strong>g tool


Real-Time <strong>Maude</strong> (I)<br />

Real-Time <strong>Maude</strong> : formal analysis tool for real-time systems<br />

formalism emphasizes expressiveness <strong>and</strong> ease of specification<br />

object-oriented specification<br />

nested objects<br />

high-performance simulation <strong>and</strong> model check<strong>in</strong>g tool<br />

successfully applied to advanced state-of-the-art systems<br />

schedul<strong>in</strong>g algorithms<br />

wireless sensor network algorithms<br />

embedded car software used by major car makers<br />

50+ page multicast protocol for active networks<br />

. . .


Real-Time <strong>Maude</strong> (II)<br />

Specification language:<br />

algebraic equational specification for data types/functions<br />

rewrite rules def<strong>in</strong>e <strong>in</strong>stantaneous transitions<br />

tick rewrite rules def<strong>in</strong>e time elapse


Real-Time <strong>Maude</strong> (II)<br />

Specification language:<br />

algebraic equational specification for data types/functions<br />

rewrite rules def<strong>in</strong>e <strong>in</strong>stantaneous transitions<br />

tick rewrite rules def<strong>in</strong>e time elapse<br />

<strong>Analysis</strong> capabilities:<br />

rewrit<strong>in</strong>g for simulation/prototyp<strong>in</strong>g<br />

explicit-state breadth-first search for reachability analysis<br />

LTL model check<strong>in</strong>g


<strong>AADL</strong><br />

<strong>AADL</strong><br />

<strong>in</strong>dustry st<strong>and</strong>ard for embedded/RT systems model<strong>in</strong>g<br />

US Army, Honeywell, Airbus, Boe<strong>in</strong>g, Dassault Aviation,<br />

EADS, ESA, Ford, Lockheed Mart<strong>in</strong>, Raytheon,<br />

Rockwell-Coll<strong>in</strong>s, Toyota, U. S. Navy, . . .<br />

avionics, aerospace, medical devices, robotic, . . .


<strong>AADL</strong><br />

<strong>AADL</strong><br />

<strong>in</strong>dustry st<strong>and</strong>ard for embedded/RT systems model<strong>in</strong>g<br />

US Army, Honeywell, Airbus, Boe<strong>in</strong>g, Dassault Aviation,<br />

EADS, ESA, Ford, Lockheed Mart<strong>in</strong>, Raytheon,<br />

Rockwell-Coll<strong>in</strong>s, Toyota, U. S. Navy, . . .<br />

avionics, aerospace, medical devices, robotic, . . .<br />

hierarchy of software <strong>and</strong> hardware components<br />

process, thread, subprogram, . . .<br />

processor, memory, device, bus, . . .<br />

OSATE: Eclipse plug-<strong>in</strong>s for <strong>AADL</strong>


<strong>AADL</strong><br />

<strong>AADL</strong><br />

<strong>in</strong>dustry st<strong>and</strong>ard for embedded/RT systems model<strong>in</strong>g<br />

US Army, Honeywell, Airbus, Boe<strong>in</strong>g, Dassault Aviation,<br />

EADS, ESA, Ford, Lockheed Mart<strong>in</strong>, Raytheon,<br />

Rockwell-Coll<strong>in</strong>s, Toyota, U. S. Navy, . . .<br />

avionics, aerospace, medical devices, robotic, . . .<br />

hierarchy of software <strong>and</strong> hardware components<br />

process, thread, subprogram, . . .<br />

processor, memory, device, bus, . . .<br />

OSATE: Eclipse plug-<strong>in</strong>s for <strong>AADL</strong><br />

no formal semantics!


Targeted Behavioral Subset<br />

Focus on software components<br />

hierarchical components<br />

connections, data/event ports,<br />

thread, process, systems, . . .<br />

mode transitions<br />

events<br />

periodic, aperiodic, sporadic dispatches<br />

Thread behaviors: Behavior Annex<br />

transition systems with local state variables<br />

Hardware components <strong>and</strong> schedul<strong>in</strong>g not targeted yet!


Real-Time <strong>Maude</strong> Semantics<br />

Object-oriented semantics<br />

“L<strong>in</strong>e-by-l<strong>in</strong>e” translation<br />

“One-to-one” correspondence <strong>AADL</strong> model ←→ Real-Time<br />

<strong>Maude</strong> term<br />

hierarchical objects<br />

easy to map counterexamples to <strong>AADL</strong> behaviors


Real-Time <strong>Maude</strong> Semantics (II)<br />

Class for any software component:<br />

class Component | features : Configuration,<br />

subcomponents : Configuration,<br />

properties : Properties,<br />

connections : ConnectionSet,<br />

modes : Modes,<br />

<strong>in</strong>Modes : ModeNameSet .


Real-Time <strong>Maude</strong> Semantics (II)<br />

Class for any software component:<br />

class Component | features : Configuration,<br />

subcomponents : Configuration,<br />

properties : Properties,<br />

connections : ConnectionSet,<br />

modes : Modes,<br />

<strong>in</strong>Modes : ModeNameSet .<br />

Thread components class:<br />

class Thread | behavior : ThreadBehavior,<br />

status : ThreadStatus,<br />

deactivated : Bool .<br />

subclass Thread < Component .


Real-Time <strong>Maude</strong> Semantics (III)<br />

<strong>AADL</strong> declaration<br />

thread taThread<br />

features pressEvent: out event data port Behavior::<strong>in</strong>teger;<br />

properties Dispatch_Protocol => periodic; Period => 1 sec;<br />

end taThread;<br />

thread implementation taThread.impl<br />

annex behavior_specification {**<br />

states<br />

s0: <strong>in</strong>itial complete state;<br />

transitions s0 -[ ]-> s0 {pressEvent!(1);};<br />

**};<br />

end taThread.impl;<br />

corresponds to Real-Time <strong>Maude</strong> declarations . . .


Real-Time <strong>Maude</strong> Semantics (IV)<br />

eq thread(taThread)<br />

= features (pressEvent out event data thread port)<br />

properties DispatchProtocol(Periodic) ; Period(1 Sec).<br />

eq INSTANCE-NAME thread taThread . impl <strong>in</strong> modes MNS<br />

= < INSTANCE-NAME : Thread |<br />

modes : noModes,<br />

<strong>in</strong>Modes : MNS,<br />

features : features(thread(taThread)),<br />

subcomponents : none,<br />

connections : none,<br />

properties : properties(thread(taThread)),<br />

behavior : states <strong>in</strong>itial: s0 complete: s0<br />

transitions s0 -[]-> s0 {(pressEvent ! (1))}<br />

> .


Real-Time <strong>Maude</strong> Semantics (V)<br />

Rewrite rules def<strong>in</strong><strong>in</strong>g dynamics:<br />

rl [periodic-dispatch] :<br />

< O : Thread | properties : periodic-dispatch(T, 0) PROPS,<br />

status : completed,<br />

features : PORTS ><br />

=><br />

< O : Thread | properties : periodic-dispatch(T, T) PROPS,<br />

status : active,<br />

features : dispatchInputPorts(PORTS) > .<br />

<strong>and</strong> . . .


Code Generation<br />

Have enriched OSATE with generation of Real-Time <strong>Maude</strong><br />

verification model from <strong>AADL</strong> design model


Case Studies<br />

Safe <strong>in</strong>teroperation of ventilator, X-ray mach<strong>in</strong>e, <strong>and</strong><br />

controller<br />

system by Lui Sha (UIUC)<br />

<strong>AADL</strong> model by M<strong>in</strong> Young Nam (UIUC)<br />

Active st<strong>and</strong>by avionics example<br />

system by Steve Miller (Rockwell-Coll<strong>in</strong>s)<br />

<strong>AADL</strong> model by Abdullah al-Nayeem (UIUC)


Conclud<strong>in</strong>g Remarks<br />

Real-Time <strong>Maude</strong> semantics, simulation, <strong>and</strong> formal analysis<br />

for a behavioral subset of <strong>AADL</strong><br />

Real-Time <strong>Maude</strong> expressiveness key<br />

equations <strong>and</strong> rules<br />

<strong>AADL</strong> model ≃ Real-Time <strong>Maude</strong> model


Conclud<strong>in</strong>g Remarks<br />

Real-Time <strong>Maude</strong> semantics, simulation, <strong>and</strong> formal analysis<br />

for a behavioral subset of <strong>AADL</strong><br />

Real-Time <strong>Maude</strong> expressiveness key<br />

equations <strong>and</strong> rules<br />

<strong>AADL</strong> model ≃ Real-Time <strong>Maude</strong> model<br />

Generation of Real-Time <strong>Maude</strong> model us<strong>in</strong>g OSATE<br />

Comb<strong>in</strong>e convenience of <strong>AADL</strong> model<strong>in</strong>g <strong>and</strong> Real-Time<br />

<strong>Maude</strong> analysis


Conclud<strong>in</strong>g Remarks<br />

Real-Time <strong>Maude</strong> semantics, simulation, <strong>and</strong> formal analysis<br />

for a behavioral subset of <strong>AADL</strong><br />

Real-Time <strong>Maude</strong> expressiveness key<br />

equations <strong>and</strong> rules<br />

<strong>AADL</strong> model ≃ Real-Time <strong>Maude</strong> model<br />

Generation of Real-Time <strong>Maude</strong> model us<strong>in</strong>g OSATE<br />

Comb<strong>in</strong>e convenience of <strong>AADL</strong> model<strong>in</strong>g <strong>and</strong> Real-Time<br />

<strong>Maude</strong> analysis<br />

Future work:<br />

larger subsets of <strong>AADL</strong><br />

“formal property annex” <strong>in</strong> <strong>AADL</strong><br />

synchronous <strong>AADL</strong> annex


<strong>PALS</strong> <strong>and</strong> its Correctness<br />

Acks:<br />

<strong>Formal</strong> model <strong>and</strong> correctness is jo<strong>in</strong>t work with Peter<br />

Ölveczky<br />

This is part of broader <strong>PALS</strong> collaboration with:<br />

Peter Ölveczky at University of Oslo<br />

Steve Miller <strong>and</strong> Darren Cofer at Rockwell-Coll<strong>in</strong>s<br />

Lui Sha, Abdullah Al-Nayeem, <strong>and</strong> Mu Sun at UIUC


Motivation<br />

Many distributed real-time systems:<br />

collection of components that communicate asynchronously<br />

each component has a local clock<br />

should change state <strong>and</strong> respond to environment <strong>in</strong>put with<strong>in</strong><br />

hard real-time bounds<br />

should achieve virtual synchrony<br />

Examples:<br />

<strong>in</strong>tegrated modular avionics<br />

distributed control <strong>in</strong> motor vehicles<br />

<strong>in</strong>teroperation of medical devices<br />

Often safety-critical systems<br />

Design, verification, <strong>and</strong> implementation hard <strong>and</strong> error-prone<br />

asynchronous communication<br />

message delays<br />

clock skews<br />

Model check<strong>in</strong>g verification often unfeasible due to the state<br />

space explosion caused by the system’s concurrency


<strong>Formal</strong> Architectural Patterns<br />

<strong>Formal</strong> architectural patterns:<br />

Generic formal specification of an eng<strong>in</strong>eer<strong>in</strong>g solution to a<br />

generic design problem<br />

formal correctness guarantees<br />

reduces system complexity<br />

verification <strong>and</strong> correctness of implementation much easier<br />

Amortize verification effort on a general family of designs


The <strong>PALS</strong> <strong>Formal</strong> Architectural Pattern (I)<br />

<strong>PALS</strong>: Physically Asynchronous, Logically <strong>Synchronous</strong><br />

Reduces design <strong>and</strong> verification of a distributed real-time<br />

system (that should ensure virtual synchrony <strong>and</strong> satisfy hard<br />

real-time bounds) to its underly<strong>in</strong>g synchronous version<br />

Relies on asynchronous bounded delay (ABD) network<br />

<strong>in</strong>frastructure<br />

max bound on the communication delay<br />

Assumes underly<strong>in</strong>g clock synchronization guarantees maximal<br />

bound on the clock skews


The <strong>PALS</strong> <strong>Formal</strong> Architectural Pattern (II)<br />

<strong>PALS</strong> can be seen as a formally verified model transformation<br />

(E, Γ) ↦→ A(E, Γ)<br />

E is a synchronous design<br />

Γ are performance bounds on<br />

max clock skew ɛ between any local clock <strong>and</strong> a “global” clock<br />

m<strong>in</strong> <strong>and</strong> max time for read<strong>in</strong>g <strong>in</strong>put, perform<strong>in</strong>g a “transition,”<br />

<strong>and</strong> produc<strong>in</strong>g output<br />

m<strong>in</strong> <strong>and</strong> max message transmission delay<br />

A(E, Γ) is the correspond<strong>in</strong>g asynchronous design of the<br />

distributed real-time system


The <strong>PALS</strong> <strong>Formal</strong> Architectural Pattern (III)<br />

We have verified the <strong>PALS</strong> transformation<br />

(E, Γ) ↦→ A(E, Γ)<br />

<strong>Synchronous</strong> design E formalized as an ensemble of typed<br />

mach<strong>in</strong>es<br />

A(E, Γ) formalized <strong>in</strong> Real-Time <strong>Maude</strong><br />

Verified the bisimulation between (E, Γ) <strong>and</strong> A(E, Γ)<br />

Proved optimality of the period of A(E, Γ)


<strong>Synchronous</strong> Model<br />

A synchronous model is an ensemble of state mach<strong>in</strong>es<br />

M1<br />

M2<br />

M3<br />

In the synchronous composition of an ensemble, <strong>in</strong> each<br />

“iteration,” each mach<strong>in</strong>e at the same time:<br />

reads <strong>in</strong>put from environment <strong>and</strong> from the values generated<br />

<strong>in</strong> the previous round <strong>in</strong> the “feedback” loops<br />

produces output <strong>and</strong> changes its local state accord<strong>in</strong>g to its<br />

local transition relation<br />

The environment can be abstractly seen as nondeterm<strong>in</strong>istically<br />

generat<strong>in</strong>g arbitrary outputs satisfy<strong>in</strong>g a given constra<strong>in</strong>t


<strong>PALS</strong> Asynchronous Model: Overview (I)<br />

In the distributed implementation A(E, Γ), adds a “wrapper”<br />

around each state mach<strong>in</strong>e <strong>in</strong> E<br />

each wrapper has an <strong>in</strong>put buffer that stores messages arrived<br />

dur<strong>in</strong>g the round<br />

each wrapper has an output buffer to hold outgo<strong>in</strong>g messages<br />

until they can be sent to the network


<strong>PALS</strong> Asynchronous Model: Overview (II)<br />

The behavior of each node is:<br />

at the beg<strong>in</strong>n<strong>in</strong>g of each <strong>PALS</strong> period (given by local clock):<br />

read messages from <strong>in</strong>put buffer<br />

execute local transition (change local state <strong>and</strong> generate new<br />

messages)<br />

new messages are put <strong>in</strong> output buffer with a back-off delay<br />

messages from the output buffer are sent to the network when<br />

the backoff timer has expires <strong>and</strong> the execution of the local<br />

transition has f<strong>in</strong>ished<br />

received messages are put <strong>in</strong> the <strong>in</strong>put buffer


Some Assumptions<br />

External clock synchronization<br />

difference between “local clock” time <strong>and</strong> “real” (global) clock<br />

time is always less than ɛ<br />

Local clock: c j : R ≥0 → R ≥0<br />

monotonic <strong>and</strong> cont<strong>in</strong>uous<br />

|c j (x) − x| < ɛ for all “real” times x<br />

Time for (process<strong>in</strong>g <strong>in</strong>put + execut<strong>in</strong>g transition +<br />

generat<strong>in</strong>g output) ∈ [α m<strong>in</strong> , α max ] with 0 ≤ α m<strong>in</strong> ≤ α max<br />

Message transmission time ∈ [µ m<strong>in</strong> , µ max ] with<br />

0 ≤ µ m<strong>in</strong> ≤ µ max


Optimal <strong>PALS</strong> Period<br />

The smallest possible period T is<br />

µ max + 2 · ɛ + max(2 · ɛ − µ m<strong>in</strong> , α max )<br />

We have proved optimality of T


Correctness (I)<br />

A state <strong>in</strong> A(E, Γ) is stable iff all <strong>in</strong>put buffers are full, all<br />

output buffers are empty, <strong>and</strong> there are no messages <strong>in</strong> transit<br />

The function sync maps stable states <strong>in</strong> A(E, Γ) to states <strong>in</strong> E<br />

<strong>in</strong> the obvious way<br />

Can def<strong>in</strong>e Kripke structures (E ce , L) for E (with environment<br />

constra<strong>in</strong>t c e ) <strong>and</strong> (A(E, Γ), L ′ ) <strong>in</strong> the expected way


Ma<strong>in</strong> Correctness Result<br />

Theorem<br />

Given a formula ϕ ∈ CTL ∗ (AP), <strong>and</strong> a state predicate stable ∉ AP<br />

characteriz<strong>in</strong>g stable states, there is a formula<br />

ϕ stable ∈ CTL ∗ \ {○}(AP ∪ {stable}) def<strong>in</strong>ed as follows:<br />

a stable = a, for a ∈ AP<br />

(¬ ϕ) stable = ¬ (ϕ stable )<br />

(ϕ 1 ∧ ϕ 2 ) stable = ϕ 1stable ∧ ϕ 2stable<br />

(ϕ 1 U ϕ 2 ) stable = (stable → ϕ 1stable ) U (stable ∧ ϕ 2stable )<br />

(○ ϕ) stable = stable U (¬stable ∧ (¬stable U (stable ∧ ϕ stable )))<br />

(∀ ϕ) stable = ∀ ϕ stable<br />

such that for each reachable stable state s <strong>in</strong> A(E, Γ) we have<br />

(A(E, Γ), L ′ ), s |= ϕ stable ⇐⇒ (E ce , L), sync(s) |= ϕ,<br />

where L ′ : T A(E,Γ)GlobalSystem → P(AP ∪ {stable}) is a label<strong>in</strong>g function<br />

satisfy<strong>in</strong>g L ′ (s) = L(sync(s)) ∪ {stable} when s is a stable state, <strong>and</strong><br />

stable ∉ L ′ (s) otherwise.


Avionics Case Study (I)<br />

In <strong>in</strong>tegrated modular avionics, there are for fault tolerance<br />

properties multiple cab<strong>in</strong>ets (with power supply, computer,<br />

I/O, etc.) distributed <strong>in</strong> an aircraft<br />

Active St<strong>and</strong>by System: decide which cab<strong>in</strong>et is active<br />

st<strong>and</strong>by side should monitor the side’s functionalities <strong>and</strong> the<br />

pilot’s manual switch<br />

st<strong>and</strong>by side notifies active side if change of active sides needed<br />

<strong>Synchronous</strong> design must be realized for the distributed<br />

cab<strong>in</strong>ets <strong>in</strong> the aircraft<br />

Our models based on <strong>AADL</strong> model by Abdullah Al-Nayeem of<br />

a similar spec developed by Steve Miller <strong>and</strong> Darren Cofer


Avionics Case Study (II)<br />

Architecture of active st<strong>and</strong>by for two sides:


Active St<strong>and</strong>by Model Check<strong>in</strong>g <strong>in</strong> <strong>Maude</strong><br />

We def<strong>in</strong>ed the synchronous model of active st<strong>and</strong>by <strong>in</strong> <strong>Maude</strong><br />

We def<strong>in</strong>ed a very simplified <strong>PALS</strong> asynchronous model <strong>in</strong><br />

(Real-Time) <strong>Maude</strong><br />

execution times 0<br />

perfect clocks<br />

two models of message delays:<br />

version 1: no message delay<br />

version 2: message delay 0 or 1<br />

discrete time doma<strong>in</strong><br />

shortest possible <strong>PALS</strong> period<br />

Execution times for model check<strong>in</strong>g an <strong>in</strong>variant:<br />

Model Max.msg.dly # states ex.time<br />

Synchr. n/a 185 0.2 sec.<br />

Asynchr. 0 3,047,832 2000 sec.<br />

Asynchr. 1 aborted


Requirement of Active St<strong>and</strong>by<br />

The active st<strong>and</strong>by system should satisfy the follow<strong>in</strong>g<br />

requirements:<br />

R 1 : Both sides should agree on which side is active (provided<br />

neither side has failed, the availability of a side has not<br />

changed, <strong>and</strong> the pilot has not made a manual selection).<br />

R 2 : A side that is not fully available should not be the active side<br />

if the other side is fully available (aga<strong>in</strong>, provided neither side<br />

has failed, the availability of a side has not changed, <strong>and</strong> the<br />

pilot has not made a manual selection).<br />

R 3 : The pilot can always change the active side (except if a side is<br />

failed or the availability of a side has changed).<br />

R 4 : If a side is failed the other side should become active.<br />

R 5 : The active side should not change unless the availability of a<br />

side changes, the failed status of a side changes, or manual<br />

selection is selected by the pilot.


<strong>Maude</strong> Verification of the <strong>Synchronous</strong> Model<br />

Have verified improved versions of the five desired properties<br />

of (the synchronous version of) active st<strong>and</strong>by<br />

each model check<strong>in</strong>g took about 0.8 seconds<br />

Example (Requirement 4):<br />

If a side is failed the other side should become active<br />

eq R4 = [] (((side 1 failed /\ ~ side 2 failed)<br />

-> O (~ side 2 failed -> side 2 active))<br />

/\ ((side 2 failed /\ ~ side 1 failed)<br />

-> O (~ side 1 failed -> side 1 active))) .<br />

<strong>Maude</strong>> (red modelCheck(<strong>in</strong>it, R4) .)<br />

rewrites: 101597 <strong>in</strong> 825ms cpu (831ms real)<br />

result Bool : true


Towards a <strong>Synchronous</strong> <strong>AADL</strong> Annex<br />

Acks: Jo<strong>in</strong>t work with Abdullah Al-Nayeem, Kyungm<strong>in</strong> Bae,<br />

M<strong>in</strong>gyoug Nam, Peter Ölveczky, <strong>and</strong> Lui Sha.<br />

Thanks: to SEI <strong>AADL</strong> Group for very helpful discussions.


Why <strong>Synchronous</strong> <strong>AADL</strong>?<br />

Exploit the <strong>PALS</strong> pattern<br />

Def<strong>in</strong>e high-level synchronous designs <strong>in</strong> <strong>AADL</strong><br />

Verify synchronous designs with<br />

“synchronous-<strong>AADL</strong>-to-<strong>Maude</strong>” tool<br />

Use <strong>PALS</strong> to automatically generate asynchronous distributed<br />

<strong>AADL</strong> model from synchronous <strong>AADL</strong> design model


What Should “<strong>Synchronous</strong> <strong>AADL</strong>” Look Like?<br />

Subset of <strong>AADL</strong> extended with new annotations<br />

Focus on <strong>AADL</strong> subset to model synchronous <strong>PALS</strong> designs<br />

abstract from hardware <strong>and</strong> memory, etc.,<br />

keep some real-time features<br />

focus on behavioral <strong>and</strong> structur<strong>in</strong>g subset<br />

How to trigger a synchronous step<br />

time-triggered<br />

event-triggered


Side1<br />

Side2<br />

Time-Triggered: Periodic <strong>Synchronous</strong> Dispatch<br />

All threads have the same period<br />

Thread1<br />

(period = 3)<br />

Thread2<br />

(period = 3)<br />

Thread3<br />

(period = 3)<br />

Thread4<br />

(period = 3)<br />

execute synchronously at the start of the period<br />

same-level connections are delayed connections<br />

Thread1<br />

(period = 3)<br />

Thread2<br />

(period = 4)


Event-Triggered: Aperiodic <strong>Synchronous</strong> Dispatch<br />

Environment<br />

(+ Input<br />

Synchronizer)<br />

Side1<br />

Side2<br />

Instead of only delayed connections, the system might want to<br />

react to <strong>in</strong>put from the environment immediately<br />

Thread1<br />

(period = 3)<br />

Thread2<br />

(period = 3)<br />

Immediate connection from (s<strong>in</strong>gle) dispatcher<br />

Other connections are delayed connections<br />

Non-dispatcher components conta<strong>in</strong> aperiodic threads<br />

Thread3<br />

Thread4


Behaviors<br />

Thread transitions <strong>in</strong> <strong>AADL</strong> behavior annex can be<br />

nondeterm<strong>in</strong>istic, <strong>and</strong> also <strong>in</strong> <strong>PALS</strong> synchronous models<br />

The behavior of components, except for the environment, is<br />

most often determ<strong>in</strong>istic<br />

Assumption of determ<strong>in</strong>ism of certa<strong>in</strong> components could make<br />

model check<strong>in</strong>g much more efficient<br />

Language support for declar<strong>in</strong>g threads to be<br />

“nondeterm<strong>in</strong>istic” (or “environment”)


<strong>AADL</strong> Language Extensions<br />

Use properties construct <strong>in</strong> <strong>AADL</strong> to declare synchronous systems<br />

<strong>in</strong> the component (implementation) that conta<strong>in</strong>s the<br />

synchronous components<br />

Recall active st<strong>and</strong>by architecture:


Example: Time-Triggered Dispatch<br />

system ActiveSt<strong>and</strong>bySystem<br />

end ActiveSt<strong>and</strong>bySystem;<br />

system implementation ActiveSt<strong>and</strong>bySystem.impl<br />

subcomponents<br />

sideOne: system Side1::Side1.impl;<br />

sideTwo: system Side2::Side2.impl;<br />

env: system Environment::Environment.impl;<br />

connections<br />

C1: data port sideOne.side1ActiveSide ->> sideTwo.side1ActiveSide;<br />

C2: data port sideTwo.side2ActiveSide ->> sideOne.side2ActiveSide;<br />

C3: data port env.manualSelection ->> sideOne.manualSelection;<br />

C4: data port env.manualSelection ->> sideTwo.manualSelection;<br />

C5: data port env.side1Failed ->> sideOne.side1Failed;<br />

C6: data port env.side2Failed ->> sideTwo.side2Failed;<br />

properties<br />

Synch<strong>AADL</strong>::<strong>Synchronous</strong> => periodic(1ms)<br />

end ActiveSt<strong>and</strong>bySystem.impl;


Example: Event-Triggered Dispatch<br />

system ActiveSt<strong>and</strong>bySystem<br />

end ActiveSt<strong>and</strong>bySystem;<br />

system implementation ActiveSt<strong>and</strong>bySystem.impl<br />

subcomponents<br />

sideOne: system Side1::Side1.impl;<br />

sideTwo: system Side2::Side2.impl;<br />

env: system Environment::Environment.impl;<br />

connections<br />

C1: data port sideOne.side1ActiveSide ->> sideTwo.side1ActiveSide;<br />

C2: data port sideTwo.side2ActiveSide ->> sideOne.side2ActiveSide;<br />

C3: data port env.manualSelection -> sideOne.manualSelection;<br />

C4: data port env.manualSelection -> sideTwo.manualSelection;<br />

C5: data port env.side1Failed -> sideOne.side1Failed;<br />

C6: data port env.side2Failed -> sideTwo.side2Failed;<br />

properties<br />

Synch<strong>AADL</strong>::<strong>Synchronous</strong> => aperiodic with dispatcher env;<br />

end ActiveSt<strong>and</strong>bySystem.impl;


Research Tasks<br />

Def<strong>in</strong>e <strong>AADL</strong> synchronous annex<br />

Def<strong>in</strong>e <strong>Maude</strong> semantics for synchronous <strong>AADL</strong> models<br />

Develop optimized model check<strong>in</strong>g techniques for such models<br />

Use OSATE code generation <strong>in</strong>frastructure <strong>and</strong> execution<br />

environment for <strong>AADL</strong> to synthesize a <strong>Maude</strong> verification<br />

model from a synchronous <strong>AADL</strong> design model, <strong>and</strong> to<br />

<strong>in</strong>tegrate <strong>Maude</strong> verification <strong>in</strong>to OSATE<br />

Def<strong>in</strong>e automatic model transformations from synchronous<br />

<strong>AADL</strong> models to distributed asynchronous <strong>AADL</strong> models

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!