<?xml version="1.0"?>


<!-- Peano integers is a unary encoding of integers.  We consider in
this file arthmetic expressions using Peano integers, addition, and
soustraction. The successor of an integer x is denoted s(x) and its
predecessor p(x). We consider that addition and multiplication are
associative and we do not want sub terms of the form s(p(x)) or p(s(x))

The grammar is the following (initial symbol is F)
0 is the null constant
S generates the expressions begining by s
P generates the expressions begining by p
A generates the expressions begining by + (addition)
M generates the expressions begining by * (multiplication)


F -> 0 | S | P | A | M
S -> s(nonP)
P -> p(nonS)
A -> Seq_add(nonA) 
M -> Seq_mult(nonM)


-->




<!DOCTYPE specification SYSTEM "seed.dtd">


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

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

  <constants id="N"> <!-- defintion of 0-->
    <symbol value="0"/>
  </constants>

  <union id="nonP"> <!-- definition of non-predecessor expressions -->
    <child idref="N"/>
    <child idref="M"/>
    <child idref="A"/> 
    <child idref="S"/>
  </union>

  <union id="nonS"> <!-- definition of non-successor expressions -->
    <child idref="N"/>
    <child idref="M"/>
    <child idref="A"/> 
    <child idref="P"/>
  </union>

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

  <unary id="S"> <!-- defintion  of successor expressions -->
    <symbol value="s"/>
    <child idref="nonS"/>
  </unary>

  <unary id="P"> <!-- defintion  of predecessor expressions -->
    <symbol value="p"/>
    <child idref="nonP"/>
  </unary>


  <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>

