
GENERAL REMARKS
---------------

This directory contains the examples discussed in the 
tutorial introduction.  A brief description of each
program, grouped by the section in which it is discussed,
is presented below.  The EXAMPLES directory contains several
additional programs.

A First Session
---------------

start1.P	simple join
start2.P	illustrates arithmetic

Declarative Language Features: Basics
-------------------------------------

declba1.P	program with infinitely many answers
declba2.P	illustrates problem due to lack of occur check

Declarative Language Features: Negation
---------------------------------------

declne1.P	illustrates set-difference via negation
declne2.P	examines role of variables in negated literals
declne3.P	negation and stratified recursion 
declne4.P	negation and stratified recursion (contd.)
declne5.P	non-stratified negation (defines ``working parts'')

Declarative Language Features: Sets and Multisets
-------------------------------------------------

declse1.P	illustrates multiset enumeration and grouping
declse2.P	illustrates the ``member'' built-in predicate
declse3.P	illustrates higher-order programming with ``member''
declse32.P	converts list values to multisets
declse4.P	discusses uses of multisets in pipelined modules
declse5.P	illustrates relations as multisets (counts number of paths)
declse6.P	counts number of copies of a subpart in a part
declse7.P	non-stratified aggregates (bill-of-materials program)

Declarative Language Features: Advanced
---------------------------------------

declad1.P	illustrates non-ground terms; difference-list append
declad2.P	illustrates non-ground terms; simple parsing program
declad3.P	illustrates ``head deletes''
declad4.P	illustrates ``head deletes'' / ``@prioritize'' (sorting programs)
declad5.P	illustrates ``@aggregate_selection'' (spanning-tree programs)
declad6.P	illustrates ``@aggregate_selection'' / ``@prioritize'' (shortest path)
declad7.P	illustrates use of ``@aggregate_selection'' for single-answer queries
declad72.P	shows potential danger in using agg sels for single-answer queries
declad8.P	illustrates ``@monotonic'' (party invitations program)
declad9.P	another monotonic program (company control)

Modules in CORAL
----------------

mod1.P		shows that module names are not significant (except for Explain)
mod2.P		explores several options for negation (the even program)
mod3.P		shows high cost of ordered search with large sccs
mod4.P		illustrates benefits of reducing scc size with ordered search
mod5.P		shows how to avoid ordered search for stratified programs
mod6.P		illustrates ordered search and grouping
mod7.P		shows how to avoid ordered search for stratified grouping programs
mod8.P		similar to mod7.P; emphasizes orthogonality of caller/callee modules
mod9.P		illustrates ``@save_module'' feature

Declarative Language Features: Annotations and Control
------------------------------------------------------

declac1.P	illustrates rewriting techniques (same-generation program)
declac12.P	shows how query bindings can be used with no rewriting
declac2.P	illustrates existential query optimization and factoring
declac3.P	illustrates rewriting for programs with negation/grouping
declac4.P	simple large join; compares several techniques
declac5.P	ilustrates indexing in CORAL

Declarative Language Features: Pipelined Evaluation
---------------------------------------------------

pipe1.P		shows how commands can be embedded in rules
pipe12.P	shows use of ``univ'' metapredicate (multiset-to-list program)
pipe2.P		illustrates use of cut (!)
pipe3.P		shows use of cut for single-answer queries w. materialized execution
pipe4.P		illustrates ordering of facts

CORAL and C++
-------------

impmod1.S	illustrates embedding of CORAL code in C++
impmod2.S	illustrates manipulation of relations from C++
impmod3.S	illustrates definition of built-in predicate using C++
impmod4.S	use of Arg * to pass arbitrary structures between CORAL and C++

Extensibility in CORAL
----------------------

extens1.P	illustrates the use of the logical array data type
extens2.P	illustrates the use of the destructive-assignment arrays
extens3.P	presents a ``foreach'' predicate; useful for iterating over arrays
extens4.P	illustrates creation of array values from relations

