General structure of the CATS system
------------------------------------

How to compile CATS:

Switch into a directroy where the repositories should live
(preferably a new directory).
Enter

	cvs co CATS
	cvs co atermlib
	cvs co CASL-lib 
	cd CATS
	build version

Set the CASL_LIB environment variable to the CASL-lib directory,
e.g.
    setenv CASL_LIB xxx/CASL-lib
or
    export CASL_LIB=xxx/CASL-lib

where xxx is the path where CASL-lib lives.

Then, enter

	sml-cm
	use"SROOT.ML";

to build a standalone version, which will be available via
the command

	cats/cats    (currently still: casl_parser/casl)

You also can enter

	sml-cm
	use"ROOT.ML";
	use_casl"name.casl";

in order to use CATS from the sml-shell, e.g. for the
debugging purposes.



Repositories for CATS
---------------------
CATS              main repository for CATS
atermlib          ATerm library, needed for CATS
Basic             CASL Basic datatypes (see CoFI study note L-12)


Files in the repository CATS
============================
README           This file
todo             Working plan (should be in english now...)

Loaders
-------
ROOT.ML          use this file to load CATS
SROOT.ML         use this file to build CATS standalone vesion
YROOT.ML         Root file for debugging ML yacc parser
bin/             Binary files

ML-yacc parser
--------------------------------------------------
CASL.lex           Lexical syntax for CASL (based on Frederic Voisin's parser)
CASL.parser.sml    Ml-yacc parser for CASL
CASL.grm           Context-free syntax of CASL
CASL.grm.sml       intermediate file, do not edit
CASL.lex.sml       intermediate file, do not edit

General purpose stuff
---------------------
CASLsign/global.sml         global flags
CASLsign/symtab.ML          Symbol tables 
                            (modified from Isabelle's src/Pure/symbtab.ML)
CASLsign/textform.sml       Printing functions for plain text and HTML
CASLsign/utils.sml          Utilities from Isabelle's src/Pure/library.ML

Abstract syntax
---------------
CASLsign/as.sml             Abstract syntax for CASL, as an ML datatype
CASLsign/as_types.sml       Automatically generated abstract syntax
CASLsign/as_new.sml         Template for new abstract syntax, now obsolete
CASLsign/asgen.sml          Polytypic generation of abstract syntax
CASLsign/basic_print.sml    Printing functions for ML datatypes for 
                            abstract syntax (basic specs)
CASLsign/ids.sml            Identifiers
CASLsign/makesas.sml        Calls asgen.sml


Mixfix analysis
---------------
isa_98/                     Stuff from Isabelle that is needed for using 
                            Isabelle's parser in a standalone way
CASLsign/CASL98Pre_thy.ML   intermediate file, do not edit
CASLsign/CASL98Pure_thy.ML  intermediate file, do not edit
CASLsign/CASL98_thy.ML      intermediate file, do not edit
CASLsign/CASLparser.sml     Ambiguity and precedence handler for Isabelle's parser
CASLsign/bspec98.sml        Conversion from Isabelle-term to abstract syntax tree
CASLsign/scanner.sml        Scanner, using Isabelle's generic scanner
CASLsign/mixfix.sml         Mixfix parser
CASLsign/CASL98Pure.thy     syntax of CASL, common ancestor of CASL98.thy and CASL98Pre.thy
CASLsign/CASL98.thy         syntax for mixfix anaylsis, this is dynamically extended in mixfix.sml
CASLsign/CASL98Pre.thy      syntax for first phase of parsing (now obsolete!)


Static analysis
---------------
CASLsign/local_env.sml      signatures and local environemts
subsorts.sml          Subsort analysis
overload.sml          Overload resolution
basic_ana.sml         Static analysis of basic specs
global_env.sml        Global environment
struct_ana.sml        Static analysis of structured specs
morphisms.sml         Signature morphism analysis
symmaps/              Symbol map analysis (by Bartek Klin)
arch/arch_analysis.ml Static analysis of architectural specs
arch/arch_types.ml    Semantic domains for architectural specs
arch/sharing.ml       Sharing analysis for architectural specs
lib_ana.sml           Static analysis of libraries

General encoding
----------------
encode.sml            Encoding of CASL logic into other logics (SubCFOL=, CFOL=, SOL=)
flatten.sml           Flattening of structured specs into basic specs


Formatting
----------
mklatex.sml        Generate LaTeX output
pprinter.sml       Pretty printing of CASL formulas in LaTeX, uses Isabelle pretty printer
module_graph.sml   Compute the dependency graph between specifications


External interface
------------------
build              Unix script for creating distributions of the HOL98-CASL system
config             Current configuration and version, needed for build
aterms.sml         Conversion between ML datatype for abstract syntax and ATerms
                   This needs the repository atermlib!
fxp/               XML parser
casl/              Creates a standalone version (exits sml)
                   Edit configure to enter version number, the run "build version"
                   and use"SROOT.ML"
web_interface2.sml Web interface, to be used in connection with casl.cgi
casl.cgi           Perl script for web interface, has to be in ~httpd/cgi-bin/casl2.cgi
cats/              Directory with files for the CATS distribution
files in src/Pure/Thy, rewritten for CASL

Example specifications
----------------------
examples/          Examples specifications

Files in the repository HOL-CASL
--------------------------------

Encoding into Isabelle/HOL
--------------------------
HOL              Run smlnj-110 with Isabelle/HOL. Attention: special HOL-extension needed!
HOL98-CASL*      Run HOL98-CASL system, as it was at the last save();
HOL1.thy           HOL.thy, extended with special syntax for CASL
encode_isabelle.sml         Encoding of CASL into Isabelle/HOL
CASLTheory.sml     Extend the Isabelle theory stuff to CASL
CASLgoals.sml      Extend the Isabelle goal stuff to CASL
mk_isawin.sml      Creates a standalone version of HOL-CASL with IsaWin interface
ROOT.ML            Loader for HOL-CASL
CASLThyRead.sml    Loader the CASL theories with encoding to Isabelle/HOL
tag.sml            Isabelle/HOL file with hints for print translation

IsaWin interface
----------------
This is contained in the repositories sml_tk, git, and HOL98-CASL-IsaWin
sml_tk is an encapsulation of TclTk in SML.
On top of this, IsaWin is built. IsaWin is a generic
graphical user interface for Isabelle. We instantiate
it here with HOL-CASL.
