This is the readme file for the old version of APTS for the
translator from SETL/SQ2+ to C.

Instructions:

Make sure the follwoing environment variables are set.

setenv SETL2_LIB <path>/oldapts/setl.lib
setenv APTS_LIB <path>/oldapsts/apts.lib
#create setl.lib
stll -c setl.lib

-- I find it convenient to add the following aliases to my .cshrc
--
-- alias oldapts "setenv APTS_LIB ~/<path>/oldapts/apts.lib"
-- alias oldsetl "setenv SETL2_LIB ~/<path>/oldapts/setl.lib"
-- alias oldinitsetl "stll -c ~/<path>/oldapts/setl.lib"
-- 
-- and similarly aliases for the new version of APTS.
-- If I want to run the old version of APTS, then I just
-- execute "oldapts" and "oldsetl".  Note the "oldinitsetl"
-- needs to be executed jut once the first time.

1. Compile APTS in the directory <path>/oldapts/apts

source jcompile.apts

2. Complete installation of apts applications in src and tests

cd <path>/oldapts/src/accel

stlx apts
>: .........error message saying that apts.lib doesn't exist
>:rsl.old.boot

i.  Compile Acclerator in directory rapts/src/accel

stlx apts
>:rslc snsetl; -- compile SETL syntax
>:rslc snc;  --compile c syntax
>:submit startup.old.sub; -- takes a somewhat long time
>:stop; --get out of apts and compile foreign SETL2 module and interface
stlc -o2 -s readapts
stlc -o2 -s kforeign

ii.  Test out Accelerator in directory oldapts/src

This tests out the transformation of reachability from both
High SETL and SQ2+.

a) Example for translating from SETL to C

stlx apts
>:loadcm squb;  -- load Accelerator command modules
>:testsetl; --test Low SETL to C translation (see also readme.ub)
-- whenever it pauses, type in a "continue;" to continue
-- whenever is asks for a type for something, type in "int"
>:stop;
-- The output program goes to testc.src
cc c.c
a.out < reach1000.out
-- Get a long sequence of numbers as answer.  
-- The answer can be checked by comparing with the output of the SETL version
-- stlc -o2 -c reachbnf.stl
-- stlc reachbnf < reach1000.in

b) Example for translating from SQ+ to C

stlx apts
>:loadcm squb; --load translator executables
>:testsq2;  --test sq2 to C translation
-- whenever it pauses, type in a "continue;" to continue
-- when it asks to supply an identifier for something, do so
-- whenever is asks for a type for something, type in "int"
>:stop;     -- exit
cc c.c
a.out < reach1000.out

3. Other examples can be tested out as follows

PLEASE LOOK at file <path>/oldapts/src/readme.ub for instructions
on running other examples.

cycle testing (translating cyclebnf.src to c)
stlx apts
>:loadcm squb; --load translator executables
>:setlx (cyclebnf, cycle1000);
-- whenever it pauses, type in a "continue;" to continue
-- whenever is asks for a type for something, type in "int"
>:stop;
-- The output program goes to testc.src
cc c.c
a.out < cycle1000.out
-- Note that to check what the right answer is, do the following
-- stlc -o2 -c cyclebnf.stl
-- stlc cycle < cycle1000.in

Other examples for SETL to C translation can be run as:

setlx(centbnf,cent1000);
setlx(cyclebnf,cycle1000);
setlx(orbitbnf,orbit);
setlx(maxindbnf,maxind1000);
setlx(topsortbnf,top1000);
setlx(aclosebnf,aclose1000);
setlx(dijkstrabnf,dijk1000);
setlx(floydbnf,dijk1000);


Other examples for SQ+ to C translation can be run as

sq2x(cycle,cycle1000);
sq2x(aclose,aclose1000);

----------------------------------------------------------------------------
Hi Annie,

I have tested out the following examples.  Here is the list of
what works and what doesn't work.

1) SETL To C

Exmaples that work:

reachbnf
cyclebnf
aclosebnf
dijkstrabnf
maxindbnf
orbitbnf
topsortbnf

Examples that do not work:

centbnf
floydbnf


2) SQ+ To C

Examples that work:

reach
cycle
aclose

Exaples that do not work:

orbit


So out of the 13 examples, 10 work fine.  Hopefully this should be
enough to get you started.

-Deepak
