Metacomputation MST plus SCP

Valentin F Turchin

The City Col lege of New York

First of all I want to thank the organizers of this seminar for inviting me

to review the history and the present state of the work on sup ercompilation

and metasystem transitions I b elieve that these two notions should b e of pri

mary imp ortance for the seminar b ecause they indicate the lines of further

development and generalization of the twokey notions most familiar to the

participants sup ercompilation is a development and generalization of par

tial evaluation while metasystem transition is the same for selfapplication

For myself however the order of app earance of these keywords was opp o

site I started from the general concept of metasystem transition MST for

short and my consequentwork in computer science has b een an application

and concretization of this basic idea

History

Consider a system S of any kind Supp ose that there is a waytomakesome

numb er of copies of it p ossibly with variations Supp ose that these systems

are united into a new system S which has the systems of the S typ e as

its subsystems and includes also an additional mechanism which somehow

examines controls mo dies and repro duces the S subsystems Then we

call S a metasystem with resp ect to S and the creation of S a metasystem

transition As a result of consecutive metasystem transitions a multilevel

hierarchy of control arises which exhibitss complicated forms of b ehavior

In my book The Phenomenon of Science aCybernetic Approach to

Evolution I haveinterpreted the ma jor steps in biological and cultural

evolution including the emergence of the thinking human b eing as nothing

else but metasystem transitions on a large scale Even though my PhD

was in theoretical physics I was so excited ab out my new cyb ernetic ideas

that I shifted from physics to computer science and left the atomic center

in Obninsk for the Institute for Applied Mathematics in Moscow

An extrascientic factor came into play in the late s I b ecame an

active memb er of the human rights movement My b o ok was written ab out

but it could not b e published in the Soviet Union solely b ecause of

the authors name It to ok seven years to smuggle it to the West and have

it published in the English language

The rst step towards MST in computers was to design an appropriate

algorithmic language I called the rst version of such a language meta

algorithmic since it was supp osed to serve as a metalanguage for den

ing semantics of algoritmic languages Then I simpiled it into what was

named REFAL for REcursiveFunctions Algorithmic Language Refal was

conceived as the universal language of metasystem hierarchies which is on

one hand simple enough so that the machine that executes programs in

this language the Refal machine could b ecome an ob ject of theoretical

analysis and on the other hand is rich enough to serve as a program

ming language for writing reallife algorithms unlikesuch purely theoretical

languages as the language of the Turing machine or Markovs normal algo

rithms the latter by the waywas one of the sources of Refal Even to

this day Refal remains in my biassed no doubt view the most successful

compromise b etween these two requirements

An ecientinterpreter for Refal was rst made in At that

time Refal was very dierent from other languages b eing a purely functional

language with builtin patternmatching Now after quite a few functional

languages similar to Refal have app eared I need only to summarize its

distinctive features in order to make it familiar

The most distinctive feature of Refal is its data domain Unlike other

functional languages whichuselists skewed binary trees for symbol ma

nipulation Refal uses expressions which can b e seen as trees with arbitrary

unxed arity of no des and are dened formally as

ter m sy mbol j expr ession j f unction expr ession

expr ession empty j ter m expr ession

Variables in Refal have their intrinsic typ es shown by a prex thus si

where i is the index name stands for an arbitrary symb ol ti an arbitrary

term and ei an arbitrary expression eg s t ex In the case of

an expression variable the prex may b e dropp ed x is the same as ex

We use angular brackets to form function calls fx A program in

Refal is a sequence of sentences replacement rules which are tried in the

They rst app eared in Lisp so I often refer to lists as Lisps data domain

order they are written Here is an example of a function f which traverses

its argument from left to right and replaces every a by b

f a bf x

f s x s f x

f

By the year I was lucky to have gathered a circle of young p eo

ple the Refal group which met regularly survived my emigration and is

still alive and well As in any informal group some p eople went new p eo

ple came I am deeply thankful to all of them and esp ecially to those

most active and p ersistent Sergei Romanenko the rst to havecome

Nikolai Kondratiev Elena Travkina Andrei Klimov Arkadi Klimov Viktor

Kistlerov Igor Shchenkov Sergei Abramov Alexei Vedenov Ruten Gurin

Leonid Provorov Andrei Nemytykh Vika Pinchuk I will always remember

Alexander Romanenko who died b efore his time in

Together with a smaller group at the Moscow Engineering and Physics

Institute Stanislav Florentsev Alexander Krasovsky Vladimir Khoroshevsky

we made Refal compilers for the most p opular machines in the Soviet Union

and Refal b ecame prettywell known in that part of the world It is not my

intention to fo cus on Refal a bibliography on the development and use

of Refal compiled a few years ago includes ab out items but I want

to mention two further outgrowths of Refal The language FLAC for al

gebraic manipulation develop ed by VKistlerov and Refal Plus by

SRomanenko and RGurin which is a kind of logical closure of the ideas

on which Refal is based In may later work I used the extended version of

Refal named Refal which is op erational under DOS and UNIX

The next conceptual station after xing the language was driving

Supp ose wehave the call f ax of the function f ab ove Obviously

it can b e replaced by bf x b ecause this is what the Refal machine

will do in one step of function evaluation Partial evaluation to ok place

which is a simple case of driving Nowtake the call f x where partial

evaluator has nothing to do Driving however is still p ossible b ecause it

is simulation of one step of computation in any circumstances When you

see equivalent transformation of programs as the use of some equations

our partial evaluation is the use of the equation fax bf xand

this makes p erfect sense But given the call f x there is no equation in

sightwhichwould improve the program Driving is a pro duct of cyb ernetic

thinking We create a metamachine and the rst thing it must b e able to do

with the Refal machine is to simulate its b ehavior Thus the metamachine

drives the Refal machine forcing it to do somehting for whichitwas not

originally prepared make computation over expressions with free variables

In our case driving will pro duce the graph

f x xax bf x

xsx s f x

x

where the original call is the ro ot no de lab eled by and there are three

edges separated by which lead to three resulting expressions according to

the three sentences in the denition of fBye p we denote the op eration

of matching expression e to pattern p a pattern is a sp ecial kind of an

expression referred to as rigid which guarantees the uniqueness of the

op eration stands for an empty expression for readability

From driving I came to sup ercompilation SCP for short Let me

briey describ e this technique of program transformation leaving aside many

details and variations

A sup ercompiler is an upgrade of a driver When a new active ie

representing a function call no de C app ears in driving the sup ercompiler

examines its ancestors and with regard to each ancestor C takes one of the

three decisions

Reduce C to C with a substitution this can b e done only if C C

g g g

Generalize C and C ie nd such C that C C and C C

g

then erase the driving subtree which starts at C reduce C to C and

g

go on driving C

Do nothing on C the no des C and C are far from each other

and examine the next ancestor If there are no more ancestors go on

driving C

Sup ercompilation ends when the graph b ecomes selfsucient ie for

every activenodeshows howtomake a transition to the next no de which

corresp onds to at least one step of the Refal machine This graph is a

program for computation of the function call represented by the initial no de

Note the dierence b etween the principle of sup ercompilation and the

usual idea of program transformation where the program is changed step by

step by applying some equivalences In sup ercompilation wenever change

the original program We regard it as a sort of laws of nature and con

struct a mo del of a computation pro cess governed by these laws When the

mo del b ecomes selfsucient we simply throwaway the unchanged original

program

When we discussed sup ercompilation in the seminars of the Refal group

I always stressed my b elief that metasystem transition is imp ortant in itself

If it has b een the key at all stages of biological and technical evolution how

can we hop e to create really intelligentmachines without the use of this prin

ciple We should develop techniques of dealing with rep eated metasystem

transitions applications are b ound to emerge

The rst conrmation of this b elief came when I gured out that sup er

compilation of an interpreter is compilation and sup ercompilation of the

sup ercompiler that do es compilation second MST yields a compiled e

cient compiler Moreover making the third MST we can obtain a compiled

compiler generator I was very excited ab out my discovery and told Andrei

Ershov ab out it Ershov at that time worked on partial evaluation the

rst MST but he did not know ab out the second MST and he also got



excited Neither he nor I knew at that time that Yoshi Futamura made

this discovery a few years b efore me Andrei saw a reference to Yoshis pa

p er but could not get the journal In his big pap er he referred to my

result as Turchins theorem of double driving

That was in Since I had b een jobless homesearched and

p erio dically interrogated by the KGB Meanwile a b o ok on Refal and its

implementation was written byseveral memb ers of the Refal group includ

ing myself My friends managed to get p ermission for publishin g it as a

technical material of the institue where I worked b efore b eing red on the

condition that I will not b e in the list of authors To meet this requirement

they decided not to include the list of authors at all The b o ok was pub

lished anonymously But I smuggled into it a page or so ab out my results

on automatic pro duction of compilers

I emigrated in and it to ok some time to take ro ots in the new

environment a pro cess which can never b e fully successful For a year and

a half I stayed at the Courant Institute of NYU and used this time to write

a pages rep ort where I summarized the ideas and results of the

past years and also sketched some new ideas to turn to them later Then I

got a p osition at the City College of the City UniversityofNewYork

I wrote the rst sup ercompiler SCP in with the help

of Bob Nirenberg and my son Dimitri in carrying over the implementation

of Refal from Russia to the US and upgrading it From the examples in



Ershov describ es our meeting in detail in

one could see that sup ercompilation includes but is much stronger as

a transformation technique than partial evaluation whichtakes place auto

matically in driving The examples in included program sp ecializaiton

but when I tried selfapplication nd MST I met a dozen of technical

diculties

Partial evaluation is simpler then sup ercompilation so automatic gener

ation of a compiler from an interpreter was rst achieved by selfapplication

of a partial evaluater nd and rd MST This was done by Neil Jones and

coworkers at DIKU Cop enhagen and was an imp ortant

step forward and a great success Selfapplicable partial evaluation b ecame

an established eld of research Of the memb ers of the Moscow Refal group

Sergei Romanenko and Andrei Klimovcontributed to this eld

but I decided to concentrate on further development of techniques of

sup ercompilation and wrote a stronger an b etter sup ercompiler SCP

The fall semester of I sp ent at DIKU in Cop enhagen invited by

Neil Jones This was a very imp ortant visit for me Igotachance to

discuss in detail my ideas on MST and SCP with Neil and other p eople at

DIKU Among other things these discussions help ed me to nalize and have

published my pap er on sup ercompilation Since then I visited DIKU on

several o ccasions and always had useful discussions and enjoyed the friendly

atmosphere there

In Rob ert Gluc k then at the Vienna Technical University joined

the MSTSCP Pro ject He sp entayear and a half at the City College work

ing with me on its various asp ects We managed to achieve selfapplication

of SCP in some simple cases but it b ecame clear that a thorough overhaul

of the sup ercompiler is needed After returning to Europ e Rob ert wentto

Cop enhagen He carried over the techniques of metaco ding and doing MSTs

whichwas originally develop ed for the Refal sup ercompiler to partial eval

uation and listbased languages In the early work on partial evaluation by

NJones with coworkers itwas stated that in order to achievegood

results in selfapplication a preliminary binding time analysis oline

was necessary However Rob ert showed that with a correct use of

metaco ding partial evaluation is selfapplicable without any binding time

analysis on line

Little by little more p eople got involved in the work on MSTSCP ideas

including some memb ers of the Moscow Refal group Andrei Klimovstarted

activework in this eld and found a mate in Rob ert Gluc k

Alexander Romanenko started work on function inversion Sergei

Abramov did an excellent and p otentially very imp ortantwork on pro

gram testing on the basis of driving with a neighborhood see Sec and

wrote a monograph on metacomputation other than sup ercompilation

Neil Jones gave a thorough theoretical analysis of driving as com

pared to partial evaluation More pap ers on sup ercompilation have app eared

recently from DIKU The role of Rob ert Gluk in that

as one can see from the references has b een of primary imp ortance

Morten Srensen wrote a Master thesis on sup ercompilaiton Its ti

tle Turchins Supercompiler Revisited which pleased me very much b ecause

it symb olized the emerging interest to mywork Then he made a suggestion

that the HigmanKruskal theorem on homeomorphic emb edding b e used as

the criterion for generalization in sup ercompilation which probably will

b e judged as one of the most imp ortantcontributions to the SCP techniques

during the last few years I discuss it in more detail in Sec

In I decided to restrict Refal as the ob ject language of SCP to its

at subset where the right side of a sentence cannot inlcude nested function

calls it is either a passive expression or a single function call The purp ose

of course was to simplify the sup ercomiler for selfapplication to b ecome

p ossible I started writing such a sup ercompiler SCP In September

Andrei Nemytykh from the Programming Systems Institute Perslavl

Russia came to CCNY for an academic year under a grant from the Na

tional Research Council Working together wehave made SCP at long

last selfapplicable That was in the spring of Returning to

Russia Andrei continued the work on SCP with Vika Pinchuk I do not

sp eak more on this b ecause SCP with some examples of its p erformance

is presented in a separate pap er at this symp osium

In the summer of Yoshi Futamura invitedmetospendamonth in

Tokyo to discuss sup ercompilation in relation to his concept of generalized

partial computation There are common asp ects indeed In b oth

approaches the information ab out the states of a computing machine go es

beyond listing the values of some variables The main dierence is that

Yoshi relies on some unsp ecied theorem proving while mypointistodo

everthing by sup ercompilation including theorem proving

In July invited byJose Meseguer I sp ent a pleasantweek at Stan

ford Research Institute in California explaining and discussing the details of

SCP and MST Jose and his graduate studentManuel Clavel are working on

reective logics and languages in the frame of Meseguers theory of general

logics Their goal is to extend the techniques of sup ercompilation

to their systems in order to improve their eciency and I know that Manuel

has already made some progress along this path

My review of events and ideas concerning MST and SCP is no doubt

incomplete and so is my bibliography I ask for forgiveness in advance

In Sec I discuss a few imp ortant asp ects of sup ercompilation In Sec

I give an outline of a few ideas whichhavenotyet b een prop erly translated

into computer programs My exp osition is very informal and sketchy I try

to have it done through a few simple examples The eld of MSTSCP has

its own formalism whichIobviously cannot systematically present here

Yet I hop e that ther reader unfamiliar with it will still b e able to gure out

what it all is ab out without b eing going into formal details

Aword on terminology In I suggested metacomputation as an um

brella term covering all computation which includes at least one metasystem

transition By this denition partial evaluation is also a varietyofmeta

computation and the term could b e used for identifying such meetings as

this seminar However partial evaluation p eople havebeeninnohurry to

use it In contrast it is readily used by p eople in the eld I denote in this

pap er as MST plus SCP sounds barbarian of course Thus for the time

b eing at least

metacomputation MST SCP

Asp ects of sup ercompilation

Patternmatching Graphs

I will reveal a small secret Our sup ercompilers do not actually use Refal as

the language of ob ject programs they use the language of patternmatching

graphs also referred to as Refal graphs The program in Refal to b e su

p ercompiled is rst automatically translated into the graph form and the

output of the SCP is also a Refal graph

Algebraically a patternmatching graph is a sum of pro ducts of three

varieties of the op eration of patternmatching with a pro duct implying se

quential and a sum parallel execution A contraction is a pattern matching

v p where v is a variable and p is a rigid pattern we shall denote this

c

contraction as v pAnassignment is a pattern matching e v where e

a

is an expression and v avariable we shall denote this assignmentase v

This notation may seem unusual esp ecially that of an assignment but

it is logical and quite convenient It is derived from the following two prin

ciples On the left side wehave bound old dened variables on the

right side free new to b e dened variables When the op eration is

understo o d as a substitution the arrow is directed from the variable to its

replacement

c

Examples x s xa is a contraction for x If the value of x is

koshka after the execution of this contraction x b ecomes oshk and a

new variable s b ecomes dened and having the value kIfx is kot

the result is the imp ossible op eration Zfailure of matching Further this

contraction can b e decomp osed into a pro duct of elementary contractions

c c c c

xs xa xs xxx ssa

The third op eration used in Refal graphs is a restriction G where G

is a sum of contractions It is evaluated either to Zifatleastonecontraction

in G is successful or to the identity op eration Ido nothing An example

a c c

bs sasb Z

Idevelop ed a set of relations of equivalency for the algebra of pattern

matching op erations and the programming of SCP was based on it but

unfortunately this theory is not yet published the initial stages of the theory

can b e found in

The most imp ortant equation is the clash between an assignment and a

contraction for the same variable whichisresolved in a matching

a c

e v v p e p

Thus the example ab ove can b e seen as the equation

a c a a

koshkax xs x a oshkx ks

Here is an example of resolution which includes the contraction of a

b ound variable

a c c a

kotsx x xa sa kotx

To give an example of a function denition in the graph form here is the

graph for the iterative program of changing each a to b where no des

n corresp ond to congurations of the Refal machine

a

y

c c a

x s x f sa by y

c a

sa s y y g

c a

x out

With Refal graphs driving is an application of the commutation re

lations for patternmatching op erations Awalk in the normal form in

which it app ears in function denitions and represents one step of the Refal

machine has the structure CRA where the letters stand for Contraction

Restriction and Assignment resp ectivelyAwalk representing two steps is

C R A C R A Resolving the clash A C and then adjusting contractions

   

and restrictions according to commutation relations we return the walk to

the normal form wehave made one step of driving

Generalization

Generalization is one of the central problems of sup ercompilation It breaks

down naturally in two parts a decision to generalize the currentcon

guration C with some of its predecessors C trying to reduce C to it we

need a whistle to warn us that if we do not try reduction wemay end

up with innite driving and the generalization prop er te dening a

conguration C such that b oth C and C are its subsets A go o d gener

gen

alization algorithm must nd a balance b etween two extreme cases a to o

willing generalization whichmakes the resulting program interpretiveand

leaves it unoptimized and a generalization p ostp oned for to o long so that

the sup ercompilation pro cess never ends

In I dened an algorithm of whistling for lazy sup ercompilation of

nested function calls and proved its termination This algorithm was im

plemented in SCP and worked very well but only within its domain of

applicabili ty It gave nothing for generalization of at congurations ie

ones without nested function calls In SCP and SCP we used several

empirically found algorithms of generalizing at expressions but no termi

nation theorems were proven

An imp ortant step forward was initiated by Morten Srensen who sug

gested that the HigmanKruskal theorem ab out homeomorphic emb edding

HK for short should b e used to dene a whistle for sup ercompilation which

is of proven termination This was done in

The data domain in is the set of functional terms with xed arity

of each functional symb ol This kind of data is sucient for the languages

such as Lisp and which op erate on binary trees referred to as lists

But the data structure of Refal do es not b elong to this category It allows

concatenation of terms which can b e seen as the use of a functional symbol

of arbitrary arityavaryadic symb ol Fortunately the HigmanKruskal

theorem allows variadic symb ols When I learned this I dened a whistle

for sup ercompilation in Refal along the line of

I will briey outline the concept of emb edding following the work by

Dershowitz

Let a nite set F of functional symbols be given Consider the set T F

of all functional terms f t t with functional symbols f F Some

n

symbols maybeofarity n theyare constants and we shall write them

without parentheses f for f Some of the symb ols maybevaryadic

dierent n in dierent calls

Denition The homeomorphic emb edding relation onasetT F of

terms is dened recursively as follows

t g t t t f s s s s

 n  m

if either

t s for some i m

i

or

f g and t s for all j n

j i

j

where i i i m 

 n

Note that in the second rule f and g must b e identical but their calls may

have dierentnumberofterms nm someofthetermsin f maybe

ignored

Theorem HigmanKruskal If F is a nite set of function symb ols

then any innite sequence t t of terms in the set T F of terms over



F contains two terms t and t where jksuch that t t 

j k j k

To use HK we map the set of all Refal terms T onto the domain of

R

functional terms T F over some set F of functional symb ols

Denition The set F is S fs s f f g where S is the set of Refal

e s par fun

symb ols it is nite b ecause only those symb ol that enter the program can

app ear in computation Symb ols from S aswell as the two sp ecial symbols

s and s are of arity while the other twosymb ols are varyadic The

e s

mapping M T T F is recursively dened by

rt R

M si s

rt s

M ei s

rt e

M s s

rt

M ef M e

rt par rt

M se f M s M e

rt fun rt rt

M te M t M e

rt rt rt

M empty

rt

where s stands for any Refal symbol t term and e expression 

In Refal the most general data structure is that of expressions not terms

But it is easy to reduce a relation on expressions to a relation on terms

e e e e

R  R 

We dene the homeomorphic emb edding relation on Refal terms as

R

the mapping of the relation

t t if and only if M t M t

R  rt rt 

Rewriting the denition of in terms of Refal wehave

Denition The homeomorphic emb edding relation on the set T holds

R R

if either term is embeddedinterm

t e t e

R 

where t t and e for i are some expressions or expression is

R i

embedded in expression

t t t e t e t e t e

 n R  n n

 n

where t t for i nandany of the expressions e may b e empty

i R i

i



This denition translates into the algorithm in Refal given in Table

This algorithm was not yet tested in the computer but I b elieveitwill

work well

Idiscovered with some surprize that the emb edding relation on Refal

expresions leads to a whistle dierent from that derived from the emb edding

relation on Lisps lists even though these two kinds of symb olic ob jects

maylookidentical I cannot go into detail here see for that Just an

example and a few words

Emb t t results in T if t t

R

and in F otherwise

Emb feX Dec eX Embk eX g

Decide if the second case must be considered

Dec f eX T T

eX F F

eXEmbkeXg

Embk f

sN s s T

sN t s F

sN e T

t

tF

t t e Emb t t

f T T

F Embk t e g

t ets es Emb t ts

fT Embk ees

F Embk t ees g

g

Table The Refal program for the emb edding relation

R

Consider this relation

abc apbcq

If it is understo o d as a relation b etween Refal expressions itdoesnot

R

hold But if we see it as a relation b etween lists it do es hold Moreover the

algorithm for Refal expressions ab ove is linear with the size of expressions

while the corresp onding recursive algorithm for lists is exp onential it can b e

converted though into a quadratic iterative algoritm I must also notice

that we can have the Refal whistle working in the Lisp environmentby

exploiting a onetoone mapping b etween these two domains

A few words ab out generalization prop er With a given whistle algo

rithm various algorithms of the generalization prop er may b e used For a

whistle algorithm all variables of a given typ e s or e are the same while

for generalization prop er this is not so of course Still the the emb edding

relation which caused the whistle mayserve as a starting p oint for general

ization In particular if the relation t t in the case expression imbedded

i R

i

in expression happ ens for some i to b e an equalitywe can leaveitasa

common part in generalization For example the emb edding

abc pabcq r

R

leads to the generalization

genabcpabcq r x abcx



where x and x are some evariables



This metho d though works only for Refals data not for Lisps With

lists as the basic data structures generalization can preserve only that com

mon substructure which is on the left but not on the right side Even

though a list suchasabc lo oks like a string it is in fact a binary tree

which in the Refal representation is

abcnil

We can generalize it with a list which extends it on the right side without

lo osing the common part

genabc nil abcp nil abcx

but if the extension is on the left the most sp ecic generalization is a free

variable The common part is lost

genabc nil pabc nil x

Unfortunately when a program works by iterations as opp osed to pro

grams where data is passed from the value of one function to the argument

of another it is exactly on the left side that the lists are growing Because of

this a sup ercompiler working with lists may not p erform partial evaluation

in cases where Refal sup ercompiler easily do es it

Theorem proving

Using formal logic is not the only way to prove theorems in computers es

p ecially those of primary interest for computer scientists Metacomputation

provides an alternative metho d of automated theorem proving We face here

two dierent paradigms

In the axiomsandlogic paradigm of mathematics we deal with things

which are completely undened true abstractions Wecanknow ab out these

things only as muchaswe can extract from the axioms wehavechosen to

assume Mathematical ob jects as long as the mathematician is faithful to

the pro claimed axiomsandlogic paradigm whichvery often is not the case

do not really exist The meaning of the statement that certain mathematical

ob jects exist is simply that the manipulation of the symb ols representing

these ob jects in accordance with the rules of logic and the axioms do es not

lead to a contradiction

In contrast when we are doing computer science we deal with well de

ned nite cyb ernetic systems suchasTuring machines or computers and

with computational pro cesses in these systems

Compare the treatment of the primary theoretical ob jects of all exact

sciences natural numb ers in the axiomatic and cyb ernetic paradigms

In axiomatic arithmetics numb ers are abstract entities op erations on which

meet requirements co died in a certain numb er of axioms In particular the

op eration of addition is dened bytwo axioms

x x

x y x y

where x is the function next numb er applied to xTo prove a prop osition

one must construct according to wellknown rules a demonstration which

is a sequence of prop ositions

In the cyb ernetic paradigm natural numb ers are chains of some pieces

of matter called symb ols and functions are machines whichknowhowto

handle symb ols The Refal program for is

x x

xy xy

Another function wewant to compute is the predicate of equality

T

y F

x F

xy xy

The strong side of the axiomsandlogic metho d is its wide applicability

A theory maybedevelop ed ab out ob jects such as those of geometry or

set theory which are not easy to representbysymb olic expressions Also

the same theorem can b e used with dierentinterpretations Group theory

is usually adduced as an example However in computer science it is ex

actly the world of symb olic expressions and pro cesses that we are primarily

interested in For this world the cyb ernetic paradigm is pretty natural

The obvious advantage of the cyb ernetic paradigm is the completely

mechanized way to p erform computations Toprove that we only

have to compute the truthvalue of the prop osition

When wegive this job to the Refal machine the results is a nite computa

tion pro cess It ends with T whichproves the statement

This has b een a prop osition without quantication Can general prop o

sitions b e proven by computation

Not directly But they can b e proven by metacomputation For any

tautology of the prop ositional calculus metacomputation is straightforward

and guarnateed to give the desired pro of Dene logical connectives NOT

AND etc

NOT T F

NOT F T

and the others in the same manner Toprove de Morgans law p q

p q form the conguration

EQU NOT AND pq OR NOT pNOT q

It includes twofreevariables p and q but all the functions involved are not

recursive so the simple driving gives the nite result

c c

p Fq F T

c c

p Fq T T

c c

p Tq F T

c c

p Tq T T

Nowwe only have to recognize that all exit congurations in this graoh

are T hence the conguration can b e replaced by T This amounts to

the desired pro of

Let us take a simple example from arithmetics where the pro of requires

the use of mathematical induction Consider the following statement

x x x

Let us see how this theorem is proven by a sup ercompiler The transla

tion of the statementinto the cyb ernetic paradigm is as follows The initial

conguration

x x

evaluated by the Refal machine with anyvalue substituted for x results in

Tsowe exp ect from the sup ercompiler that it will equivalently transform

into just T

The sup ercompiler that makes this job uses the outsidein lazy driving

It attempts to drive the call of but the nested call of is a hindrance

thus it switches to driving the latter Twocontractions are pro duced in ac

c c

cordance with the denition of x and xx With the rst con

traction the computation is straightforward and leads to T With the second

contraction the machine makes a step in the computation of x

which pro duces the conguration

x x

The pro cess returns to the outermost call and makes in a unique way

one step according to the denition of The result is the same as

Thus wehave this transition graph

c

x T

c

x x

The sup ercompiler easily recognizes such a graph as transformable to just

T since the only exit conguration is T this is the form which mathematical

induction takes in metacomputation The theorem is proven We set aside

the problem of termination In our case it is secured by the fact that all

functions involved are total

The asso ciativity of addition is also easily provable in this wayHow

ever to prove the commutativity of addition requires more sophisticated

techniques which I shall discuss in Sec

Metasystem hierarchies and jumps

Consider metasystem hierarchies of computing machines After wehave

chosen a universal alllevel such as Refal a hierarchy

of computing machines b ecomes a hierarchy of programs Wewant to write

functions which are dened on denitions of other functions

In every programming language we distinguish the objects whichare

manipulated from certain sp ecial details variables and function calls which

e feg

s s

si si

ei ei

e feg

e feg

e e fe gfe g

 

Table The metaco de

represent sets of ob jects and computation pro cesses and cannot b e directly

treated as ob jects Let the set of ob jects b e S and the set of variables

ob

and function calls S To write a program which manipulates programs

vf

wemust map the set of all elements of programs ie S S on the set

ob vf

of ob jects S We call this mapping a metacode and denote the metaco de

ob

transformation of e as feg

S S S

ob vf ob

Obviously metaco ding must have a unique inverse transformation demeta

codingsoitmust b e injective

e e e e fe g fe g

  

For convenience of reading metaco ded expressions we require that fe e g



fe gfe g Also it is desirable that the image of an ob ject expres



sion b e as close to the expression itself as p ossible It would b e nice of

course to leave all ob ject expressions unaltered under the metaco de but

this is unfortunately imp ossible b ecause it contradicts to the requirement

of injectivity

One convenient metaco de for Refal which is used in the latest imple

mentation of this language is dened byTable where s is anysymb ol and

i the index of a variable

Consecutive metaco ding creates a hierarchyofMST domains

 

S S S

 k k 

where S S S and S fS gfork

ob vf

Compare two function calls F F x and F fF xg The

rst call is a functional comp osition F x is computed and its value is

taken as argument in the computation of F In the second call there is

no evaluation of F x but the metaco de of this expression is turned over

for the computation of F If the metaco de of Table is used wehave

F Fex This is an MST hierarchyoftwolevels function F

is supp osed to manipulate F its representation to b e precise If this ma

nipulation is semantic in nature ie based on the denition of Fasitisin

all interesting cases then the machine F must have access to the denition

of F In order not to encumb er our notation we shall always assume that

whenever a metamachine F manipulates a machine F it incorp orates the



denition of F sowe need not indicate this in each case

We use MST schemes for a clear and metaco deinvarient representation

of metasystem hierarchies An MST scheme is built according to the rule

whenever a sub expression has the form E fE gE the metaco ded part is

 

moved one level down and replaced by dots on the main level

E E



E fE gE E

  

This rule can b e applied anynumb er of times

Refal expressions on the lower level are written the same wayasifthey

were on the upp er level metaco ding is implicit and is indicated by putting

them one line down Toconvert an MST scheme into an equivalent Refal

expression wemust metaco de each level as many times as long is its distance

from the top

MST schemes allow us to representvery clearly certain op erations on

variables which are necessary for correct construction and use of metasys

tem hierarchies We shall show this using as an example the wellknown

pro cedure of converting an interpreter for some language into a compiler

by partial evaluation see Let L be an interpreter for some

language L written in Refal and used in the format L eprogedata

Let PE b e a partial evaluator for Refal written in Refal and having Refal

as the target language ie pro ducing a Refal program at the output We

apply PE to the call of L where some program P is substituted for eprog

while edata remains free This call is L P edataWemetacodeitand

submit to the partial evaluator

PE

L P edata

In this MST scheme the call of L which is submitted for partial eval

uation is a function of data only since the value of eprog is xed at a

sp ecic expression P After PE p erforms all op erations whichcanbeper

formed b ecause the program P is known it outputs a residual program

which is nothing but the translation of the program P into Refal Function

PE has worked as a compiler

Now supp ose wewant a function whichwould accept an arbitrary pro

gram not just P Ifwe simply put the variable program instead of P

PE

L eprog edata

we will not get what wewant Here the variables for data and for program

are on the same level and are treated in the same way No partial evaluation

takes place b ecause the value of eprog remains unknown to PEEven

though eprog is an argumentof L its value must b e provided on the level

of PE so that when L is running b eing driven by PE the program is xed

We represent this situation by raising eprog to the top level and leaving

the bullet in the place where this variable originated on the b ottom level

PE eprog

L edata

We shall call the variables like eprog elevated For suchavariable

the denition level at which its name is placed is dierent from the usage

level where the bullet is found and the dierence h between the two is the

variables elevation The value assigned to a variable on the denition level

enters the conguration after b eing metaco ded h times

Even though eprog is used by L it is not free for it It is free on the

level of the partial evaluation function PEtorun PE wemust rst substitute

some sp ecic program for eprogHenceL always receives a xed program

The result of PE will b e a transformed partially evaluated function L which

dep ends only on the variable edata and is a translation from L into Refal

The translation however is made directly by PE which can work with

any denition of L hidden in the function name Laswe agreed ab ove

We can sp ecialize PE by partially evaluating itself by itself according to the

MST scheme

PE

PE eprog

L edata

This scheme is the scheme of generation of a compiler from L The

program which it pro duces is a compiler it has a program at input and a

function of data at output

The rule of two levels helps read MST schemes The variables on the top

level are free Those on the next level are bound they run over their domains

as eg integration variables or the variables in a function denition Any

top part can b e chopp ed o from the rest of the scheme hence every level

can b e interpreted as if it were the top

It often happ ens that a program transformer must transform a function

call which in fact can b e simply evaluated The argumentmay include no

free variables or yet uncomputed function calls or if there are some they

may not b e consulted at any stage of evaluation Even more frequentisa

situation where such indep endence of unknown data holds for a part of the

evaluation pro cess even though not for the whole length of it

Consider our twolevel scheme of compilation The interpreter L op erates

on a known program andunknown data On some stretches of computation

L will work on the program but without consulting the data An obvious

example is the parsing of the program Further if the language L includes

GO TO statements with jumps to a lab el then it may b e necessary to

examine a big piece of program in search of the needed lab el The work

of the function PE in this part of computation will b e nothing else but

simulation of the work of L which of course will takemuch more time than

a direct run of the function L

In we describ e a sup ercompiler whichmakes automatic jumps from

one level to another in order to avoid doing on the level n in the interpre

tation mo de what can b e done on the level n by direct computation

Before driving a conguration the sup ercompiler passes control one level

down by demetaco ding the conguration and starting the execution of it If

it is p ossible to bring the computation to the end the result is metaco ded

and control returns to the upp er level If at a certain stage of execution

its continuation b ecomes imp ossible b ecause of unknown values of variables

the conguration of the latest stage preceding the current is metaco ded and

controll passes to the top level for driving

Tomake this system work it was necessary to mo dify the implementa

tion of Refal by adding a feature whichwas called a freezer see In

tests we could see that the use of metasystem jumping can lead to a very

considerable sp eedups sometimes by a factor of more than twenty

Refal vs Lisp

As mentioned ab ove the ma jor dierence b etween Refal and Lisp as well as

other languages working with lists is the data domain Refal expressions are

strings of terms which can b e pro cessed b oth left to right and right to left

They are trees with an arbitrary and unxed arity Lisps list is a sp ecial

kind of a Refal expression There are several reasons why I stubb ornly use

Refal b eyond the main reason which I am trying to conseal I invented it

I hop e that so oner or later the metho ds of metacomputation will b e used

on the industrial scale for automatic development of big and fast programs

The ecinecy of algorithms is as wevery well know tightly b ound to data

structure I cannot imagine that practical programmers will agree to aban

don such an imp ortant data structure as string Limiting ourselves to lists

we throwoverb oard a huge pile of ecient algorithms

As wesawabove Refal expressions allow such generalizations whichare

inexpressible in lists This makes sup ercompilation easier and more ecient

Our data structures are essentially mo dels of reality More sophisticated

data structures allow us to express more subtle features of the medium

A language based on graphs would have the same advantage over Refal as

Refal has over Lisp

When we create a metamachine for examining and controlling the op era

tion of the ob ject machine we often want to trace its steps in b oth forward

and backward directions Histories of computation are naturally represented

by strings of states In Sec I showhow sup ercompilation can b e enhanced

by switching from congurations of the computing machine to histories of

computation by it Moreover backward movement is part of the concept of

sup ercompilation It can b e avoided but not without paying some price

in conceptual simplicity if not in anything else Languages we use not only

help express somehting we are doing they suggest what we might do further

It is not an accident that the concept of sup ercompilation rst app eared in

the context of such a language as Refal

Functional languages using lists are go o d for programming in recursive

style but p o or when the algorithms are iterative Meanwhile we often face

the situation where a recursive algorithm is clear and elegant but inecient

so that wehave to transform it into an iterative form In Lisp even a simple

traversal without inverting the list is imp ossible when wedoititeratively

Refal is equally at ease with b oth recursive and iterative programming 

The use of lists though is not without its own advantages As a data

structure for analysis and manipulation lists are simpler than Refal ex

pressions though in my view the dierence is not signicant Another

advantage is the simple fact that p eople in computer science researchhave

accustomed to this domain and the languages based on it are widely used

One balances these two sets of advantages according to ones priorities

Still to come

Walk grammars

Now I will showhow to make one more and mayb e most promising

metasystem transition in program transformation

As discussed in Sec one step of the Refal machine is represented

in the patternmatching graph as a normal walk C R A For driving we

combine two steps by concatenating two normal walks C R A C R A and

  

normalize them into one walk again We can p ostp one driving and combine

anynumb er of elementary walks into unnormalized walks of arbitrary length

Suchwalks will represent p ossible but not necessarily feasible histories of

computation without p erforming the computation itself

Take the graph

a

y

c c a

x s x f sa by y

c a

sa s y y g

c a

x out

from Sec Denote the onestep walks in the graph as follows

a

w y

c c a

w x s x sa by y



c c a

w x sxsa s y y



c a

w x out



Now the set of all terminated walks histories of completed computation is

describ ed by the regular grammar

w

w



w



w





or by the regular expression w w w w

  

It is easy to see that for an arbitrary Refal program the set of all walks is

dened by a contextfree grammar while if we restrict ourselves to at Refal

no nested calls the walk grammar b ecomes regular hence the whole set is

represented by a regular expression which is a great advantage of the at

version We shall work with a generalization of regular expressions where

the numb er of iterations is denoted byavariable so that suchwalksets as

n n

w w are p ermitted

Walksets are an alternative form of a program We can dene an in

terpreter Int which executes such programs and transform Int calls by the

sup ercompiler an MST to the threelevel hierarchy Scp Int P r og r am

But what do weachieveby this MST Well if Int do es just driving ie

pro cesses the walks in the strict order from left to right wehaveachieved

nothing But we can create a clever interpreter which uses equivalency rela

tions on the set of walks It could unwind iterative lo ops b oth from the left

n n n n

and from the right ie use the relation W WW or W W W

in order to achieve reduction in sup ercompilation It could also reorder op

erations in walks using commutation relations and do other transformations

In I show that with this technique we can make transformations which

could not b e done by direct sup ercompilation such as function inversion

and the merging of consecutive iterative lo ops

The Scp Int technique can b e very eectively used for graph cleaning

Supp ose we nished sup ercompilation and have the resulting at graph G

It do es no mean that all exit no des expressions for output are actually

feasible For eachnodein G we can write a regular expression for the set of

all walks which lead to this no de Using the ScpInt metho d wemaydiscover

that some walksets are reduced to Z then these no des can b e eliminated

As an example let us return to the pro of of commutativity of addition

whichwehave found more dicult to prove than the other theorems in

Sec The pro of requires a considerable analysis of the graph resulting

from straightforward sup ercompilation I will only sketch the pro of

The conguration to compute is

xy yx

In the pro cess of sup ercompilation is generalized and reduced to

the generalization

a a

x xy y xy yx

The graph for has exits Four of them are T eleven are FTo

prove the theorem the walks whichleadtoeachoftheeleven F ends must

b e proven unfeasible As an example I will do it for one of the walks which

is neither the least nor the most dicult

a a c c c c

n n

w x xyyy y xx yyx

c c c c c

m m

yy yy yy y yy

Using commutation relations we reduce it to the form

a c c

n

w x xxx x

a c c c

p q

yy yy y yy

where wehaveintro duced new variables p q whichshow the total number

of iterations in the walk Their relation to the lo op variables m nnamely

p m and q n m will b e treated as a restriction on p q

The unfeasibilityofw results from the second line ie y partofitso

we ignore the rst line xpart The call of the interpreter takes the form

a c c c

p q

Int yy y y y yy

This is a function of p and q Unwinding the plo op means breaking it into

a resursive call and the base

c c

p p

W p p WW p

and analogously for the q lo op

Thus driving pro duces branches to four cases

c c

Int w p pq q

c c

p pq

c c

pq q

c c

pq

Let us consider the walk transformation in This is the case when

recursion takes place in b oth plo op and q lo op

a c c c c c

p q

yyy yyy y yyyy

Resolving the clash ony wehave

a c c a a

y yyy yy yy yy yy

a

Now the assignment yy travels to the right and clashes with con

c c

traction yy to pro duce nothing The contraction y y is taken

from the argumentofInt and b ecomes a contraction on the input variable

y I cannot go here into formal details The result is that b ecomes

identical to a reduction folding

It is easy to check that congurations and are unfeasible Con

guration is an exit from the lo op where p and q are decreased byone

in every cycle If we denote the numb er of cycles as N the restriction on

p q becomes

p N m q N n m

When p q wehave the restriction m n m which cannot

b e satised b ecause n The graph for b ecomes a lo op without exits

c c

Int w p p q q

This completes the pro of of unfeasibility of the chosen walk The other

ten walks are handled analogously

Alternating quantiers

The logical formula for commutativity of addition is universally quantied

over x and y Nowwewant to nd out how the computational paradigm

tackles the cases of existential quantication and esp ecially those where

and alternate As is well known a sequence of identical quantiers can b e

reduced to one by op erating on tuples of variables but there is no similar

reduction when quantiers alternate We shall see that each putting of in

frontof orviceversa requires computationally a metasystem transition

Let All b e a function which uses a sup ercompiler to prove universally

quantied statements as in the ab ove examples If the sup ercompiler comes

with a graph where no branch ends with F it outputs T otherwise it outputs

ZThus

T xPxisproven

All P x

Z no information

Tointro duce existential quantication we dene the function Exs which

constructs by driving the p otentially innite tree of congurations using the

breadthrst principle If it nds that some branch ends with T it outputd

T Otherwise it works innitely or realistically till it is stopp ed

T xPx is proven

Exs P x

is stopp ed no information

As always in Refal a variable x may b e an ntuple xxnIfallof

them take part in the driving implied in All P x or Exs P x

they are all appropreately quantied eg computing

All

P x y z

is proving xy zP x y z We can x the value of one variable say xby

raising it to the top level see Sec

All x

P yz

This computation requires some value of x be given and for this value

it tries to prove y zP x y z

We can consider this function as a predicate dep ending on x and quantify

it existentially by submitting it to function Exs

Exs

All x

P yz

This is the metacomputation formula MST scheme for xy zP x y z

In a similar manner we establish that the logical formula xy zP x y z

is represented by

All

Exs x

All y

P z

Following these lines it is easy to construct an MST scheme for every

logical formula after it has b een reduced to the prenex form

As an example consider the theorem there exists no maximal natural

number xyLessy x Here the function Less is dened as follows

Less xy Less xy

Less x F

Less y T

Less F

To prove the theorem we rst reduce the prop osition to the prenex

normal form xy Lessx y wehave used the equivalence Ly x

Lx y then we form the corresp onding MST scheme

All

Exs x

Less y

Sup ercompilation of this simple conguration can b e done manually

and I did this I wrote a sp ecialized version of Exs which do es driving

in the exp ectation that the only function called is Less Then I did the

sup ercompilation implied in All and the result was T whichproves the

theorem

Neighb orho o d analysis

Consider a function which lo oks for the rst a in the string and returns T

if it is found otherwise it returns F

fa ax T

fa s x fa x

fa

Consider the computation of fa kasha

fa kasha

fa asha

T

One may notice that there is a part of the argument namely sha

which did not take part in computation It could b e replaced byanyex

pression and the computation as well as its nal result would not change

a bit One might guess that this kind of information ab out computational

pro cesses maybeofinterest for dierent purp oses such as debugging and

testing programs Avariation of driving driving with neighborhood

provides a general metho d for representing and extracting such information

We dene a neighborhood as the structure ap where p is a pattern

and a is a list of assignments for all variables in psuch that the result of

substitution ap is a ground expression ie one without variables referred

to as the center of the neighb orho o d Driving with neighb orho o d is a com

bination of computation and driving In computation the argumentisa

ground expression and it denes the path of computation whichsentence

is used at each step In driving the argument is an arbitrary expression

and we analyze all p ossible for it computation paths Driving with a neigh

borhood we drive its pattern but consider only one path namely the one

taken by the neighborhoods center Ateach step the center is the same as

if the initial function call were directly evaluated The free variables in the

pattern whichmay b e lo osely called neighb orho o d represent the part of

information whichwas not up to the current stage used in computation

Consider this driving

a c

kashay y fa y yky

a c

ashay ky fa y yay

a

shay kay T

In the initial neighb orho o d column the pattern has the maximal ex

tension anything a free variable y the assignmentmakes the center

kasha In column is the call to compute the pattern By driving under

the denition of fawe nd that the contraction in column is necessary

in order to take the path the center will take the second sentence of the

denition Mo difying the neighborhood bythiscontraction wehave the

next stage neighb orho o d in line Pro ceeding further in this manner we

complete the computation of the initial call it is T and get the representa

tion of the argument as a neighb orho o d with the pattern kay whichtells

us that together with our argument any argument whichmatches kay

will lead to the same result of computation

Sergei Abramov found a way to use neighb orho o d analysis for program

testing This may seem strange b ecause the neighborhoods giveus

information ab out unused parts of arguments data not ab out the program

But Abramov makes a metasystem transition driving with neighb orho o d

is applied not to program P working on data D but to program Int which

is em an interpreter of the language in which P is written and works on

the pair P D Now the program b ecomes data Fixing some input D a

test for P wecanby neighb orho o d analysis determine what parts of the

program were used and hence testedin this run and which parts were not

On this basis Abramov built an elegant theory of program testing which

usues the principle cho ose eachnexttestsoastocheck those features

of the program whichhavenotyet b een tested Abramovgives a precise

mathematical denition to this intuitive principle and provides the necessary

theorems and algorithms

Conclusion

Sup ercompilation and partial evaluation b elong to the same kind of program

transformation whichwe refer to as metacomputation Sup ercompilation

includes but go es far b eyond partial evaluation It may cause a deep trans

formation of a program esp ecially when combined with various metasystem

transitions Potential applications of driving sup ercompilation and other

forms of metacomputation are numerous and include function inversion pro

gram testing and theorem proving Esp ecially intriguing is the p ossibility

of rep eated metasystem transitions from pro cessing a function to pro cess

ing the sets of p ossible computation histories walks in the graph of this

function as shown in Sec

The b oundaries of what is p ossible to do with sup ercompilation are not

yet known I would say that while sup ercompilation is certainly not suf

cient for successful program transformation it is in a sense necessary

b ecause this concept is a computer implementation of the general principle

of human knowledge which is a search for such generalized states in terms of

whichwe can construct a selfsucient mo del of a system One consequence

of this nature of sup ercompilation is its universality No sp ecial conditions

or restrictions are set b eyond the fact that we deal with a computing sys

tem In my view it is natural to nd what can b e done by sup ercompilation

b efore trying more complicated approaches This is what I mean bysaying

that sup ercompilation is necessary

Even though the principle of metacomputation is simple its translation

into working machines may b e far from b eing simple This is not unusual

The basic principles of ying are also simple but an airplane consists of

many thousands of details and it has taken manyyears of work by many

p eople in order to develop air technology to the stage when the wonderful

machines of to day b ecome p ossible Metacomputation and in particular

sup ercompilation are now at the technological stage of the brothers Wright

Let us hop e that a steady pro cess of technological improvement of sup er

compilers can b e started and that it will pro duce software to ols to b e widely

used in computer science and industry

Acknowledgment Toavoid rep etition of what I have said in the History

section let me simply express my deep gratitude to all those who worked

with me or appreciated mywork

References

SMAbramov Metacomputation and program testing in st Interna

tional Workshop on AutomatedandAlgorithmic Debugging Linkoping

Sweden pp

SMAbramov Metavychisleniya i ikh Prilozhenija Metacomputation

and its Computations in Russian Nauka Moscow

Bazisnyi Refal i yego realizatsiya na vychislitelnykh mashinakh Basic

Refal and its implementation on computers in Russian GOSSTROY

SSSR TsnIPIASS Moscow

SVChmutov EAGaydar IMIgnatovich VFKozadoy

APNemytykh VAPinchuk Implementation of the symb ol analytic

transformations language FLAC DISCO LNCS vol p

DershowitzN Termination in rewriting Journal of Symbolic Compu

tation pp

Ershov AP On the essence of compilation Programmirovanie

in Russian See translation in EJNeuhold ed Formal

description of Programming Concepts pp NorthHolland

Op ening Keynote Sp eech in DBjornerAPErshov and NDJones

ed Partial Evaluation and Mixed Computation NorthHolland pp

Futamura Y Partial evaluation of computation pro cess an approach

to compiler compiler Systems Computers Controls pp

Futamura Y Nogi K Generalized Partial Evaluation in Bjorner D

Ershov AP Jones ND eds Partial Evaluation and Mixed Com

putation Proceedings of the IFIP TC Workshop pp North

Holland Publishing Co

Futamura YNogi K Takano A Essence of generalized partial eval

uation Theoretical Computer Science pp

Gluc k R Towards multiple selfapplication Proceedings of the Sym

posium on Partial Evaluation and SemanticsBasedProgram Manipu

lation Yale UniversityACM Press pp

RGluc k and JJrgensen Generating transformers for deforestation

and sup ercompilation in B LeCharlier ed Static Analysis Proceed

ings Namur Belgium LNCS vol pp Springer

RGluc k and AVKlimov Occams razor in metacomputation the no

tion of a p erfect pro cess tree in PCousot MFalaschi GFile and

RauzyedStatic Analysis LNCS vol pp Springer

RGluc k and AVKlimov Metacomputation as a to ol for foramal lin

guistic mo delling in RTrapple ed Cybernetic and Systems vol

pp SIngap ore

RGluc k and AVKlimov Metasystem transition schemes in computer

science and mathematics Worlds Future the Journal of General Evo

lutionvol pp

RFGurin and SARomanenko The Programming Language Refal Plus

in Russian Intertekh Moscow

Jones ND Sestoft P Sondergaard H An Exp erimentinPartial Eval

uation The Generation of a Compiler Generator In Jouannaud JP

Ed Rewriting Techniques and Applications Dijon France LNCS

pp Springer

Jones ND Automatic program sp ecialization a reexamination from

basic principles in DBjornerAPErshov and NDJones ed Partial

Evaluation and Mixed Computation NorthHolland pp

Jones N D Sestoft P Sndergaard Mix a selfapplicable partial

evaluator for exp eriments in compiler generation in Lisp and Symbolic

computation pp

NDJones The essence of program transformation by partial evaluation

and driving in NDJones MHagiya and MSato ed Logic Language

and ComputationLNCSvol pp Springer

Kistlerov VL Printsipy postroeniya yazyka algebraicheskikh vy

chislenii FLAC The dening principles of the language for algebraic

computations FLAC Institut Problem Upravleniya Moscowin

Russian

Klimov AV and RomanenkoSAA Metaevaluator for the language

Refal Basic Concepts and Examples in Russian Preprint Keldysh

Institute for Applied Mathematics Moscow USSR

Jose Meseguer General logics in HD Ebbinghaus et al ed Logic

Col loquium pp NorthHolland

Jose Meseguer and Manuel Clavel Axiomatizing reective logics and

languages submitted for publication

Olunin VYu Turchin VF FlorentsevSN A Refal interpreter in

Trudy oi Vses Konf poProgrammirovaniyu Kiev in Russian

PSestoft The structure of a selfapplicable partial evaluator in

HGanzinger and NDJones ed Programs as Data Objects Copen

hagen LNCS vol pp Springer

The generation of inverse functions in Refal in DBjornerAPErshov

and NDJones ed Partial Evaluation and Mixed Computation North

Holland pp

Inversion and metacomputation in Proceedings of the Symposium on

Partial Evaluation and SemanticsBasedProgram Manipulation Yale

University pp ACM Press

Romanenko SA A compiler generator pro duced by a selfapplicable

sp ecializer can have a surprisingly natural and understandable struc

ture in DBjornerAPErshov and NDJones ed Partial Evaluation

and Mixed Computation NorthHolland pp

Romanenko SA Arity raiser and its use in program sp ecialization in

Jones ND ed ESOP LNCS vol pp

MHSrensen Turchins Supercompiler Revisited Masters thesis

Dept of Computer Science University of Cop enhagen

MHSrensen RGluc k An algorithm of generalization in p ositivesu

p ercompilation in JWLloyd ed International Logic Programming

Symposium MIT Press to app ear

MHSrensen RGluc k and NDJones Towards unifying deforesta

tion sup ercompilation partial evaluation and generalized partial evalu

ation in DSannella ed Programming Languages and Systems LNCS

vol pp Springer

MHSrensen RGluc k and NDJones A p ositive sup ercompiler Sub

mitted to Journal of

Meta jazyk dlja formalnogo opisanija algoritmicjeskikh jazykov A met

alanguage for formal description of algorithnic languages in Russian

in Cifrovaja Tekhnika i Programmirovanie pp Moscow

Turchin VF Programmirovanie na yazyke Refal Programming in Re

fal in Russian Preprints Nos of the Institute for

Applied Mathematics AN SSSR

Turchin VF Equivalent transformations of recursive functions dened

in Refal In TeoriyaYazykov I Meto dy Postro eniya Sistem Program

mirovaniya Pro ceedings of the Symp osium KievAlushta USSR

pp in Russian

Turchin VF The Phenomenon of Science Columbia University Press

New York

Turchin VF The Language Refal the Theory of Compilation and

Metasystem AnalysisCourant Computer Science Rep ort New

York University

Turchin VF Nirenb erg RM Turchin DV Exp eriments with a

sup ercompiler In ACM Symposium on Lisp and Functional Program

mingACM New York pp

Turchin VF The concept of a sup ercompiler ACM Transactions on

Programming Languages and Systems pp

Turchin VF The algorithm of generalization in the sup ercompiler

In Bjorner D Ershov AP Jones ND Eds Partial Evaluation and

Mixed Computation Pro ceedings of the IFIP TC Workshop pp

NorthHolland Publishing Co

Turchin V Refal Programming Guide and Reference ManualNew

England Publishing Co

Turchin VF Program Transformation with Metasystem Transitions

J of Functional Programming

Turchin V Nemytykh A Metavariables Their implementation and

use in Program Transformation CCNY Technical Rep ort CSc TR

Turchin V Nemytykh A A Selfapplicabl e Sup ercompiler CCNY

Technical Rep ort CSc TR

Turchin VF On Generalization of Lists and Strings in Sup ercompila

tion CCNY Technical Rep ort