Warnier/Orr Diagrams with DraTEX

Eitan M. Gurari

June 29, 2000
Abstract

This document describes the features of a style file wotree.sty, for drawing Warnier/Orr diagrams in TEX-based documents with the DraTex.sty and AlDraTex.sty packages. The style file and the documentation are also available in zipped format.

Contents

1 The Features
2 Examples
3 Copyright Note
4 Sources of Background Information and Examples

1 The Features

A Warnier/Orr diagram is requested by a command of the following form.

\WOTree{nodes}
The nodes should be listed in a pre-ordered manner, subject to the following constraints (see also Figure 1).
  1. A non-leaf node should be grouped together with its children, between curly braces ‘{’ and ‘}’.
  2. Entries within each group should be separated by commas.
  3. Commas and round parentheses ‘(’ and ‘)’ within the nodes should be enclosed by curly braces.

                  |
          |       ||\1.1.1.1
          ||\1.1.1 -|
   |     -|       ||\1.1.1.2
   ||\1.1   ||\1.1.2  |
   |      ||\1.1.3 -||\1.1.3.1
   |              ||\1.1.3.2
1 -|      |       |
   |      ||\1.2.1 - |\1.2.1.1
   ||\1.2  -|
   |      ||\1.2.2
    |\1.3
 1
 1.1
 1.1.1
 1.1.1.1
 1.1.1.2
 1.1.2
 1.1.3
 1.1.3.1
 1.1.3.2
 1.2
 1.2.1
 1.2.1.1
 1.2.2
 1.3
 1,
   {
   1.1,
       {
       1.1.1,
            1.1.1.1,
            1.1.1.2
       },
       1.1.2,
       {
       1.1.3,
            1.1.3.1,
            1.1.3.2

       }
   },
   {
   1.2,
       {
       1.2.1,
            1.2.1.1
       },
       1.2.2
   },
   1.3
(a) (b) (c)
Figure 1: (a) A diagram. (b) Pre-ordered listing of the nodes. (c) Braces and commas.

As is the case for the parameters of other types of nodes of AlDraTEX, spaces may be requested by tilde character ‘~’, line breaks by the double-tilde characters ‘~~’, horizontal text shifting by the TEX commands \hfil and \hfill, and execution tracing by the directives \TraceDiagramOn and \TraceDiagramOff.

The spacing between nodes can be altered with the following command, where the dimensions are assumed to be in point units.

\WOSpace{horizontal-space,vertical-space}
Each mode is implicitly prefixed with the command \WO{}, unless it is explicitly prefixed by a \WO{argument} command. The meaning of such commands can be defined with instructions of the form \defWO{argument}{meaning}. The following definitions are built-in within the wotree.sty package.
 \defWO{}{\llap{$\triangleright$ }}
 \defWO{not}{\hrulefill~~\WO{}}
 \defWO{or}{~$\bigoplus$}
 \defWO{plus}{~$+$}
 \defWO{xor}{~$\bigotimes$}

2 Examples

Hierarchy / Sequence:

             |
             ||\ child 1
             |
Children   --||\ child 2
             |
             ||\ child 3

 
           \Draw   \WOSpace(10,30)\Large
           \WOTree{
                Children,
                  child ~1,
                  child ~2,
                  child ~3
           }
           \EndDraw
     
Selection:

             |
             ||\ left
             |    o+ 
direction  --|
             |
             ||\ right

 
           \Draw  \WOSpace(10,30)\Large
           \WOTree{
                direction,
                  left, \WO{or}, right
           }
           \EndDraw
     
Complementation:

        |
        ||\ small
        |    o+ 
size  --|
        |  ------
        |
        ||\ small

 
           \Draw  \WOSpace(10,30)\Large
           \WOTree{
                size,
                  small,
                  \WO{or},
                  \WO{not}small
           }
           \EndDraw
     
Repetition:

           |
           ||\ front
           |
           |   (1)
           |
execute  --||\ loop
           |
           |  (2,7)
           |
           ||\ back

 
           \Draw  \WOSpace(10,30)\Large
           \WOTree{
                execute,
                  front\hfill ~~{(1)},
                  loop\hfill ~~{(2,7)},
                  back
           }
           \EndDraw
     
Concurrency:

         |
         ||\ task A
         |
         |   +
tasks  --|
         ||\ task B
         |
         ||\ task C

 
           \Draw  \WOSpace(10,30)\Large
           \WOTree{
                tasks,
                  task~A,
                  \WO{plus},
                  task~B,
                  task~C
           }
           \EndDraw
     

A larger example:

 
       \Draw
       \WOTree{
       Handle\hfill ~~Rankokus\hfill ~~Indian\hfill
                                 ~~Reservation \hfill,
         {
         Initiate\hfill ~~Processing\hfill ~~{(1)},
           Open~ All~ Files\hfill ~~ {(1)},
           {
           Process~ User~ Level\hfill ~~ {(1)},
             {
             General~ User \hfill ~~ {(1)},
       
               Restrict~ Access\hfill ~~ File~ \&~
                    Custom\hfill ~~ Query~ Access \hfill
             },
             \WO{xor},
             Database~ Manager\hfill ~~{(1)}
           }
         },
         {

         Main\hfill ~~Processing\hfill ~~{(N)},
           {
           Process~ File \hfill ~~ Management\hfill
                           ~~ Transaction\hfill ~~{(N)},
             Add,
             \WO{or},
             Delete ,
             \WO{or},
             Modify
           },
           \WO{or},
           {
           Process~ Query \hfill~~ Transaction
                                      \hfill ~~{(N)},
       
             Get~ Query\hfill ~~ {(or)}~ Get\hfill~~
                                Custom~ Query \hfill,
             Search~ Database \hfill,
             Display~ Records~ Req \hfill,
             Perform~ File\hfill ~~ Maintenance~
                    Based\hfill ~~ On~ Query \hfill,
             Print~ Selected\hfill ~~ Records \hfill
           }
         },
         {
         Terminate\hfill ~~Processing\hfill ~~{(1)},
           Close~ All~ Files \hfill ~~{(1)}
         }
       }
       \EndDraw

                        |                                       |
           |            ||\ OpenAllFiles     |                    ||\ RestrictAccess
           ||\ Initiate     |      (1)         ||\ GeneralUser -------|  File& Custom
           |  Processing -|                  |      (1)            |  Query Access
           |     (1)     ||\ ProcessUserLevel |   ox 
           |            |        (1)        |
           |                               ||\ DatabaseManager
           |                               |        (1)
           |                               |
           |                               ||\ Add
           |                               |
           |            |                  |   o+ 
           |            ||\ ProcessFile       |
           |            |  Management -----||\ Delete
Handle     |            |  Transaction       |   o+ 
Rankokus   |            |     (N)          |
Indian     -|            |   o+               |
Reservation  |            |                  ||\ Modify
           ||\ Main      |                  |
           |  Processing -|                  ||\ GetQuery
           |     (N)     |                  |  (or)Get
           |            |                  |  Custom Query
           |            |                  |
           |            |                  ||\ SearchDatabase
           |            ||\ ProcessQuery     ||\ DisplayRecordsReq
           |            |  Transaction   ----|
           |            |      (N)          ||\ PerformFile
           |            |                  |  MaintenanceBased
           ||\ Terminate -||\ CloseAllFiles     |  On Query
           |  Processing  |      (1)         |
           |     (1)                        ||\ PrintSelected
                                           |  Records

3 Copyright Note

The wotree.sty file is provided under the LATEX Project Public License (LPPL). However, it is allowed to modify the file without changing its name, if the signature of the file is modified (see copyright notice within the file).

4 Sources of Background Information and Examples

gurari@cse.ohio-state.edu
http://www.cse.ohio-state.edu/~gurari