<tree>

<tree> 根,内部ノード,葉,矢(または辺)から成る木を示す. [19.2 Trees]
モジュールnets — 19 Graphs, Networks, and Trees
属性att.global (@xml:id, @n, @xml:lang, @rend, @rendition, @xml:base, @xml:space) (att.global.linking (@corresp, @synch, @sameAs, @copyOf, @next, @prev, @exclude, @select)) (att.global.analytic (@ana)) (att.global.facs (@facs)) (att.global.change (@change))
arity 木構造における,根や内部ノードが持つ子供の最大数を示す.
状態 任意
データ型

<rng:ref name="data.count"/>
data.count
A nonnegative integer.
ord (ordered) 当該木構造が,順序付き木,または半順序付き木であるかどうかを示す.
状態 必須
データ型

<rng:ref name="data.enumerated"/>
data.enumerated
正当な値:
true
木構造中の全ノードは,順序付きであることを示す. [初期値]
partial
木構造中のノードの一部は順序付きであるが,一部は順序付きでは ないことを示す.
false
木構造の全ノードは,順序付きではないことを示す.
order 木構造の順番を示す.例えば,ノードの番号を示す.
状態 任意
データ型

<rng:ref name="data.count"/>
data.count
A nonnegative integer.
解説
木構造中の辺数(サイズ)は,常にノード数(オーダー)より1少ない. 従って,属性sizeorderの2つは必要ない.
当該モジュールを使用するもの
上位
下位
core: label
宣言

<rng:element name="tree">
 <rng:ref name="att.global.attributes"/>
 <rng:ref name="att.global.linking.attributes"/>
 <rng:ref name="att.global.analytic.attributes"/>
 <rng:ref name="att.global.facs.attributes"/>
 <rng:ref name="att.global.change.attributes"/>
 <rng:optional>
  <rng:attribute name="arity">
   <rng:ref name="data.count"/>
  </rng:attribute>
 </rng:optional>
 <rng:attribute name="ord" a:defaultValue="true">
  <rng:choice>
   <rng:value>true</rng:value>
   <rng:value>partial</rng:value>
   <rng:value>false</rng:value>
  </rng:choice>
 </rng:attribute>
 <rng:optional>
  <rng:attribute name="order">
   <rng:ref name="data.count"/>
  </rng:attribute>
 </rng:optional>
 <rng:group>
  <rng:optional>
   <rng:ref name="label"/>
  </rng:optional>
  <rng:group>
   <rng:zeroOrMore>
    <rng:choice>
     <rng:ref name="leaf"/>
     <rng:ref name="iNode"/>
    </rng:choice>
   </rng:zeroOrMore>
   <rng:ref name="root"/>
   <rng:zeroOrMore>
    <rng:choice>
     <rng:ref name="leaf"/>
     <rng:ref name="iNode"/>
    </rng:choice>
   </rng:zeroOrMore>
  </rng:group>
 </rng:group>
</rng:element>
element tree
{
   att.global.attributes,
   att.global.linking.attributes,
   att.global.analytic.attributes,
   att.global.facs.attributes,
   att.global.change.attributes,
   attribute arity { data.count }?,
   attribute ord { "true" | "partial" | "false" },
   attribute order { data.count }?,
   ( label?, ( ( leaf | iNode )*, root, ( leaf | iNode )* ) )
}
<tree
  n="ex2"
  arity="2"
  ord="partial"
  order="13">

 <root xml:id="G-div1" children="#G-plu1 #G-exp1" ord="true">
  <label>/</label>
 </root>
 <iNode
   xml:id="G-plu1"
   children="#G-exp2 #G-exp3"
   parent="#G-div1"
   ord="false">

  <label>+</label>
 </iNode>
 <iNode
   xml:id="G-exp1"
   children="#G-plu2 #G-num2.3"
   parent="#G-div1"
   ord="true">

  <label>**</label>
 </iNode>
 <iNode
   xml:id="G-exp2"
   children="#G-vara1 #G-num2.1"
   parent="#G-plu1"
   ord="true">

  <label>**</label>
 </iNode>
 <iNode
   xml:id="G-exp3"
   children="#G-varb1 #G-num2.2"
   parent="#G-plu1"
   ord="true">

  <label>**</label>
 </iNode>
 <iNode
   xml:id="G-plu2"
   children="#G-vara2 #G-varb2"
   parent="#G-exp1"
   ord="false">

  <label>+</label>
 </iNode>
 <leaf xml:id="G-vara1" parent="#G-exp2">
  <label>a</label>
 </leaf>
 <leaf xml:id="G-num2.1" parent="#G-exp2">
  <label>2</label>
 </leaf>
 <leaf xml:id="G-varb1" parent="#G-exp3">
  <label>b</label>
 </leaf>
 <leaf xml:id="G-num2.2" parent="#G-exp3">
  <label>2</label>
 </leaf>
 <leaf xml:id="G-vara2" parent="#G-plu2">
  <label>a</label>
 </leaf>
 <leaf xml:id="G-varb2" parent="#G-plu2">
  <label>b</label>
 </leaf>
 <leaf xml:id="G-num2.3" parent="#G-exp1">
  <label>2</label>
 </leaf>
</tree>
解説
根がひとつ,,0以上の内部ノード,複数の葉.但し,内部ノードが1つの 場合は,葉は1つになる.