110 likes | 259 Views
The XMPL Language. Tazeen Mahtab July 22, 2003. Introduction to XMPL. Stands for XML-based Model Programming Language Designed to be portable, human-readable and machine-readable Part of Livingstone 2 JMPL compiles to XMPL in Livingstone 2 MPL compiles to MOF in Titan.
E N D
The XMPL Language Tazeen Mahtab July 22, 2003
Introduction to XMPL • Stands for XML-based Model Programming Language • Designed to be portable, human-readable and machine-readable • Part of Livingstone 2 • JMPL compiles to XMPL in Livingstone 2 • MPL compiles to MOF in Titan
Typical Structure of .xmpl file <componentinstance/> contains the model specification. <xmpl> <attributetype .... /> <componenttype .... /> <componentinstance ... /> </xmpl>
Model Specification A <componentinstance/> can contain multiple attribute types and components. For example, this model contains circuit breakers and LEDs. <componentinstance name="cbAndLed"> <ci:attributetype … /> … <ci:component type="cb" name="cbAndLed.cb10“… /> <ci:component type="cb" name="cbAndLed.cb9“… /> <ci:component type=“led" name="cbAndLed.led1“… /> … </componentinstance>
Attributes • An attribute type specifies the domain of an attribute. <ci:attributetype name="onOffState" members="on off"/> • In Titan’s MOF format, this corresponds to the VARIABLE-DOMAIN-TYPE.
Components • A typical model component contains modal constraints and transitions, as well as additional attribute types. <ci:component type="cb“ name="cbAndLed.cb10"> <ci:statevector vars="mode"/> <ci:attribute … /> <ci:transition … /> … <ci:clause … /> … </ci:component>
Constraints The same element is used for both modal and transitional constraints. <ci:clause> <ci:term>!mode=off</ci:term> <ci:term>currentOut=off</ci:term> </ci:clause>
Transitions A transition specifies the to and from states, as well as the transition guards. <ci:transition to="on" from="off“ name="turnOn"> <ci:clause> <ci:term>!cmdIn=on</ci:term> </ci:clause> </ci:transition>
Failures • Failure transitions look the same as normal transitions. • They can include a probability. <ci:transition to="blown" probability="rare" from="*" name="blown"/>
Translator • Located inside /projects/mers/xmpl-parser. • Converts .xmpl to Titan CCAModel data structure and then to .cca and .bm files. • Tried it out, but probably still has errors.
Sources • Livingstone 2 distribution • http://ic.arc.nasa.gov/projects/mba/projects/L2/doc/jmpl/intro_to_xmpl.html