next up previous
Up: Elvira Specification Format Previous: 3 Tokens of the

4 Production rules for elvira format

  1. Elvira ::= NetworkDeclaration()
    

  2. NetworkDeclaration() ::= NetworkClass() <WORD> "{" NetworkContent() "}"
    

  3. NetworkClass() ::= <NETWORK>|<BNET>|<IDIAGRAM>
    

  4. NetworkContent() ::= ((Property()|DefaultDeclaration())";")*
                         (ElementDeclaration())*
    

  5. DefaultDeclaration() ::= (<DEFVALUE>|<EVERY>)
               (<NODE><NODETYPE><EQUAL><FINITE>) |
               (<NODE>(NodeProperty() | FiniteProperty())) |
               (<NODE><NODETYPE><EQUAL><CONTINUOUS>) |
               (<NODE>(NodeProperty() | ContinuousProperty())) |
               (<NODE>"("<FINITE>")"(NodeProperty()|FiniteProperty())) |
               (<NODE>"("<CONTINUOUS>")"(NodeProperty()|Continuousproperty())) |
               (<RELATION> RelationProperty() )
    

  6. Property() ::= (<TITLE><EQUAL><STRING>) | 
        (<COMMENT><EQUAL><STRING>)|
        (<CONSISTENCY><EQUAL><OPEN_PAREN><CLOSE_PAREN>)| 
        (<CONSISTENCY><EQUAL><OPEN_PAREN>ListWords()<CLOSE_PAREN>)|
        (<AUTHOR><EQUAL><STRING>)|
        (<WHOCHANGED><EQUAL><STRING>)|
        (<WHENCHANGED><EQUAL><STRING>)|
        (<LOCKED><EQUAL><BOOLEAN>)|
        (<VERSION><EQUAL><FLOAT>)| 
        (<WORD><EQUAL> (<BOOLEAN>|<WORD>|<STRING>|<STRING_DECIMAL>|<DECIMAL_LITERAL>) )
    

  7. ElementDeclaration() ::= NodeDeclaration()|
                             LinkDeclaration()|
                             RelationDeclaration()
    

  8. NodeDeclaration() ::=  <NODE> ( <WORD> | (T=<STRING>) | <PARAMETER_WORD> ) 
                           (  DefaultNodeDeclaration() | 
                              ( "(" ((FiniteDeclaration() | ContinuousDeclaration() ) )
                           )
    

  9. DefaultNodeDeclaration() ::= FiniteBody() | ContinuousBody()
    

  10. FiniteDeclaration() ::= <FINITE> ")" FiniteBody()
    

  11. ContinuousDeclaration() ::= <CONTINUOUS> ")" ContinuousBody()
    

  12. FiniteBody() ::= ( "{" FiniteNodeProperties() "}" ) | ";"
    

  13. ContinuousBody() ::= ( "{" ContinuousNodeProperties() "}" ) | ";"
    

  14. FiniteNodeProperties() ::= ( (NodeProperty()|FiniteProperty()) ";")*
    

  15. ContinuousNodeProperties() ::= ( (NodeProperty()| ContinuousProperty()) ";")*
    

  16. NodeProperty() ::= (<TITLE><EQUAL><STRING>)| 
                       (<COMMENT><EQUAL><STRING>)|
                       (<NODEKIND><EQUAL>(<CHANCE>|<DECISION>|<UTILITY>))|
                       (<NODETYPE><EQUAL><FINITE>)|
                       (<POSX><EQUAL> (<INTEGER>|<DECIMAL_LITERAL>) )|
                       (<POSY><EQUAL> (<INTEGER>|<DECIMAL_LITERAL>) )|
                       (<RELEVANCE><EQUAL><FLOAT>)|
                       (<WORD><EQUAL> (<STRING>|<STRING_DECIMAL>|<DECIMAL_LITERAL>) )
    

  17. FiniteProperty() ::= ( <STATES><EQUAL> "(" ListWords() ")" ) |
                         (<NODETYPE> <EQUAL> <FINITE>)|
                         (<NUMSTATES> <EQUAL> <DECIMAL_LITERAL>)
    

  18. ContinuousProperty() ::= (<NODETYPE><EQUAL><CONTINUOUS>) |
                             (<MIN><EQUAL><FLOAT>) |
                             (<MAX><EQUAL><FLOAT>)
    

  19. LinkDeclaration() ::= <LINK> (<WORD> | <PARAMETER_WORD>)
                          (<WORD> | <PARAMETER_WORD>)
                          ( ( "{" LinkProperties() "}" ) | ";" )
    

  20. LinkProperties() ::= ( LinkProperty() (";") )*
    

  21.   
    LinkProperty() ::= (<DIRECTED><EQUAL><BOOLEAN>) |
                          (<COMMENT><EQUAL><STRING>)
    

  22.   
    RelationDeclaration() ::= <RELATION> ListWords() 
                          (";" | ("{" RelationProperties() "}") )
    

  23.   
    RelationProperties() ::= (RelationProperty()";")*| ";"
    

  24.   
    RelationProperty() ::= (<COMMENT><EQUAL><STRING>) | 
                           (<VALUES><EQUAL> (TableDeclaration()|
                                           TreeDeclaration()|
                                           ConvexSetDeclaration()|
                                           FunctionDeclaration() |
                                           ContinuousTreeDeclaration()) ) |
                           (<ACTIVE><EQUAL><BOOLEAN>) |
                           (<RELATIONNAME><EQUAL><WORD>) |
                           (<RELATIONKIND><EQUAL><WORD>)
    

  25.   
    FunctionDeclaration() ::= <FUNCTION><WORD>"(" ( (ArgumentInclusion() (",")? )*)
    ")"
    

  26.   
    ArgumentInclusion() ::= <FLOAT> | <WORD>
    

  27.   
    TableDeclaration() ::= 
                  <TABLE> "(" (ListAssignments() | ListFloats()) ")"
    

  28.   
    ConvexSetDeclaration() ::= <CONVEXSET> "(" 
                           ( table=TableDeclaration())+ ")"
    

  29. ListAssignments() ::= 
                 ((Assignment() (",")?)+ DefaultAssignment()? 
                                       (Assignment() (",")?)* ) |
                 (DefaultAssignment()) (Assignment() (",")?)*
    

  30.   
    Assignment() ::= "[" ListWordIntegers() "]" <EQUAL><FLOAT>
    

  31.   
    ListFloats() ::= (<FLOAT> (",")?)*
    

  32. FloatsToVector() ::= (  
                (<DECIMAL_LITERAL>|<INTEGER>|<FLOAT>|<FLOATSCI>) (",")?
                         )*
    

  33.   
    Vector ListWordIntegers() ::= ( (<DECIMAL_LITERAL>|
                 <WORD>|<STRINGDECIMAL>) (",")?)*
    

  34.   
    DefaultAssignment() ::= <DEFVALUE><EQUAL><FLOAT>
    

  35.   
    TreeDeclaration() ::= <TREE> "(" BodyTree()  ")"
    

  36. ContinuousTreeDeclaration() ::= <CONTINUOUS_TREE>
                                    "(" BodyContinuousTree()  ")"
    

  37. BodyContinuousTree() ::= FinalCT() | ExpansionCT()
    

  38. FinalCT() ::= DensityDeclaration() ";"
    

  39. ExpansionCT() ::= <CASE>  ( <WORD> | <STRING> )
                     (  ( "(" FloatsToVector() ")" 
                            "{" ListContinuousOptions(T) "}"
                        ) |
                        (
                           "{" ListDiscreteOptions(T) "}"
                        )
                     )
    

  40.   
    BodyTree() ::=  (<FLOAT>";") | (<CASE> <WORD> "{" ListOptions() "}" )
    

  41.   
    ListOptions() ::= (Option())* (DefaultAssignment()";")? (Option())*
    

  42. ListContinuousOptions() ::= (ContinuousOption(T))*
    

  43. ListDiscreteOptions() ::= (DiscreteOption(T))*
    

  44. DiscreteOption() ::= (<WORD>|<STRING>|<BOOLEAN>|Q=<DECIMAL_LITERAL>) 
                          <EQUAL> BodyContinuousTree()
    

  45. ContinuousOption() ::= <DECIMAL_LITERAL><EQUAL> BodyContinuousTree()
    

  46.   
    Option() ::= (<WORD>|<DECIMAL_LITERAL>) <EQUAL> BodyTree()
    

  47. DensityDeclaration() ::= DensityElement() (("+"|"-")? DensityElement())*
    

  48. DensityElement() ::= (   
                           (<FLOAT>|<FLOATSCI>|<INTEGER>)
                           ("*")? <EXP>
                           "(" LinearFunctionDeclaration() ")"
                         ) | 
                         (
                           <EXP>
                           "(" LinearFunctionDeclaration() ")"
                         ) |
                         (
                           <FLOAT>|<FLOATSCI>|<INTEGER>
                         )
    

  49. LinearFunctionDeclaration() ::= ("-")? ElementLinear() 
                                    ( ("+"|"-")? ElementLinear() )*
    

  50. ElementLinear() ::=
      ( (Q=<FLOAT>|Q=<FLOATSCI>|Q=<INTEGER>)
          
        (
          "*")? ( Q=<WORD>|Q=<STRING> )
        ) |
        (
          (Q=<WORD>|Q=<STRING>)   
        )
    

  51. ListWords() ::= ((<WORD>|<DECIMAL_LITERAL>|<PARAMETER_WORD>) 
                                               <COMMA> ListWords())|
                    ((<WORD>|<DECIMAL_LITERAL>|<PARAMETER_WORD>) 
                                               ListWords())|
                    (<WORD>|<DECIMAL_LITERAL>|<PARAMETER_WORD>)
    


next up previous
Up: Elvira Specification Format Previous: 3 Tokens of the
Andrés Cano 2001-03-01