SCP 4 you Quick Help

For a description on how use the SCP4, please see a SCP4 User's Guide (in Russian).


Bottom

This page contains quick help on the following topics:


Bottom

Session Of Supercompilation

There are two versions of SCP4-script files. The versions correspond  different operating systems: under Windows 95/98/NT and MS-DOS the script files have bat-extensions  while under UNIX there is no extension. 

At present a whole session of supercompilation consists from a number of stages:

  1. Translation of  a Refal-5 program (to be transformed) to a Refal-graph.  (inref4p.bat or inref4.bat)
  2. Translation of a MST-scheme in an inner representation of the configuration. (mst4p.bat or mst4.bat)
  3. Supercompilation itself: the main stage. (scp4.bat)
  4. Clearance of the input/output formats of functions from a residual program as well as redundant function calls. (redund.bat)
  5. Translation of a residual program to Refal-5. (cgr54.bat)

The first and second stages commute. The fourth stage is optional. The fourth and fifth stages transform a last result of the the third stage. A whole session can be run by a single script file (scpwholp.bat or scpwhole.bat).

Please, pay your attention that the supercompiler can looping forever (by definition) under a combination of keys to run. Default keys are such combination.
There are a number of reasons for that.  In the archive (to be downloaded) version of the documentation we give a number of such examples.

Script File Descriptions

Optional arguments are enclosed by [ ]. 
Top Bottom

Task Description

Scp4 transforms an algorithmic definition of a function. Consequently any task for the supercompiler is split in two natural parts. 

Refal-5 Programming Language

REcursive Functions Algorithmic Language by Prof. Valentin F. Turchin  (The City College of New York) .  


MST-schemes Language

MetaSystem Transition schemes Language by Prof. Valentin F. Turchin  (The City College of New York) .  


The MST-schemes language is a two dimensional  programming language. 


If  there exist  a call to a supercompiler on a given line inside a MST-scheme,  then the supercompiler treats a part from the next line ( those part which exactly under its arguments) as a parametrized set of inputs to a given program. 

There are three types of parametrs -- e-parametrs , t-parametrs and s-parametrs. 

The power of the image depends on syntax the MST-scheme so , in the fact,  every type has  the countable set of  subtypes. If  there are two parametrs with the same types and names, then these parametrs can take just equal values.


A simple example of a MST-scheme is present on the next two lines:

<Scp4 ............................. >
       <Fcd <Fbc <Fab 'aebfc' e.1>>>  ;

The MST-scheme describes a classical task: to supercompile  a composition of  three functions when the argument of the inner Fab-function starts with string  'aebfc' while the rest of the argument is unknown and can be any object expression. 



Top Bottom

Pseudo-Comments

A pseudo-comment is a line (in a Refal-5 program) which starts with  *$DECLARATION , where DECLARATION is one of declaration types. The pseudo-comments are understood  by the Scp4 (inref4-stage) while they are ignored by the Refal-5 compiler . 

The available version of the Scp4 supports just one pseudo-comment:

*$EXECUTABLE function_name1, function_name2 ...; 

If your Refal-5 program contains the pseudo-comment then calls to functions from the list will be executed by the Refal-5 interpreter in super-compile time if arguments of the calls turn out to be object expressions in a moment when the supercompiler will specialize these calls . 

The next built-in functions Type Numb Symb Implode Add Sub Mul Div Mod Divmod  (see Refal-5 documentation  for definitions) are executable by default.

You are responsible to link to the supercompiler  definitions of functions which you declare as executable (see Session Of Supercompilation) .


Top Bottom

SCP4 Environment Variable Summary

Several environment variables are used by SCP4 to determine the location of certain files and directories. These variables include:
SOURSCP
The directory which contains the SCP4 source files. By default  this is a directory, where your installed SCP4.
TMPSCP
The directory where PGRAPH and SCPOUT subdirectories have to be presented. SCP4 use these directories to keep temporary data files. By default, the environment variable is defined with a value of the SOURSCP environment variable.
REF5RSL
The directory which contains the SCP4 rsl-modules. By default,  it is defined with a value of the SOURSCP environment variable. The REF5RSL  environment variable is a service variable of Refal-5  so,  please,  see Refal-5 documentation for additional explanations.

Top

Online Demonstration

The online demonstration presents demo-examples from the Scp4 distribution. Here you can find a brief  description of the examples.

You are welcome:

Please, take attention:


Top

nemytykh@math.botik.ru