BNF Symmetric Nets with Bags

For questions regarding the syntax, please contact Maximilien Colange, Fabrice Kordon, or Yann Thierry-Mieg.

The presentation of the syntax is divided in four parts:

  • The declaration attribute,
  • The arc valuation attribute,
  • The transition guards attribute,
  • The place marking attribute.

A precise (and formal) definition can be found here for Symmetric Nets with bags:

Grammar: Basic Elements

The grammar is presented as a Backus-Naur form.

First of all, let us define some elements of the grammar:

        <Integer> ::= any sequence of numeric character
<PositiveInteger> ::= any sequence of numeric character which value > 0
 <NaturalInteger> ::= any sequence of numeric character which value ≥ 0
      <Identifier> ::= any sequence of character starting with a non numeric character
       <Interval> ::= <Integer> .. <Integer>

Keywords are presented like this; they are case insensitive.

Grammar for the Declaration Attribute

This attribute allows one to declare color types. There are several possibilities in the implementation of Symmetric Nets with Bags :

  • Basic types (integer ranges or enumerations),
  • cartesian product of these types,
  • bags of these types.

Please note that bag-types can be part of cartesian products. There is also the possibility to define explicit equivalence classes.

<Declaration> ::= <ClassSection>
                  [<EquivalenceSection>]
                  [<DomainDeclaration>]
                  <VariableSection>

Declaration of Color Classes (Basic Color Types)

         <ClassSection> ::= class <ListClassDeclarations>
<ListClassDeclarations> ::= <ClassDeclaration> |
                            <ListClassDeclarations> <ClassDeclarations>
     <ClassDeclaration> ::= <ListClassNames> is [circular] <ClassDescription>;
       <ListClassNames> ::= <ClassIdentifier> |
                            <ListClassNames> <ClassIdentifier>
       <ClassIdentifier> ::= <Identifier>
     <ClassDescription> ::= <interval> | [<ListElements>]
         <ListElements> ::= <Identifier> |
                            <ListElements>, <Identifier>

Declaration of Equivalence in Color Classes

    <EquivalenceSection> ::= equivalence <ListEquivDeclarations>
 <ListEquivDeclarations> ::= <EquivDeclaration> |
                             <ListEquivDeclarations> <EquivDeclaration>
      <EquivDeclaration> ::= in <ClassIdentifier> : <ListInterval>;
          <ListInterval> ::= <NamedInterval> |
                             <ListInterval>, <NamedInterval>
         <NamedInterval> ::= <Identifier> is <IntervalDefinition>
     <IntervalDefinition> ::= <interval> | Integer

Declaration of Color Domains (Composition of Color Classes)

         <DomainSection> ::= domain <ListDomainDeclarations>
<ListDomainDeclarations> ::= <DomainDeclaration> |
                             <ListDomainDeclarations> <DomainDeclaration>
     <DomainDeclaration> ::= <ListDomainNames> is <DomainDescription>;
       <ListDomainNames> ::= <DomainIdentifier> |
                             <ListDomainNames> <DomainIdentifier>
       <DomainIdentifier> ::= <Identifier>
     <DomainDescription> ::= <ProductDefinition> |
                             <BagDefinition>
      <ProductDefinition> ::= <ComponentList>
         <ComponentList> ::= <Component> |
                             <ComponentList>, <Component>
             <Component> ::= <ClassIdentifier> |
                             <DomainIdentifier>
          <BagDefinition> ::= bag (<ClassIdentifier>

Declaration of variables

         <VariableSection> ::= var <ListVariableDeclarations>
<ListVariableDeclarations> ::= <VariableDeclaration> |
                               <ListVariableDeclarations> <VariableDeclaration>
     <VariableDeclaration> ::= <ListVariableNames> in [unique] <Component>;
       <ListVariableNames> ::= <VariableIdentifier> |
                               <ListVariableNames>, <VariableIdentifier>
       <VariableIdentifier> ::= <Identifier>

Grammar for Arc Valuations

             <ArcLabel> ::= <ListElementaryExpr> |
                            <PositiveInteger>
   <ListElementaryExpr> ::= <ElementaryExpression> |
                            <ElementaryExpression> + <ElementaryExpression> |
                            <ElementaryExpression> - <ElementaryExpression>
 <ElementaryExpression> ::= <ElementaryProduct> |
                            <Coefficient> * <ElementaryProduct>
            <Coefficient> ::= <PositiveInteger> |
                            ord (<VariableIdentifier>) |
                            ord (<ClassIdentifier>.<LitteralValue>)
    <ElementaryProduct> ::= <ListProdElements>
     <ListProdElements> ::= <ListProdElements> |
                            <ListProdElements>, <ProdElement>
          <ProdElement> ::= <ElementaryExpression> |
                            <VarClassElement> |
                            <SimpleBagOperators> |
                            <RecursiveBagOperators>
      <VarClassElement> ::= <VariableIdentifier> |
                            <ClassIdentifier>.<LitteralValue> |
                            <VariableIdentifier>++<PositiveInteger> |
                            <VariableIdentifier>--<PositiveInteger> |
                            <ClassIdentifier>.all
        <LitteralValue> ::= <Integer> | <Identifier>
   <SimpleBagOperators> ::= {<VariableIdentifier>}
<RecursiveBagOperators> ::= <VarClassElement> |
                            (<RecursiveBagOperators>) |
                            <RecursiveBagOperators> <BagOperation> <RecursiveBagOperators> |
                            <SimpleBagOperators> |
                            ~<RecursiveBagOperators>
         <BagOperation> ::= union | inter | diff

Grammar for Transition Guards

  <TransitionGuard> ::= true | false | [ <Guard> ]
            <Guard> ::= not <Guard> |
                        (<Guard>) |
                        <Guard> and <Guard> |
                        <Guard> or <Guard> |
                        <GuardOperand> <RelOperation> <GuardOperand> |
                        unique (<GuardOperand>) |
                        card (<GuardOperand>) <RelOperation> <NaturalInteger>|
                        <VariableIdentifier> in <ClassIdentifier>|
                        <SimpleBagOperators> <InclusionOperator> <SimpleBagOperators>
     <GuardOperand> ::= <VarClassElement> |
                        <SimpleBagOperators>
     <RelOperation> ::= = | <> | < | > | <= | >=
<InclusionOperator> ::= included | strictincluded

Grammar for Place Marking

<InitialMarking> ::= <Marking> |
                     <InitialMarking> <Marking>
       <Marking> ::= <ElementaryProduct> |
                     <PositiveInteger> * <ElementaryProduct>