27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

example, (Circle, t 5 , t 6 , x 4 ,). When an InternalTransition is<br />

executed in a Mo de, an ExitStep whose targe is the starting<br />

pseudostate of the InternalTransition and an EntryStep<br />

originating from the target pseudostate of the Internal-<br />

Transition will take place meanwhile, forming an execution<br />

path called InternalStep, for example, (free, t 2 , t 3 , t 4 , Circle).<br />

When a top-level Mode resides in a certain StateConfiguration,<br />

continuous variables will be updated according to the flow and<br />

invariant constraints contained in the StateConfiguration, and<br />

such an execution process is called a ContinuousStep, As<br />

shown in F igure 2, (DATC:free, DATC.flows∩free.flows,<br />

DATC.invs∩free.invs) is a ContinuousStep.<br />

B. Metamodel of QHP model<br />

top-level Mode m, the execution process of the rule<br />

TLMode2QHPCode is as follows. First, get all EntryStep<br />

instances of m by calling ATL helper EntrySteps, and by rule<br />

ES2QHPI, each EntryStep is mapped to a QHPInitialization<br />

instance, making up IBS. Second, get all InternalStep instances<br />

of m by calling helper InternalSteps, and by rule IS2QHPDT,<br />

each InternalStep is mapped to a QHPDTransition instance<br />

composing DTS. Third, get all ContinusStep instances of m by<br />

calling helper ContinusSteps, and by rule CS2QHPCT, each<br />

ContinusStep is mapped to a QHPCTransition instance<br />

composing CTS. Fourth, get the mark indicating whether all<br />

InternalStep instances composes an execution cycle by calling<br />

helper CycleSymbol, and as a Boolean variable, CycleSymbol<br />

can be assigned directly to the variable Cycle of the QHP<br />

model p. Finally, template rule QHPModel2QHPCode will be<br />

invoked to generate final QHP code form QHP model p.<br />

2) QHP code generation from QHP model<br />

TABLE II.<br />

MAIN TEMPLATE RULE<br />

Figure 3. Metamodel of QHP model<br />

Definition 2. (QHP) A QHP model can be formalized as a<br />

tuple: , where<br />

IBS, DTS and CTS denote the set of all QHPInitialization,<br />

QHPDTransition and QHPCTransition instances of the QHP<br />

model respectively, Cycle signifies whether the model can be<br />

executed repeatedly, and SG denotes all QHPState instances.<br />

As for other model element, see Figure 3.<br />

C. Model transformation from toplevel Mode to QHP Code<br />

1) Description of main transformation rule based on ATL<br />

TABLE I. MAIN TRANSFORMATION RULE-TLMODE2QHPCODE<br />

entrypoint rule TLMode2QHPCode{<br />

from<br />

m:Mode(m.isTopLevelMode=true)<br />

to<br />

p:QHP (<br />

IBScollect(i|thisModule.ES2QHPI(i)),<br />

DTScollect(d|thisModule.IS2QHPDT(d)),<br />

CTScollect(i|thisModule.CS2QHPCT(i)),<br />

Cycle

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

Saved successfully!

Ooh no, something went wrong!