Permalink
Fetching contributors…
Cannot retrieve contributors at this time
1211 lines (1085 sloc) 30.2 KB
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!-- ############################################################### -->
<!-- I. Calculation Layer -->
<!-- ############################################################### -->
<!-- ============================================================= -->
<!-- I.1. Models -->
<!-- ============================================================= -->
<start>
<element name="opsa-mef">
<optional>
<ref name="name"/>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<zeroOrMore>
<choice>
<ref name="model-data"/>
<ref name="event-tree-definition"/>
<ref name="alignment-definition"/>
<ref name="rule-definition"/>
<ref name="initiating-event-definition"/>
<ref name="fault-tree-definition"/>
<ref name="substitution-definition"/>
<ref name="CCF-group-definition"/>
<ref name="extern-library-definition"/>
<ref name="extern-function-definition"/>
</choice>
</zeroOrMore>
</element>
</start>
<define name="Identifier">
<data type="NCName">
<param name="pattern">[^\-.]+(-[^\-.]+)*</param>
</data>
</define>
<define name="name">
<attribute name="name"> <ref name="Identifier"/> </attribute>
</define>
<define name="reference">
<attribute name="name">
<data type="NCName">
<param name="pattern">([^\-.]+(-[^\-.]+)*)(\.\i[^\-.]*(-[^\-.]+)*)*</param>
</data>
</attribute>
</define>
<define name="NonEmptyString"> <!-- Texts without LF and other special chars. -->
<data type="normalizedString">
<param name="minLength">1</param>
</data>
</define>
<define name="label">
<element name="label"> <ref name="NonEmptyString"/> </element>
</define>
<define name="attributes">
<element name="attributes">
<zeroOrMore>
<element name="attribute">
<ref name="name"/>
<attribute name="value"> <ref name="NonEmptyString"/> </attribute>
<optional>
<attribute name="type"> <ref name="NonEmptyString"/> </attribute>
</optional>
</element>
</zeroOrMore>
</element>
</define>
<!-- ============================================================= -->
<!-- I.2. Consequences, Consequence Groups -->
<!-- ============================================================= -->
<!-- ============================================================= -->
<!-- I.3. Missions, Phases -->
<!-- ============================================================= -->
<define name="alignment-definition">
<element name="define-alignment">
<ref name="name"/>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<oneOrMore>
<ref name="phase-definition"/>
</oneOrMore>
</element>
</define>
<define name="phase-definition">
<element name="define-phase">
<ref name="name"/>
<attribute name="time-fraction"> <data type="double"/> </attribute>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<zeroOrMore>
<ref name="set-house-event"/>
</zeroOrMore>
</element>
</define>
<!-- ############################################################### -->
<!-- II. Event Tree Layer -->
<!-- ############################################################### -->
<!-- ============================================================= -->
<!-- II.1. Initiating events, Initiating event Groups -->
<!-- ============================================================= -->
<define name="initiating-event-definition">
<element name="define-initiating-event">
<ref name="name"/>
<optional>
<attribute name="event-tree"> <ref name="Identifier"/> </attribute>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
</element>
</define>
<!-- ============================================================= -->
<!-- II.2. Event Trees -->
<!-- ============================================================= -->
<define name="event-tree-definition">
<element name="define-event-tree">
<ref name="name"/>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<zeroOrMore>
<ref name="functional-event-definition"/>
</zeroOrMore>
<zeroOrMore>
<ref name="sequence-definition"/>
</zeroOrMore>
<zeroOrMore>
<ref name="branch-definition"/>
</zeroOrMore>
<ref name="initial-state"/>
</element>
</define>
<define name="functional-event-definition">
<element name="define-functional-event">
<ref name="name"/>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
</element>
</define>
<define name="sequence-definition">
<element name="define-sequence">
<ref name="name"/>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<zeroOrMore>
<ref name="instruction"/>
</zeroOrMore>
</element>
</define>
<define name="branch-definition">
<element name="define-branch">
<ref name="name"/>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<ref name="branch"/>
</element>
</define>
<define name="initial-state">
<element name="initial-state">
<ref name="branch"/>
</element>
</define>
<define name="branch">
<zeroOrMore>
<ref name="instruction"/>
</zeroOrMore>
<choice>
<ref name="fork"/>
<ref name="end-state"/>
</choice>
</define>
<define name="fork">
<element name="fork">
<attribute name="functional-event"> <ref name="Identifier"/> </attribute>
<oneOrMore>
<ref name="path"/>
</oneOrMore>
</element>
</define>
<define name="path">
<element name="path">
<attribute name="state"> <ref name="Identifier"/> </attribute>
<ref name="branch"/>
</element>
</define>
<define name="end-state">
<choice>
<element name="sequence">
<ref name="name"/>
</element>
<element name="branch">
<ref name="name"/>
</element>
</choice>
</define>
<!-- ============================================================= -->
<!-- II.3. Instructions, Rules -->
<!-- ============================================================= -->
<define name="instruction">
<choice>
<ref name="set"/>
<ref name="collect"/>
<ref name="if-then-else"/>
<ref name="block"/>
<ref name="rule"/>
<ref name="link"/>
</choice>
</define>
<define name="set">
<choice>
<ref name="set-house-event"/>
</choice>
</define>
<define name="set-house-event">
<element name="set-house-event">
<ref name="name"/>
<optional>
<attribute name="direction">
<ref name="direction"/>
</attribute>
</optional>
<ref name="Boolean-constant"/>
</element>
</define>
<define name="direction">
<choice>
<value>forward</value>
</choice>
</define>
<define name="if-then-else">
<element name="if">
<ref name="expression"/>
<ref name="instruction"/>
<optional>
<ref name="instruction"/>
</optional>
</element>
</define>
<define name="collect">
<choice>
<ref name="collect-formula"/>
<ref name="collect-expression"/>
</choice>
</define>
<define name="collect-formula">
<element name="collect-formula">
<ref name="formula"/>
</element>
</define>
<define name="collect-expression">
<element name="collect-expression">
<ref name="expression"/>
</element>
</define>
<define name="block">
<element name="block">
<zeroOrMore>
<ref name="instruction"/>
</zeroOrMore>
</element>
</define>
<define name="rule">
<element name="rule">
<ref name="name"/>
</element>
</define>
<define name="link">
<element name="event-tree">
<ref name="name"/>
</element>
</define>
<define name="rule-definition">
<element name="define-rule">
<ref name="name"/>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<oneOrMore>
<ref name="instruction"/>
</oneOrMore>
</element>
</define>
<!-- ############################################################### -->
<!-- III. Meta-Logical Layer -->
<!-- ############################################################### -->
<!-- ============================================================= -->
<!-- III.1. CCF-Groups -->
<!-- ============================================================= -->
<define name="CCF-group-definition">
<element name="define-CCF-group">
<ref name="name"/>
<attribute name="model">
<ref name="CCF-model"/>
</attribute>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<ref name="members"/>
<ref name="distribution"/>
<ref name="factors"/>
</element>
</define>
<define name="members">
<element name="members">
<oneOrMore>
<ref name="basic-event"/>
</oneOrMore>
</element>
</define>
<define name="factors">
<choice>
<element name="factors">
<oneOrMore>
<ref name="factor"/>
</oneOrMore>
</element>
<ref name="factor"/>
</choice>
</define>
<define name="factor">
<element name="factor">
<optional>
<attribute name="level"> <data type="positiveInteger"/> </attribute>
</optional>
<ref name="expression"/>
</element>
</define>
<define name="distribution">
<element name="distribution">
<ref name="expression"/>
</element>
</define>
<define name="CCF-model">
<choice>
<value>beta-factor</value>
<value>MGL</value>
<value>alpha-factor</value>
<value>phi-factor</value>
</choice>
</define>
<!-- ============================================================= -->
<!-- III.2. Substitutions -->
<!-- ============================================================= -->
<define name="substitution-definition">
<element name="define-substitution">
<ref name="name"/>
<optional>
<attribute name="type">
<choice>
<value>delete-terms</value>
<value>recovery-rule</value>
<value>exchange-event</value>
</choice>
</attribute>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<element name="hypothesis">
<ref name="formula"/>
</element>
<optional>
<element name="source">
<oneOrMore>
<ref name="basic-event"/>
</oneOrMore>
</element>
</optional>
<element name="target">
<choice>
<ref name="basic-event"/>
<ref name="Boolean-constant"/>
</choice>
</element>
</element>
</define>
<!-- ############################################################### -->
<!-- IV. Fault Tree Layer -->
<!-- ############################################################### -->
<!-- ============================================================= -->
<!-- IV.1. Definitions of Fault Trees & Components -->
<!-- ============================================================= -->
<define name="fault-tree-definition">
<element name="define-fault-tree">
<ref name="name"/>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<zeroOrMore>
<choice>
<ref name="CCF-group-definition"/>
<ref name="event-definition"/>
<ref name="component-definition"/>
<ref name="parameter-definition"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="component-definition">
<element name="define-component">
<ref name="name"/>
<optional>
<ref name="role"/>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<zeroOrMore>
<choice>
<ref name="CCF-group-definition"/>
<ref name="event-definition"/>
<ref name="component-definition"/>
<ref name="parameter-definition"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="role">
<attribute name="role">
<choice>
<value>private</value>
<value>public</value>
</choice>
</attribute>
</define>
<define name="model-data">
<element name="model-data">
<zeroOrMore>
<choice>
<ref name="house-event-definition"/>
<ref name="basic-event-definition"/>
<ref name="parameter-definition"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="event-definition">
<choice>
<ref name="gate-definition"/>
<ref name="house-event-definition"/>
<ref name="basic-event-definition"/>
</choice>
</define>
<!-- ============================================================= -->
<!-- IV.2. Definitions of Gates, House Events & Basic Events -->
<!-- ============================================================= -->
<define name="gate-definition">
<element name="define-gate">
<ref name="name"/>
<optional>
<ref name="role"/>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<ref name="formula"/>
</element>
</define>
<define name="house-event-definition">
<element name="define-house-event">
<ref name="name"/>
<optional>
<ref name="role"/>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<optional>
<ref name="Boolean-constant"/>
</optional>
</element>
</define>
<define name="basic-event-definition">
<element name="define-basic-event">
<ref name="name"/>
<optional>
<ref name="role"/>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<optional>
<ref name="expression"/>
</optional>
</element>
</define>
<!-- ============================================================= -->
<!-- IV.3. Formulae -->
<!-- ============================================================= -->
<define name="formula">
<choice>
<ref name="event"/>
<ref name="Boolean-constant"/>
<element name="and">
<oneOrMore>
<ref name="formula"/>
</oneOrMore>
</element>
<element name="or">
<oneOrMore>
<ref name="formula"/>
</oneOrMore>
</element>
<element name="not">
<ref name="formula"/>
</element>
<element name="xor">
<oneOrMore>
<ref name="formula"/>
</oneOrMore>
</element>
<element name="nand">
<oneOrMore>
<ref name="formula"/>
</oneOrMore>
</element>
<element name="nor">
<oneOrMore>
<ref name="formula"/>
</oneOrMore>
</element>
<element name="atleast">
<attribute name="min"> <data type="nonNegativeInteger"/> </attribute>
<oneOrMore>
<ref name="formula"/>
</oneOrMore>
</element>
</choice>
</define>
<define name="event">
<choice>
<element name="event">
<ref name="reference"/>
<optional>
<attribute name="type">
<ref name="event-type"/>
</attribute>
</optional>
</element>
<ref name="gate"/>
<ref name="house-event"/>
<ref name="basic-event"/>
</choice>
</define>
<define name="event-type">
<choice>
<value>gate</value>
<value>basic-event</value>
<value>house-event</value>
</choice>
</define>
<define name="gate">
<element name="gate">
<ref name="reference"/>
</element>
</define>
<define name="house-event">
<element name="house-event">
<ref name="reference"/>
</element>
</define>
<define name="basic-event">
<element name="basic-event">
<ref name="reference"/>
</element>
</define>
<define name="Boolean-constant">
<element name="constant">
<attribute name="value"> <data type="boolean"/> </attribute>
</element>
</define>
<!-- ############################################################### -->
<!-- V. Stochastic Layer -->
<!-- ############################################################### -->
<!-- ============================================================= -->
<!-- V.1. Definition of Parameters -->
<!-- ============================================================= -->
<define name="parameter-definition">
<element name="define-parameter">
<ref name="name"/>
<optional>
<ref name="role"/>
</optional>
<optional>
<attribute name="unit">
<ref name="units"/>
</attribute>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<ref name="expression"/>
</element>
</define>
<define name="units">
<choice>
<value>bool</value>
<value>int</value>
<value>float</value>
<value>hours</value>
<value>hours-1</value>
<value>years</value>
<value>years-1</value>
<value>fit</value>
<value>demands</value>
</choice>
</define>
<!-- ============================================================= -->
<!-- V.2. Expressions -->
<!-- ============================================================= -->
<!-- *********************************************************** -->
<!-- V.2.1. Entities -->
<!-- *********************************************************** -->
<define name="expression">
<choice>
<ref name="constant"/>
<ref name="parameter"/>
<ref name="operation"/>
<ref name="built-in"/>
<ref name="random-deviate"/>
<ref name="test-event"/>
</choice>
</define>
<define name="constant">
<choice>
<ref name="bool"/>
<ref name="int"/>
<ref name="float"/>
</choice>
</define>
<define name="parameter">
<choice>
<element name="parameter">
<ref name="reference"/>
<optional>
<attribute name="unit">
<ref name="units"/>
</attribute>
</optional>
</element>
<element name="system-mission-time">
<optional>
<attribute name="unit">
<ref name="units"/>
</attribute>
</optional>
</element>
</choice>
</define>
<define name="operation">
<choice>
<ref name="numerical-operation"/>
<ref name="Boolean-operation"/>
<ref name="conditional-operation"/>
</choice>
</define>
<define name="built-in">
<choice>
<ref name="exponential"/>
<ref name="GLM"/>
<ref name="Weibull"/>
<ref name="periodic-test"/>
<ref name="extern-function"/>
</choice>
</define>
<define name="random-deviate">
<choice>
<ref name="uniform-deviate"/>
<ref name="normal-deviate"/>
<ref name="lognormal-deviate"/>
<ref name="gamma-deviate"/>
<ref name="beta-deviate"/>
<ref name="histogram"/>
</choice>
</define>
<define name="test-event">
<choice>
<ref name="test-initiating-event"/>
<ref name="test-functional-event"/>
</choice>
</define>
<!-- *********************************************************** -->
<!-- V.2.2. Constants, Parameters -->
<!-- *********************************************************** -->
<define name="bool">
<element name="bool">
<attribute name="value"> <data type="boolean"/> </attribute>
</element>
</define>
<define name="int">
<element name="int">
<attribute name="value">
<data type="integer"/>
</attribute>
</element>
</define>
<define name="float">
<element name="float">
<attribute name="value">
<data type="double"/>
</attribute>
</element>
</define>
<!-- *********************************************************** -->
<!-- V.2.3. Numerical Expressions -->
<!-- *********************************************************** -->
<define name="numerical-operation">
<choice>
<element name="neg">
<ref name="expression"/>
</element>
<element name="add">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="sub">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="mul">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="div">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="pi"> <empty/> </element>
<element name="abs">
<ref name="expression"/>
</element>
<element name="acos">
<ref name="expression"/>
</element>
<element name="asin">
<ref name="expression"/>
</element>
<element name="atan">
<ref name="expression"/>
</element>
<element name="cos">
<ref name="expression"/>
</element>
<element name="cosh">
<ref name="expression"/>
</element>
<element name="exp">
<ref name="expression"/>
</element>
<element name="log">
<ref name="expression"/>
</element>
<element name="log10">
<ref name="expression"/>
</element>
<element name="mod">
<ref name="expression"/>
<ref name="expression"/>
</element>
<element name="pow">
<ref name="expression"/>
<ref name="expression"/>
</element>
<element name="sin">
<ref name="expression"/>
</element>
<element name="sinh">
<ref name="expression"/>
</element>
<element name="tan">
<ref name="expression"/>
</element>
<element name="tanh">
<ref name="expression"/>
</element>
<element name="sqrt">
<ref name="expression"/>
</element>
<element name="ceil">
<ref name="expression"/>
</element>
<element name="floor">
<ref name="expression"/>
</element>
<element name="min">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="max">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="mean">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
</choice>
</define>
<!-- *********************************************************** -->
<!-- V.2.4. Boolean Expressions -->
<!-- *********************************************************** -->
<define name="Boolean-operation">
<choice>
<element name="not">
<ref name="expression"/>
</element>
<element name="and">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="or">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
<element name="eq">
<ref name="expression"/>
<ref name="expression"/>
</element>
<element name="df">
<ref name="expression"/>
<ref name="expression"/>
</element>
<element name="lt">
<ref name="expression"/>
<ref name="expression"/>
</element>
<element name="gt">
<ref name="expression"/>
<ref name="expression"/>
</element>
<element name="leq">
<ref name="expression"/>
<ref name="expression"/>
</element>
<element name="geq">
<ref name="expression"/>
<ref name="expression"/>
</element>
</choice>
</define>
<!-- *********************************************************** -->
<!-- V.2.5. Conditional Expressions -->
<!-- *********************************************************** -->
<define name="conditional-operation">
<choice>
<ref name="if-then-else-operation"/>
<ref name="switch-operation"/>
</choice>
</define>
<define name="if-then-else-operation">
<element name="ite">
<ref name="expression"/>
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="switch-operation">
<element name="switch">
<zeroOrMore>
<ref name="case-operation"/>
</zeroOrMore>
<ref name="expression"/>
</element>
</define>
<define name="case-operation">
<element name="case">
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<!-- *********************************************************** -->
<!-- V.2.6. Built-ins -->
<!-- *********************************************************** -->
<define name="exponential">
<element name="exponential">
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="GLM">
<element name="GLM">
<ref name="expression"/>
<ref name="expression"/>
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="Weibull">
<element name="Weibull">
<ref name="expression"/>
<ref name="expression"/>
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="periodic-test">
<element name="periodic-test">
<oneOrMore>
<ref name="expression"/>
</oneOrMore>
</element>
</define>
<define name="extern-function">
<element name="extern-function">
<ref name="name"/>
<zeroOrMore>
<ref name="expression"/>
</zeroOrMore>
</element>
</define>
<define name="extern-library-definition">
<element name="define-extern-library">
<ref name="name"/>
<attribute name="path"> <data type="anyURI"/> </attribute>
<optional>
<attribute name="system"> <data type="boolean"/> </attribute>
</optional>
<optional>
<attribute name="decorate"> <data type="boolean"/> </attribute>
</optional>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
</element>
</define>
<define name="extern-function-definition">
<element name="define-extern-function">
<ref name="name"/>
<attribute name="symbol"> <ref name="Identifier"/> </attribute>
<attribute name="library"> <ref name="Identifier"/> </attribute>
<optional>
<ref name="label"/>
</optional>
<optional>
<ref name="attributes"/>
</optional>
<ref name="extern-function-return-type"/>
<zeroOrMore>
<ref name="extern-function-parameter-type"/>
</zeroOrMore>
</element>
</define>
<define name="extern-function-return-type">
<ref name="extern-function-parameter-type"/>
</define>
<define name="extern-function-parameter-type">
<choice>
<element name="int"> <empty/> </element>
<element name="double"> <empty/> </element>
</choice>
</define>
<!-- *********************************************************** -->
<!-- V.2.7. Random-Deviates -->
<!-- *********************************************************** -->
<define name="uniform-deviate">
<element name="uniform-deviate">
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="normal-deviate">
<element name="normal-deviate">
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="lognormal-deviate">
<element name="lognormal-deviate">
<ref name="expression"/>
<ref name="expression"/>
<optional>
<ref name="expression"/>
</optional>
</element>
</define>
<define name="gamma-deviate">
<element name="gamma-deviate">
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="beta-deviate">
<element name="beta-deviate">
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<define name="histogram">
<element name="histogram">
<ref name="expression"/>
<oneOrMore>
<ref name="bin"/>
</oneOrMore>
</element>
</define>
<define name="bin">
<element name="bin">
<ref name="expression"/>
<ref name="expression"/>
</element>
</define>
<!-- *********************************************************** -->
<!-- V.2.8. Test-Events -->
<!-- *********************************************************** -->
<define name="test-initiating-event">
<element name="test-initiating-event">
<ref name="name"/>
</element>
</define>
<define name="test-functional-event">
<element name="test-functional-event">
<ref name="name"/>
<attribute name="state"> <ref name="NonEmptyString"/> </attribute>
</element>
</define>
</grammar>