Known bugs
----------

- pattern matching algorithm doesn't distinguish between an empty match and 
  a non-existent match. At this time this is a not really a bug or a problem, 
  only the side effect of an implementative solution

To do
-----
- fully document the code with JavaDoc comments
- change the comment of normalization!
- refine examples, first of all Simple.xre, too complex just now to be
  named "simple" :)
  I thought to the following examples:
  TUTORIAL
  1) Seq.xre - show a simple "import root[a[],String,b[String],String]" clause
  2) Alt.xre - add alternatives in patterns and typedefs
  3) Typesw.xre - operators in patterns + typeswitch + "default:" clause
  4) Checks.xre - refined output, export type
  5) Errors.xre - the current one 
  COMPLEX EXAMPLES
  6) GetFirstTel.xre - the current Addrbook.xre
  7) SearchBook.xre - search a book with an unique id (Ambig.ps page 5)
  DEBUG EXAMPLES
  1) show the problem of exact output type
  2) difference test
  3) intersection test
  4) output check test
  5) ambiguity check test
  ...

Tests
-----
- test the "program file not found" case 
- compile a list of errors. Make all possible tests
- ensure that disconnectedness and checkLinearity work well
- "too much errors" handling is correct now? If I remember well there is 
  a problem with it
- check if there are bugs in the translation process from external to
  internal patterns! I'm not sure that all bugs are removed
- To find bugs in the code:
  1 - check that all searches in the symbol table are correctly performed.
  2 - verify all TODO notes in the code 
- check type name as root node in a pattern (it's better in 2 patterns)

Doubt proposals
---------------
? The second parameter optional to make the run-time phase optional?
? rewrite prepareDistribution.bat. It should compile also the Javadoc 
  documentation and it could be written with Ant
? write scripts also for Unix?
? symtab.jjtmReplaceSubtree(parent,oldNode,newNode) ?
? replace String with string (Java has String)
? 3 errors verbosity levels
  less: 1 row
  normal: the normal message as now
  more: the normal message + the stack of calls
? more information for linearity errors (without sacrifice speed).
? allow to merge the command line options togheter (-vd) as the Posix
  conventions would require
? "||" operator for the first-match semantics (like XDuce).
? allow "~" or any other symbol for "any match" (simple pattern optimization)?

To do for version 0.13?
-----------------------
- to let output check work I must implement the building of expression
  automata. They're the same as type/pattern automata but they have
  variables: I need to change BuildTA of TASimple for this
- another problem to resolve to implement output type check are
  subtrees of expressions: I cannot normalize expressions as run-time
  algorithms need expressions not normalized. A solution could be duplicate
  expressions on another vector of the symbol table, normalize these copies
  and create automata from these copies (but I've not the time to do this)

Never to do
-----------
- when I create a new pattern in the internalization algorithm check that is
  not already present (allow duplication when they're in different scopes,
  this is for variables) (I've made a little optimization but there are
  problem with original / desugared form)
- change empty type/pattern from the single token "()" to the double
  token "(" ")" - problems

Optimization techniques:
? tree hashing (Hosoya calls it "a sort of hash consing")
  Pay attention to the fact that 2 subtrees can seem actually identical
  when in fact they're different. I think to subpatterns with identical
  variable names that are actually different variables (because they're
  in different scopes)!

A big proposal
--------------
(a complete restyling of the language)

- compilation of static part to XML?
- one only command line argument: the program name. User can specify "-"
  to read it from the standard input like a pipe. "--" (end of
  arguments) supported.
  Options: -d/--debug, -v/--verbose, -h/--help, -t/--times
  -h writes out an extended help string.
- I would like introduce channels, recursive functions (and function
  calls), iterative and conditional statements, and constant 
  assignments.
  Furthermore I would like replace "import" with loadXML(String filename),
  take printf for the standard console and maybe add saveXML().
  The main() should return a type so that main() is typed.
  Also I would line add x.rcv(P) and x.send(E).. ok this is the same
  like integrate my work together with the work of Paolo :)
