============================================================================
Help Pages
============================================================================
EXIT              - Halt program
LIST              - Display the relations loaded.
SOURCES           - Display the sources files available.
PRINT r           - Display the contents of relation r.
DELETE r          - Delete the relation r from the disk.
PROMPT s          - Specify s as the command prompt within LEAP.
@ sourcefile      - Use sourcefile as command file.
+
Algebraic Operators
-------------------
UNION             - Type HELP UNION for syntax and usage.
INTERSECT         - Type HELP INTERSECT for syntax and usage.
DIFFERENCE        - Type HELP DIFFERENCE for syntax and usage.
PRODUCT           - Type HELP PRODUCT for syntax and usage.
PROJECT           - Type HELP PROJECT for syntax and usage.
JOIN              - Type HELP JOIN for syntax and usage.
SELECT            - Type HELP SELECT for syntax and usage.
ASSIGNMENT        - Type HELP ASSIGNMENT.
DISPLAY           - Type HELP DISPLAY for syntax and usage.
+
Miscellaneous Operations
------------------------
CREATE r f1,f2..fn - Create a relation r, with fields f1, f2..fn
CHANGE r          - Change the temporary status of relation r.
DESCRIBE r        - Display the fields associated with relation r.
MEM               - Display the amount of free memory.

NORMAL            - Return the screen mode to 'normal' 80x25 Colour mode.
HIGH              - Set the screen mode to high resolution, 43/50 lines.

STATUS            - Report the status information of LEAP.
DEBUG             - Change the debug setting of LEAP.
INFIX             - Change the evaluation methodology.
TIMING            - Change the timer setting.
USTIME            - Set time format to US/European

HELP n            - Display help page number n (leave blank for all)
                        Where n is either 1,2, or 3.
INFO              - Display warranty and conditions of use.
+
===============================================================================
This program, and all associated files/documentation are
copyright (c) 1994,1995 Richard Leyton.
+
=
# HELP
Help is context sensitive. To bring up help on a particular item type

HELP <item>

For example, to bring up help on the SELECT operator, type:

HELP SELECT

Help also contains cross-references to other help topics, and you can bring
up help on these by typing HELP <topic> - Watch out for spelling mistakes
though!

There is an INDEX of help topics, which you can bring up with HELP INDEX

+
# PROMPT
Usage: prompt s
Operation: Specifies the string s as the prompt to be used within LEAP. All
           prompts are appended with the '>' symbol.
Example:

>prompt LEAP
LEAP>prompt Test Prompt
Test Prompt>prompt
>

Note that prompt entered on its own returns the prompt to the default '>'
prompt.

+
# PROJECT
Usage: project (rel) (f1,f2,...,fn)
Operation: Projects the specified ATTRIBUTEs from the specified expression.
Result: PROJECT reduces the result of the specified expression to
        contain only the ATTRIBUTEs specified. In the process, all duplicate
        tuples that may occur are removed.
Examples:

rel=project (a) (status,city)

+
# ALGEBRA
The relational algebra is the manipulative part of the relational model.
In order for a relational database management system to be termed relational
complete, it must support the relational structures, and provide at least
the functionality of the relational algebra. LEAP can be termed relationally
complete. To be truly relationally, an RDBMS must also ensure that
entity integrity and referential integrity is maintained. 

The relational algebra consists of nine operations: UNION, DIFFERENCE,
INTERSECTION, PRODUCT, PROJECT, RESTRICT, SELECT, JOIN and Divide.

RESTRICT and SELECT are one and the same within LEAP. Divide has not been
implemented at this stage, as it is possible to create it using the other
operators.

+
# ASSIGNMENT
The result of an EXPRESSION may be assigned to a RELATION name, 
enabling it to be used in other EXPRESSIONs.

r1=project (book) (author)
print r1

Assignment is often used in place of NESTING an expression, as it
enables queries to be broken into logical sections that are 
more manageable.
+
# RESTRICT
See the SELECT operator. RESTRICT and SELECT have been combined in LEAP.

+
# SELECT
Usage: select (rel) ((condition) bool (condition))
Operation: Produces a relation which contains all TUPLEs within the
           source relation matching the given CONDITION.
Examples:

rel=select (names) (address='oxford')
rl2=select (names) ( (address='oxford') and (name='richard leyton'))

NB. RESTRICT and SELECT have been combined in LEAP, such that the following
are equally valid:

rel=select (rel) (fielda = fieldb)
rel=restrict (rel) (fielda = fieldb)

+
# CONDITION
Within the SELECT and JOIN operator, a condition may be specified. The 
condition is compared against each tuple, and if the tuple satisfies the 
condition, some action is performed. It takes the form:

<qualification> ::= (<condition> [{andor} <condition>]* ) 
<condition> ::= <attribute-name> <comparator> {attribute-namevalue}
<comparator> ::= { <  >  <=  >=  =  <> }

A value is a text string surrounded by quotes, and an attribute name, is,
well, the name of an attribute.

Some examples:

(name='Richard Leyton')
( (name='Richard Leyton') or (name='Robert England') )
(first_name=second_name)

Note that each individual condition must be surrounded in brackets, and the
entire expression must be surrounded in brackets. Up to ten conditions can be
specified in one qualification.

+
# JOIN
Usage: join (rel1) (rel2) ((condition) bool (condition))
Operation: Produces a relation which contains the attributes of 
           the source relations, and reduces the tuples to those
           matching the given CONDITION.
Result: Conceptually the same as a PRODUCT followed by a SELECT.
Examples:

s1=select (subject) (class_name='non-fiction')
s2=join (s1) (index) (s1.class=index.class)
s3=project (s2) (author,title,shelf)
print s3

+
# UNION
Usage: (rel1) union (rel2)
Operation: Performs the UNION of the two specified relations, which
           must be UNION COMPATIBLE (see UNION COMPATIBILITY)
Examples:

rel=(a) union (b)

+
# UNION COMPATIBILITY
Two relations are said to be UNION COMPATIBLE if they share the
same attributes, each of which is drawn from the same domain as
the corresponding attribute in the other relation.

+
# DISPLAY
Usage: display(expression)
Operation: Displays the content of the relation or expression, and
           returns the expression. This enables display to be nested
           within an expression if necessary.
Examples:

display( (a) union (b) )
rel=project (display(a)) (status,city)

+
# INTERSECT
Usage: (rel1) intersect (rel2)
Operation: Calculates the INTERSECTION of the two specified relations/
           expressions, which must be Union compatible (see UNION
           COMPATIBILITY)
Result: The resulting relation contains all tuples of (rel1) that are
          ALSO in (rel2).
Examples:

rel=(a) intersect (b)

+
# MINUS
See the DIFFERENCE operator for information. MINUS is defined as an
alias of DIFFERENCE.

+
# DIFFERENCE
Usage: (rel1) difference (rel2)
   or: (rel1) minus (rel2)
Operation: Calculates the difference of the two specified relations/
           expressions, which must be Union compatible (see UNION
           COMPATIBILITY). 
Result: The resulting relation contains all tuples of (rel1) that
        are NOT help in (rel2).
Examples:

rel=(a) minus (b)
rel=(a) difference (b)

rel=(b) minus (a)
rel=(b) difference (a)

Note the difference when the relations are reversed, as above.

+
# PRODUCT
Usage: (rel1) product (rel2)
Operation: Calculates the PRODUCT of the two specified relations/
           expressions.
Result: The resulting relation contains the cartesian PRODUCT of the
        two relations. This relation has all of the attributes of the
        source relations, and the tuples consist of all possible
        combinations of the tuples.
Examples:

rel=(a) product (b)

+
# LIST
Lists all of the relations that exist within LEAP, along with their
temporary status.

+
# SOURCES
Lists all of the source files that exist within LEAP. Source
files may be displayed with the L command. Source files may
be executed with the @ command.

There are two important source files - STARTUP.SRC and
SHUTDOWN.SRC - Which are executed at startup and shutdown.
Place special options in the startup file, but do not
remove the load command.

+
# L
Usage: L sourcefile
Prints out the contents of the specified source file.

Example:

>l startup
Listing C:\LEAP\DATA\SRC\STARTUP.SRC
------------------------------------
-->load
-->high

+
# @
Usage: @ sourcefile
Executes a source file, taking commands from the file as opposed
to the keyboard.

Example:

>@ iex45

>>>s1=select relation (subject) where (class_name='non-fiction')
S1 Returned.

>>>s2=(s1) join with (index) where (s1.class=index.class)
S2 Returned.

>>>s3=project (s2) with (author,title,shelf)
S3 Returned.

>>>print s3
Relation: S3
AUTHOR                    TITLE                     SHELF
---------------------------------------------------------------------------
KING                      STRENGTH TO LOVE          24
HEMINGWAY                 DEATH IN THE AFTERNOON    22

>>>@

+
# PRINT

Usage: PRINT relation

Displays the specified relation on the screen. See DISPLAY.

+
# DELETE

Usage: DELETE relation

Removes the specified relation from the database. The relation is
only removed from disk if it is TEMPORARY - See CHANGE to change
the temporary status of a relation.

+
# TEMPORARY

Relations can either be permanent or temporary. Permanent relations 
remain on the disk between runs, whereas temporary relations
are removed after a DELETE command, or after LEAP is shutdown.

The status of a relation can be displayed with the LIST command,
and changed with the CHANGE command.

+
# PERMANENT

See TEMPORARY for more information.

+
# CHANGE

Usage: CHANGE relation

Reverses the temporary status of the specified relation. TEMPORARY
relations are removed from disk when DELETEd or LEAP is shutdown.
PERMANENT relations remain on disk despite a DELETE, but are no
longer available in the current run of LEAP.

+
# DESCRIBE

Usage: DESCRIBE relation

Displays the attributes present in the specified relation, and
the data type of each attribute.

+
# MEM

Displays the amount of free memory remaining that is available to
LEAP. Normally this is the remaining about of conventional
memory. All used memory is released on termination.

+
# NORMAL

Sets the display to the 'normal' 80 x 25 colour mode which is 
standard in MS-DOS.

See HIGH to display more information on screen.

+
# HIGH

Sets the display to the higher resolution 80 x 43/50 EGA/VGA resolution,
which is useful for viewing larger relations.

See NORMAL for returning the display to a lower resolution,

+
# STATUS

Displays the current status of settings within LEAP. See
COMMAND LINE for default values and settings.

+
# NESTING
Expressions may be nested, such that in place of a relation name,
a further expression is specified:

r2=(project(subject)(class)) minus (project (index)(class))
print r2

Note that each expression is contained within the brackets that a relation
name is normally surrounded by.

+
# INFIX
Usage: infix [y|n]

LEAP 0.9 allows expressions to be expressed in an infix fashion,
whereas previous versions required expressions to be expressed
in a prefix fashion.

By default, infix expressions are turned off, to turn infix
evaluation on type:

infix y

Infix expression evaluation can be set at the COMMAND LINE.

Examples:

INFIX Form:
r1=(project(subject)(class)) minus (project (index)(class))

PREFIX Form:
r1=minus((project((subject)(class)))(project((index)(class))))

+
# PREFIX
See INFIX for examples of INFIX and PREFIX form EXPRESSIONs.

+
# EXPRESSION
An expression is a valid algebraic query that will result in 
a relation. Such an expression may then be assigned to a 
relation, or combined within another expression. For example:

r2=(project(subject)(class)) minus (project (index)(class))

The expression project(subject)(class) is combined into a
larger expression, which is in turn assigned to a new
relation.

+
# INFO
Displays information about the warranty/conditions of LEAP. You
are required to have read and accepted these conditions to continue
using LEAP.

+
# QUIT
Shuts down LEAP. Relations are automatically stored if they are
PERMANENT, and deleted if they are TEMPORARY. You are returned
to the DOS prompt following the shutdown procedure.

+
# DEBUG
Usage: DEBUG [YN]
Debug information showing the progress of expression evaluation
can be written to the REPORT FILE. Type STATUS to display the current
setting. By default, debug information is set off.

Debugging can be set at the COMMAND LINE.

+
# TIMING
Usage: TIMING [YN]
The evaluation of expressions can be timed. Type STATUS to display
the current setting. By default, expression timing is off.

Timing can be set at the COMMAND LINE.

+
# COMMAND LINE
A number of LEAP settings can be specified at the command line:

#-------------------#-----------#-------------------#--------------#
 Setting            Parameter   Required Value      Default    
#-------------------#-----------#-------------------#--------------#
 Data directory     DIR        Absolute DOS path    C:\LEAP    
 Timing             TIMING            Y  N             N      
 Infix expressions  INFIX             Y  N             N      
 Debug output       DEBUG             Y  N             N      
 Output copy        COPY              Y  N             Y      
 Colour (*)         COLOUR            Y  N             Y      
#-------------------#-----------#-------------------#--------------#

Example:

LEAP DIR=c:\db\leap TIMING=Y INFIX=Y DEBUG=Y

You may specify as many or as few of the settings as needed.

Note that later versions of LEAP will default infix expressions to Y. 0.9
will default to N in order to maintain backward compatibility.

* Color can also be specified instead of colour.
+
# COPY

LEAP by default creates a file in your temporary directory containing
a copy of the output sent to the screen. If this is not required, specify
the COPY parameter at the COMMAND LINE, e.g.:

LEAP copy=n

By default the file is created, and overwrites any information that
is contained within it from previous runs.

+
# COLOUR
LEAP has a small amount of colour. If you would prefer purely grey
output, specify COLOUR=N on the command line. Note that you can also
spell colour as color.

Oh the things I do to keep you happy... ;o) 

+
# USTIME
LEAP allows dates to be output in the US Date format, ie. mm/dd/yyyy
as opposed to the European dd/mm/yyyy which is the default - Specify 
USTIME=Y at the command line, or enter USTIME at the LEAP prompt to 
change within the program.

+
# INDICIES
LEAP supports indicies using B-Trees. However at this release, B-Trees have
not been incorporated extensively into LEAP. A number of commands exist to
demonstrate its operation:

SPECIDX r p1 p2   - Specify an index to be created on relation r
                    with attributes p1 and p2
IDXPRINT r p1 p2  - Print the index for relation r, with attributes
                    p1 and p2
IDXSTORE          - Store the indicies to disk.

+
# SUMMARY
There is help information on the following, type help <topic>

Topics
------

HELP            PROJECT               ALGEBRA            ASSIGNMENT
RESTRICT        SELECT                CONDITION          JOIN 
UNION           UNION COMPATIBILITY   DISPLAY            INTERSECT
MINUS           DIFFERENCE            PRODUCT            LIST
SOURCES         L                     @                  PRINT
DELETE          TEMPORARY             PERMANENT          CHANGE
DESCRIBE        MEM                   NORMAL             HIGH
STATUS          NESTING               INFIX              PREFIX
EXPRESSION      INFO                  QUIT               DEBUG
TIMING          COMMAND LINE          COPY               INDICIES
COLOUR          USTIME                SUMMARY            ABOUT
BOOKS           CONTACTS

+
# ABOUT
About LEAP...

LEAP is a relationally complete relational database management system.

LEAP has a relational algebra based command interpreter, support for
relational structures, indexing using b-trees, hashing tables and 
extensive documentation. A source code level framework for enhancement 
is incorporated for interested programmers.

LEAP has been successfully used as a teaching aid in a course in
Databases at Oxford Brookes University, England. Students have been 
encouraged to use the system to experiment with the relational algebra,
and this has proved very successful and enjoyable.

In addition, there has been a warm reception to LEAP on the internet, 
leading to a number of sites using LEAP as a teaching tool.

LEAP is copyright Richard Leyton, 1995. Type INFO for more information 
on warranty and conditions.

+
# BOOKS
A large number of books exist on the subject of Databases and
Database systems. Of particular merit (with my comments) are:

* "Theory and Practice of Relational Databases", by Stefan
  Stanczyk, published by Pitman, 1990. ISBN 0-273-03049-3
  - The majority of examples contained within LEAP are taken
    from this book, and it provides a sound introduction to
    the field of relational databases. 

* "An introduction to database systems - Volume 1", 5th Edition,
  by C.J. Date, published by Addison-Wesley, 1990. 
  - This book is regarded by many as the best book in the field,
    it certainly covers more or less everything. To me, an
    unbeatable reference book.

* "An introduction to database systems", by B.C.Desai, published
  by West Publishing, 1990.
  - More mathematical than Date's, but covers everything.

+
# CONTACTS
Contact: Richard Leyton
Address: No.3.Pelting Drove, Priddy, WELLS, Somerset, BA5 3BA. England
E-Mail : richard_leyton@mail.amsinc.com
       : e0190404@brookes.ac.uk
Home Page: http://www.brookes.ac.uk/~e0190404/leap.html

+
