<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href='http://gres.uninova.pt/iopt-flow/show-pf.xsl' type='text/xsl' ?>
<net name="sample" type="iopt-flow">
  <place id="p1" x="465" y="90" init_marking="0">
    <name off_x="-10" off_y="-10" text="P7"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <place id="p2" x="338" y="164" init_marking="1">
    <name off_x="-10" off_y="-10" text="P1"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <place id="p3" x="272" y="313" init_marking="0">
    <name off_x="-10" off_y="-10" text="P2"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <place id="p4" x="404" y="313" init_marking="0">
    <name off_x="-10" off_y="-10" text="P4"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <place id="p5" x="272" y="437" init_marking="0">
    <name off_x="-10" off_y="-10" text="P3"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <place id="p6" x="404" y="442" init_marking="0">
    <name off_x="-10" off_y="-10" text="P5"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <place id="p7" x="465" y="505" init_marking="0">
    <name off_x="-10" off_y="-10" text="P6"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <transition id="t8" x="272" y="379" priority="0">
    <name off_x="-10" off_y="-10" text="T3"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </transition>
  <transition id="t9" x="338" y="91" priority="0">
    <name off_x="-10" off_y="-10" text="T1"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </transition>
  <transition id="t10" x="335" y="235" priority="0">
    <name off_x="-10" off_y="-10" text="T2"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </transition>
  <transition id="t11" x="404" y="380" priority="0">
    <name off_x="-10" off_y="-10" text="T4"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </transition>
  <transition id="t12" x="337" y="506" priority="0">
    <name off_x="-10" off_y="-10" text="T5"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </transition>
  <transition id="t13" x="466" y="225" priority="0">
    <name off_x="-10" off_y="-10" text="T6"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </transition>
  <arc id="a14" type="normal" source="t9" target="p2"/>
  <arc id="a15" type="normal" source="p2" target="t10"/>
  <arc id="a16" type="normal" source="t10" target="p3"/>
  <arc id="a17" type="normal" source="t10" target="p4"/>
  <arc id="a18" type="normal" source="p4" target="t11"/>
  <arc id="a19" type="normal" source="t11" target="p6"/>
  <arc id="a20" type="normal" source="p6" target="t12"/>
  <arc id="a21" type="normal" source="p3" target="t8"/>
  <arc id="a22" type="normal" source="t8" target="p5"/>
  <arc id="a23" type="normal" source="p5" target="t12"/>
  <arc id="a24" type="normal" source="t12" target="p7"/>
  <arc id="a25" type="normal" source="p7" target="t13"/>
  <arc id="a26" type="normal" source="t13" target="p1"/>
  <arc id="a27" type="normal" source="p1" target="t9"/>
  <signal id="Input2" x="110" y="89" mode="input" type="boolean" min="0" max="1"/>
  <signal id="Input3" x="107" y="207" mode="input" type="range" min="0" max="100" frac="0" value="0" dynamic="none" io_pin="0"/>
  <signal id="Input4" x="108" y="264" mode="input" type="range" min="0" max="100" frac="0" value="0" dynamic="none" io_pin="0"/>
  <event id="InEvent" x="105" y="381" mode="input"/>
  <signal id="Output1" x="715" y="165" mode="output" type="boolean" min="0" max="1"/>
  <signal id="Counter" x="710" y="280" mode="output" type="range" min="0" max="1023" frac="0" value="0" dynamic="none" io_pin="0"/>
  <event id="OutEvent" x="710" y="225" mode="output"/>
  <arc id="a35" type="read" source="Input2" target="t9"/>
  <arc id="a36" type="read" source="InEvent" target="t8"/>
  <arc id="a41" type="read" source="t13" target="OutEvent"/>
  <arc id="a48" type="read" source="p2" target="Output1"/>
  <signal id="Input1" x="108" y="27" mode="input" type="boolean" min="0" max="1"/>
  <signal id="Output2" x="709" y="35" mode="output" type="boolean" min="0" max="1"/>
  <operation id="o1" x="568" y="34" rot="0" shape="arrow" size="24">
    <name off_x="-10" off_y="-20" text="Out"/>
    <input off_x="-24" off_y="-8" name="Input1" id="o1.Input1" type="boolean" min="0" max="1"/>
    <input off_x="-24" off_y="8" name="p1" id="o1.p1" type="boolean"/>
    <output off_x="24" off_y="0" name="out" id="o1.out">
      <expression>
        <operand type="signal" idRef="Input1"/>
        <operator type="when"/>
        <operand type="signal" idRef="p1"/>
        <text>Input1 WHEN (p1)</text>
      </expression>
      <expression>
        <operand type="literal" value="0"/>
        <text>0 OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a2" type="read" source="Input1" target="o1.Input1"/>
  <arc id="a3" type="read" source="p1" target="o1.p1"/>
  <arc id="a4" type="read" source="o1.out" target="Output2"/>
  <operation id="o5" x="230" y="235" rot="0" shape="arrow" size="24">
    <name off_x="-15" off_y="-20" text="Guard"/>
    <input off_x="-24" off_y="-8" name="Input3" id="o5.Input3" type="boolean" min="0" max="1"/>
    <input off_x="-24" off_y="8" name="Input4" id="o5.Input4" type="boolean" min="0" max="1"/>
    <output off_x="24" off_y="0" name="out" id="o5.out">
      <expression>
        <operand type="signal" idRef="Input3"/>
        <operator type="less"/>
        <operand type="signal" idRef="Input4"/>
        <text>Input3 &lt; Input4</text>
      </expression>
    </output>
  </operation>
  <arc id="a6" type="read" source="Input4" target="o5.Input4"/>
  <arc id="a7" type="read" source="Input3" target="o5.Input3"/>
  <arc id="a8" type="read" source="o5.out" target="t10"/>
  <operation id="o9" x="625" y="370" rot="0" shape="arrow" size="32">
    <name off_x="-5" off_y="-25" text="Cnt"/>
    <input off_x="-32" off_y="-16" name="Counter" id="o9.Counter" type="boolean" min="0" max="1"/>
    <input off_x="-32" off_y="0" name="Inc" id="o9.Inc" type="event" min="0" max="1" frac="0"/>
    <input off_x="-32" off_y="16" name="Dec" id="o9.Dec" type="event" min="0" max="1" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o9.out">
      <expression>
        <operand type="signal" idRef="Counter" delay="1"/>
        <operator type="add"/>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="signal" idRef="Inc"/>
        <text>Counter[-1] + 1 WHEN (Inc)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="Counter" delay="1"/>
        <operator type="sub"/>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="signal" idRef="Dec"/>
        <text>Counter[-1] - 1 WHEN (Dec)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="Counter" delay="1"/>
        <text>Counter[-1]</text>
      </expression>
    </output>
  </operation>
  <arc id="a10" type="read" source="o9.out" target="Counter"/>
  <arc id="a11" type="read" source="Counter" target="o9.Counter"/>
  <arc id="a12" type="read" source="t10" target="o9.Inc"/>
  <arc id="a13" type="read" source="t12" target="o9.Dec"/>
</net>
