<?xml version="1.0" encoding="UTF-8"?>
<!--
  for SGML validation, use this first line instead:
  <!DOCTYPE grammar PUBLIC "-//thaiopensource//DTD RNG 20010705//EN" "">
 -->

<grammar
  xmlns="http://relaxng.org/ns/structure/1.0"
  xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">

  <a:documentation>
    EPNML 1.1 label conventions - RELAX NG implementation
    version: $Id: conv.rng,v 1.6 2004/07/28 19:48:28 pnml Exp $
    (c) 2003, Technische Universiteit Eindhoven
        JMEM van der Werf, jmw@petriweb.org
        some editing by R. Post, rp@petriweb.org
     human-readable documentation:
        EPNML 1.1 - an XML format for Petri nets
        http://www.petriweb.org/specs/epnml-1.1/pnmldef.pdf
  </a:documentation>

  <a:documentation>
    We use the standard annotations and conventions of PNML,
    by including them directly.
  </a:documentation>
  <include href="http://www.informatik.hu-berlin.de/top/pnml/conv.rng"/>

  <a:documentation>
    In EPNML a net can have a position, this because we see
    an PNML document as a container of nets; however it can also have
    a dimension without a position, unlike nodes (and unlike pages).
    It cannot have fill or line attributes,although it would be conceivable
    to specify default values in this way.
    For this reason we cannot invoke the nodegraphics.content definition.
  </a:documentation>
  <define name="netgraphics.content" combine="interleave">
    <optional>
    <interleave>
      <optional>
      <ref name="position.element"/>
      </optional>
      <optional>
        <ref name="dimension.element"/>
      </optional>
    </interleave>
    </optional>
  </define>

  <define name="common.labels">
    <a:documentation>
      We use some different common labels:
        *) Name
        *) Description
        *) Graphics. But this is already in basicPNML.
      Everything already has a name, because it's defined in the conv.rng doc.
      See [1], section 9
    </a:documentation>
    <interleave>
      <optional>
        <ref name="Name"/>
      </optional>
      <optional>
        <ref name="Description"/>
      </optional>
    </interleave>
  </define>


  <define name="Description">
    <a:documentation>
      The name of an element, has element text in it, just like name.
      See [1], section 9.3
    </a:documentation>
    <element name="description">
      <ref name="simpletextlabel.content"/>
    </element>
  </define>
  
  <define name="place.type">
    <a:documentation>
      The type of a place is either a channel (common) or a store.
      See [1], section 5
    </a:documentation>
    <element name="type">
      <element name="text">
        <choice>
          <value>channel</value>
          <value>store</value>
        </choice>
      </element>
    </element>
  </define>


  <define name="transition.type">
    <a:documentation>
      The type of a transition is AND (common) or XOR.
      See [1], section 6
    </a:documentation>
    <element name="type">
      <element name="text">
        <choice>
          <value>AND</value>
          <value>XOR</value>
        </choice>
      </element>
    </element>
  </define>


  <define name="Transformation">
    <a:documentation>
      A transition also has a transformation: it defines what a transition does.
    </a:documentation>
    <element name="transformation">
      <ref name="simpletextlabel.content"/>
    </element>
  </define>


  <define name="arc.type">
    <a:documentation>
      An arc has a type with some more possibilities:
      See [1], section 7
    </a:documentation>
    <element name="type">
      <element name="text">
        <choice>
          <value>C</value>
          <value>R</value>
          <value>U</value>
          <value>D</value>
          <value>inhibitor</value>
<!-- emergency hack, rp 17 may 2006; this is *not* EPNML 1.1 -->
          <value></value>
          <value>CR</value>
          <value>CU</value>
          <value>CD</value>
          <value>RU</value>
          <value>RD</value>
          <value>UD</value>
          <value>CRU</value>
          <value>CRD</value>
          <value>CUD</value>
          <value>RUD</value>
          <value>CRUD</value>
          <value>reset</value>
<!-- end of emergency hack, rp 17 may 2006 -->
        </choice>
      </element>
    </element>
  </define>


  <define name="ArcInscription">
    <a:documentation>
      The inscription of an arc (not implemented in PNML)
      See [1], section 7
    </a:documentation>
    <element name="inscription">
      <ref name="simpletextlabel.content"/>
    </element>
  </define>
</grammar>
