/**
 * @version     Last modified on Fri May 24 10:10:14 2002 by hak
 * @author      <a href="mailto:hak@ilog.fr">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; 2002 <a href="http://www.ilog.fr/">ILOG, S.A.</a>

This directory contains the Javadoc'ed source code for the files comprising
the package <tt>ilog.language.design.types</tt>. This documentation file
(<tt>READ_ME_types.java</tt>) acts as an additional repository of comments
in addition to the more specific ones in the individual files. It should
best contain generic information or yet-to-be sorted out specifications of
planned, or to-be-completed, designs. It also may outline, and/or add to, on-going
documentation of implemented features.

*/

/**

The type system consists of two complementary parts: a <i>static</i> and a
<i>dynamic</i> part. The former takes care of verifying all type
constraints that are statically decidable (<i>i.e.</i>, before actually
running the program). The latter pertains to type constraints that must
wait until execution time to decide whether those (involving runtime
values) may be decided. This is called dynamic type-checking and is best
seen (and conceived) as an <i>incremental</i> extension of the static
part.  The complete outline of the type system as it exists at this
writing is as follows.

<p><ol indextype="A">
<li> <b><a href="#The static type system">The static type system</a></b>
  <p><ol>
  <li> <b><a href="#primitive types">primitive types</a></b>
    <p><ol>
    <li> <b><a href="#Boxable types">Boxable types</a></b>
      <p><ol>
      <li> <b><a href="#void"><tt>void</tt></a></b>
      <li> <b><a href="#int"><tt>int</tt></a></b>
      <li> <b><a href="#real"><tt>real</tt></a></b>
      <li> <b><a href="#char"><tt>char</tt></a></b>
      <li> <b><a href="#boolean"><tt>boolean</tt></a></b>
      </ol><p>
     <li> <b><a href="#Boxed types">Boxed types</a></b>
      <p><ol>
      <li> <b><a href="#string"><tt>string</tt></a></b>
      <li> <b><a href="#built-in type constants">built-in type constants</a></b>
      </ol><p>
    </ol><p>
  <li> <b><a href="#type constructors">type constructors</a></b>
    <p><ol>
    <li> <b><a href="#function types">function types</a></b>
    <li> <b><a href="#tuple types">tuple types</a></b>
       <p><ol>
       <li> <b><a href="#position tuple types">position tuple types</a></b>
       <li> <b><a href="#named tuple types">named tuple types</a></b>
       </ol><p>
    <li> <b><a href="#array types">array types</a></b>
       <p><ol>
       <li> <b><a href="#int-indexed arrays">0--int-indexed arrays</a></b>
       <li> <b><a href="#int-range-indexed arrays">int-range-indexed arrays</a></b>
       <li> <b><a href="#set-indexed arrays">set-indexed arrays</a></b>
       <li> <b><a href="#multidimensional arrays">multidimensional arrays</a></b>
       </ol><p>
    <li> <b><a href="#set types">set types</a></b>
    <li> <b><a href="#class types">class types</a></b>
    </ol><p>
  <li> <b><a href="#Polymorphic types">Polymorphic types</a></b>
  <li> <b><a href="#Type aliasing">Type aliasing</a></b>
  <li> <b><a href="#Type hiding">Type hiding</a></b>
  </ol><p>
<li> <b><a href="#The dynamic type system">The dynamic type system</a></b>
  <p><ol>
  <li> <b><a href="#Dynamically constrained type">Dynamically constrained type</a></b>
  
  <li> <b><a href="#Extensional types">Extensional types (contract-based types)</a></b>
    <p><ol>
    <li> <b><a href="#Set types">Set types</a></b>
    <li> <b><a href="#Int range types">Int range types</a></b>
    <li> <b><a href="#Float range types">Float range types</a></b>
    <li> <b><a href="#Enum types">Enum types</a></b>
    </ol><p>

  <li> <b><a href="#Boolean-assserted types">Boolean-assserted types</a></b>
  </ol><p>
</ol><p>

*/

/**

<h2><a name="The static type system">The static type system</a></h2>

  <h3><a name="primitive types">primitive types</a></h3>

    <h4><a name="Boxable types">Boxable types</a></h3>

      <li> <b> <tt>void</tt></b>
      <li> <b> <tt>int</tt></b>
      <li> <b> <tt>real</tt></b>
      <li> <b> <tt>char</tt></b>
      <li> <b> <tt>boolean</tt></b>

     <h4><a name="Boxed types">Boxed types</a></h4>

      <h5><a name="string"><tt>string</tt></a></h5>
      <h5><a name="built-in type constants">built-in type constants</a></h5>

  <h3><a name="type constructors">type constructors</a></h3>

    <h4><a name="function types">function types</a></h4>
    <h4><a name="tuple types">tuple types</a></h4>

       <h5><a name="position tuple types">position tuple types</a></h5>
       <h5><a name="named tuple types">named tuple types</a></h5>

    <h4><a name="array types">array types</a></h4>

       <h5><a name="int-indexed arrays">0--int-indexed arrays</a></h5>
       <h5><a name="int-range-indexed arrays">int-range-indexed arrays</a></h5>
       <h5><a name="set-indexed arrays">set-indexed arrays</a></h5>
       <h5><a name="multidimensional arrays">multidimensional arrays</a></h5>

    <h4><a name="set types">set types</a></h4>
    <h4><a name="class types">class types</a></h4>

  <h3><a name="Polymorphic types">Polymorphic types</a></h3>
  <h3><a name="Type aliasing">Type aliasing</a></h3>
  <h3><a name="Type hiding">Type hiding</a></h3>



*/

/**


<h2><a name="The dynamic type system">The dynamic type system</a></h2>

Dynamic types are to be checked, if possible statically (at least
their static part is), at least in two particular places of an expression. Namely,
<ol>
<li>at assignment time; and,
<li>at (function) parameter-binding time.
</ol>
This will ensure that the actual value places in the slot expecting a certain type
does respects additionnal constraints that may only be verified with some runtime values.
Typically, such dynamic parts will be so-called <i>dependent</i> types (such as - <i>e.g.</i>,
array types whose size depends on a fixed size value that may be only computed at runtime).
<p>

From this, we require that a class implementing the <tt>DynamicType</tt> interface provides
a method <tt><b>public boolean</b> verifyCondition()</tt> that is invoked systematically by
code generated for dynamically typed function parameters and for locations that are the
target of updates (<i>i.e</i>, array slot update, object field update, tuple field update)
at compilation of abstractions and various assignment constructs. Of this class, three subclasses
derive their properties:
<p>
<ul>
<li>extensional types;
<li>Boolean-assertion types (of which non-negative number types are instances).
</ul>
 

<p>
We shall consider here a few such dynamic types (motivated esssentially by the need expressed
by OPL types). Namely,
<ul>
<li> extensional types;
<li> non-negative numbers---or more generally, Boolean-assertion types.
</ul>

An <i>extensional</i> type is a type whose elements are determined to be members of
a predetermined and fixed extension (<i>i.e.</i>, any runtime value that denotes a
collection - such as a set, an int range, a float range, or an enumeration). Such
types pose the additional problem of being usable at compile-time to restrict the
domains of other variables. However, some of those variables' values may only fully
be determined at runtime. These particular dynamic types have therefore a simple
<tt>verifyCondition()</tt> method that is automatically run as soon as the
extension is known. It just verifies that the element is a <i>bona fide</i> member
of the extension), otherwise it relies on a more complicated scheme based on the
notion of <i>contract</i>. Basically, a contract-based type is an extensional type
that does not have an extension (as yet) but already carries the obligation that
some particular individual constants be part of their extensions. Those elements
consitute ``contracts'' that must be honored as soon as the type's extension becomes
known (either positively - eliminating the contract, or negatively - causing a type
error).

<h3>The notion of dynamically constrained type (<tt>int+</tt>, <tt>float+</tt>,...)</h3>

<h4>The notion of extensional type</h4>

<h5>Set types</h5>
<h5>Int range types</h5>
<h5>Float range types</h5>
<h5>Enum types</h5>

<h4>The notion of boolean-assserted type</h4>

 */
