noeeeehe ehmmheeeeeeeeeeal - dtic · naval postgraduate school monterey, california 93940 11....

150
AD-AlGA 586 NAVAL POSTGRADUATE SCHOOL MONTEREY CA FIG 9/2 CONDITION RECOGNITION FOR A PROGRAM SYNTHESIZER.IUI N UNLSIID JUN Al J S LAPE. C W MI LLER USIEIEEEEEEEE NOEEEEhE EhmmhEEEEEEEEEEAl

Upload: others

Post on 12-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

AD-AlGA 586 NAVAL POSTGRADUATE SCHOOL MONTEREY CA FIG 9/2

CONDITION RECOGNITION FOR A PROGRAM SYNTHESIZER.IUI N

UNLSIID JUN Al J S LAPE. C W MI LLER

USIEIEEEEEEEE

NOEEEEhEEhmmhEEEEEEEEEEAl

Page 2: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0NAVAL POSTGRADUATE SCHOOLMonterey, California

THESISCONDITION RECOGNITION FOR A

PROGRAM SYNTHESIZER

by

Joseph Shawn Lapeara id'

Charles Wayne Miller

June, 1981

Thesis Advisor: Douglas R. Smith

Approved for public release; distribution unlimited

k __9_2__0%

Page 3: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

SECURITY CLASSIFICATION OF THIS PAGE (Uhum bag. Soto)___________________

REPR OCUMENTATION PAGE NUMBS TRU~TIfNS ORI. R9PORT NUNNE 12. OOVTACCESSIO it. L RCIP~INT CATALOG mNMBER

4. TITLE (awaug ucEle) I. TYPE or REPORT S, PERIOD COVERED

Condition Recognition for a Program Synthesizer Juner' 1981 is

S. PERFORMING ORG. REPORT NUMER

7. AUT040OR(sj 6. CONTRACT OR GRANT NUMSCRI.)

Joseph Shawn LapeCahrles Wayne Miller

9. PERFORMING ORGANIZATION NAME AND ADDRESS 10. PROGRAM ELEMENT. PROJECT, TASKAREA A WORKC UNIT NUMBESA

Naval Postgraduate SchoolMonterey, California 93940

11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE

Naval Postgraduate School June 1981Monterey, California 93940 13. NUNBER1OF PAGES

14714. MONITORING AGENCY NAMEK & ADORIESS0lI differen h Cag~ifI1i1d O0111*0 IS. SECURITY CLASS. (of this raper)

Unclassified

160. 21JCk ASSIFIC ATIOk/ DOWN GRADIN4GNDULE

IS. OIST RIBUTION STATEMEN1T (of this Rea4J

Approved for public release, distribution unlimited

17. OISTRIBUTION STATEMENT (of do@ abstrimi entere~d Ia o , It different. *4 M~)

IS. SUPPLEMENTARY NOTES

IS. KEY WORDS (Cagglm.. a~ v"idea i naaaaamW end 5Idielp A k ber)

program synthesis, automatic programming, conditions, example computation,static processing, dynamic processing, miniterms, character set hierarchy,condition recognition

20. ABISTRACT (C4stMa On... 0041 1 Odd 10 1060605' Ai #~*Irby AS'Aell -o)

-An enumeration algorithm which synthesizes programs from examplecomputations is presented. The algorithm, originally proposed by Alan W.Biermann of Duke Ualiversity, assigns a labelling of the instructions containedin an example trace consistent with producing minimum state Moore machinerepresentations for the synthesized programs. Techniques for processing theinformation to reduce enumeration are given. Biermann' s algorithm isextended by trace preprocessing techniques which identify and generalize

00 IAN11473 C0OITION OPl I NOV #6 If OB0SOLETE(Page 1) SIX 0102-018-4*01

SECURITY CLASUIFICATION OP THIfS *AS# eln =70=1000,0

Page 4: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

conditions on instruction sequencing in the synthesized programs without theuserfs assistance. The techniques are presented using text editing as thedomain, but are general enough to be extendable into other domains.

Acressol orNTIS AI

DD orvM 1472 2S/14 IFA'b2%l4-601 sge9 CAWUIC66*ION@ Oi ?IS &afbbe&#*d

6.*-~-

Page 5: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Approved for public release; distritution unlimited.

CONDITION RECOGNITION FOR A PROGRAM SYNTFESIZER

by

Charles Wayne MillerCaptain, Uinited States .Marine CorpsB.E., Vanierllt University, 1472

and

Josepn S~nawn LapeCaptal.., United States Marine CorpsB.S., University of Louisville, 197b

Submitted in partial fufi'lilment of tnerequirements for tne degree of

MASTER OF SCIENCE IN CO' PUT;P. SCIENCE

from tne

NAVAL POSTGRADUATE SCHOOLJune 19EI

A u t h o r s _ _ _ --- -------

Approved by: -- - -- - - -- - -

-- - -Se -n- - -- -r

C- a no epartm Comuter Science

U LDean of Inor mation and Policy Sciences

3

Page 6: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

ABSTRACT

An enumeration aleoritnm whicn synthesizes prorrams from

example computations is presented. Tne alporitnm, originally

proposed by Alan i. Biermann of Duie University, assiens a

laoelling of the Instructions contained in an example trace

consistent with prolucing minimum state Moore macnine

representations for the syntnesized programs. Tecnniques for

processing the information to reduce enumeration are given.

Blermann's algoritnm Is extended by trace preprocessing

techniques wlich identify and generalize conditions on

Instruction sequencine in tfe synthesized proarams witnout

the user's assistance. The techniques are presented using

text editing as the domain, but are general enough to be

extendable into other lomains.

4

Page 7: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

TABLE OF CONTENTS

I. INTRODUCTION ---------------------- 1

A. BACKGROUND -------........---------- .. 1v

B. AUTOMATIC PROGRaMmING ----------- ----------- 16

1. '4enerai ------------------------------ 16

2. Problem Specification witnt Natural Languaze -19

3. Formal Problem Spezification -------------

4. Input-Output Pair Specification -------------

5. Example Computations .------------------------ b

5. A General Automatic Programmer Desipn ------- 29

C. OBJECTIVES ------------------------------------------ 2

D. THESIS ORGANIZATION ------------------------------- 3

II. SYNTHESIZER --------------------------------- 5

A. GOALS ------------------------- 5

B. OiEREE --------------------------------

1. eneral Description ------------------------- 36

2. Trace Coline ---------------------------------

3. Innut/Output Trace Renresertation -----------

C. SYNTHESIS PROCEDURE ------------------------------ 7

1. Function ---------------------------- 44

2. Concepts -------------------- 45

D. SYNTHESIZER STRUCTURE --------------- - ---- 52

1. Static Processing ------------------ 52

2. Dynamic Processing ----------------------- 57

a. Label Assignment ------------------------ 59

b. Difference Set Resolution --

5

Page 8: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

c. Dynamic juivaience --

. 5acxup/t1xup -- 7Z

III. ?~P~i3S?------------------------------------------

. &PR L1ZR 3nEIPI T N -,

~.DFSI1N FOR A CCJNTEZ F~ --------- 7

1. overview -- - - - - - - - - - - - - - - - - -U

2. Stru-tur- ot tne Condition Pre;c-sscr -

3. Preprocessor Data Strur. .re5 --

4. Implementation ------- ----------

C. DESI N FOR A CONTE XT SVJSITIVE WViRO -1 N' .... - ----

1. Cverview -- - - - - - - - - -- - - - - - - - 7

2. Implementation ...- Iiz

1V. CONCLUSIONS AND RECOMMEND&TIONS --------------------

A. SYNTFESIZEh --------------------------------------

B. CONDIrION PROCESSING ---------------------------11

AFFENDIX A: FRO0,RAM LISTING- F0 SYNTHESIZE -------------- 1

lIST OF EFERENCS----------------------------------- ----- 4

I'JITIA! D13T1HI '0TT11X LIST -----------------------------------

NOE.6

Page 9: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

LIST OF FI:UES

1. In i ti a i i z e (I Se q u e n t f'o r tnie S o :a re R oo t P r ,)rle -i -. .-----

?. An '1rapti Co.ruta onr---------------------------------,

~.PIpu Mora ---------------------------------------*. Input Tra-e -

5 cn-4etermiirist,: Voore Macalnre ....-- "

C. Deter-rinisti- Moore ' acni - - --

7. Instruction-Conrit ion-Instruct i cr Triple --

. C.aininq of Difreren-e Set Reiatio a

Y. Non-leterin1stic Input Trace -7

1Z. Deterinistic Trace -- e'

11. Strain1tt-line Program --

12. Minimum State Machine --

13. Ilnstruction Set Lower 5 --oss --- I

STypici Input to -tatic i-rore- sor -------------------

15. "oore acmine for Input Trace ----------------------- ,

1. Inter-ediate Tra'e Tare ----------- ----------------

17. TraceTa ------------------------------------------

2- . Partial Trace Laeiin ------------------------------.

IY. Partially Determinec. "oore "acaire -,--------- ----

2'. Trace Taole/Failure Memory Confip-uratio: for a

Forcel Assienment--------------------------- --------

21. Trace Table Entry Snowi_ Aritrary

Assion7ient etnoa ------------------------------------

7

Page 10: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

22. Nondpter~inistir! InDUt Trace ------------- 6

23. Trace rable/Faliure memory Conf'iguration

After Assieni"ent at thle Fourth Level -------- 5

24. Nondeterministic Pref'ix Label Assignment -------- l

2b. Trar*e Tatle/Failure Meoy-------------7

?6. Computation Without Ezpiicit Conditions-------------- 76

27. Computation 'ditn Explicit Conditions ---------76

29. Svnttesizer Action ------------------- 1

?9. ASCII Ve,:tor ---------------------------------------- b

30~. Default Hierarcmyv----------------------------------- 2

31. Moditted Hierarchy -- ----- ----- -

3?. Format of Transition Table ------------------------ 3

33. Monitor Output -- ----------------- ------- 9

34. Completel Transition Table -------------------------- 93

35. Condition for "Time" and "time"----------- ------- 99

8.........

Page 11: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

ACKNOWLEDGEMENT

We wisn to acicnowi ege Alan 'w. Blermann for tte extra fte i

ttat P e f urnis feI u5 while we were doing the researcn rcr

this thesis, and for the insigtts wnict te gave us on

!rethods of proerammine by example.

IJ

Page 12: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

I. INTRODUCTION

A. SACCGROUND

Since the introduction of electronic computine macnines,

manual tasks that are mundane, tedious ani/or repetitious

nave been considered for automation. The computer is iaeally

suited for tnls type work since it neitner complains c±*

boredom nor wanders from its assigned task. Tne macnine

meticulously sequences throuzh a series of' computations over

and over, producing answers consistent witnin tne

limitations of the hardware. &s consistent as tfle computer

is at performing tasks, assigning tne tasks is still left to

the user of the system.

Programming the early macnines was a difficult chore.

Communications between man and macnine were only

accomplishable through the language of tne machine. This

machine language consisted of binary coaei iacnine

operations. Tae efficient macnine language programmer had to

memorize these codes or Keep a list of the codes close ty.

All control transfer points had to be coded in atsolute

macnine addresses wlich tne programmer calculated by qant. A

prorrammmer had to interpret the binary representation of

the machine operations to determine tne cause of errors in

protrams. There were no diacnostic messages to aid tne user

in isolating errors. The difficulty of programming in

Page 13: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

m3.nine lanpuaee led to a searcn to rini better way5 cf

generating prorrams. ?ne first step was tne recor~tlon tnat

tfe computer was a zool boo geeper. capable Of computinO

absolute addresses from labels and translating mrnemoni -

representations of" machine operation codes. Wetster's New

Word Dictionary, Second Edition, defines mnemonic to te, a

system or tecnnique of Improving memory by tne use of

certain formulas. Soon proerams were written wnicn would

accept abstract programs containing mnemonics and labels,

convert the mnemonics into macnine operation codes and

translate tne labels into absolute macnine ad .resses. Tiese

programs produced executable macnine ianguage co(4e as

output. These translation proerams were called assemblers

and the data tney translated were called assembly larguage

programs.

Assembly language provided some automation of tne manual

tasts associated witn machine lanouaqe propramminz. An

important convenience of assembly language Is tae

readability of the prorams wnen corparel tc Tacni.e

language programs. The mnencmics convey tne meaning of treir

function wnile tne labels relieved tne proprammer o

calculating absolute addresses for control transfer points.

Assembly language provided a level of abstraction wnicn

allowed prorrammers to concentrate on tne proprammine

problem witnout dealing witn every atomic macnine operation.

The assembler provided booieepinR, address translation and

11

Page 14: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

mneumonic iecodlng fast and efficiently. Programmers were

now capable of producinz more code in less time witn *ewer

errors with assembly language.

Assembly lanruaee eased tae programmers tasT but it

still could not be considered a panacea for -omputer-rurran

interaction. Assembly language still required tne programmer

to maintain control over many macnlne operations and ne nad

to provide tne logic to control tne flow o program

execution. The instructions used to perform contrcl

functions appears as similar code fragments in most programs

written in assembly lanauare. These code fraernents per'orrred

fuctions such as controlling brancning decisions and Keeping

count of loop indices. When it was observed that co-7mon code

fragments appeared across a wide range of assembly programs.

it was recognized tnat tnese code fragments could te

represented as a single Instruction and the computer could

translate tne single instruction into tne code fragment it

represented. The prorrams that translate these -omplex

instructions are called compilers or interpeters. Tne

complied or interpeted lanpuares that followed assembly

language in this evolutionary process incorporated the

prowram fraements as a silnle instruction for tne language.

Constructs sucn as FOR, DO WHILE and IF THEN are examples cf

nigner level control structure implementation.

FORTRAN was the first in a lonR line of" hiefner level

languages. FORTRAN differed from tne others by oecomIng

i2

Page 15: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

endeared to a family of users and the lanpuaee endures today

as one of the most frequently used nigher level languages.

What aualities of tfe lantuaze produced tnis popularity?

The FORTRAN language is attributed to Jonn Backus. Fis

primary goal when lesigning tne lanpuage was to mare tne

language resemble the notation used in nign sclool alpeora.

Since the notation used in nign school alebra was familiar

to a wide audience, FORTRAN zave a friendly appearance. Tte

language's apparent simplicity is tne endearing quality of

FORTRAN. Some other lanouage Implementors failea to

recognize tais point and tneir languages never received wide

acceptance. ALGOL is an example of a powerful language tnat

never received the acceptance anticipated.

Otner programming languages tnat followed added ccmpact

representation of otner recurrine proRram fragments. The

higher level constructs were not limited to control

structures but also included constructs for tata

manipulation functions. Iverson's [11 APL (A Programmirg

Language) provided powerful operators capable of performing

complex functions such as matrix multiplication in cne

instruction.

This trend continues today. Many of tne newer lanruares

implement sophisticated and powerful operators and control

structures. Some of these languages are for a select sewment

of computer users, intended for application to a particular

domain. The users are expected to be familiar witfl the

13

Page 16: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

domain, so tne form of tne language snould te familiar to

the user also. A problem witn a domain specific lanruace is

its inability to adapt to otner areas. To work in anotner

area the user must become farriliar with another lanzuaee. A

phenomenon demonstrated by many computer users is a

reluctance to adapt themselves and learn a new lanpuace tnat

may be more appropriate for a given task. Eitner they break

the egg witn a sledge nammer or dip the well witn a spoon.

When required to use a new languape, the user will lizely

use only a small subset of tne language tnat is capatle of

doine the job. Worst than usine only a subset of tne

language features is the tendency to bring old programming

styles applicable to tne old language into tne new language.

The point that is to be made is ttat learnine a new

programming language is a nard chore and is avoided wnenever

possible.

Another direction wlicn tne automation of progranming

tasks nas taken is the development of a proerarrinz.

environment. A programming environment automates soie of tfe

manual chores by providiln the user with aids that assist

him in constructing programs. The environment includes a

proeramiine laneuare, an interactive syntax--directe! editor

and an on-line debugger. Tne editor provides syntax error

diagnostics vnlie the proRrammer Is creating tne source

file. The prowrammer is forced to correct the syntax error

immediately before the editor will allow him to continue

Page 17: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

procrammine. The error should be readily apparent to tne

programmer because it is in tne latest input. The on-line

debuaner allows the prorrammer to actively test nis proeram,

halt execution, cnecic tte value of variables, ctange the

value of varia0les or cnange tne code itself. Prok;ram

environment systems may even allow tne programmer to swit'n

from tne tne editor to tne on-line debugger and baci at any

time. A procrammine environment can be summarized as a

friendly interface utilizing an intelligent editor wnich can

recornize syntax errors in the associated prograirming

language and one tnat contains otner Interactive prcgramrnlng

tools.

Programming has been called an art form requirine

Intellectual creativity. Tne automation of Intellectual

behavior is a field of study within Computer Science called

Artificial Intelligence. The study of tne automation ef

proerammine tass which require human-liKe reasonInip is

called Program Syntnesis or Automatic ProgramminR. It is nct

our intention to provide a definition of intelligent

behavior for a macnine since tnere is (ons lterable

disagreement even among tne experts. However, we note that

tne goal of researcn in automatic programming is tne same

goal thnat led to all vne advances in programmine laneuaRes.

Informally, tnis goal is to male the interaction tetween man

and computer as painless as possible. That is, painless for

tne man but not necessarily for tne computer. DliJrstra (2J

Page 18: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

objects to our automation of proerammine by clairine, ge

Stould not automate prograiming even if we can, oecause it

would tare away our enjoyment of the tasK. We note tnere

are those wao may require the use of computer services trnat

nave neitner tme time nor inclination to Obtain tne required

education to do thnat cnore. These Include professions su-h

as lawyers, pnysicians, and even tneoretical pnysicists. We

assume, if proerammine be-!omes fully autoratel, tne

programmers will then turn tneir attention toware. otner

creative and stimulatinz pursuits. R. ?ammin nas said. "The

purpose of computing is insignt not numbers."

Many on-going efforts are aimed at providing better

systems for the user so ne may create prorrams faster, with

less errors and wita Less effort. Tne nistory of programring

lancuace development nas shown that automation of many

programming tasts is feasible. HIow mucn more of te

prorrammine tasts can be alutomatea? What would re considered

the ultimate system for producing computer programs?

B. AUTOMATIC PROGRAMMING

1. General

Prorram syntbesis or automatic prozrarrin Is a

research topic concerned witn the development of system's

that provide more and more automation of tne proRramiring

process, particularly those tasics requiring numan-lile

reasoning. The goal is not to create systems tnat proiram

themselves, but to create systems wtich can construct, under

ih

Page 19: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

the direction or a user, prozrams that can perform some

function ne desires. These systems must be easy to use, easy

to learn, and increase the exiciency or the user. The users

of these systems will no longer be restricted to tne few

computer professionals, but will include otner professional

fields as well as non-professionals. Automatic prcgrammir.r

systems are to interact with tne user, recognize

'rejuirements, and then synthesize a correct proaram tnat

satisfies the requirements.

Two questions arise in tne researcn on automatic

programming. First, wnat is tne form of tne interaction

between the user and the system? This question is called tne

specification problem because it is concerned with issues

relatine to how the user is to Inform tne system of nhis

requirements. The second question is, given a specification

method, what syntnesis tecnnique is available to be applied

that will transform the specification into an appropriate

program. The tecnnique used for syntnesis is often aependent

upon the form of tne problem specification and most of tne

projects involvine automatic programming consler bOth

problems toretner. It has been proposed by Green [3J tnat

the two questions snoull be separated with research

proceedinr concurrently on both problems. He proposes tnere

is a standard intermediate representation of tne problem

specification whicn would permit interaction between the two

problems.

17?

Page 20: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Four tecnni4ues nave been proposea for tne

specification problem wnicn dominate tne literature on

automatic programming. Eacn of the proposed te-nniques of

problem specification Introduce a different approacn to tne

syntnesis problem. The four specifliation tecnniques can be

categorized as follows:

1. Natural Laneuaee.

2. Formal Problem Specification.

3. Input-output Pairs.

4. Example Computations.

.ach of these specification tecnniques will be dicussed in

tne following subsections and tne relationsnip to a

synthesis approach will he discussed.

2. Problem Specification with. Natural Language

A visionary approach to the speciflcatlon problem is

the use of natural language. Natural language provides a

fast, comfortable metnod of communication wnicn is already

understood by numans. Implementation of' a natural lanRuape

understanding system has proven to be a very di:'flLut

problem (Glass 14j).

Two forms of natural language are the spogen form

and the written form. Understandine spoKen lang,.age

Increases the degree of difficulty because tne communicaticr

Is in the form of audio waves. Once the audio Input Is

captured, it must be converted into another form for furtner

syntactic and semantic analysis. The reader will note tnat

18

Page 21: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

once the audio input has been captured and convertet the

problem of written 3nd spoken ianeuage becomes tne same.

That is, the internal representation of tne spoken and

written word can be tne same and tne problem becomes one of

inferring meaning from the representation. Future advances

in voice unaerstanaing nardware can be expectec and tnese

alvances may be expected to find tneir way into use.

A complete natural lanzuage understandinz system

would be expected to be able to understand all Prarmatizally

correct sentences. However, natural languages to nct nave

finite zrammars. This complexity implies a coTplete

understanding system cannot oe implemented. However, a

system capable of understanding a subset of natural language

can prove useful in specific domains. Early examples of

programming znrougn natural language dialogue is presented

in a survey by Heidorn (5]. Curren, work on understandin,

natural language may be found in Piermann [5J, and Walker

17].

In conclusion natural language understanding is a

difficult problem that can De solvel only in limited

domains. The use of natural language in programming ta been

shown to be possible by Heldorn [bJ, and by Biermann [6j in

limited domains. The systems developed up to today nave been

experimental systems and tne results will aid in

understanding the problem. Natural language prcerammine

systems will not be available for Industry for at least a

19

Page 22: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

decade. Finally, we present the example Piermann t£]

describes as a natural language specification for a problem.

Tnis example is quoted from his paper on natural lanp'vaoe

programming. Its intent is to give a feel for proerammine in

natural language. Tnls example does not specify tne

aleorithm that is to be used althouen a natural lanzuaee

programming system would be capable of accepting suct a

specification.

"Wnen I asi for a status report on adoctorial student, eive me his or ner yearin grad school, source and amount offinancial support, and wnicn core examshave been passed. If the student has becuna tnesis give me tne advisor and tnesistopic.

3. Formal Problem Snecification

The second tecnnique is formal specification of tne

problem. &s the name implies, tne input is in a more rigid

structure than natural language. Tnis tecanique allows tne

user to convey the benavior ne deslres tne syntnesized

program to nave without specifyine the alporithm ttat is to

be used. Smith [9j gives tne following definition for tne

form of a formal specification of a problem A."A(W) = z such that z c S & P(z,x) wnere x c D &I(x) wnere D and S are the input and output datatypes respectively, and I and P are tne input an.output conditions respectively.

An example of a formal problem specification for a program

to compute the intewer square root of a nonnegative inteeer

n may be found in Manna and 'aldinger [9].

20

Page 23: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

"sqrt(n) <== FIND z SUCH THATinteger(z) & z*2 =< n < (z 2) 2WHERE inte~er(n) N 0 =< n

In the above example n Is an element of tne input data type,

z is an element of the output data type, sqrt is tte problem

name, integer(n) . 0 =< n is tne input condition, and

integer(z) 6 z**2 =< n < (z+l) * 2 is tne output conaition.

Formal Droblem specification and its appli:ation to

tne program synthesis prociem can best te explained tnrou'n

examination of the work by Manna and Waldineer [9], Manna

and Waldinger (10], and Smitn [9]. Althougn all of tne worK

is similar in that the formal specification is cnanzed into

an appropriate program by some form of rewrite. It is

valuable to differentiate the approaches by their rewritinw

methods.

The first example is tne system of Manna and

Wallinger [9]. Their system, called a deductive approach,

converts the formal specification into a proran, in soTe

target language. Tneir approacn, "combines tecnniaues of

unification, mathematical induction. and transformation

rules into a single system." The following is an brief

explanation of this conversion.

A structure is needed to contain initial and

intermediate results of the conversion process. Tnis

structure is call a sequent. The sequent is a tableau

containing two lists. The first list is a list of assertions

and the second list is a list of goals. Each element in

21

Page 24: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

eltner list may nave an output expression associatec witn

it. Figure 1 represents a sequent as a tahle. Eafh row in

tne table nay contain eitner an assertion or a goal but not

both. Firure 1 is tne initial sequent for the integer square

root problem given above. Tne input condition nas been

placed in tile assertion list and tne output condition placed

in tie goal list. Tne output variable is associated wItn tae

output condition in tne output expresssion column. Tnis

initiation action assumes tie input condition is true and a

search is attempted for tne trutn of tne goal or output

condition.

sqrt(n) <== FIND z SUCH THATInteger(z) and z**2 =< nand n < (z+l) *a 2WHERE integer(n) and 0 =< n

Assertions t Goals Output I

sqrt(n)

inteper(n)ana

integer(z)and

z**2 =< n zand

-n < (z+i)

Firure 1. Initialized Sequent for the Square Root Probler"

22

Page 25: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Durin tnis searcn if the sequenT ever contains a row where

the assertion can te trivially shown to be false or tne eoml

snown to be true anI If' the output expression for tnat row

contains only primitives from the tareet lan ,uace then tne

output expression is taKen as tne lesired syntnesi~ed

propam.

Once the tableau is initialized, tne syster, 's

deductive rules are applied to the assertions and eoals. The

application of these rules will cause the creeaticn of new

assertions and coals and associated output expressions. Tne

rules may tten be applied to the new goals and assertions

untl tne condi tion for a program is satisfied. The

application of the rules chance tn entries in tfe tableau

withnout cnanging Tne meaning of tne tableau. We recommend

that the interested reader review tne original worK for a

description of tne rules and their application.

The attraction of tals taneorem-provinR tecnnique is

that tie resulting program can be prcven correct by the saTe

steps used to create it. Currently there is not a running

Implementation of tnis technique. One or tne implementation

questions is letermining wnat rule to apply at eacn step in

the synthesis process. This problem can be viewed as a

search through all possible sequences of rule applications.

This search space may become astronomical for any relatively

complex program since it may require hundreds of rule

applications. dnat is needea is a mecnanism tnat can control

23

Page 26: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

the search in a reasonable fasnion. Tne rorm or control 7,ay

be neuristic in tnat tnere is a feel for wnere a rule sncUid

be applied. If this intuitive feel :an be quantized, tnen

this tecnnique may become practical.

Earlier wort by Manna and Waldineer [10J on tne

DEDALUS automatic programing system also required formal

problem specifications. Tne DEDALUS system, an imple'iented

automatic procrammine system, utilized only transformation

rules. A tranformation rule simply rewrites a portion of tne

specification into another equivalent form. The continuous

application of these rules would eventually result in a

proeram in the tarret laneuake.

4. Input-Output Pair Specification

Input-output pairs is a metnod of descritinp a

problem witn examples of input and output behavior. For

example, if someone wanted to lescribe a proeram to compute

tne Fibonacci numbers tnen tie could supply tne input-outpost

pairs.

(I, i)(2. 3)(3, b)(5, 9)(8,13)

The goal of a synthesizer system is to determine the

desired program from the examples of the input-cutput

behavior. One approach is to enumerate all possible programs

in the target language in order and test ea-h prorram for

thne desirel behavior. That is, test eacn enumerated proirem

24

Page 27: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

by rivine it tne input from each of' the examples ana see if

tne program will Rive tne associated output. Tne enumeration

will produce the correct propram at sore poirt tut you

cannot determine if an arbitrary program can ircauce tne

desired behavior (see 7iermann [111 }. Tnerefore, the

following taeore is given by Piermanr, "Tne programs ft'r

tne partial recursive functions cannot te generated from

sample of input-output behavior. A large class of programs

may be inferrea from examples of input-output pairs provided

they belone to the class of procrams where tne naitin

problem is lecidable. Smitn (121 an - Summers [13] nave

looted at the synthesis of LISP programs for example

input-output pairs. It has been shown that a restricted

class of LISP procrams can be synttesized from example pairs

without enumeration over tne class. The reader is irvitec to

review Biermann (14] and Gold (151 for tneoretical

background information.

5. Example Computations

Program specification using example ccmputations

allows more information to be obtainel from tne user. An

example computation is a sequence of instructions, without

an explicit control structure, which tne user provides tie

system in order to describe the benavior ne wants from a

program. Vxamples are a good communication metnod wni'n

people use to describe new concepts or explain new

processes. To describe a problem to the computer the user

25

Page 28: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

uses tne available instructions and provides an example of

what he wants done. Figure 2 snows an example computaticr

tnat demonstrates now to compute tne first 1I Fitonacci

numbers.

In Figure 2 the two operand Instructions f OV. ADr)

perform the action on the two operands and leave the result

in the first operand. For example, it A = 2 and B = 3 tnen

ADD A,B would result in A = b and B = 3. All of tne

instructions perform action on some variables execpt for the

START, HALT, and NOTE instruction. START and BALT flag tne

begin and end of the program respectively. The NOTE

instruction is providing information on the reason for tne

execution of tne next instruction.

This metnol of specification depends on tne user to

supply more information about tne problem, Includine the

algorithm to be synthesized. The algoritnm is implicitly

defined by the example computation that is Riven. Ttis

specification technique should be contrasted with tne

previous tecnnioues. Note that the formal specification and

tte input-output pair specification only required tne user

to specify the desired benavior witnout specifyinp tne

algorithm. Thus It can be claimed that these two Tetnols

intentionally ignore information tnat the user nas, assuming

that most users have an idea of the form of the alRorithm.

26

Page 29: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

STA?9T START

"Ov A,1A~

1;UR 11% TMo V AE

DQ C,1c

PRINT A

DCO C FRINT .b

ADD BA

PRI NT B D C - C

DCR C

Al:)D A.,3

* PRINT A

PRINT A C=

DCR C DCR C HL

NOTE C =< 0 C 0~

HALT ADD 2,A

Figure 2. An Example Computation

27I

Page 30: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Tae primary contrioutor to tne understanding of

program synthesis has been Alan d. Biermann (see Blermann

and &rlsnnaswaiy [1i and Biermann, Baum and Petry [17j ). In

particular, Biermann [161 provides a formal definition of an

algorithm tnat will syntnesize programs from exarple

computations. The alzoritnm and variations nave provided tne

oasic structure upon wnicn tnis tnesis nas oeen developel.

Briefly, tae algoritnm identifies tne conditions tnat may

nave inadvertently (or purposely) been left out of the

computation. A condition is a predicate as aefined in

predicate calculus. Tnat is, an entity for wnlich a trutn

value may be measured. Once tne omitted conditions nave been

inserted, tne algoritnr finds a labelling for tne

instructions such that a program witn a minimum number of

instructions is produced. To explain tnis labelling, assume

the instruction ADD A,E appears in three different locations

in an example computation (see lFieure 2). Suppose It was

Known that there has to be two occurrences of tne

instruction. Then two of the instructions could be labeled

witan a 1 and the otner instruction labeled witn a ? to

indicate that the instruction labeled 2 is different from

tne instructions labeled 1. Finding tne labels for tne

instructions in the example computations requires an

enumeration search of all possible latellings. The labelling

selected is tne first labelling that produces a proFram tnat

is deterministic.

28

Page 31: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

This ileoritnm is comrate and the syntnesized

programs are sound. Completeness meanF tnat tne algoritam

can synthesize every possible proeram. Soundness Tean tnat

tne synthesize program will correctly exect-e tne example

used to construct it. A disadvantage of tnis syntnesls

method is the alroritfnm is an enumeration sear-n and i.- the

worst case will require exponential time on tne lengtn of

the example computation to find a bolution. Tecnniques nave

been developed to speed up tnis searcn tnat will produce

satisfactory response for most pratical programs.

6. A General Automatic Programmer Design

Before leaving tnis section on automatic program we

wish to discuss a design for an automatic proerammer that

uses at least two of the specification tecnniques. Tne name

of the system is PSI and was desiened by a croup of

researchers at Stanford's Artificial Intelligence

Laboratory. The research effort was headed by Cordell Green

[,61. Green nas presented a nighn level design of an

autoprogranmer tnat identifies some ot" the more important

areas that need furtner researchi. Green admits tnat tne

design was an effort to focus attention on some of tne

sub-areas of the overall synthesis problem. His modular

design does focus attention on different aspects of tne

problem. The desien decision to split tne overall problem

into two main sub-problems of acquistion and syntnesis Is of

particular interest. Tnis desicn choice allows worg to

29

Page 32: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

proceed concurrently on two nard problems witn tne interface

hetween tue problems being some intermealate representation

of thne problem.

PSI is a knowledge-based program unlerstandir

system oreanizea as a collection of" interacting modules.

Fieure 3 details the tielf level nodular desizn of' tne PSI

system. The PSI design divides tne system into two groups.

The acquisition Proup interfaces witn tre user and collects

tne specification given by tne user while tne syntnesis

rroup produces a proram in some tareet lanuare tnat meets

the user's requirements. Communications between tr.e two

major groups is tarougn an intermediate representation

called the program model. The goal of tae acquisition eroup

is to accept tne user's specification cy eitner natural

lancuare dialorue or by traces, and present a unilied entity

to the syntnesizer group. Tne implementation of tne

synthesizer eroup is then simplifiea tecause or" tne

consistent representation it receives. Since tne user's

input is convertel Into an intermediate representation tnat

is supplied to the syntnesizer group, tne user is free to

switcn from one specification tecnnique to anotner during

prorram specification.

The overall interaction witf tne user is meant to be

throuph natural lantuage lialorue. Since natural language

understanding is not currently witnin tne

30

Page 33: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

F

of. -4

.... I a)-- - -- - -- - - - - ------ - - - - - - - - - - v

I .4 -. I c'

$..a

G)

S- - - -- -- -- -- - - -- - -- -- -- -- -- --

I -.4 ~ -*~I -I . - I 0)

id $- 1 1 444• I--,I I .- -- , I

I - I L

.. . - - I n - .

0 m)

4) c I II I I I-- I I I

P. I I. . . I i

I~~- iO14PI CUl ~ W~ I jIr IO:N 614 1* 1I6- 9L~ I~I

j '~- I--4i W31

Page 34: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

state of the art, the system must interact in a subset o*'

natural language limited to a particular domain.

Tne system-user interaction is to appear as natural

as possible. Tne system nas been designed to incluae a

mixed-initiative lialocue capability wnicn means the user or

the computer can assume tne dominant communication role at

different tImes urinR the discourse. This allows the user

to provide as mucn inowledge as ne can to nelp tne syntnesis

process and allows the computer to assist tne user by asking

questions or providing responses. The system develops a

current model of tne user and a model of the context tnat

assists tte system in determining wmen to assume the

Initiative and wnat questions to asK the user.

A partial implementation was completed in 1Y7b t.at

Included tne syntnesis expert and thne efficiency expert from

tne syntnesis croup. The acquisition croup modules nave

proven to be a more lifficult assignment and only portions

of the acquistion croup nave been implemented. The important

point of tae PSI design is that it provides a modular

livisiun of tne program syntnesis problem tnat helps provoke

study into taese sub-problems.

C. OB'ECTIVES

Automatic programmers, whicn synthesize programs from

example computations, require conditions to be explicitly

defined by the user in order to generate programs witn a

minimum number of instructions. Previous wort ( Blermann and

Page 35: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Krisnnaswamy [161, and Biermann [18J ) nas reduced tne

number of required conditions, tut nas not eliminated tne

need for the user to explicitly state a minimal set of

conditions.

The explicit aefinition of conditions is not 3 natural

part of an example computation. Tnat is, one would not

normally give control structure information when usinz

examples to explain now a tasK is to be performed. Our

objective is to provide an environment where tne user may

define the tasks ne wants accomplished witnout explicitly

definine the control structures tnat specify tne 'low of

execution in a syntnesized program.

We will implement an automatic programming system based

upon the example computation specification method in order

to study the feasibility of Identifying conditions from user

actions. We limit tnis study to the domain of text editine

in order to provide a well defined area in wnicn to wore. It

is hoped that the results of our efforts may provide Insier.t

into tne overall problem and generate further researcn whicn

will extend condition Identification to other domains.

D. THESIS OR1ANIZATION

The thrust of this thesis is the developement of metnods

for the automatic construction of conditions necessary for

the proper synthesis of programs from example computations.

Example computation is one approach to the problem of

protram synthesis. Chapter One Introduces the reader to

33

Page 36: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

program synthesis ant gives a brief nistorical perspective

of tne evolution of" this field of study. Cnapter One also

provides a comparison of tie different proposed approacnes

to this problem.

An automatic programmer has been implemented to support

tnis research. This syntnesizer was levelope to use tne

example computation metnod for program specification.

Chapter Two is a detailed explanation or our particular

implementation. Chapter Two includes a aiscussion of

tecnniques we nave incorporated in our implementation wnich

speed up tne synthesis process.

Chapter Thtree presents our approach to reneratine

conditions given an example computation. It iescribes

alcorithms which will eenerate conaitions from a sequence of

editor Instructions.

Chapter Four discusses tne result of our research. A

brief discussion is included on tne merits of tne

synthesizer which we nave implemented and recommendations

are given for potential improvement. Finally, Cnapter Four

presents a review of our worK on Ideatt irazion and

construction of condtions from example computations. Areas

requirn& further research have been nlimnlizated and

examples of possible applications to otner domains nave been

pointed out.

Page 37: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

A. GOALS

There is a two-foil purpose benind aesipr.ine and

buildinR the program syntnesizer. Tne first directly rpIates

to the usefulness of the syntnesizer. It is hoped that by

l"yine tne proundworic for an autoprogramming systam, tne

impetus will be provided that will eventually result In a

total automatic programming environment telng available for

the user. This environment is envisioned as an intera-tive

one consisting of several components: an interface to

provide the user wilt the means to perform example

computaZons, a linI between tne interface and tne

synthesizer wnicq records the user actions and transmits a

trace of those actions to tne syntnesizer, tne syvtnesizer

itself whicn produces the algcritm in some internal forT,

and, finally, a translator tnat receives tne internal

representation of tne aigoritnm and translates it into

michine-reacable form and/or user-reaaable for. Tte second

purpose for wntcn the syntnesizer is built is to Drovide a

suitable vehicle to be used in the main area of research

tnat this thesis explores. If an autoprogrammer can generate

correct alrorithms from example computations, now much can

be done to relieve tne user from navinp to include orancninR

or looping con!Itions in his Pxample computations?

35

Page 38: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

1. en ral Description

An automatic proera-niie system wnin pro1ues

programs based upon tne user's input of example comoutations

tas a natural appeal. Ex-mple nomputations are 5eulir."s t'

Instructions Derforrred in an aiioritnrric manner. For

instance, if the user is doing a matrix multiply, co ' u 1in

the entry for the resultant matrix involves the bum of

products from tne appropriate row and column o: tne

multiplicand and multiplier Tatrices, respectively. #On.en

nu7)ans communicate ideas to eacn otner, tne proper rse of

example computations often plays a vital role. It is nard to

imagine trying to explain tne metnol of multiplyvin two

matrices together, or trying to explain tne concept of

set-sutset relationships witnout being able to draw eearmples

that enmance the explanations. Tnis metncd of communication

seems to be vital to human uncerstanding of alrr tc5 .

Since programmers often use small eyample corputations wr.ile

cod Ine proerams, it seems tnat a logIcal ap.roa-r to

automatic programming would consist of tfte macnine doin4 tae

actual prowram synthesis based upon example computatiors

given by the programmer.

Program syntnests is the act of putting instructions

togetner in sucn a way tnat an alroritnm is tuilt wnicn

accomplisnes a desired tast. Ctviously, an algorltn wnicn

is an exact replication of the sequence of instructions will

Page 39: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

accomplish tne task, tut it Is uninteresting since it cannot

be generalized to accomplish a set of related tasks. For

example, a linear sequence of instructions which multiplies

two 2 x 2 matrices together will only work for 2 x 2

matrices; nowever, by allowing loop constructs and if-tnen

constructs, an algorithm can be produced wlch performs tne

more ceneral task of multiplying any two matrices witn leral

row and column dimensions. So, in the case of the matrix

multiply, the task of the program syntnesizer Is to produce

a general matrix multiply alcoritnm given tne example

computation for a 2 x 2 matrix multiplication in some form

such as:

c(I,lJ = a[i,lJ * b[i,lj + a[l,2J * b[2,1J

c[1,2] = all,l] * b~l,2] + a[l,2J * bL2,2]

c(2,11 = a12,1I * b[l,lJ * a(2,2] * b(2,11

c(2,21 = a[2,1] * bl1,2] + a[2,21 * b[2,21

Generalizine from tne example computation also

requires some means of noting when tne array bounds nave

been reached for this example. In other words, conditions

nave to be interposed between some instructions wnere a

cnanage in tne flow of control for tne algoritnm Is

necessary. An input trace is defined as a sequence of

instructions and conditions whica describes the example

computation. In the matrix multiply example this mitfnt be

accomplished thusly:

37

Page 40: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

c [1,11 --C11,11 = C [1,11 + A,13 * BtI,1jC[i,11 = c[II1 + A[1,]2 - B[2,11

COND - col index of A = col size of A

C~L,2] 0C[1,21 = c(1,21 * A[,lj * B[1,2JC[I1,2 = C(1,21 + Al1.21 4 B12,2J

COND - col index of A = col size of A

C[2,2j = c[2,21 + A(2,Zj q B12.21

COND - row & col Index of C = Dimension of C

STOP

The procram synthesizer used for this thesis is

designed around concepts and ideas on syntnesizinp a program

riven example traces as described in reference 1171.

Previous researcn, references (16, (171, and [181, seems to

indicate that correct proerams can be synthesized on the

basis of relatively few sample computations, out tnat tne

amount of time required to do tne syntnesis grows very

quicily as a function of progran complexity.

2. Trace Coding

Tne syntnesis procedure is domain independent; that

is, the input trace can be coded into any consistent

representation, and it will not affect the operation of the

synthesizer. Since the synthesis procedure Is independent of

the input trace representation, alphanumeric characters will

be used to represent Instructions and conditions. They are

distineuished from each other by tneir position within the

38

Page 41: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

tracp rather tnan by tneir Symbolic representation. Fcr

example, an 'a' mignt represent an Instruction or a

condition. Within the instruction set itself, identical

instructions are encoded as identical symtois. k simple

trace of a routine to find all positive numbers in an input

strea'n miint be:

A =0

READ B

COND - B is negative

A = A + 1READ B

COND - B is nepative

A = A + I

READ B

COND - B is positive

PRINT B

If the instruction A=A+l is represented by a t', eacn

occurrence of tnat instruction in tne trace will nave to be

represented by a 'b'. The reason for tnis constraint is

obvious. Since tae synthesizer only receives a tra-e of t'ke

example execution, it cannot determine wnetner A=A+l is tne

same instruction beinR encountered repeatedly in a loop, as

it is in this example, or wnetner there are several

Independent occurrences of A=A+l. Fieure 4 is an example of

a typical coded input trace. The left-nand column entries

are conditions and tne rignt-nand column entries are

39

Page 42: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

instructions. Fiture 4 Is read as state 's' transistions on

condition "x' to state 'a' which in turn transitions on 'x"

to state "b', and so forth.

transitions states

Sz ax bI Cx by eI Cz b• Cy sy a

by dx bI fX dX bx f• dy s

Figure 4. Input Trace

3. Input/Output Trace Representation

A Moore-type representation, as lefinel in [17J, can

be used to fhtiklIalt certain features that must be dealt

with when producing an algoritnm from an example trace.

Throuhout the rest of the discussion, Moore machines and

algoritnms will be used synonymously. Conditions relate to

transitions and instructions relate to states of the

machine. In fact, tne function of the syntnesizer can be

viewed as that of determinine a minimum-state deterministic

40

Page 43: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Moore macnine equivalent of a non-deterministic Moore

machine. Representine input traces as Moore macnines will

often snow the non-deterministic structure of the example

trace. This non-determinism must be resolved by tne

synthesizer in order for an alaoritnm to be eenerated.

Figure 5 is tie Moore machine representation of tne inDut

trace of Fieure 4. Notice that at node "b', tne trate is

non-deterministic. Transition 'y' leads from node 'b' to two

different nodes; similarly, transition "x" leads from nole

b' to two separate noles. Figure 6 is tne deterministic

Moore machine which has been constructed by our synthesizer

based upon the input trace given in Figure 4. The

non-determinism has been resolved by splittine state 'a'

Into two states distinguished from eacn other by an integer

prefix label. The assionment of the prefix label is the

mechanism used by toe syntnesizer to prevent

non-determinism. In order to accompllsh tnis assignment, the

syntnesizer uses an enumeration tecnnique. Eacn Instruction

is assigned a prefix label in a manner tnat !aintains

determinism and assures that the alrorithm will correctly

execute the input trace. It is easy to verify that tne

deterministic Moore macnine of Fiure 6 will execute the

trace.

41

Page 44: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

xx

Figure 5. Non-mee8rministic Moore Macnine

Page 45: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Fiur . ~tr~tl~t~ ore~1clxl

2 b

Page 46: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

C. SYNTHESIS PROCEDURE

1. Function

Tne function of tne syntnesizer pro.ram is to

orovide a -ri nium-state, correct propram consistont witn VIe

Input trace of tne example computation. Tne syn tneei 5

Drocess will be completed when it is deter-inei wri-'

occurrence of a labellea instruction correspon ,5 to eacn

particular instruction in the input trace. In order to

accomplish ta is goal, tne syntnesizer Is ta5Icaliv

structured as a deptn-first searcn aigorltrm. BacKup ari

fixup mechanisms exist to enhance the searcn procelure when

pruning nas not Kept tne algori nm from traversinz a

fruitless brancfh ot the searcn tree. Tne spar-n Te.nanism

attempts to assion a latel to eacn instructior. In ucn a

manner that tae generated algoritnm remains tecinicanLy

correct; tiat is, nondeterminis-n ib not allowel to exist ind

the orizinal trace can still te excu.tel. I numoer cf

tecqniaues exist within the byntneblizer #rirn ai Drunine c!'

tne searcn tree, and therety matce it possible to evntne1ze

more complicatel programs in a reasonable amount of tire

tnan could otnerwise oe expected from a zeneral enumeration

tecnnique. These tecnniques offset the major disadvantage of

exponential crowtn of tne search space as a "unctlon of

input wnicn is found in a general enumerative searcn

technique.

44

Page 47: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

z. Concepts

Certain definitions and concepts must re presentvi

before the actual aleorilm is Iistussed. In order to

facllitate tne discussion, it Is necessary tc refer to

Figure 7. Each level in the figure consists o an

instruction-condition-lnstruction triple, referren to as an

I-C-1. In Figure 7 tre lertmost 5yrooi unipr I-C-I is

referred to as tte Imading instructior cf t"e tr1ple, tne

middle symbol is the condition, and the rizntmost tvr-tol is

tne trailinr instruction. Tne traillnr instruction at ie'!el

I becomes the leading instruction at level i+1. So tnls

input trace represents tne Instruction-condition sequence 's

r a n S r a

level I-C-I

1 5ra

2 ans

13 sra

4 ada

~axa

6 aya

7 axa

Sanr

Figure 7. Instruction-Condition-Instructlon Triple

Two levels i and J are said to belong to the sane

caule-class if the elements of the level are the sarre.

45

Page 48: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Instruction elements o" tne trace wnicn are in tne same

couple-class may oe assigned tne same prerix laoel auring

syntnesis if the assignment does not cause non-leterminism.

For example, eiven tne trace in Fieure 7, levels I and 5 are

in ne same couple-class, as are levels 5 ant 7. Difference

set relations are another situation tnat can exist wnlicn is

of interest. The first two elements of level i ant level J

are tne same, but tne third element is not t!e same. A

difference set relation indicates tnat tne leading

Instructions cannot be represented by tne same state

regardless of the prefix laoel assigned during syntnesis

because the leadine instruction has the same transition to

two different trailing instructions. Again usine the above

trace, level 2 and level 8 fall into tnis category. In this

situation, the inlex 8 would be entered into tte difrerence

set for level 2. By implication, the index 2 is also in trne

lifference set for level t, altnouefh, in practice, it is not

entered.

Once the initial couple-class informatin and

difference set information nave been determinea, additional

difference set information can be obtained tnrotgn tne

cnaining nature of differencing. For example, suDpose tne

trace consists of the one snown in Figure S. Tnen tne Moore

machine representation of this trace is shown in Fizure 9.

46,

Page 49: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

index trace

b axa6 axa7 ays

ala.

ayt

Fizure S. CnPainine of Difference Set Relations

FiueI o-eemnsi nu rc

hiurace is obvouy oeter'inistic InincTac

state 'a* transitions by 'y' to two difterent states.

Difference set resolution requires tnat tne index fcr 'ayt'

be In the difference set of 'ays'. Since that requirement

causes different states to represent the 'a' in 'ayt' and In

'ays', and further since the trailing 'a' In the preceding

level Is exactly the saime instruction, the precedine levels

nov satisfy tne difference set relation. Thie leading

47

Page 50: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Instruction and the condition are tne sarme, but tne trailin_instruction in tne I-C-I triple is different since they nave

previously been assigned to a difference set relation.

Therefore, tne lead instruction must be labelled witn a

different prefix during assignment and similarly, the levels

above tnem'. So the Moore machine will now be deterministic

and in the following form.

X x

la ... 2a

is i t

Figure i. Deterministic Trace

Given a partial trace derived from the example

execution, tnere are numerous Moore macnines that (,ar be

constructed to satisfy tne trace. At one end ot tne

spectrum, a prowram can be constructed such that eacn

succeeding state is assigned a different prefix latel. This

method always results in a straiert-line prcram. Facn

instruction has one transition entering it and one

transition exitinr from it. Allowinz tlis metnoa produces

the maximum size program consistent witn tne input trace.

See Figure 11. Tnis is not a particularly desirable metnod

since it does not recognize loop structures that can

significantly reduce tne size of tne program. Additionally,

48

Page 51: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

it hides the basis structure ot tte aleoritnm. Tte major

advantage, of course, is that absolutely no searcn is

required to produce a deterministic macnine.

condition instruction

- a

x a

x a

x a

Figure 11a. Trace Figure 1lb.Program

Figure 11. Stralgat-Line program

On the other end of the spectrum, a prorram can te

constructed such tnat each identical instruction receives

the same prefix label. This method tames full advantape of

loop structures, and will result in a minimum state macnine.

However, such a metnod will seldom produce a deterministic

machine; therefore, it will not produce a satisfactory

algoritnm. See Figure 12.

level cond instr1 - a2 x a

3x a Y4 x aX5 y a la lb

y b y

Figure 12a. Trace Figure 12b. Program

Fieure 12. Minimum State Machine

49

Page 52: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Tne best solution lies somewnere tetweer, these

endpoints. A reasonable first zuess at the numter of states

required to produce a leterministic macnine witni: tnis

spectrum can be made by establisnline a lower tound on tne

number of states. The carainality of the instruction set is

defined as the number of different instructions appearing in

the trace. Using tne above figure as an example, it can te

determined tnat tne cardinality oif tne instruction set is

two; that is, tnere are two different instructions, 'a' and

" b', in the trace. Tnis neasure provides an absolute lower

bound on the number of states required in tfe final ma-nine.

This lower bound can be refined by determining a lower bound

on the number of states needea for eacn individual

instruction. Once again, using the above figure as in

example illustrates this concept. The instruction 'a' at

level 5 must be different than the instructions at levels 1

tnrougn 4 because of difference set resolution, or else

nondeterminism results on the transition "y'. Therefore, in

order to maintain determinism, tne instruction 'a' nust re

allowed at least two states. Summation of tne lower tounts

for each of the instructions gives a lower bound on tr.e

total number of states required for the macnine. For tnis

particular example, the prorram would be eenerated as:

50

Page 53: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

x

Fieure 13. Instruction Set Lower Bounds

If the searcn space is viewed as a tree _tructure

then the levels of' the tree can be associatei witr t.e

instructions by' assigning the f'irst Instruction in tne input

trace to the first level, tne second instruction to tIe

second level, ana so fortn. Tne vrancnlni factor at eacn

level is the state lower bound computed for the irstructicn

seen at that level. The prefix label assioznez to tne

instruction is represented by tne specific brancn used to

traverse to the next level.

Tne idea of nrovilinp a lower bound on tne nurnner of

states leads to an iteratively exuanjinp leptn-tirst sear,-..

When all possible combinations of prefix labels nave been

tried, but tne algorithm remains non-ieterrrinistlc, tne

lower bound is incremented and the search Is restarted *ror"

the top level. When toe lower bound Is Increased, tne search

tree obtains additional paths to tne final solution ty

increasing tne brancning factor associated with one or more

instructions. The deptr or a successful sear:h into tne tree

51

Page 54: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

is restricted by the lower touna on tne number of noaes

required by tt.e deterministic macnine. Only wnen a pattern

of prefix assignments has been mate wnifl allows tne

algoritnm to remain ieterministic and all o " th e

instructions in tne original trace aave been assipned prefix

labels will the syntnesis terminate. Tnis mecnanism prevents

a straielit-line model from beine output at tne alorit m

unless It is tne only one tnat can satisfy the input trace.

More importantly, it provides tVie minimum-state

deterministic macnine capable of executing the input trace.

D. SYNTHESIZER STRUCTURE

The syntnesis program is subdivided into two primary

modules: static DrocessinR of the input trace; and aynamic

processing of the information extracted from the input trace

by the preprocessing, or static processing pnase. Static

processine provides Information such as couple-classes,

difference sets, anl lower bounds on tfe numter of Tacnine

states. Dynamic processine uses Knowlelee innerited from

preprocessing to guile the searchl mecnanism to a final

output of the alroritrr. These two modules will te discussed

in turn, and the primary mecnanIsms involved will be

amplified.

1. Static Processing

Static processink can be conceptualized as

consisting of three main functions: (a) accept tne input

trace; (b) preprocess the trace for difference sets,

52

Page 55: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

couple-classes, and state bounds; and (c) prepare a trace

table for furtner use by dynamic processine. Cnce tnis

preprocessing nas been accomplisqed, tne statiz module is no

longer necessary to tne syntnesizer.

In the current confieuration, tne static module

expects to find tne input as a sequence of

instruction-condition-instruction triples. Fizure 14 is an

example of an input trace.

level trace

1 anp2 psa3 aga4 ayrb rsr6 rsr7 rra

saa

9 ayt

Fiture 14. Typical Input to Static Processor

Racn line consists of a triple, for example "anp'.

The 'a' represents an instruction, tne "n' represents tne

condition wnicn causes the program trace to transition to

the next instruction 'D'. For each level, tne first element

represents tne same Instruction as tne last element of tne

preceding level. This is easier to see It the above trace is

represented as a Moore macnine in which the nodes are

instructions and tne conditions are transitions. State 'a'

transitions on condition 'n' to state 'p' wlich transitions

on condition 's' to state 'a' wnics transitions on condition

' baCK to state 'a-, etc.

535

Page 56: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

n r

Firure 15. Moore Machline for Input Trac e

level trace c-c difference set

1 anp-

2 p s a

1 {SI

4 ayr -49

5 rsr 2

6 rsr 2

7 rra -

8 aga 1

9 ayt -

Figure 16. Intermrediate Trace Table

54

Page 57: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Each occurrence or an instruction symbol in the input tra-e

is representel by tne same state at tnis point in tne

synthesis.

Once tne input trace nas been acceptea, static

processine can beein. Static processinv consists of

determining tne level indices associated witn eact

couple-class and with each difference set. For tne trace of

Figure 15, these are snown in Figure 15.

There are two couple-classes in this trace. Tney are

[agaJ at levels 3 and 8, and [rsrl at levels 5 and 6. Te

reiaining levels are not assigned to a couple-class because

no other levels matcn with tnem. Couple-class inforTation is

useful to the dynamic processor for determining forced

assienments anl dynamic non-equivalence. These ideas will te

discussed more fully in tne section on dynamic processing.

Difference sets exist for levels 3 and 4. Level 4

ias a difference set wnicn contains tte index 9; that is,

tne eleient at level 4, 'ayt', 'ust nave a different prefix

label on 'a' than tne element at level ., 'ayt'. It the "3'

is not latelled iifferently during the syntnesis,

nonleterminism will result since the same transition would

lead to different nodes.

Difference set resolution is a very powerful

mechanism for ensuring deterministic benavior of the

algoritnm. A considerable amount of the prefix label

asslenments to the nodes can be resolved usinR difference

55

Page 58: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

sets. Notice that level S appear! in tne difference set fir

level 3 even thougn levels and 9 are in tne sa-e

couple-class. kt first tnis appears contradictory since

equivalent couple-class names imply that tne elements are

tne saie, but difference set existence forces tne lead

instructions to be different. Tnis points out tne relative

power of couple-class information and difference set

information. Difference set information is imiutaole.

Couple-class information only tints at equivalence. In tnis

particular example, tne entry at level 3 was caused ty toe

cnaininR effect of' difference set resolution. Notice tnat

since toe 'a' at level 4 iust be different tnan tne 'a' at

level 9, and notice that since tne trailine 'a' at level 3

is, by defirition, the same as the leading 'a' at level 4,

the trailing 'a' at level 3 cannot be tne same as tne

trailing 'a' at level S; tnerefore, levels 3 and 8 cannot be

in tne same couple-class.

To compute tte lower bound on the number of states

in tne algorithm, tne iinlium number of states neeaed for

each Instruction is summed. For tnis same example, the

instruction set consists of ta,p,r,tl. Toe 0ounds for p,r,

and t are each 1. Tne bound for 'a' is 2. Tnere must be at

least two different occurrences of 'a' from the difference

set resolution. Therefore, tne minimum number of states with

which a deterministic Moore machine can be constructed for

ttis trace is 5.

56

Page 59: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Finally, static proressInf passes al te

information concerning tne input trace to the cynai c

processor via a trace table in the 'ollowilne torm. Eacn

level has only one associated condition and one associatel

instruction. Since difference set information is associated

with the lead instruction in an

instruction-condition-instruction sequence, It is enterea at

tnat level. Since couple-class Information is associated

vitn tne entire instruction-condition-instruction sequence,

It is associated with the trailinz condition-instruction

pair.

level condition Instruction c-c difference set

1 - a2 n p3 s a - 14 g a 1 1915 y r6 s r 2 -7 s r 2B r a9 g a 1 -

1 y t

Figure 17. TraceTable

2. Dynamic Processing

Dynamic processing involves asslgnlng prefix labels

to the states of the macnine. In tnls way, separate

occurrences of tne same instruction are differentiated. Tne

dynamic processor is the search mechanism for t!e

synthnesizer. It operates In such a way tnat, at any point in

57

Page 60: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

the synthesis, the portion of the trace previously pro'-essed

represents a deterministic Moore macnine. In order to

maintain the determinism, dynamic processine steps tnroueh

tnree pnases:(1) assignment of tne prefix label to tne

instruction; (2) difference set resolution, and ',) dynamic

equivalence assurance. Additionally, eacn of these pnases

nave built in fixup anI backup conditIons associated wit

t tem. The fixup/baciup conditions encountered durine

difference set resolution or during dynamic equivalence

cneckine are indicators tnat, if tne current assipnrrents

remain tne same, a nondeterminism will occur in future

assirnments. As such, they inform the pruning mecnanisms of

the searca algorithm.

An Intecral part of the dynamic processor is tne

failure memor . It controls the search. The failure memory

may be conceptualized as a L x M matrix where L is tne row

size and corresponds to tne number of levels in the trace.

Eacn row has M columns wnere m Is equal to tne lower bound

assiwned to the instruction contained on tnat level of the

trace. An entry into tne failure memory at some level I ant

sore column J, where 1 <= i <= L and 1 <= j <= M, prevents

the assignment of j as a prefix label for tte instruction at

level i. When a failure memory cell contains an entry It Is

called a valid cell; otnerwise it is Invalid. Eact cell of

tne failure memory is a two-element entry. The structure

factor is the first element. It indicates wlicn level of tne

58

Page 61: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

trace caused tae entry. The free state factor is tne second

element. As tne name Indicates, tnis element Is a function

of tne number of free states available at tne time of'

assignment. Tqe specifics of the failure memory operation

and tne nature of failure memory entries will be discussed

throukhout the rest of the section as each phase of the

dynamic processor is discussed.

a. Label Assignment

As previously mentioned, latel assignment is tne

first function provided by the dynamic processor. A label

assipnment can be eitner forced or arbitrary. Additionally,

the assirnment can result in tne creation of a new state, a

label-name combination not seen before. A forced assignment

occurs wnen the instruction at the current worKine level is

a member of tte same couple-class as an instruction at a

prior level, and tne lead instruction into botn of those

levels nas tae same label assignment. The current worzine

level is defined as Tne level of' tne trace whicn contains

the most recently assienel pretix label, but ditf'eren~e set

resolution and dynamic equivalence cnec ing nave not been

completed at tnat level. An example is eiven in tne trace

shown in Figure 18.

Tne label at level 7 is forced by tne label

assignments at levels 4 and 5. Notice that the instructions

at level 5 ani at level 7 are in tne same couple-class,

49

Page 62: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

level conlition instruction c-C label

4 a a - 25 n r 3 15 r a 4 27 n r 3 .19 r a 4 .2

.indicates forced trove

Figure 18. Partial Trace Labelling

and that the instructions at levels 4 and 6 nave tne saie

prefix label. This condition forces tne instruction at level

7 to nave tae same prefix label as tne Instruction at level

5. The Moore machine representation of tne partial trace is

snown in Figure 19. The assignment at level LQ is also forced

for similar reasons. By definition, any forced assinrrent

involves previously assigned states, label-instruction

combinations, tnat nave been seen before; tnerefore, no

forced assignment can result in a new state.

a n

r

Figure 19. Partially Determined Moore Macnine

' . . ... . . . . . . . . d ' ' ' - " . .. ' .. ., : . . . 1 .. .6. . . ......

Page 63: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

The failure memory can be used in conjunction

with forced assignments to signal a bacKup condition to tre

search. It tne failure memory entry corresponding to tne

label assizament at the current worKinw level is valid, tnen

a contradiction results from the forced assignment. Sup)ose

that the trace table and failure memory are as snown in

Figure 20, and tne forced assignment at level 8 nas just

been made. The entry '1.1' at row 2, column 8 of tne failure

memory is interpreted in the followine manner. The intezer

to tne left of the decimal indicates tnat the entry was

caused by the current assionment at level 1. The "1' to tne

right of the decimal point is the number of free states + 1

available when the asslnment at level 1 caused tne failure

memory entry; therefore, wnen the entry was made there were

no free states available. A free state is one wnicn nas not

been bound to a particular instruction.

The assIrnment at level 8 is forced. In other

words the sequence of the previous absiznments causes tne

prefix laoel of tne instruction at level H to be a 2.

However, the failure memory contains an entry at row L

column 2, FM(9,2). This entry indicates tnat tne Instructicn

at level 8 cannot be assiened the label '2', for if it were

to be assigned a '2', a nondeterminism will result. To

resolve the conflict, baCKup is initiated until tne last

unforced assignment is found. In this case, the bacWup is to

level 6.

Page 64: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

The assignment at level b will be cnanged ana t:e searcn

will continue from there.

Trace Table Failure Memory

level cond instr c-c label 1 2

4 a a - 2 - - -n r 3 1 - - -

6 r a 4 2 - - -

7 n r 3 .1 - - -

L r a 4 .2 - 1.1-

Figure 20. Trace Table/Failure Memory Configuration

for a Forced Assignment

If tne assignment is not forced, tne failure

memory row corresponding to the current worrinR level is

searched for tne first occurrence of an invalid cell. An

invalid cell is one which does not contain a failure memory

entry. If a cell is invalid, tae assignment of a prefix

label correspondinR to the failure memory column inaex for

that cell is possible on that level of the trace. Tne 'olumn

number of the first invalid cell becomes tne latel

assirnment for the instruction at that level. For example,

suppose level 5 is the current working level and tne trace

table and failure memory nave the confieuration snown in

Figure 21.

62

Page 65: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Trace Table Failure Memory

level cond Instr 1 2 4 4

5 r a 1.1 4.1 - -

Figure 21. Trace Table Entry Snowing

Arbitrary Assignment Metnod

Tne first Invalia entry in tne failure memory on

row 6 is In column 6; tnerefore, instruction I a' for level 6

will be assigned a prefix label of 3. Tnese non-forced

assiRnments may result in the creation of a new state; that

is, a label-instruction pair not previously assigned during

the synthesis. If, at some future point in tne search, a

backup is initiated tnat reaches tis level of tne trace,

tne backup mecnanism will not stop to perform a retry. kt

any point in the synthesis, all previous levels have

received assignments based on the constraint that tue

minimum number of states has been used consistent with

maintaining determinism; tnerefore, assigning a lifferent

prefix label to a state which has been defined as a new

state only cnanges the name of tne state, and does not

cnanwe the structure of tne algorithm. Since tne structure

of the algoritnm has not been changed, the cause of the

nondeterminisi is still present.

One otLer type of assianment should be mentioned

at tnis point. Pseudo-assignment occurs when tnere is only

63

Page 66: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

one invalid cell left in a failure memory row at a level

otner tnan tne current worcing level and there are no free

states available. AlthouRn pseudo-assienment does not

immediately cause a label to oe assigned to the instruction

at that level, it does simulate a looK-anead mecnanism for

the search tecnnique by triggering difference set resolution

and dynamic eoulvalence chectinR as If that level of toe

trace were assigned a value. Since the pseudo value is tae

only value currently possible for that level, If a backup or

fixup condition is encountered durine pseudo assienment, the

assignment mecnanism can immediately try another label at

the current worginr level; thereby savine the unnecessary

search of a pats whicn it already knows to be nonproductive.

Once a tentative label assignment nas been male

to the instruction at the current woriing level, difference

set resolution anI dynamic equivalence cnecking can te

performed. Althougn tnese actions may cause a fixup on t'e

prefix label at tne current worting level, their primary

purpose Is to furnish infor'mation to the failure rerory t..at

will nelp guile future label assignments.

b. Difference Set Resolution

Difference set resolution prevents future

assiwnments beine made that are Known to ^ise

nondeterminism if the current assirnments remain uncnangei.

Difference sets outline a sirnificant portion of tne

structure of toe Input trace without regard to label

64

Page 67: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

assirnments In that they prevent notdeterminismn trofr

occurring as a result of the same transition out of a state

leadine to more thlan one followine state. Consider 'Fiwure

Figure 22. Nondeterministic Input Trace

There are several instances wnere difference set

resolution will force a state to be split into two or rrcre

different states. States 'a', 'q', 'p', and 11tt' all nave

nondeterministic transitions -associated with them. Tfle trac-e

table and failure memory configuration for tnis trace is

shown in Fieure 23.

65

Page 68: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Trace Table Failure Mpery

level cond instr c-c difference set latel 1 2 3

1 - a - 3,,5,1b,1 S - -

2 n p {4,1113 s a 2 j5,15,1St 2 1.14 n p 1 {iI 2 2.15 S a 2 - 3 1.1 3.16 r 3 - 1

7 s a -

8 v - {9,i ,2 I

10 r P 4 {2A1 r p 5 {211 2.1 4.112 s t - ti3,14,17113 s t S {I4,I?114 s t1 515 s a 7 1.1 3.116 n r 3 -

1? n t - -

is s a 7 - 1.1 3.1

19 n r 3 -20 p 9 - -

21 r p 5 - 4.1

22 s a 2

Figure 23. Trace Table/Failure Memory Configuration

After Assienment at the Fourth Level

As dynamic processing proceeds wtr label

1sstrnments, ilfrerence set resolution occurs. Difference

sets are resolvea by mating an entry into tne failure memory

row at thie level corresponding to tne aifference set

element, and tne column corresponding to the prerix label

assigned to the instruction at tne level from wnicn tne

difference set is beine resolved if the cell has not alreali

been made valid through a previous assignment. For examplP,

if tne prefix assignment at level 1 is a '1', tne failure

memory entries are made in column 1 at levels 6,5,15,1?.

66

Page 69: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Similarly, when tne assienment "1' is made at level 2,

failure entries are made at levels 4 and 11. Now wren tne

assignment at level 3 Is iade, tne lynamic processor will

not try to assion a prefix value of '1' since tne failure

memory cell at (3,1) is valid. The assignment will

automatically be '2". Notice that at level 5 the Drevious

assirnments nave caused tne prefix label to be a "6'. Tn

otter words, the failure memory nas caused the searcn tree

to be pruned so that an assienment of '1' or '2' will not te

tried. Either one of these assignments would nave resulted

in nondeterminism being Introduced into the trace at level

6.

n Ir

Figure 24a. Prefix Label Equals 1

67

Page 70: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

n 1ir

la ip2ap

5

Ficure 24b. Prefix Label Equals 2

Figure 24. Nondeterministic Prefix label Assignments

While failure memory entries are teing made

under difference set resolution, it Is possible for a row to

nave all cells valid except one. This nas oeen previously

defined as a situation leadinr to pseulo-assiznment. T!'.is

situation has occurred at level 11 in tne example -iven in

Ficure 23. When sucn an occurrence happens a looK-anead

mechanism is triggered to resolve the difference set at tnat

level. In this example, the failure memory cell at (21,3)

his been valilated with an entry wflic indicates the !urrent

worting level as level 4 when the pseudo-assignment occurred

at level 11. Another situation wlich can occur in a failure

memory row Is when all the entries in the row become valid.

68

Page 71: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

This condition is called an incipient fence. #fen an

incipient fence exists and tnere are no free statps

available, then no assiftnment can be made at that level.

T .is condition is called a fence.

Since the searcn mecnansm always Knows tne

level from whict it is doing loot-anead ty differen-e set

resolution, it is able to perform a fixup on tne label

assignment at the earliest possible time. A fiTup is

accomplisfsed by incrementinp the prefix label bv one. If an

entire row in the failure memory bec-omes valid and there are

no free states available a fixup must be performed on tne

label assinment at the current wortine level. If the label

is left the same, then when the search reacnes the fenced

level, no assienment will be possible. Eact time a fixup

occurs, all entries made in the failure memory as a result

of t~e previous label assiznment are deleted, and entries

are then made based on tne new label.

c. Dynamic Equivalence

Couple-class information furnished by StaTiC

processine ails in tne determination of dynamic

nonequivalence. Dynamic nonequivalence can occur during the

syntnesis at any level below tne current working level when

the couple-classes are equal. Dynamic equivalence results

wnen instructions in the same couple-class nave bpen

assiened the same prefix label. Consider Ficure 25. The

I-C-I triples at levels 5 and 6 and at levels 11 and 12 are

69

Page 72: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

talai; therefore, they are in the sare couple-class. The

instruction 'a' at level 5 aas been assigned a Drefix cf

' 2', and the instruction Oa' at level S has been assiRned a

prefix of '1'. Now, if tne instruction at level 11 Is

assigned a prefix of '2' and the instruction at level 12 is

assitned a orefix of '1', dynamic equivalen-e will c-cur.

Furtner, tne assignment at level 12 will te forced. D3narc

non-equivalence results when such an issienment scheme

causes non-determinism. Dynamic equivalence crecing

functions as a looK-anead reclanism ty preventing tne fut,:re

occurrence of a forced assignment wnlcfn will result in

nondeterminism. Suppose the synthesizer is Inspecting tne

trace in Figure 6, ani has just assiened the instrurction at

level 6 a prefix of "1'.

Notice that level 12 is in tne same couple-class

as level 6. Since the instruction at each of these levels is

in tne same couple-class, the possibility exists tnat tnev

may be the same instruction. If tne instruction at level 11

is assigned a label of '2' wnen tne woriing level reacnes

that part of the trace, then the assirnment at level 12 will

be a forced assignment of '1'. However, an entry nas already

been made in the failure memory at (12,1) wnich Indicates

that the instruction at level 12 cannot be assigned a prefix

label of i.

70

i I i....e Id

Page 73: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

TraceTable Failure Memory

level cond instr c-c latel 1 2 L

5 d a 1 2 4.1- -

6 r a 2 1 - - -7 g a 2 .. . .

ii f a - - - 6.112 e a 2 - 4.1 - -

13 n a 3 .. . .

Figure 25. Trace Table/Failure Memory

In order to avoid tnis contradiction and a

backup, dynamic nonequivalence processing causes in entry at

(11,2) of the failure memory wnicn corresponds to tne

labelling of '2" given to the instruction at level 5. Once

tnis is accomplisned, wnen the wortini level descends to

level 11, an assienment of '2' cannot be made and as a

result, tne assignment at level 12 will no longer be eorcea

by dynamic equivalence whicn rives the synt.iesizer a cnance

to try otner assignments that will maintain determinism rf

the alroritnm.

Pseudo-assignment conditions and fixip

conditions can occur in the failure memory as a result of

validation of all but one of the failure memory cells In a

row in the same manner that they occur in difrerence set

resolution. Addlitionally, lynamtc equivalency and differpnce

set resolution can interact to cause failure memory entries

71

Page 74: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

in the following manner. If a failure memory entry is maie

by difference set resolution at any level wnicn is In the

same coupla-class as a level previously assigned a prpt'ix

label, and if tne failure iemory entry prevents the

assignment that will cause the instructions to become ;art

of tne same state, then dynamic no-equivalence will result;

therefore, an entry must be made in tne failure memory to

indicate tnls condition.

3. Bactup/Fixup

The discussion of backup and fixup conditions nas

been saved until last. The basic idea benind constructin-

tne syntnesizer is to provide as mucn information as

possible to the search mechanism, and thereby dire-t tre

label assignment witn a minimal number of retries. Wltn tnis

in mind bactup and fixup become last resorts.

The fixup operation attempts to resolve

nondeterminism by incrementine the label at tne current

working level wnen a contradiction occurs. If t.. nawly

incremented label is not a legal assignment or does not

correct tne contraliction, tnen bacKup must be inittitao.

Tne fixup operation cannot be attempted It' tne assIrnient at

the current wortine level is forced or if the assipnmert

created a new state. In eitner of tnese cases, a fixup

operation would leave nondeterminism in the aleoritnm.

If a fixup fails, or cannot be attempted, bacKup is

initiated. Baccup must be initiated from tne current worKinr

72

Page 75: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

level when any level is discovered wnicn contairs one cf

these conditions:

1) The label assignment is forced and the failure memory

cell corresponaine to that level an! latel Is valid.

2) The label assignment causes a contradi-ticn and

represents a new state, or

3) There is no free state available for tne instru-tion

at a particular level, and all entries in tne failure

memory row at that level are valil.

The backup begins at tne current working level regardless cf

which level trierered the mechanism, and continues until

none of the three conditions given above are present. At

tnat level a fixup operation is attempted and tne searcfn

begins anew. Any entries into tne failure memory w.tic'h were

caused by levels greater tnan or equal to tne new current

workinR level are Invalidated by resettine t~e failure

memory entries to (0,0). Additionally, any dssir'nments are

deleted alone with their side-effects, 5u-n as annotatior.s

on forced assignments an! new states. IO' oacicup causes tne

woriine level to be decreirented to zero, a free state is

added for the use of the first instruction needin- more

states tnan initially allotted as tne lower bound.

73

Page 76: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

III. PREPROCESSOR

A. PRObLEM SPECIFICATION

The program syntnesizer expects a set of triples wnere

each triple is an Instru:ction, a condition, and an

instruction. Biermann (21 nas snown teat condltions

inadvertently or purposely omitted by tne user Tay re

inserted into a trace. The alrorit-m for insertion of

conditions collects tne set of atoms seen on tte transitions

for an instruction. An a is an entity whicn has a value

of either 'true' or 'false'. A nnnd.tinn is composed by

logical conjunction and disjunction operations on atoms. Fnr

example, an atom may be 'c <= V', but a condition may te "r

<O 1.nd a = 4'. A set of mtntqrm5 is computed from tne set

of atoms and one of tne minterms is inserted after eacn

occurrence of that instruction in tne trace. If {a,tf is a

set of atoms, then tne set of minterms will e

{a, b, {-a, b,{a,-b}, {-a,-bl wnere - stands for lopial

negation. It nas been snown in reference [16J tnat only one

of the minterms can be true for earn occurrenr' of a

transition from any single instruction.

One problem witn the algorithm is tnat it is Incapaie

of Inserting conditlons if tne user has failed to supply ary

atoms after a particular instruction. For example, i the

user should specify instruction Ii followed ty instruction

74

Page 77: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

12 in one part of the trace and instruction I! followed t y

13 in another part of the trar-e, but tne user t'ails to

provide a condition after eitner occurrence of I, tten tne

"ltorltnm will be unable to renerate a condition for 11. It

is assumed that II does not appear with an atom elsewhere !n

tne trace. The syntvesizer will force two states for 11 to

resolve any nondeterminism. This mecnanIsm is fully

explained in Section II. If conditions nad teen supplied in

the above example, the differ-nce in the two prorams would

be tne nuiber of states assirned to instruction Ii. FInure

2b snows a partial computation witnout, explicitly exnressed

conditions along witn tne associated synthesized program

fraement. Figure 25 assumes that Ii does not appear

elsewhere in the trace. Figure 27 is a representation of tte

same partial computation except tnat the conditions cl and

c2 nave been explicitly expressed. Tne computations in tot

figures are the same, and eacn proeram frapment will

correctly execute either trace; therefore, the proprair5 -rust

be equivalent prorrams with respect to program tenavinr.

However the prorram in Fieure 27 is miniml in that it

contains fewer states because the user explicitly supplied

the conditions.

75

O MAN I-#l4l . n~ll ._ h.

Page 78: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Example Computation

Svntnesized Prorra

Figure 26. Computation witnout Explicit Conditiors

(S,. . , 1f ,c ,1 1. 1,B .. ,F)

Example Computation

Synthesized Prorram

Figure 27. Computation witn Explicit Conditions

We intend to show that there are mechanistrs wrt -n an be

used to automatically generate tne necessary conditions fi3r

the correct synthesis of an alrorltrm Droducet by an mxarple

conputation without tne user explicitly ipeining tem. The

problem may be lescribed as follows. Given an -xample

computation witrnout explicitly defined conditions, infer

those conditions necessary to control tne flow if

computation in a manner such that the synthesized proeram

will demonstrate tne benavior desired by tne user. In oreter

76

Page 79: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

to facilitate tre solution to tne problem, a condition will

be viewed as a function tnat returns a value of 'true' or

"false' when callel ratter than a lovical operation on

atomic boolean entities. Tne problem can then be tncunt cf

as constructine a function.

Very little information is available to tne current

version of the synthesizer when the user provides only a

sequence of Instructions. Certainly not enou-n tc generate

minimal programs as described In Figure 27. Tnls lei us to

search for other sources of information that would allow us

to construct toe necessary conditions. We soon realized tnat

the Instructions issued by the user do not exist in a

vacuum. These instructions manipulate data. If tne entire

computer memory, includIng registers, Is viewed as tne

domain of interest, then execution of an instruction always

changes this state. Intuitively, toe domain also reflects

the reason that the user decided to execute a particular

instruction. A search of a space of tnis size in order to

determine tne reason is Impractical; however, ooservin only

those data elements affected by the sequen-e of Instructions

can often be quite practical and can significantly reduce

the search space.

We chose the text editing domain as the domain of

interest since we felt that it would be sufficiently

Interesting to warrant application of svntnesis techniques.

This domain was selected because, first, tecnnioues

7

Page 80: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

developed in tflis lomain may .be general enougn for extensier

into other dorains, se'7ondly. the world for tnis domain can

be descrlted as tne set of all cnaracters contailned in a

particular text file wnicn males the world 'inite, and

finally, tne instruction set is srall enough to e

managea ble.

Altnought our primary researcn is Ire,,te! toward

studyinp tecnniques to apply to automatic contition

generation, we feel that tte synthesizer could be a powerf'ui

text editor and Could provide some useful features not

normally seen in conventional text editors. Extended

features could include the ability to capitalize the first

letter of every sentence, the ability to capitalize all

small letters in tne text, the ability to identify a string

and perform some operation before, after or on it . or any

combination of these editinp actions.

The worring nypotnesis is to nave tne user process tne

text file in a normal manner and have tne syntnesIzer infer

a program from nis actions. Two requirements were levied

upon tne user. Tne first requirement on tne user Is tnat le

must inform tte syntnesizer when ne desires to nave a

program generated so tnat tne syntnesizer can teIn

monitoring tne user's actions. A great deal of time was

spent trying to figure out methods tnat allowed one reneral

mechanism to be used to monitor the user's actions and the

resultine cnanes In the text file. Since we could not

78

Page 81: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

produce such a mechanism, a second reouirement was levied on

tne user. This requirement recognizes a basic cAstinction

between two different aspects of text e4itinp,: context itree

substitutions, and context sensitive substitutions. go

define a context free environment to be one In wnicn tne

cnaracter to be operated upon Is not dependent on characters

around it. CapitalizinR all occurrences of small letters Is

an example of a context free operation. A contexi sensitive

operation is lefined as an operation in wnict trne action to

be performel on a character or sequence of characters

depends upon otaer characters around tne main c.aractpr cf

interest. Capitalizinp the first letter of every sentence is

a context sensitive operation. Conaition inference in a

context sensitive environment is Innerently more difficult

than in a context free environment in that the condition

must be constructed from events wlicn require a loox-anead

capability not inherent in the synthesizer. The user will te

free to switcn from environment to envirorn ent at nis

convenience. The synthesizer will create proora"i segments

from each environment wnicn can be used to construst a

conplete prorram by a post-processor.

B. DESIGN FOR A CONTEXT FREE ENVIRONMENT

1. Overview

Programs that operate on a single entity can te

constructed by the synthesizer. Fteure 2F snows the

construction of a program from a trace intended to

79

Page 82: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

coimunicate that the letter ".'I snould be apitalized

wnerever It appears in tne text file. Tne column latelled

"trace' contains triples of the form instruction, condition,

instruction. B is the start instruction, R is tne novo right

instruction, C is tne capitalize or change instruction and S

Is the stop instruction, respectively. Tne conditions for

tnis trace are tne cnaracters seen in tne text file prYor to

the execution of toe second instruction In eacn triple. The

special conlition "o" is tne null condition, and Is always

inserted after the start instruction.

Tne generated program will correctly execute tne

trace that was used to construct it, and by examination of

the program it can be snown that the program will convert

all d's to D's in a text file consistin_ of the cnaracters

A, b, C, I, F and G. There are no arcs available for otnor

cnaracters in the cnaracter set. In order to zenerate a

program to perform the same function on an irbitr3ry text

file, tne user would be forced to Five an eTample of tne

desired transition for every ctaracter in tne chrarter set.

Since it is desiraole to relieve tne uicer of tne

chore of providing an inordinate number of examples in order

to completely specify tne function, a metnod is required

that utilizes a few examples of the types of conditions that

are to appear on tne arcs to generalize tne conditions into

a more compact and complete form. If a ceneralization can be

found, the multiple arcs may be replaced with a more Peneral

Page 83: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

condition and, tr.eretore, correct 'roerams can oe 'reited

wttn fewer examples. However the combination of' arrs cetween

nodes must te accorplisned so that determinism is maintained

or the syntnesizer will not create a mimimum state macnine

capable of performing the desired functior. Tnat means that

tIe _eneralization tecftnIque must De able to handle

conflicts properly. The arcs in Firvre 2B tnat origInate at

state R and terminate at state R appear to -onsist of"

elevents from tne capital letters and small letters. The

generalization of {hI x e capital letters U tz! z 6 s-all

lettersl would appear to be a reasonable replacement ror all

of thne R to R arcs. If tnis generalization was made a

conflict woull result because tIe letter 'd' is also an

element of the {zj z f small lettersi.

Trace Syntnesizel proram

B R A/b F16R AR

R CR /P I C ===>1 STNTHESIZER === 0CDRDR 11

CsRG R sR LA S

Figure 28. Syntnesizer kctior

2. Structure of tie Condition Preprocessor

The preprocessor is designed to accumulate k.nowledge

from the traces it is provided, then use tne Knowledge to

construct meaningful conditions. The preprocessor scans t~e

Input trace looring at tne instructions and cnaracters tnat

81

-5-

Page 84: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

are seen before the instructions. Tnis phase extra-ts pairs

of instructlors from tne trace. Tne trate in Figure 2H woiiud

nave tbe instruction pairs (.bR), (R,R), (R,C) and (C,PF

extracted. Attached to eacn of these pairs is the set cf

characters that were seen between tne pair. Tne preprocessor

then analyzes the information to determine if a

gen eralIzati on can be mate frim the set of cnaracters

associated dita eacn instruction pair.

The natural division mentioned above allows tne

preprocessor to be divided into two modules. Tre first

module performs tne scanning function wnile tne second

module analyzes tae information and anpltes a neuristi- to

provide the most general condition Dossiole. The

i rpleMentation of the preprocessor will be discussed later,

but before It can be discussed an explanation of the data

structures required ty the preprocessor is needea.

3. Preprocessor Data Structures

To simplify tne problem we define two tvpes of

instructions in this domain. Instructions thiat specify tne

current location of interest are cursor Dositionlre

instructions. Instructions tnat ctange tne state of tre

domain are data manipulation instructlo-s. Tne preprocessor

accepts as input a sequence of instructions and an

associated sequence of cnaracters. Tne first Instruction in

tne instruction sequence is always the start instruction

wnicn does not nave a character associatei witn It. The last

8!2

Page 85: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Instruction in the sequence Is always a nalt intruct *o.

Every action performed by the user Is ̂ aDtured ina apuri _e

to tue instruction seguence list. Tne character ssouen.P is

created in narmony witn the instruction seauence. In t e

quiescent state the cursor will indicate a certain ,osition

in the text. When the user performs some action sucn as move

tne cursor rignt, a monitor piccs up tne value in tne old

position and associates tnat value witn tne inctr,)ctlon

executed rv tne user. For examnie, assume a user has a text

file in lower case letters that ne wants to cnange to all

upper case letters. The user initiates tte synthesizer then

proceeds across tne line of text cnanging lower case letters

to upper case letters. For the purpose of this example,

assume tne line of text is change lower case to upper

case . As the user moves arross tne line matinp

substitutions, the condition monitor captures tre actions

performed and the characters seen. The example line would

yield an instruction sequence of (P, C, R, C, R, C, P, C.

C, S). The associated cnaracter sequence world te; (c,

C, n, H, a, A, ... , e, 0). The "C" and "R in tne

Instruction sequence are the capitalize and move right

instruction, respectively. Note that tne caDitalize

instruction does not reposition the cursor and wnen tne user

moves the cursor to tne right, tne result of tne capitalize

instruction is associated with the move.

93

Page 86: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Anotner data structure needed ty tne preprocessor is

the ASCTI vector. The ASCII vector is a 12F-byte linear

array witn indicec numbered 0 tnrouen 1?'?. Each tyte in tne

array is referenced ty the decimal value of a particular

ASCII character. For example, tne array elerert rpservpi for

the ASCII character '0' is indexed ty 4-9 decimal. The arrav

element reserved for tne ASCII cnararter 'a' is intexed y

t6 decimal. Tne vector defines a partition -f tne ASCII

c.haracter set by usin the followine te-nnique. The ASCII

character .set has been divided into eight mutually exclusive

subsets.

Subset 0 Capital letters

Subset I Small letters

Subset 2 Numbers

Subset 3 space character <sp>

Subset 4 Symbols

Subset 5 Punctuation

Subset 5 Arithmetic operators

Subset 7 Control characters

Ah Subset name is entered into the ASCII vector at eacn

cell by converting the ASCII character to its decimal

equivalent and using tnat value as the array index. The

default partition is shown in Fifure 29.

84

Page 87: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Index 30 31 ... 39 65 6 ...

! I! I

2 21...1 2 L LAI I

I I I I

ASCII 0 1 ... 9 A B ... Z

Fizure 29. ASCII Vector

Tne cnaracter set nlerarcny is delined bv tne tree

structure in Figure 30. The tree is related to the ASCII

vector tnrouRn the cnaracter subset names contained on eacn

node one level above the leaf nodes. For tne dPfault

nierarcny shown in Fig'ure 30, a zero would te entered in tne

ASCII vector for all capital letters, and a 1 would be

entered for all small letters. If a cifferant partition of

the character set is required the user can modi ry the

nierarcny or create his own. An example will be given to

explain tow tne modification may be accomiplisned. Assume a

partition is desired where tne vowels are isolated into a

set. Assume furtner that tae the vowels are to be Subdivided

into capital vowels and small vowels. The flerar-ny would te

modified by placing a son calle, 'vowels' on tne alpnaeetic

node. Attach to the new node two sons. -alled 'Cap-voweI5'

and 'Small-vowels', witn arcs to tne appropriate cnaracters.

Relabel the nierarcny so that siolln relations are numnerel

in increasing order. Finally, initialize tne ASCII ve-tor

witn tne new labelling. All of the modifications can be done

by the system when the user calls for the modifi-ation Tne

modified nierarcny is snown In Figure 31.

8bt

Page 88: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

ASCII

DIsplayable control

special Alofla-nurneric

[Arith-1 jPunc-1 Syrnbols! !Space! jAlpnabetic! !Num~eric!ietic 1 tua- 1 3 1----'opera-, fion f --- --- - ----Itors 1 5 1 T1

6 <sp>

77- -- --

A .. Z a .. z

Firure 30. Derault Hierarc.hy

86

Page 89: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

ASCII

--- ------------

- -----

to I 7r

:,. p -S~e7. .,Cajwetas vo s

letters: ----- ietters,!

voweisl v ow eis;

----~ ~ - - -- -- - - - -- - - -

B e ...u y 7 ... zCap-letter Cap-vowels SF Ili-vloeI5 callelter<

leSS LESSCap-vowels i .l-, o* 1

Fipure 31. 'oci.'ea -ierarcn:7

t I

Page 90: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

The next lata structure use! vy the preprocessor Is

the transition table. The transition table contains tne

knowledge gleaned from scanning tne instruction sequen-e and

tne character se4uence createa oy the monitor. F'irure '52

snows the format of the transition table. The transition

table is an array of records with each record containing

Information on a transition. In the table, Ii ana 12 are

instructions vere 12 directly follows Ii In at least one

place in the instruction sequence. 'Active-sets' is a field

that contains information on sets of cnaracters tnat have

been observed by tne monitor on tne transition froT Ii to

12. The fields 'Set-i' tnrouen 'Set-n' contain the value for

set name, the count of the elements from the set associated

wltn tne transition anl a pointer to a linKed list of the

elements. The records that would be created for the tra-e

given In Figure 23 would be associated witn the transitions

B to R, R to R, R to C, C to R and R to S.

III I- I Active-sets 1 Set-i , Set-2 : . Set-nI I • . I

I I I I I I I

Figure 32. Format of toe Transition Table

4. ImDlementation

The context free preprocessor consist of two Tain

modules; the scanner and the insertion modules. Another

Important module not part of the preprocessor is the user

Page 91: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

monitor. Tne monitor gatners tne actions of tne user and

creates two arrays. One array contains tte sequence of

Instructions tne user providel and tne otner contains

in formation of what was true before an instruction was

executed. The information tnat Is gatnered is tnen passed to

tne appropriate preprocessor.

Tne example instruction and cnaracter sequences

Riven in Fieure 35 will be the example use! to explain the

mecnanism of tne preprocessor. Figure 33 is llustrative of

a collection of actions tnat were performed by sone user.

Tne user's roal is: CnanRe all lower case letters in a text

file into upper case letters. The user nas activated tae

condition Tonitor, positioned the cursor at tne berinninp of

a line of text and moved rignt along tne line, cnaneine tte

lower case letters to upper case wnenever one appeared anove

tne cursor. Fieure 33 is an example of output from tre

monitor assuming the line tne user processed was Tie

numbers 1, 2, 3, b, 7 ARE prime. . Tie first column in

Figure 33 is tna cnaracter array. It centains tne cnarictor

under tne cursor prior to execution of tne Instruction in

column two. Column two is a trace of' tne actions perforred

by the user. Tte "R" represerts tne .move cursor rignt'.

instruction and tne "C" represents a cnange witnout cursor

reposition instruction. Figure 33 can be read as: Tne

cnaracter in column one was observed and tne instruction in

column two was executel.

89

Page 92: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

inaex cnaracter Instructiorvector vector

I T R2 a C

H Re C

5 E R5 <sp> R7 n C

22 1 RR

<sp> R25 2 R

37 R

39 R

49 C

Figure 33. Monitor Output

Tre scan module or tne preprocessor is activatea

wehen the user Indicates tne representative exqmple is

coiplete. Let "Inst-iniex" be an inciex for tne instruction

array tnat is initialized to 1. Tr.e tirst step is to rreate

a transition from tne start instruction to tne first

instruction in te instruction array ani add tr.e transition

to the transition table. Tnls transition will Indicate tne

beeinnine of tne protram and will transition to tne virst

instruction provided on a null condition. The module tnen

moves down tne instruction array creatine otter transitions

and adding tnem t o tne transition table. Duplicate

90

Page 93: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

transitions will not appear in the table. A transition is

defined as a pair (11,12), Ii and 12 are instructions anl 12

follows Ii witnin tne instruction array. Tne Instruction

array in Fivure 33 yiells transitions (R,C), (C,R). (P,R).

Tne transitions are constructed by indexing tnrough

the instruction array. The instruction at inst-inaex and

Inst-index ' 1 form a transition. Tte transition is tne

match against tne transition table. If a matcn occurs, tne

character in the character array at inst-index + 1 is

extracted and its ASCII value is used to index into tne

ASCII vector. The value stqred in the ASCII vector is used

as an exponent for two and stored in a temporary variable. A

bit by bit logical OR is perforlied between the temporary

variable and tae Active-sets variable for tne transition and

tne result is stored in Active-sets. Active-sets contains

the information of every set from the partition that has

elements seen on tne transition. Tne operation lescribed

above allocates one bit for eacn set in the partition. If

Aective-sets equals 1 tnen bit one of Active-sets is a I

signifying at least one element of set 1 has been seen cn

this transition. A two would sipnify that soe element of

set two nad been seen and a three would signify ttat some

element of set one and some element of set two nad been

seen.

In the transition table are fields for each set that

nas been determinel to be active for tne transition. Witnin

91

Page 94: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

eacn of the set fields tnere are tnree subfields, tne first

is the set naire, the seconl is a count of the elements seen

for tne set and the last is a pointer to the start of a

circularly linked list containine the elements used from tne

set. The value that was obtained from tne ASCII vector is

used as a set name and matcnel apainst each of the set

fields' set name. If the set name matcnes an entry the

character at Inst-index + 1 is added to tne linked. list in

lexicowraphical order if not already on the list and tne

count is incremented by one. If a match does not occur on

the set name a new set field is created and eiven tne name

that was obtained from the ASCII vector, the count is set to

one, and tne cnaracter Is put on tne list.

When the scan module reaches the end of the input,

tne transition table contains an entry for eacn transition

that was seen. Each transition is associated with all tne

sets that nad elements seen witn the transition. Finally

eacn transition is associated witn tne actiial elements

t.rougn the linked list for each set. The information is

then passel to the insertion module for analysis. Flure 34

snows the completed transition table and the linKed list of

elements for each set.

Once a completed transition table nas been created,

control Is passed to tne insertion -nodule. Tne Insertion

module processes the information in the transition tatle and

assigns a condition for each transition.

92

LAN-,-

Page 95: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

I I An a cs s ttt Ir r v12 e I Set-n

IBIRI 1 1 1 1 1 <7> 1

RICI 2 ', 1 '19 1 (<0

IcI I i 0 s 1 <5> 'IRI 4 3 <1> 1 2 I <2> 1 3 11 1 <3> 5 b 1 1 1 <>

<1> <2> <3> <> <b> <6) <7>

A 1! n <I> < e p po

41 INI

17 1

i1 11 is!I

NOTE: Tne notation <1>, (2>, etc. represents a pointer tothe linced list headed by the same symbol.

Figure 34. Completed Transition Table

93

Page 96: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

The Active-sets entries provide an efricient

mecnanism for recognizing potential conflicts on emanating

arcs. Performine a tit by bit AND on tne Active-sets entries

that nave a common originating intruction yields tne sour-e

of conflicts. Tne bit positions that are on (bit equals 1)

are tne set (or sets) tnat nave nad elements on multiple

transitions. For example, let (11,12) and (11,13) be entries

in the transition table with Active-sets value of five (Z1

binary) and three (00i1 binary) respectively. Let Q equal

tne result of the bit by bit AND of the Active-sets values

given above (i.e. 0001). Q indicates that there is a

conflict between tne transition (Ii,I2) and the transition

(11,13). Furthermore, Q indicates that tne set causing the

conflict is labelled zero in the aierarcny of Figure .0

because the on bit is in the rignt most position wnicn

corresponds to two raised to tne zero exponent. Usinp tne

exponent to enter the nierarcny, it can be determined that

capital letters were seen on both transitions. Onpe all tre

conflicts for transitions wita tne same originating

intruction are inown, tne conflicts must be resolved before

an assignment of conditions can be made.

Extending the example given above, assume that eignt

capital letters were seen on transition (I1,12) and t'our

capital letters were seen on the transition (II,1M). A

partial conlition can be constructed for the transition

(I1,12) as a set difference between tne set of capital

Page 97: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

letters and tne actual elements seen on the transition

(Il,13). Tne partial condition for tne (Il,13) transition

becomes the set of capital letters tnat were aCtUalyseen

w!th tis transition. The inItial conditions for tnese

transitions become the union of tne sets indicatea in

Active-sets as not being in conflict and tne sets createi ty

the resolution of conficts. Tnerefore, tne conaltion for

(11,12) is (t x x 4 capital lettersl - {xlx c capital

letters on otner transitionsi) U Jx',x a numeric}, ana tne

* condition for (11,13) becomes { z z c ({actual capital

letters seenl U ismall lettersf)J. In tnis example, it was

assumed tnat tne sets, numeric and small letters, were an

appropriate eeneralization for tne transition. In practice

it cannot be done without consideration of the numoer of

elements that have been seen from the set on the transition.

If the count field for the set exceeds a taresnola value for

the set, the eeneralization Pay be macne, otnerwise tne

elements tnemselves become the partial condition for tne

transition.

After a condition nas been constructed for a

transition, a final stronz weneralization tecnnique is

enployed. The Active-sets value for the transition again

supplies tne starting point for tnis tecnnique. Notice

adjacent bits in Active-sets correspond to adjacent nodes in

tne nierarcny. Therefore, a cnecc is made of tne Active-sets

to see if it has adjacent bits with a value of one. It' it

95

Page 98: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

FVAD-AI04 586 NAVAL POSTGRADUATE SCHOOL MONTEREY CA F/S 9/2

CONDITION RECOGNITION FOR A PROGRAM SYNTHESIZER.IUI NJUN al J S LAPE, C W MILLERUNCLASSIFIED NL

22ffIIIIIIIIII

EEohhohmhhEI-IEEEEEllEllEEE*rnuuuuuurnumIIIIIIIIIIIIII

Page 99: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

does then a generalization may be attempted. Assume tne

condition (({capital lettersl - tA E I 0 Uj) U ismall

letters} U tnumericl) Mas been constructed :or some

transition. The Active-sets value for tnis transition must

be seven (0111 binary). With tie default nierarcny in Fieure

32, a generalization to Alpnabetic and tnen to Alpna-numervc

would be attempted. Notice tnat a generalizatlon to

Alpna-numeric would fail because of a confl1ict witn another

transition. Intuitively (talpna-numericf - IA, E, I, 0, Uj)

would be a correct cnoice for the -ondition for tnis

transition. A general procedure for tce construction of

reneralized conditions is eiven below.

A set of nodes T = ty, ,z, ... , y, is

eeneralizable to a node X if the set of' node Y form a

complete and exhaustive set of leaves to the subtree rooted

at X. Further, a set of nodes Z = {z1 , z. , ... , zM } is

eeneralizable to the set 4 = {wl, w2, ... ,w J, J < m, where

eacn w is a generalization of a subset Z.

IF the condition = F U F U ... U Fwhere F =z - q, i 1,n

where qc C zi (qj possibly null)

THEN the condition Is set to W -U qU

wnere W is tne smallest setV = 1w, , w2 , .. . , w) Isuch tnat W generalizes {z, , ... , z

96

Page 100: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

C. DESIGN FOR A CONTEIT SENSITIVE ENVIRONMENT

1. Overview

Condition generation In tne context sensitive

environment is a more difficult task tnan in tne context

free environment. This difficulty arises from tne s' ope of

Irnowledge required to ,aie decisions on wnat a condition Is

to be. The conditions themselves are more complex te7ause

tney depend not only on tne character tnat is being seen,

nut also depend on characters tnat precede and follow tne

current cnaracter under consideration. The following example

will be used to illustrate the difficulties and our solution

to this problem. Assume a user wishes to capitalize all

occurrences of tne word 'time' in some text file. Also

assume that the word occurs at the beeinninR, at the enl,

and in the middle of sentences in the text file. The

question is tow to construct a proeram that performs tne

desired function given only tne actions tae user performs as

an example of the required program.

The assumption about the position o the word "'ti'e'

in tne text file implies tnat tne requested action needs to

be accomplished on strians that nave very different

characteristics. Certainly, botn 'time' and 'Time' snoula .e

capitalized as should 'time,' , 'time?' and 'time<sp>'. On

the other hand the string 'time' should not be capitalized

when it occurs witin a word liKe 'sometime' or 'timely'.

97

Page 101: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Any generated program that benaves as iescribed

above must be able to recognize an occurrence of tne string

or some variation of tne string. The totality of t.s

Information must be glued togetner to provide a single

condition that is descriptive of. what the surroundine

environment must be lire before tne action is performed. The

implication Is that tne condition itself must be arle to

perform caecking ani Iook-anead. In other words, the

condition for tne transition to tne operation must in fact

be a procedure which responds 'true' whenever the string of

interest is recognized. Assume for tne present tnat tne

strine of Interest can be discerned from the user's actions,

(a hard problem by itself, see Angluin [19J ) one must wonder

now sucn a procedure can be constructed and then inserted

into tne generated program wnicn performs the function of a

condition on some transition in the program. Figure 35 snows

a procedure whqi:h recognizes the word time'. Note tne

robustness of tte procedure In tnat it distinguishes between

the differine occurrences of 'time' as mentioned above.

Figure 35 points out that tne problem is not just generating

a procedure as a condition but also generating conditions

within the procedure that is to be tne overall rondition.

Tne arcs labeled 'T v t' and '<SP> v tpunctuationl' snould

be noted with interest because they provide the robustness

tne condition procedure needs. Tne discovery of arc labels

for the condition procedure vill be discussed next.

98

Page 102: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

IIASCIII t<sp>ff

R

(sp>

(TT v t)

R

R

R

(<sp> v tPunc.1)

!Requested!Opera tion!

Figure 35. Condition f'or "time" and "Time"*.

Page 103: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

2. Lmnpientation

The monitoring of user actions provides ttle

instruction and cnaracter sequence In tne same manner as

done in the context free mode. A consideration was eiven to

require 'ore information be provided by tne monitor,

however, the notion was discarded because it would reouire

the user to be aware of the functioning of tne preprocessor.

Requiring tne user to provide Information to tne system

would betray our goal for the system. The user should only

be required to initiate tne system and tnen perform ealting

as if the system was not actively monitorine his actions. We

feel the requirement of specifying whether the user wants to

perform context free or context sensitive operations is tne

maximum tnat should be asied. If it were feasitle to

recognize tne lifference between tne two modes from tne

user's actions alone, tnis limitation would be also removed.

Given only tne instruction sequence, tne cnaracter

sequence, and the information of a -ontext sensitive

environment, tne first assipnment of the conte7t sersitive

preprocessor is to discern tne strine of characters upon

whicn some operation Is to be performed. Tnis is a pattern

recognition problem of considerable difficulty. Anpluin (19J

provides the followine theorem, "There is an effective

procedure wnicn, when given a sample S as input, outputs a

pattern p which is descriptive of S. The sample S is a

subset of tn. set of all strings over the alpnatet of the

Page 104: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

I

laneuaze. The effective procedure is computationally

expensive dnd not Ilplerentationally desiraole for our

system. The procedure is an enumeration tecnnique on

patterns witn a length less than tne snortest example in tte

sample set S. Each of tne enumerated patterns is testec to

determine if it is descriptive of the entire set S. Tte

longest pattern that is descriptive of S is the most

specific pattern for the set. Clearly, as tne lengtn of' the

of the sample grows, the number of enumerate. patterns will

grow exponentially. Angluin [191 states, "In tne general

case, the test performed on the patterns is an NP-complete

problem. . The test she is referring to is the cneck to see

if the enumerated pattern is descriptive of S.

For implementation purposes, we need a mechanism

that falls well snort of tne exponential tenavior of the

effective procedure mentioned above. The text editine domain

has two types of Instructions for tne purpose of tris paper.

The first type of instruction %ill he called cursor

positioning instructions wnlile tne second type will e

called data manipulatinR instructions. Assumine the text

file is to be represented as a linear array, only one cursor

position instruction need concern us. All cursor positioning

commands such as move left, move up or move down can be

represented as move right instructions. Data manipulation

instructions operate on one character and do not reposition

tne cursor.

101

Page 105: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

The metnol we nave adopted for determining tne

strint of interest and the context of tne string is basea on

tne above definition of tne types of instructiors availale

in tne text editing dorain. The preprocessor scans tne

instruction sequence loolcine for an occurrence of a data

manipulation instruction. The character associated with tnis

instruction is then taKen as the first cnaracter of tne

string of interest. Other characters are added to tte strire

by continuing the scan until multiple occurrences of cursor

positioninr instructions are encountered. A nypothesis is

then constructed consisting of three parts. The first part

is tne beginning context. It is constructed from tne

characters tnat preceded the string in the cnaracter

se4uence. The second part Is the string itself and tne final

part is the endink context constructed from the characters

seen after tne string. For engineering considerations, tme

number of characters in the bezinnine and ending context

will be limited to twenty characters. The probability of tte

context exceeding twenty cnaracters on botn sides of" tne

strinr in the text elitint domain is small enouzn to iwnore.

Once a nypotnesis is proposed it is set aside as an

active hypothesis and scannine of tne input continues. Otner

cises of data manipulation instructions surrounded by cursor

positioning instructions will result in otner nypotnesis

being constructed. As these hypothesis are added to the

active nypotnesis iAst tney are chected for consistency and

Page 106: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

if the new hypothesis causes conflicts they are resolved ty

constructing another nypotnesis from tne conflicting

hypothesis. To demonstrate this mecnanism we present an

example which will illustrate the generation of fnypotneses

and resolution into a condltion function. Tne example used

is the construction of the function which will recognize tne

string 'tine'.

Suppose the text file contained the tollowine

sentences somewnere in tne file.

The time is two oclocK.It is time to go to tea.Time the runner.Did you run out of time?

Also, suppose tne user has specified the environment is to

be context sensitive and nas berun to perform actions on tne

file. The monitor coull create the following Instruction and

character sequence fragments from tne user moving tnrouen

the text file and capitalizing tnese occurrences of 'time'.

(RRRRCRCRCRCRRRR ...)(The tTIImMeE is ... )

(RRRRRRCRCRCRCERRR ...)(It is tTiImMet to ...)

(RCRCRCRRRRR ...)(TiImMeE the ...)

(... RRRRRRRR.RRCRCRCRCRR)(... run out of tTilmMeE?)

103

Page 107: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

This example is not to imply the user must cnanre all

occurrences in tne text file but ne snoula provide enougn

examples from the file to insure tis desires are understool.

If tne user has not supplied a distinguisning set of

examples and an incorrect program is zenerated ne may add to

tne set of examples.

Scannine the first instruction sequence until tne

first data manipulation Instruction results in tne string

"time' beine constructed. The resultine ftypotnesis is tnat

the string 'time' is witnin tae context of 'Tne(sp>" and

'<sp> is two oclocK.'. Tne nypotnesis may be viewea as tne

followine data structure.

Hypotnesis 1:Begin context: Tne<sp>

Strine: timeEnd context: <sp>is two oclocK.

A second hypothesis would be zenerated for the next portion

of the instruction sequence as snown below.

Hypothesis 2:Begin context: It is<sp>String: timeEnd context: <sp'to ko to bed.

A comparison of taese two aypotheses indicates a

disaereement between the contexts. The conflict is resolved

by determining the longest beginnine and endine 'context that

agree between tne two nypotneses and generate a nypotnesis

reflective of ttis agreement. By worKing bacKward from the

last cnaracter in tne begin context for botn nypotneses, it

is possible to ascertain tnat the only character in

104

Page 108: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

agreement is tne space. Woring forward from the first

cnaracter in the end context for botf nypotneses, apain orly

character in agreement is tne the space. A tnird nypotnesis

wita tne new begin and end contexts Is renerated as follows:

Hypothesis 3:Begin context: <sp/String: timeEnd context: <sp>

This hypothesis specifies tnat tne string 'time'

must be preceded ani followed by a space. Note tne test of

the hypothesis implies tne user is allowed to specify one

string during an example computation. It Is also Implied

that there must be a bezin and an end context for the

string. Since it is possible to nave two hypotheses where

one of the context strines do not agree in any of tne

characters, a method must exist to provide tne appropriate

context.

Whenever the comparison between context of two

nypotneses results in tne null string, a disjunction is

formed from the characters immediately next to the string.

For example, the instruction sequence given above woulc give

the hypothesis:

Hypotnesis 4:Begin context: Did you run out of<sp>Strine: timeEna context: 7

A comparison between nypothesis 3 and nypotnesis 4

would result in the null string for the end context. Since

there must be an end context, the disjuction of <sp> and ?

105

Page 109: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

is formed and tnis tecome tne end context for tne new

hypothesis. Generalization tecnniques tnat were mentionea in

tne section on context free environment ar, tnen applied in

an attempt to reduce tne end context to tne most -eneral

context consistent witn tne data seen. The only alteration

in the generalization scheme is tne lowering of tne

tnreshold values for important sets. In tnis example, tne

threshold value for the punctuation set wruld be lowered to

1 and the ending context would become { x! x=space or x c

tPunctuationfl.

The final problem to be solved is tne recognition of

variations in a strine. Examples o variations of a string

are, 'Time' and "time', or 'enclosure' and 'inclosure'. As

mentioned, if tne user intends to capitalize all occurrences

of 'time', 'Time' is to be included. Note these variations

of the strinp become tne conpouna labels for tne arcs In

Figure 35. The system includes a rule that enables tle

recognition of variations of strings provided tne user gives

an example of the variation. The rule simply states tnat tne

string length will be establisned to be as long as tne

longest string encountered during processing. Again, using

the example, the hypotnesis ror 'Time the runner.' would be:

Hypotnesis 5:Berin context: ... TString: imeEni context: <sp>tne runner.

It has been establisned by precedine user actions

that tne string length for tne nypotnesis snould be 4. By

106

Page 110: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

matcnine the pattern in hypothesis 5 witn tne btrirn Irom

nypotnesis 4 it can be deterinea tnat tne string in

Hypothesis b shoula be expanded by inserting a "T' in front

of the string. Anotner nypotnesis is then generated where

tne string will te tne disjuction tetween tne strins 'tie"

and 'Time'. The final nypotnesis from the example woul1 thern

be:

Hypotnesis b:Beein context: <sp>String: 'time' v 'Time'Eni context: t xl x = space or x e Punc.1

Once tnis nypotnesis nas teen generated, it Is tnen

used to examine the Input for neRative examples that can

strengtnen or weaken tne nypotnesis. Suppose tne input

contained the fragment ... timely results.... Pro-essinR

the input witn Hypotnesis 6 would snow a matcn for the

strinR, but tne ena context would not agree; therefore, tne

nypothesis will be strengthened by cnaneina tne end context

as shown below:

Final Hypothesis:

Begin context: <sp>String: 'time' or 'Time'Eni context: lxlx=space v

x e Punc. Nx a small lettersl

After the input has been processed ani a final

hypothesis proposed, the hypotnesis is used to construct a

procedure such as shown in Figure 35. The first part of the

procedure to be constructed is the transitions ror the

beginning context. The states in tne procedure are tne

107

Page 111: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

instructions in tne instruction set, and the arc labels

consist of the information In Lne final nypotnesIs. A start

state is placed in the procedure with an arc to a move rignt

instruction (R). Since the procedure Is a strine matcn or

iooK-anead routine all states other than tne start state

will be move rizht instructions. Each of tte states will

have two arcs exiting them. Tne labels on tiese two arcs

Will be the necation of the each other.

Tne construction is accomplisned by placing tne

first character of the becin context on tne exitin&n arc

going to a new move right state. The other arc is labeled

with the negation of the character and tnis arc terminates

at the first move right state. Each character or the bein

context creates another move right state labeled as

mentioned.

The string from tne nypotnesis is then used to

complete tne procedure that has been partially constructed.

If the string is composed of disjunctions, the characters

are used to form disjunctions. Each of the disjunctions are

combined wita conjunctions. The final nypotnesis above

provides a string of 'time' or 'Time'. The conjunction of

disjunctions will be formed as:

('T' v 't') & ('i' v '1') & ('m v 'm') & ('e' v 'e)

Upon reduction the strine will be expressed as:

('T" v 't') & 'i' & 'm' & 'e'

Each disjunction becomes a label on an arc to a new move

108

Page 112: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

rignt state ani tne negation Decomes tne latel on an arc

back to tne original move rignt state.

Finally, tne end context is aldej in tne same manner

as the begin context. The first character oecomes the latei

on thne last move rignt state created frim the string and new

states are aled for eacn character in the end context. Tne

result of tnese operations is displayed in Figure 65.

109

Page 113: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

IV. CONCLUSIONS AND RECOM'ENrATIONS

A. STNTHESIZER

Tne syntnesizer tnat nas been implemented for tnis

tnesis will produce programs from example computations in a

reasonable amount of time. Tne system response for most of

tne traces was witfhin 1v seconds on a Dipital Yqupient

Corporation PDP-11/50 minicomputer. The response time is a

function of tne lengtn of tne trace and tne rnumcer of

multiple occurrences of a particular instruction or set of

instructions In tne final algoritnm, wItn multiple

occurrences of an instruction affectina response time tne

most. As Blermann (17J nas noted, tnis nas a nice

implication for prorramminR by example because most

algoritnms do not exnibit tne cnaracteristic of ftavnng a

laree number of instances of tne same instruction. In otner

words, almost all multiple occurrences of an instruction In

an input trace are indicative of a loop in tqe aliorltnm.

In all of tne test cases except tnose tnat requlred a

large amount of backups, static processing accounted for at

least talf of tne total response time. Future modifications

to tne syntnesizer wnicn would decrease tne total response

time could be directed toward desirninr tne static

processing stage more efficiently. However, tne trade-off

between static processing and dynamic processinj must be

Page 114: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

-1ept in perspective. static processing is a linear fur ction

of the lenett of tte tra e, whereas dynamic processin',

since it is an enumerative search tecnnique, is i n

exponential function of tne lengtn of thne trace.

Another area wnich should be considered is t.e dynamic

processing stage. Tnere exists a pletnora of researcn

ouestions within this area. The primary one being: Can rrcre

information be gleaned from tne input trace auring static

processine wnich will decrease trne search time r'or dynamic

processing? Difference sets and couple-classes provide scTe

powerful mecnanisms for decreasine tne amount of searcn;

however, lower bounds computations on the number or states

required by the macnine often increase tne amount of searct.

Lower bounds are restrictive in nature. They are desizned to

force tne final algorithm Inte a minimum state configuration

which, in many cases, causes extra search time. Relaxation

of the lower bounds ccmputation will result in a 'inal

algorithm which may not be expressed in a minimum nurer of

states, but which will still oe determlnistic. There r-ient

be better methods of initially computing the number of

states whicn would result in a closer estimate of tne actual

number of states required for tne algoritnm. Obviously, the

closer tne initial guess is to tne actual requirement, tne

less backup incurred, and, therefore, the less search ti're

requi red.

111

.1.'

Page 115: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Since tie amount of search requirel Is governed Dy tne

failure memory entries, the more dense tne failure iemory

can be male, the more directed tne search be-omes. So

anotner area for researcn is to determine If more

information exists In the fillure memory entries than is

currently being used. How lucn information do tne structure

factor and the free state factor provile? Is there another

factor which would be useful?

Finally, a more Reneril question can oe addressed. Tre

underlying structure of tnis technique is an enumerative

search. Can the tecnnique be zeneralized to Include otner

algoritnms wnich are enumerative In nature? 'dhat

modifications to the failure memory are needed? How would

difference sets and couple-classes be redefined?

B. CONDITION PROCESSING

The condition processor front-end to tne synthesizer

relieves tne user from worrying about some of tne control

structure considerations by automatically !eneratinf?

conditions. Anotner allition which would increase tne power

of the syntnesizer Is an automatic loop varlatle generator

as discussed by Biermann 1181. Altnougn the text editine

environment nas been used in this tnesis worr, tne part of

the condition processor desien which deals with a context

free environment is general enougn thnat it could be designed

to operate in any domain.

112

Page 116: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Condition generation in a context sensitive ervironrnt

Is a 'iurn harder problem further complicatea by requisite

pattern matching and pattern generation. Before tnis Type cf

condition.reneration can be generalized. mucn worr nas to te

done to increas-e the efficiency of pattern reneration

scnemes. Angluin (19J nas shown a pattern generation scneTe

which is a polynomial time alzoritfn for pattern eeneration

witn one variable, but tne domain we nave exafoined will

require at least two variables. There is not a polynomial

ti-ne algorithm for pattern generation witn two varlatles.

Heuristic tecnniques will probably be necessary to proviie

methods of pattern generation wtticn will be fast enouen. to

be useful over a wide range of problems.

113

Page 117: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

in

.4 0 U=')(U a4 -aJ C3

a,4

0~ 5.

4.v d)L 0C 3 0. N1J D 0 4A (a "

a, t ~G0 4)AQ ..4~ r- 4-A

40 ~ 41 4.t 4)C

) -- 1 kA 0 C: 4 . -4 * QJ

GD. "~ 04GD .

60 E

0) 0 C J-G

U'90 0

0.4 .4-4 .'~114 5

Page 118: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

Ininkn 4A

C3 E4 -40A:c cu -V u

'3 u 0);3 c

4.3 '3 (V 0.4 0.

-4 n'- 4A0 toI

vi..- a.o o2 'ii 5-. 6

E3 W i .. r- a)-4 to -40 ) 4-' cu W

-- V) 'U:44 w- 0 . N 4 & 443 to. -P &0 0' a) 0.4 4)

m. -4 0) 0. ;" 0 J .4 3 '% 31 vi vi IV 4.3 01 %.4G

10 13 c3 a)J --4 In 0.0 '

940E3 G.. 10 4 C-4 4#a 0 cu' f 0 4j3~fAC0W I - wl 4 n0 $-a m1N- 0 0 9

Q i E 0 4 to 39 '34 %4 4,04J 4 4tw a 1 434- .I' £ 0 .,in. In .

M (0 W'0 * U F cu &4 ~ 4.b4*. 4

op- " 61 Id ea %A40.- C:0( :to f f 0 0-0 = £ .0 0 u in E4 C4 CU A e.-I

*iQ v 0v -0 9: 04 41 -4 b,'. .160..- .t;( C0 c1 "10 1

0".~ to W') In U.Q£ '3o$ 4 ;Qajn :334 E4E --4 FE'3 6-2 =

o. E4 .-. 4 la 03 -4 = EOE :It

or -4 t3 £0 A0a0 400 £0 m(o( t

G 4 '0 0 I W) t 0 Q3 '3 AZ E 4

g3 -44 4-0 &04.- 1 0' zo .m ( U 3 '3U - (V 4 '0* u -C:Q aa: -4 % Z

041 o * 0-4 E &. "0 ':v3 *4 = % 0E.:31-4(3-4A II1.3 rd 434) (1 3 InS .00.e aq I

92- (130 V -0 -4'.. 0) to0 0£ O 1U..4 IncQ n " )0 id *A0 A i r - 4%

00 0.44 43 I ) cu3' =0 u. 4 F- -E-y 4 Q a0 dm414 4.# 4 u .4'3 OII Id eo3 '3U' $A z '

a0 if: 0. '3 -4' 4ad 4 0 3 a~ r- l

.1.4 '3 0.. 43. 4 £0 V0 -4 V4

~~4U~~~~fl0~d In..4 (3U' 0'0 -

0140 In43L3 3 40 141 C)115

Page 119: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0*

tn -4

0

o P'4 $- 0

'4 - *ACJ= unE' '4

AL 4W.Jf 04 &. 0oa '4-.4GG o~~ ff 64 #a

Ad P. *0 N AV)t 0s 0 10 0

93 0.q..4 a)G * 0 CU -4 - 4.1 .. 0 in 0 IV w 0 cu

v 4.E cu 0 14.4 0 4 0 '40 c

0) d)-4 .40 0)0?0"5q1A ~ 00 94 -4 '4 .-j cu '~a

In C 0) . '4 4-4.-I 0 0ai

An : :3A M 0 0-4 000 to Q'4 S.

0 >*;~ ** * SZ * *

,4 N

-u E- -Ign Q49z6- C 06- C 0 z0

vi A-4 .0- . O

93~~~'-' r.a0 n931 t 9 $ oA 0 3= C E 3S

.4wo q q-4 4 q-4 6-4 4- dU C q- .4 L)4G~ C. )4r J - a

%-4 %-44. 44c, f*- %-4;scto d) I0Z~ a) a)'U-' ILO- " mt $4

skata _.4~ b 5 wo' fW l- w 4-

wa)@ o~aJ~w ~ ~ ~ ~ ..... c..116-

Page 120: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

CU

in- V-Q

QJLQ C.) k F -o

0 ckJU

444 -4

P 6 4'..E

C:4 4-D a 0Z W

to to1 c,.

0 4'o CU0

40 '41 to -4

40 0 toO. t

&0 L, An i *u 06 vo0 9 4 '04. Idl 93 C) -

00 ov 0. q o

r40 Z.0c-d '0-s .

9:O 0 Q) cl ZO '-4 -4 1

10J 46.0~l

6..L.4 &-,~ 10.-6

4'0)4 .- 04 0 0

.4-4- 0 4 .00 M4

' 100 -4 '-

o. V4 #4 g4 Ujo a

U a- 0 ) * -.

.v4 '41 W ' ) k' 0

L44 w4)GO o4'b'

a r.OO to 0. to(.%4F

0 . a- b ~~ N #j 0 ow . W6-40 . = --

&'5. to-~ b00'g

do4 6A of; . 0 .0 .eb0

04v 64 0664 4'.-P '

117

Page 121: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

to

-

00

0 E- 0

0- 4) cu&4 44

V-4

q-4 E-*0 W -noW

. 4

11

Page 122: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0 'o

U E~

. 4 a. -4 A- 0 N

A .) 0 =3 k. 0t

0'. N. U I 4 CU 3

-4l 44.4 tob 4. E G: wto w 44; -4ne n 0 q9

(U 04 04. (U *~E E P4 1E 10 E

Nw j S~ N. 111.5

O~~o e ow ~ 4e-'.Q~ob4 Gi~enen l~G+

+b -QG Ere X:o -4 M -4 4-fOA 6..J -4 C.)

0 0 6a- -C

E. E.. E O tO4

L11* u* 1 11q .. ow -* a

r.~~~I 63 a ODII0a

- %A. W4 4 W4. -. -. w

~*.. E-. .~1U-. 4Z ~119-

Page 123: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

CU 4. a)

CU 0

>2 -4Q, a) c c.

-

4-40

0 OCI. . )..-f

+I 0

4- ~ '-4 4. .4 A 4

+. -4

C4 . 0 E2 cu C.

vi ( ai 0~ " S. IV~ (v C WC.) U1 ea Cl) 30

n in. o- 0

~ ~- 44 -4 E- -4 -40 (u Q~ ~.fa N/ III. C) E f V0

.4~-- # -4 vi t 4

,a ~ ~ ~ ~ -N 1vg oV Q& '

E-C-5-4 -4 -4 E4 ;:so j 4.. -120

Page 124: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

o -E

c) 0 W) $..

(U a,

4.3 cu u rr- E s...

- --4 --4. -1 W, -3tO fl4 -4 t"-'(U

.4 0 J 0 0 : 939 0U- C A -

CU em. -

0n a. #-6 =O..-4. SO~ 0- 0 0

4.. I .13 C L,C.) -41 4 c

Ad GJ P4 ." Ift a 4

ri 0.0 to -4a % I Ci

0 ~ J= 0 ) c Ec -oa 4. a ev --4 a)cu

E fa 0) --4 ai~ E Er:

a) 0n --0 0. fu- aJcu

+ C34 to .4 0 -4QOJ C+ (v G GJ -4

-4 . 4 A 3 -4 ~ 4fr0*j .- uU E 0. C' ajiW

+) 4 a'U 1-e0s0

)4 4-4a~ .3 " -

E P.~ - -4 -4 0 =~ &4- Nw 4.) 44.) a)) 0ld. E-

Q) 0 LO c0 4* 4 --4 E

E- u4 A.. A= .. P6 40) 4- 4-'- -4U00~ E -0

cu -4 Ad4 9-4 0 j= IMI.-4w -

E If (u E l.. - -4 *-1.. Id *4 0*4 4 + m I c h ~ -31

0. u -4436 -t If. 111-

(U 440 :.3

F M-

121

Page 125: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

-4

-4 0

aj .-4 Q.

=1 4 .)LnJ

&.4

(U E +n+ 4 aWP4 S 4 -

(Ud -'.EE U LJ4G

10 0M tn &n

(u E- E. toCln '

4 a--4 cu +4*4 .

Gj in 4.--4. 6

-4 0- 04 -

6q 14 4) -4 -4 ILI

:;0 9= *- l4.

~WO & I -4EW.) E 0

& 4 E (

- ~ + 04+

+- +

be +

122

Page 126: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

di BEul V-4 L

4.V)

44 in

di InU O -- V

kn u P.LI

~~4j 0 ~ C Qd,4 ~-4 -) S0

bJ~qU gji-~ B..3 -.~>.4*-

-

go 0 W ~v. 0 -4 -4. V) -4x -'-

cu to 0 di IV P.-C) jP. -4 E*- k*

0- w ... oP -oi '..- -4

C: .4 S. *+ n .- -I

.4 in p% 84 04sV.jo 3 * C.v V- n U-4

F -.1 4-4 -0 *-.-. - U-

ci a) Ln > Ed c-L +

"* m 4 -4 (U E- +C,- ifl4. Id~

fo 4 tol .4 #-4& - .- 4 f

uII 6-0 &.. (U-0 W) ".- .

i .i 4-V to L 3 .. f= 4d .4di W 0-

41 ** -4 #j 0 E-41-4 'S. -4go in08. 0-.

U4 9.d3V 4 II

di ~1" 0.0- 0-4 c ..*

P6 4- +:I I i

0 .~ 4 * ~ U -4

W4 + d -

di 0.- --

C A d 4 S . 4 3

123

Page 127: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

*'.. 1 -4

it 0 4. )4.

4.1 Q.0 F-.4ogsF a)0a)

-+ 4b' =J.a C 4-4 E :0 04 .)6.

* ) C.3 0 0 i&A

4.)r. 10 j b-.

lE E.0A4 F 0jV

oe--j4-a 'O (U -4 -4 00

(1) 4.3;0.4 b.4. £ Ib41

() 0 .- 4 0 it .

r. . - 4 4-.

to4 to * 4.) 4.) ) 4

0 r- r- 4-4 -4 (a.. eW 0 0 0V-4

Qn0. 6n #- d () I-l -0.3-. WUO -' ' a CU -4 41--4. ... -4~U )' =1 (U *. c + -

II.- , 64 . caI- 4 +~ 1 - 92 -- +

4-0. $- 4. + (a 4 E

4.) 4)0 -4~ :3 .. ,4 03 V10ninf 40 P.f 0 " 0 ) E- * C)

'.A .. 40 V1 ~ - CU V)--- 6.3 0. z~i -11 -4 -4 -Z 4

r- W4 .-4 P.- 4-- ". 4.a

aw to0 4 0n 4U.46 CU 0.3c .4 0 (1 ) '.)d) As I'f. s -:.4 4. -4 4fl25

GJ%4 0) .4.- P. 6-X3%-44 %" -4 vO C)4 '-1i

9d. ed4 . 4 4 W4 ". 4 O4-4 W f-493 16 P . 0. -h4.. 4E -1,1*.1Ja W- .e444 .4 i*4 It -I4%. .

- .&4

U N U a if 0 N

124

Page 128: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

,~aE

cJ -4 c a)4.a)

:3 0.4 GJ CU

Q L..-49 0 P-C 4

5..n0 OE S.. 0 a) 0Z in (a

3B M 10- = 0 ) 0 E E r

--o a(o4V% o ) 9. i L) 02 4 r-4#.4a *0* 4J-b.0JV) .) QJ 4--a

a)O .. 0 o 0 to0 t -

:3*u*, #- 0-- =9 L -4 $- -C

64l~ *-aOJ 4Lpn *a_-4 V)faO (U. J= CU .) 4J.4

0 4n Ia0-4 -4 S. UJ

0 -4G J 4 k- 10Q >Ugo0* 4I.. $-= 4 Cfl S 4 0)

-4 0 -Q).C.o M cu -3: 5 40 IC4Jd 4-4 I 4:3 0 cu

ro0w)0 W)O AI IIi. V) + 0. OC_ I

to 0C * 0-4 93 -* l 14 U A 0 dS. -10-.4 -4' 4)(-4P H. :V

a) Q 6a X - a) 411 0 -4 J.EGJ 0aE 0 ev %n )S. - -4. C- E - E W1

a)S. 0) k aw A: . U :.- 493wl c w C 0) cu 0 4-4 E E - S.. b4J GJQJ2 (I 0 E 0 j=j=29 -20 >b-4 a1 C~- F ul

> ) A&1 6 -4 a .a~ * C: *& 10.. \/4 0 -4 040 (OD ) petto( '0 *4 .- 0J w4 >I

0 flJ ~ 0 IA a) *a 4 * v-4 (L *.0 0) in it4. AS. o..4C C -4 11-)0. Ad - )0A

&a 093 -4.0. -4-O.4 0 #a (u 4).- &0 C: 0) ifSP4to > .fS. 4) C4 .14 4.9. sm

04 W%.4 (U~ E ~ a C.) U. -4 4.-w) d 0Q.ES. A 0 a -to IV.t C4 &-. ES.bj-4 Gj E w0- j 4 a .I &1 -- *a I 0.4

bi to to' E 64 () -4w40 0 ~ U4 W4 > -ll4

0 W n r -0 3 % ~4 ) 40 %A -0 (0A3 in W WI4 f" PI-4 D. .4 CU 0i (U ofl-4 2

0a E U II1.-4S40 E C .0%

125

Page 129: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

CU w

0

c) r.- CUJD

-4~

.40 kn WIn n

4." ti ca4 b. C2II

c0)0 In IC.) * a-.4 to In in, E.- #-I .. ~.0 ~ -4 *- .- E 6 n

C.) -0+ 0 000 + 7 + ~UJ.4 4'"

Q4 j3'f -4 T + U10j 0 d 0) In c. I3 ii 0 n ., -04. a 'ISI II d 0~.~ "I .0. 11 -1%o..

#A n t It 4-f- -4l b.3EJ4j -+ -.. ' = 04

a) hd a hd Is Q60 L.'nO 0 0)0 0)r- Q

- U4j- (V)0 11 a) oE Q0() -- q 00 + IZ cu =W 00u 1. *a - 4 - IL * - *a-4 .'. - - a)i .V1 c (A= o o In Ln o 0I0 ) (U 4 vi 0) a) W-4 u)

S3. In *a a)0.2 -- #.a'S "..k4k.=0k0m L4 =0)cuI0I V) IEO ( 0ILO.).J 0 =~ ! .)-UEO 0 .- 00 P .4. ) ". In0)0 CO CA(i-CU (1.-' ) E %'n 0.~ 0 In- (85' 0.. 0

0)) - L..3 0 4 E S-e- 0) E 0 .4 0~ -". *+0 4-' -4 0) a-00 0.0

to( oi %nU -4 0. lif- I=. - 1. 0,,o 0J= (U h E hdE 4. -4 311 4 ' 0) -4 E

a. -- a) ~-4 -4 IJ00In m046) 0

Wn a.C- 0) o--. 93. CU 2 0. 0

126

Page 130: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0) E44-4Q 4 0 C

94 4.0

to CE

004-'1 9Li3 -4 21

4n to0v (U laoL

0 0. 0 c: ) cu4

in =1 10

*.) d0 p V- 4

0 0u (U (U 16.

-o 0. to*'o-4 0'. 04.& .- fp 4.W E 44

0)6- -4 0 0- C6'4

E~- 0.0)0 04 E.'

0.10) 0-4 164UE~

+-" E.4 0)) 0V 311 =4 +~ 4)4)+0 &. S. QE 0 1. -W 1

d) 0u to tvIL a 4 ) 0 0 ) J,.

a.-- 16 ;-~ 4 NI 4.'I. -. q -40 I4.- I

0 6 0 m: E 40 4 to 4.'0 1Z04 EE) "cu > - -. 4 e4 Uu-4- &0.--

Eo*a in toc t0 jd 0-.

+ 0" 0 J 0 -4 3E'J C " 11- F-04 hd 0 o!400 1) 0E *X~ E-40il :

cu#* E4 (U Q in-4 -4 0)0oA-

(U'a 8) )-4'. -400+ tu -0. b'J- J.4 9 A C210 W )

+ 4w : -.4 -4 Li "V V al~- to A.. O-'

936p+a. %- 4 Oc U

-4- 0

Page 131: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

(U tArE

03 '

*j 'V 5.. .4

P C.D

fa0 S. 0

.C4 (o N 4-

>6 0 ... f . '-S 3.4

Ln " $V-l

V4- kn 1= -4 0

:W. isJ' 4) .0-0 E ~L01L9w -4 GO I 4U4 o.k(U 04. S %.- 01 1 .. 0

* 4 .- 4 #* +P4. 0 *0a)0 E

.4 ) + S.. -40)-- M6. cI-

-4 + . *- # A ;- U u*. 0 L) (U'03. t1 ~ ' -E4 (cu0 1) l - 1

.0 16 4 (1) C 09 -

16 =J 401 03U61N S If ~ .C.'* 03)~ do 6q ;D4 - 0 04

'A to a - P V .6'A4f0. d)1* r-4 -4A. cl 4) -0 to30.IV 0S..

r4 40 -O44MAD. A k jo. C0f.)03 E'AJ.j to~ #a to LA 'A + .4)~- IVSa'. &.0 1 002 O- to 0 j

P-4 -# d) ~ ,. 4U fl. 160 01.4

A2 c.- C) lr4-4 UA 3 *'.4~.

to to 4.0 G4 4 . 0 tor. N1 #a S.. f"0114o

6.464if&0 f 6.11 .- C) j. to 0) 0 . +)

4 o -4 E- -4 06 -9 4 40-d 4-p -4 ' 0 -0 -4~.U-03 OJ1 J)-0 %A .0 do. -4 03 .tv ..... u u- Up 0~

O'e 0'~J 0 0. Vf 3. 40-4- 50.55 s..Sa . 0 1A4 l

128

Page 132: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

4A

.~CliU -u

JI..4

0 d

to4V4 O* 4 UQ

Fm. E I --44J

0 v 0 -W)

:p o i o .vi vi. 0= CO) (U W ) i Q u

(U4. S4..-4G J 11 10ruEIND ~ ~ ~ N4$ 6.e

0.lC; 0-4~ n IL--JO aiOU 4. - j C 4 + - ItI )

on vs0 0 -4 k a U4

6D,' E-.ld' 00 -44

0O~ ii 4 * C:P4 C

04 V1 U-1 0' Eo =I Ed z I00~ O~~i 'F - -

0 l -r -0.4 -

I-6oo %nwE 0 t woO- .44 6a P4 C. N 4 I) t

ILIQ w4bE %4 11 to -4 0. 64 ± E If

#a C" 1=1,i. flO IhA4 W14 ON. %4

0U,..4~~r O0A0 x- e ~-

#" 0 6n~ .U 0 *. b. *4.

al 'U04. P44i o4 $14 ~ - 14 L

GiO ~129

Page 133: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0.3 -

W-4 --4

1. 4 00 Q0

V) co -

;P4 E-4l

o3 to(

0 E- r-~

-'1 -4 1" 0 .

63 > "- -4 -4

0.) -4 .t #.a P-4 > 3

-. 4 L0h ) a).W04L

go -4 =1 -4 C.)

W 0 0.) hef q i - (

1 0 - 3 11 l1 - -

'.3 -0 ::1 940 C.) Am

-4 $4 fa. to~E ~ 4 ~0) i E- -0 C) -4 C- 4c.)

S-4 'd 0. U &.4 u 1

P, 0 =f b. 4 ~ to

030 wi 0k QO. - 0. ~-4 -

hd "4 -4 S4 6-4 ~~. 4~

0. $A3 Ad. ~ 0 )~

W--4

94 N a...e E -.to

'U c

4.3 ~ 0U ~ *~ N. ~ 130

Page 134: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

(U a)

W a)

61 6a 0 to vGo4 -Z -4 U4

0 0 r. V% a), -if r

0) LU -4A 0 0

CU 9: 0 *4 f4 1 -4 .

o =0. A:4 -4~ -4- )40

k~ 4 Ad4 .0 &#4 AD 4A

ul- a) I.$ .. x -4 0- 4)4

C 4q4 o - U

4-4w tS m

N.a ~ 4l j= E~ -~4 C. 0 -4U. 4 "I'I 4)0 011 4AIQAn0

4. 44 a C) 11W( -4 A

430 )0 E: m" l

(U ) W 4 u ) U -P4 > CE.d E o04 0 .' -44-U U~l 0 i0 Ad uf

-4 jo (a~ 4-~ 0

E..4. s. 4 01C 0.S.. W. f=~- 0 m S."C m) -4 $A

TO 1- S2 r NO OE *. E-4 4 = V

W -4 V) 40 -4 - 4 FA . 4 U3 E- - E-4

40 -0 V) to* M .$4. 4) to 0J 0)a -2 -40 m~ to

v#- to 6a 40 S2 1")I -144 &' 0E E-UN ' towif 4 Id a) 0 -.4e3.0.

*-a W -.. int 4 -.

im w- -4 4 :p4 d)3- 0Z-4f

39 .0 R *a 53 -4 w -40 00o

1.. 4 J~ qfl oo- &a0 to-Q) 0 L 0 '..S w N

4) -4 0 . 4 a 0md.. 3 * 1 )4

-4 w44- ~ , $ 0

.-"O~ J 40 4 ~ 94.

-i 'm E 0 .44 .0 -4~131 -

Page 135: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

-q1. Ad0

di -4 0

0 3-, .4A& 00ago 31 E

PA -- o. #:Ga GaV :w -4 ( LO

E4 E-4 *P

1 - 4 IfWo4 :3 0 -hdS 4 4

cu &4 X'

(U C- ;M E u 1 U Ga -IV ai - 41c e G .4-$4 / -44 U .4-q

-- E4 0 () cl X -4 in- 0a-U rE-4 *2 ; IJW++ v -

Ga#- EU , - - E- - G

to4E It cuc 9:- 3

w- to~ -4 1 C4 i - 4 3 1 1 bd *- -

to to 4)A k 1 A - E-4 ~ato m GJ4 to4 64~ Ua 6-.I

X30 k a F 6D E a)~ d) -4e~ S4

1116 1,. 14 0Z 14E-4-

116 GE~5-0 II I

GaO fr4' - 0 A~U132

Page 136: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

IId

,-4

toA431 &a M-1- 3 -

.. 4i1 h

E-40

0

0 U 4

54

o .

#9 - "l II S3 .A3- k -""- t

133

.. . . . . . . . .. .. - - I 1 . . .

Page 137: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0Abi -4 0E

-44 0l-

&S 4 h.j 4c0i 6.1' -f

.4 4

0 . ra r u 3

It 0 -4 W c

o 4 4*a oa4 0 -

#.a C3I It.. -4-) -

0.b toN 10 cJ + 0

34 >- m - 4 4 0e -4 I ..

to (aO 113 1 931 i 4) N 4.3 * bC0

a) 0) da 0 Fs P= .. )d k .-. I= 04. /4.3 C3 u .3 0)C . 4 14 1- 00.4 N + I kiv00 a)s~ on to& 00" 2A2Ai + -1164 Ifl 4.3 4.u XI c5to t45 b .. 11 1 ..5 '4 -4 I

d)E4440 *0 164 &43 4 & 0 0) % II I

a. -4-4 &- P ) t J . L4'd -4 -4

0 1. toA t).v #vI -4 0 :1-.t L 3904 ." *j- JA - , 1- &4 f"* . 3 4 0 -. d

Adi 3 3 -39i- . E 4-

a .RI0 -- 4 0). ml0 4-

-411 P404l 4-4 39~ 4. 0

s- fh 3Iq 41d

54 ~ a'a '-' 33 iidi .4.1.34

Page 138: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

] 00

hd &

- 4 Q A 40 .. 0 9

Ov 1:X: -

to 0. v4-4 m

cu 64 P. "a j t

C - 4 X: 0:E4Cto a%.I rm d) & 4Z

+-4 I 9Il~' - ii C.) =

oq * 0 * 0 16. Oj

r0o P4

1356

Page 139: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0) 0

E0 (u 9

-4 C.) C

10 10 E1 dC WE543 O-V 4.) 44.

ajk 40 4 0 U

4-a 0)

44 ) 0 10 I --4 -4 4) 01 4)

CO) $4 0 0)

9 0-4 r. 0Ji 5

4) tv 4.)

1.4 1.4

-- 4 ;0. E. PO5 --f

;0-4 44 II vi4 M4-4 -U r-0 -a#a L

-4 t0 -4 11

m0 65..4 Ad0)1GJ' 0' 'U- --4 ts 04F

4.) 4. U. 4 4.) 0 a

CU0 0) ) 0* .-i v 6..-a-44 -4l Id -- nt + 4 5..n -

0 6 M t E) f4) y - 4~ P0 4 (U LJ rfl. E.. U =-.W41

w4 .4 -4 4)W hd 6- 'U4~ &. c

6) U ) C3 0t) to) J=1 11 -4A2 ti &0~t E-44 -- E- UE E -

to (U P-4 c 4u >) 6451j (a

540 C) 0)0 (U ) f*)i- U +3 M: T-4 NA2 C. to 0-4 4 rA4~ FS4 U4.

a0 *- Li 0 aEU * -N 0 4 4

cu- 4) 4) Ad 0)*i9~S 40-4 4 )0 0- 'a ' 4 -..4.

be a. W4 -0 E ~ ~ .-4W rq to 10 4) -00 s

*~ Cl4.~ 0 ~ I-'4 E Fs~r4 *%136.

Page 140: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

-4 '-4

a) CP l -- q C

1-4- a)U *U a)E Zi 4) P. i

qu PP (Cb 31; cP. E4 ;QO -4 0) P

0) QGj '.n' to ittAC( CL.4 0 G di 1.4V

aO 92 0-i.i --4 -- G V' L;" > p .

U4 It4N G

(C~~- *2G G -4 PE-* -

0= . 0 W) V)£ to &"4

0- -4u 04. -P4 go.M-4C-4 (U O9,O- wl rs. . " f G.) Q " -

0 0) OP 1..c 4.1U (C z Lo o..- 0o 0. Ts-4U" 9

o.i* =) *.. P--4 0G -' &4. E-&n- If~ "C --4 L) P :3 E 9.4 -

toP (cG 2 cn Iu u -ain E

00)4. (1) vO .34 MOPP' -+GJ-

S.. Ga 4 $-a *-4 (U .- 4P - J4WI - 4 -4-4

*A 4.fi W) L) *C NN. * o 1 =f4. Pa.- ( - ,3 1

137

Page 141: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

54

0 31

-. a

f 0 Oi

4) 9

U) - f

X: 04

o 4,nM0 V

+n ait 3 3(I,- E-A40

+ii a - 63

al 0"\ 94-C4 -4

3 9-.--- 4-'~ 4-138G

Page 142: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

0u (L Q

CU

0) W 4-4b95G di - 0 -4

.. 4 S.. -

C: a)4 hJ (4)U - b) f0.- a) di 14 =.- (v

d *w4 P-4U() LE) 'U Zf -

to M c o 4 LAOJ- C.4 .- 4 -0 o ~ E (a) (

A2 (D.-4 I.. C):4)u -4 ea -Ao.to4 = ( 0 a)) #. '.) --4 Q~d

-- V4 4- UO.4 11

Tj GO >O4 4

di- CL) 4) 0 C)' #-a . -- 4 5.in toS. 04 m.) E di 1 0--4b~ > 0f to W 4)0 a '

a)0 di l-4 $- n nP -4 &14 )

P . -4 -4 0. () A94uC&CU9 q0 (1 )Wt if-4

P. V4) 0 E-4 II -

a).~ 04) QJ-4J -i44-4)0foafl.o ra 0 cu CI- 1 3 -

W)* 4004 to =1a *=e n -- 4 ..0- 0-4c 0 & .4, 4):3loU, -. 1

4)0 0 *-4- .2 -- *4JC-4

0)di 0 0.) -M-4 :b 4- = )C))

o) * 0 0) E 7 E-40afC J= 4JJ CUC -2

W to > 4 -4Q :,4d)E I CU 0ja0 U.--

-4 P- .'4k :3 fO( 4)4 *.4 E- m4) IV *a -~4 :3. 1"~ 6a 4) CH0 11

0- 00"4 r 0 d4I= . -- ^ o Aill *c)0ad 96. :*p va w= t u- 4& 4

* -a =101.%41 04)E #- .- .4 a) ..

-4 d) 0 0 *a r40 93 ij-4 ko4.- 90 cu O 40 w It 4-4cu 00 53 9 16h5Ec.X.U 4 4 L24t 04zS* &0 >0 W-4 4

lu 0) to 5..4 0 v0 d W : 1%4..G 4 93.. 04 l a - E4 i A- ILI

lp 0 a C) ba9 C /(u1

E (U41. ou 1 .

139

Page 143: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

a a-

'4 0 4

0.1 -- 4-

III I -4 I -

l e 4b IE 1

m to $3 *

f - 4 -111 C

(a4to-. 1 -4

00 W 4 0 .t -(

toG t 4 40 39l - 00 P4 +_

&4-4 - 4 I ~ k 4& -4 ( o

-4- * R - U &a 46-6- = - -DW' 4x & . 4 10 '4 UfC > P

** 04 " r -4 -. "d E. (Z -

r. 0914 (U Fffi0 -j. 4 II* *-e

X:I I 4I I ~ANl :Siil I 4 Y4

-49.4I III1140

Page 144: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

1- 4

cn II &0 --~I1 II 9e. -

*- 0 0 -' .W-4 00 - -

. --* ,... 13

w I4 wa w 0

vi 0

It- .4 " d . as a

S U-- &4 ,w t

Z ,, 0 .-- cu

II /I-. --- I -1 1 :5)

-4 ~ IV or 11 -

k k- 44 J

k -49 "4 4 9- ,0

- 0 - 00 ' *- - ,

04 r00 0&

1 . , i I K i- . 1 .

%w .4- 01 v W4 0 is. a) g0I

-* 1-4Cgo V-44w4 .,0 C/2.4 k Il -) I I/")Cfl1, U :- - II -, -

S0 .* &r 0 4 I

0 * l q-4 0-...4 4 0)-

:06'Q "0

*W4I'- IZQJ.- -44

54,.fl 5 1.4.41 4~4 141

Page 145: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

-4 a 4(

ou Q. C.)

-4) 0 4A

kU S. 0toa 1. 6

o CD to-4 c

0.4 -4WW 'A4

00 4* &- + c m0.0 0 + -4 "I"

44 0. E-'C0

0=

041U 04tbV g.o

uuaJ'a +Wo

V- tug

" 3- C)0d P4GJ4

aj~ajQ -,142

Page 146: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

1\0

W149

0. 0

W-4 +t" s

-14

Page 147: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

L IST D i EF C E Z

1. 1Ive rson, O., Cra to rb , A CA r ~rInSA t i 0ns cn ro---.-irg Tan~id,- an~ri Sgcztemic, Vol. 1 , N'o . , ct-te - 19-79 .

2. DIstr a, E. 4 ., A i s,i ]i no nT'--i 'r~rri r--, Pre r., 4

r. reer.. C. , "Te D-biken otf tne PSI . ro 1 -Syr tr t,

nr SnftwA-P Ernginring P.4-A',Octooer 1&?~z.

Glass, R__F._,____________P o __________-- ______

Zorpu ti nz Wo rlda, 1977 .

b. Heidorn, 1 . E. , "Automatic ?rowraprrpin? Thqrow-en NaturalLa ngua ge DialIog : A Sur vey T T'4M J Dos Dv ',q 33tJuly 1z075

6. Bier-nann, A. W., %,aturai Tranguac Prrrz-sir-, pappr inpreparation, Naval Posti-ra'iuate Scftool, 19061.

7. Wlalier, D. E., flnp,ni0'1 nr' , ic TAngu; P, El'Sevjer

S-nitn , 1;. R. , .A CPS I n for inl Autmratic Pro-rr-InSysto-n , rigag-1inss n** rpi- ?t) Ttzrnar~ana :Qi L

rnrPOz!-z n A~rf"3ia Ert~ !--~r Vancouver,B. 0., Canada, lYt~l.

14. 61na Z. and Wallin-ver, R., -P Deductive Approacn toProgram Syntnesis,'. ACM Tr-,nqsArtjrior nn r~AmLanyuagqps A~n1 yj Vol. 2, No. 1, F. -l?Z~anuary 1980.

10. Minna, Z. and dallinoer, R., "Syntflesis: Pre ams ~=Progra1is," 1Ehk mrnatnc nn SnetapTol. SE-5, 4Jo. 4, july 19079.

Page 148: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

I1I. rm3n n , A. 9. Aroa-tem to Auto-,ti-! ?roP:irr-:ir.?

i2. snTita, r. .,A z:rv e xcf ta e Syn t aZ-S is ofI IPPrigrais from Exam~les ?rnrPeejino; +'rIn' tfmrr at nA I WgrrtkfloL n; ProguaM Cnns ~it ion,Bonas, Frince, I O

13. ISu mm ers , .P. D., "A "-toaoio--y for LISP rz'Co -,s tru ct o n ftraom E x arp 1 es , i A.C L 4-, F. 1 b 1-1-(5,19 i77 .

14. Bt er-rann, A. h. "T'ri Inference of* Reoul ar 1 z F ~r ogr, 7f r om E xarn pI es T tP E EP t1' Ti ryrm L;r-qnr

TnAortion anr1 Covnt!'o, Vol. 19., P. 447'j74, 1qb7.

1,-4. ti erman n, A. W . anl Kr I nnaswamy , R " Co n s t ricti nt-P rog ram s ftrorl Exa ple C omputa t ions, T PP '"A ~crti or. C!

Septerrter 1976.

17. Bleriiann, A.., Baum, R. I. ani Petr~r, F. E., *Soeer.irgup tae Fyntnssis of ?ro--rams frcnY Traces, - 4Transat-tica~s on COrPr ptrs, Vol . C-?'i, No. ?-, F . -1dP. 12e-1355, Fetruarv 167b.

lE BierTarn, A. d. , "Automa tic Irrtc of, I.!22';-nxlnInstructl')ns in Pro, -am Syritnesis", InFratna.jnhlrna j o** CInrQiit-~ a~ 1L~r Mr nn Zr('1 -c;S 7ol.7

No. 1, Marcn 1 7S

19. AnglulnA D., "Fin,41ne Patterns Commn to a Set ot

Aurust

Page 149: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

BIBLIOGRAPHY

Bibel, W.4 "Syntax-Dtrected, Semantics-Supported ProrramSyntnesis , At1iicial Intplitzence, Vol. 14, P. 243-261,1Y83.

Follet, R., "Syntnesisinx Recursive Functions with SideEffects , ArtificiAl Tntelligpnce, Vol. 13, P. 175-20,1980.

Hewitt, C.E. and Smith, B., Toward a Proprairrine Apprentie,TFEE T nArtjnnil qnftware Vneireerin Vol. SE-i, No. 1,P. 26-45, March 1975.

1 4b

Page 150: NOEEEEhE EhmmhEEEEEEEEEEAl - DTIC · Naval Postgraduate School Monterey, California 93940 11. CONTROLLING OFFICE NAME AND ADDRESS 12. REPORT DATE Naval Postgraduate School June 1981

INITIAL DISTRIBUTION LIST

No. Copies

1. Defense Tecnnical Information Center 2Cameron StationAlexandria, Virginia ?2314

2. Library, Code 0142 2Naval Postgraduate ScnoolMonterey, California 93940

3. Department Chairman, Code 5"'? 1Department of Computer ScienceNaval Postgradtuate SchoolMonterey, California 93940

4. Professor Douglas R. Smitn, Code 52SC 1

Department of Computer Sclen-eNaval Postgraduate ScnooMonterey, California 93940

5. Captain C. '. Miller, USMC 1109 Arterburn Rd.Louisville, Kentucky 40222

6. Captain J. S. Lape, USMC 1b207 Doncaster CourtSprinfield, Virginia 221bO

147