<?xml version="1.0"?>


<!-- We consider in this file arithmetic expressions using binary
encoding of positive integers, addition and mutliplication (that are
associatives).


The grammar is the following (initial symbol is F)
0,1 are digit
N generates bit strings
A generates the expressions begining by + (addition)
M generates the expressions begining by * (multiplication)


F -> N | A | M
N -> Seq_conc(D)
A -> Seq_add(nonA) 
M -> Seq_mult(nonM)
D -> 0 | 1 

-->




<!DOCTYPE specification SYSTEM "seed.dtd">


<specification>
  <start idref="All"/> 

  <union id="All"> <!-- defintion of a Peano expression-->
    <child idref="N"/> <!-- either an integer -->
    <child idref="M"/> <!-- or the product of two expressions-->
    <child idref="A"/><!-- or the addition of two expressions-->
  </union> 

  <constants id="D"> <!-- digits-->
    <symbol value="0"/>
    <symbol value="1"/>
  </constants>

  <sequence id="N"> <!-- defintion  of numbers -->
    <symbol value="int"/>
    <child idref="D"/>
  </sequence>


  <union id="nonM"> <!-- definition of non-mutliplicative expressions -->
    <child idref="D"/>
    <child idref="A"/>
  </union>
  
  <union id="nonA"> <!-- definition of non-additive expressions -->
    <child idref="D"/>
    <child idref="M"/>
  </union>


  <sequence id="M"> <!-- defintion  of multiplicative expressions -->
    <symbol value="*"/>
    <child idref="nonM"/>
  </sequence>


  <sequence id="A"> <!-- defintion  of additive expressions -->
    <symbol value="+"/>
    <child idref="nonA"/>
  </sequence>


</specification>

