a draft specification for HAB level 2
version 0.5.0.pre1 (1999, january, 3)
by Mathieu Bouchard

1. Contextual Standards

1.1. the HAB level 1 "standard", expressed in the document describing
the DULLL 0.5.0 format.

2. Purpose

This describes the conventions and specifications for type-names,
type-constraints, and document-type-definitions (DTD).

3. Type Names

Simple types and composite-types share the same namespace system as
Composite types, except for the list.

3.1. Simple Types

Simple type names begin with a lowercase. (should scrap this rule)

3.1.1. the "text" type is the only built-in simple type apart from list.

3.1.2. the "list" simple type is special and not available as a type-name.

3.2. Canonical Composite Types

Composite type names begin with an uppercase. (should scrap this rule)

3.2.1. the "List" type is different from the "list" type that doesn't
exist as a name. the "List" type is a composite type without
contraints, or rather, with a null constraint. 

        [1] List contains (Any)*.

3.2.2. the "Nil" type has a full constraint, and therefore never has
any sub-elements.

        [2] Nil contains ().

4. Type Constraints On Composite Types.

4.1. Composite Types "can enforce" proper typing of subelements.

4.2. a composite's constraint definition has two parts: the Tuple
and the Rest.

4.2.1. the Tuple definition.

an exact number of mandatory subelements, each of which has a name
and a type constraint.

4.2.2. the Rest constraint.

a constraint on the amount of Rest elements and the type of those.
the only supported amounts for now are: zero, and any. The elements
of the rest are not given names. (0-based ordinality would be fine).

4.3. Document Type Definitions.

4.3.1. Composite Type Definitions.

        [3] name is-a text.
        [4] define-composite contains name tuple rest.
        [5] tuple contains tuple-element+.
        [6] tuple-element contains name constraint.
        [7] rest contains rest-size constraint.
        [8] rest-size is-a (zero|unbounded).
        [9] zero is-a ().
        [10] unbounded is-a ().
        [11] constraint is-a (name|nil).

Some other restrictions are not expressed in the formal rules. For
example, [11]'s text must refer to a real type name.

4.3.2. Group Definitions.

a Group Name is a name representing a choice among a set of types
and/or groups. It serves a purpose similar to "union" in C, the
pipe in EBNF and RE, etc.

        [12] define-group contains name (name)*.

4.3.3. Typespace Definitions.

a Typespace Name is a name representing a particular set of type
definitions and a document type definition.

        [13] define-typespace contains name tuple rest (dtd-element)+.
        [14] dtd-element is-a
                (define-composite | define-group | define-typespace).

5. Miscellaneous.

5.1. TODO

5.2. Any questions and/or suggestions shall be directed to the webmaster
of http://hybris.netpedia.net/, which is matju@cam.org right now.
>>> NITPICKING IS ENCOURAGED <<<.

