AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified...

55
AO-A007 179 UNCLASSIFIED MARYLAND UNIV COLLEGE PARK OEPT OF COMPUTER SCIENCE F/O 9/2 ARTIFICIAL INTELLIGENCE PROGRAMMING LANGUAGES FOR COMPUTER AIDE—ETC(U) SEP 77 C RIEOER» H SAMET» J ROSENBERG N0001<t-76-C-0%77 TR-S95 NL

Transcript of AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified...

Page 1: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

AO-A007 179

UNCLASSIFIED

MARYLAND UNIV COLLEGE PARK OEPT OF COMPUTER SCIENCE F/O 9/2 ARTIFICIAL INTELLIGENCE PROGRAMMING LANGUAGES FOR COMPUTER AIDE—ETC(U) SEP 77 C RIEOER» H SAMET» J ROSENBERG N0001<t-76-C-0%77

TR-S95 NL

Page 2: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

1.0 ;r na UM 12.2

I.I

1.25

Jo

12.0

m 4 III 16

MICROCOPY RESOLUTION TESI CHAR1

Page 3: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

wmmmm ^m

•;

AD

A04

7179

<Z| *

COMPUTER SCIENCE TECHNICAL REPORT SERIES

o UNIVERSITY OF MARYLAND

COLLEGE PARK, MARYLAND 20742

•pp

•"'-•- ^-.—r-f^r : — -..-.• . —.- -.K^.S:^ — • • mi HI in

Page 4: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

TR-595 September 1977

Artificial Intelligence Programming Languages

for Computer Aided Manufacturing

Chuck Rieger, Hanan Samet, Jonathan Rosenberg Department of Computer Science

University of Maryland College Park, Maryland 20742

D D C

i«n

^-rr-rrm te®^^

ABSTRACT: Eight Artificial Intelligence programming languages (SAIL, LISP, MICROPLANNER, CONNIVER, MLISP, POP-2, AL and QLISP) are presented and surveyed, with examples of their use in an automated shop environment. Control structures are compared, and distinctive features of each language are highlighted. A simple programming task is used to illustrate programs in SAIL, LISP, MICROPLANNER and CONNIVER. The report assumes reader knowledge of programming concepts, but not necessarily of the languages surveyed.

This report was funded by the National Bureau of Standards,

and by the Office of Naval Research.

— " I, » ''iii.i^ihi"~y i'-"r _J

Page 5: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

CON STS

1. Introduction

2. SAIL

2.1. Introduction 2.?. Associative Data Base 2.3. Data Management Facility 2.A. Control Structures 2.5. System Building Capabilities 2.6. Standardization

3. The LIST Family of Languages

3.1. LISP 3.1.1. LISP Data Structure 3.1.2. Property Lists 3.1.3. Representative LISP Data Structure Manipulating Function:.

3.1.3.1. (MEMBER X Y) 3.1.3.2. (ASSOC X Y) 3.1.3.3. (SUBST X Y Z) 3.1.3.4. (APPEND X Y)

3.1.4. LISP Data Types 3.I.D. LISP Functions 3.1.6. The PROG Feature 3.1.7. LISP Macros 3.1.8. Variable Scoping 3.1.9. LISP I/O 3.1.10. Garbage Collection 3.1.11. LISP as a Self-Contained System

3.2. MICROPLANNER 3.2.1. The MICROPLANNER Database 3.2.2. MICROPLANNER Theorems 3.2.3. Heuristic Guidance of Theorem Application 3.2.4. Searching and Backup in MP 3.2.5. Other Representative MP Capabilities

3.2.5.1. (THFIND <mode> <variables> <skel> <body>) 3.2.5.2. (THMESSAGE <variables> <pattern> <bod;'>)

3.3. CONNIVER 3.3.1. Frames, Au-revoir and Adieu

3.4. Efficiency of the LISP Language Family 3.5. Standardization of the LISP Language Family

4. Related Languages

4.1. AL 4.2. MLISP 4.3. P0P-2

5. Examples

5.1. 5.2.

5.3.

5.4.

5.5.

Introduction SAIL 5.2.1. 5.2.2. LISP 5.3.1. 5.3.2.

Sample Program Commentary

Sample Program Commentary

PLANNER (MICROPLANNER) 5.4.1. Sample Program 5.4.2. Commentary CONNIVER 5.5.1. Sample Program 5.5.2. Commentary

6. Recommendations

7. Bibliography

8. Summary Chart

Page 6: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

••

1« lQi£2&U£lifiO

Intel manuf <•IC.RO are manuf for contr The f eatu compu manuf I angu langu whi ch envir

This l ige a c tu PLAN di st ac tu the ol i pape res ter- ac tu age* age,

a on me

rep nee ri ng NER, inct ri ng deve

n add r in of

auton H?§> and

re nt.

ort at program envlron

CONNIV from

env i ran lopment ition t cluaes the se • tea * tas k i a

d iscu (4) con mos t d

sc ribe mi ng ment» Eft, M langu« ments

of o the (1)

linoua anufac nd how ssions c I u s i o «si rab

s s langu The

LISP, ges LLesl high- simpl surve ?es urin it m of

ns Mi le a

one a-es lang POP

previ ie72D level e num ys a as ?en

äht I he

them no a

rece in th ua&es -2. A ous ly in t symb

erica nd c they

vi ron be ex

s tan phasi pplic

ntly e co

su L, a

u hat olic I co ompa

m ment pres card s on able

d ntex rvey nd t sed they pla

nt ro ri so ight

:..' izat the to

eve lope t of a ed are LISP. T

in provid nning a I of m ns of t

be 2) a sa as a pr ion st

types the

c c omp

SA hese comp e ca nd s achi he d use

mple ogre atus

of auto

Artif uter- IL, Ian*

ut er- pabi I uperv ne t istin d i auto

m in of fea

mated

i c io I aiotd LISP, uast i aidto i t it t i sor/ oo I - . et ive n a ma tec each each

torts -s he».

•-- ••L-aa-iT?:^:....-.::.-!--.-.. I,.,,.'., . . • M imi *Lktu • A

Page 7: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

'•• •»-!••'MI11 i« HU -^-mm^mmmmmm

2. SAH.

2.1. IntroSyctisD

SAIL has Its origins associative Language* and a unlike most LISP-Dasea. Instead extensive run-time

in a merger of version of ALGOL 60 ngL.aae, and a version or ALtcL ö'J iNaureu]. Therefore«

of the other artificial intelligence languages» it

LEAP CF lNaur60

e loman69j

• it is a general library of functi

purpose ons. As

cotnp i led befits

is net with on language

its ALGOL ori gi ns t SAIL has block structure and explicitly typed, statically seoptc variables. The cata types available include INTEGER, REAL, STRINGS of arbitrary length, structure, pointer, LIST, SET, ITEr", and aggregates of the previous (i.e., ARRAYs).

Seme of the more important features of SAIL are discussec separately below. These include the associative data base facility, the capability for usage of SAIL as a host language in a CODASYL CC0DASYL71] data fcaie management system, the control structures, ans the system cuilding facilities. Finally, a summary is presented of current s tanaa rdi zati t»n efforts.

!

2.2. Associative Data base

SAIL contains an associative data base facility which is used for symbolic computations This enables retrieval of information oased on partial specification Associative data is stored in the ordered three-tuples cf ITE*s» denoted a re :

known as LEMP the storage and of the date.

form of associations which are as TRIPLES. Examples o* TRIPLES

FASTEN XOR NAIL EflV HAMMER; FASTEN XOR SCREW EQV SCREWDRIVER; FASTEN XOR oOLT EäV PHER;

Associ ati ons form

may be conceptualizee as representing a relation of the

or Att rioute Att rioute

XOR Object (Object) •

EQV Value Value

Most programming languages Ce.a associative-like mechanism:

Given: Attrioute,Object F ind : Va lue

LISP) provide the following

However, SAIL enaoles the programmer to specify any of the components of the association, ana then have the LEAP interpreter search the associative store for all triples which have the same items in the specified positions. For example, the following may be useo to retrieve all items that can fasten a nail:

FASTEN XOR NAIL

An ITEK is a constant and is similar to a LISP atom. Items have names ana may also oe typed so that data can be associated with them. An item may oe declared, or created durin» execution from a storage pool of items by use of the function NEw. For example:

••*--- hiHtiiiii ii i ,--•-.---

Page 8: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

1 •'—'•"-•- -• »"-'I • •»••• ••• I 1111,111 ••• H »^i»^————^M

REAL ITEM VISE;

declares VISE to be an item which may have a datum of type reel associated with it* The datum associated with an item is obtainea ty use of the function DATUM. Thus, DATUM(VISE) might be interpreted äs the capacity of the vise*

In order to deal with items, the user has the capability of storing them in variables (ITEMVARs). SETs, LISTS, and associations. The distinction between SETs and LISTs is that an explicit order is associateo with the latter, whereas there is no explicit order associateo with the former« In addition, an item may occur more th*n once in a List •

Associations ere ordered three-tuples of items and may themselves be considered as items and therefore participate in other associations. Triples are added to the associative store by use of a V.*KE statement and erased from the associative store by use of an ERASE statement. For example, the following code could be used to detach assemtly 1 from assembly 2 and attach it to assembly 3:

ERASE ATTACHED XOR ASSEMBLYI EQV ASSEMBLY?; MAKE ATTACHED XOR ASSEMBLY1 EQV ASSEMbLYZ;

The motivation for using an associative store is a flexible search and retrieval mechanism. Binding Booleans and Foreach statements are two methods of accomplishing these goals.

The binding Boolean expression searches the associative store fur a specified triple and returns TRUE if the triple is found and FALüL otherwise. The aim of the search is to find an association which meets the constraints imposed by the specified triple. If seme of the components of the triple are unknown (such components are preceded ty the special item BIND), then a successful search will result in the binding of the designated component. For example:

IF FASTEN XOfc BIND OBJECT EQV PLIER THEN PUT OBJECT IN PLIEh'SET;

In this case the store is searched for an object that can be fasteneo by a PLIER and if such an object is found, it is placed in tne set PLIER'SET. Note the use of the item variable OBJECT in the association. A successful search will result in this variable being bound.

The FOREACH statement is the heart of LEAP. It is similar to the FOR statement of ALGOL in that the body of the statement is executed once for each binding of the control variable. For example:

FOREACH X I PART XOR B747 EQV X AND DATUM(X) < 3 DO PUT X IN B747!0RDER !SET;

In this case, assuming that the datum associated with each part denotes quantity at hand, the associative store Is searched for all parts of a B747 of which there are less than three on hand. These parts are placed in the set 3747!ORDER!SET.

2.3. gals Manaaement Facility.

Unlike other artificial intelligence languages, SAIL has the capaDility of being used with an existing data base management system (D3MS-10 LDEC]) to handle large data bases stored on external storage. An interface exists LSamet76J which allows SAIL to be used as the oata manipulation language in a CODASYL based data base management system. SAIL is relatively unique in this respect in that COBOL CCCB0L74] has

i^^.^Mt^^.LlitlMMaaa^Mi»«^ , •••••- -. •^fctoA- "N- . A*

Page 9: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

——

almost ceen exclusively used as the data manipulation language (DKL) of such systems. Til i s situation is not surprising since examination of the oata description facility of the CCDASYL report reveals a very stron, similarity to the data division of COBOL. Nevertheless, there have oeen some attempts to use FORTRAN ([S t acey 7*. 3 , [RAP1DATA3).

fea pas of thi to req col cap set ace

Idea ture s. sing, Soole

s t a sk avoic ues t s lectio abi lit

UNION ess i ng

11 Ur

Curren dec i s i t he u manage type via a while can a I become more t certai this i 3 rohi b

AIL tly ons ser men fro GET

ob loc s han n s t i ti

aynan an r is r

curre (the

ns of y for

and e xte

has , th . SA

to t sys m the ), he ta ini ate t rathe

t WO re cor he st ve .

a d st, ic equ ath n°l

§u set nde

a m i s IL

bu tern

da ha

ng emp r ins d rat

ata a f

stcr ests ere

pro ackt inte i loi

INT a st

echa onl

al so ilo , »h ta D s no ano

or»r unwi tanc type eg/

manip ull p age a shou

umber c I ems racki rs to ng an fcRSEC orage

ni sm» y wo has an i

en eve dse ( conv

ther y sto elay, es of s ca that

ulation language should include the following rocedure capacility which allows parameter llocation, ana recursion* Second, processing Id not be difficult. In a CCBOL-pasea systtx some as pointed out by CParsons7&j. In order raised by partial satisfaction of Boolean

ng problem [Tay lor7bD) , the user must build related records. Third, there should be a in-core data base so that operations such as

TICN can be performec without the overheao of more than once for any record.

LEAP rks f a rec n-cor r the i.e., enien inst

rage esp

a re n be i s ge

, for or int ora st e oat a user he lo

t way anc e o for th ec i al I cord t ref et

ne ral I

bui Id ernal ru ctu base

obtai ca tes of ke f thi e var y wh

ched y fol

ing mem

re c . I ns a it

epin s re i ous en h Alt

from lowe

asso ory apau n a n in via g ft cord

f i e w i erna the

a.

ciat due ilit COEO stan a FI in

elds shes t i ve

ciat Howe

i ve to i y w L-ba ce \D a temp e. ; n to

aba ver ,

oata mp lern hich sed d of a na f e orary Of CO owe ve keep insta se . the

ja ent a

ena ata

re tcne

me urse r» t rac nee s In f cost

ses . t icn b Us base c ora sit mory i he this k cf

of act,

i s

Briefly, the SAIL interface provides a SAIL reco'O structure declaration for each record type that has been defined in the data La^e management system. Primitives exist for the creation anj modification of such records. The dynamic storage allocation capability of SAIL enables the creation of several instances of each recco type each of which is identified b> an entity known as a recorc pointer«

mana j is t ext ra which is i ELECT s true Caeec f unct s true NEXT the a poi aaded

As a emen o t ct a

i s a ent RICA t uri h?C3 ion t ure wh ic LIST nt er

to

n ex t sy rave n in a me if ie L f ng str to LIS

h is X oa to

th is

ampl stem r se t ege mber d b o r f aci uctu

add TX h

of ta s the

i ns

e of t co

a r oa of

*,. x the lity re)

it aS t type t rue dead tanc

t he u ns ide r set na ta ite the se he ow data

(kno we def ems t wo fie

RECOR ture)• of an

e.

se o the

med m kn t. ner ite

wn ine o t Ids D'PO

Th ins

f oAlL a fo llowi

SUPPLIER own as P The exac

re cord, m INDUS as a RE a data s he front - ELEMEN INTER (a e functi tance of

s a ng

ow ART t i

w TRY COR tru

of T w nd on

L:

host p roy r?n ned t •> NUM n s t i. ARE , i

D!CLAJ c t u - e *

a LIST hich is points AOOTCLI STX and

ng Pr

* ge 3». an iSEhO ea» n th: luv » SAIL

.T» d s i m nown as X struct of type

to anoth ST has t

the i

i» t • US

ng

- d T

re ART oc th

has i lar t L1STX

ure • INTE

er ins • o arg nteger

ata he cor

r cur e a

o a a

The GER tan ume

t

base task

d ana ec ord rence va lot data FL/1

no a cate ana

ce of nt s - o oe

RtCORDfCLASS LiSTX(INTEGER ELEMENT; RECORDlPOINTER (LISTX) NEXT);

PKOCEDURE Ai,DTOLIST(REFERtNCE R E CO RD !P0I NT ER (L I ST X ) HEAD; INTEGER VAL);

BtGIN RE TE Ll LI HE EN

CORDFPOINTER (LISTX) TEMP; MP := NEW!ELEMENT(LISTX); STX :ELEMENTCTEMP] := VAL; STX :NLXTCTEMPD := HEAD; AD := TEMP; D;

The COEOL/DML ana SAIL encodings are given below. The critical

:•-*». ;*-<< jrw.

Page 10: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

~ • " ""•"" ii im ii m ••

d if fere nee immedi ate ly COBOL.

is the step obvious how

"Add PARTNUM in PART to result the concept of a list would bs-

list." It is not implemented in

COBOL Program:

NLXT:

ALL!FOUNO

MOVE 'ELECTRICAL' TO INDUSTRY IN WAREHOUSE. FIND WAREHOUSE. RECORD. IF SUPPLIER SET EMPTY 60 TO NONE!SUPPLIED . FIND NEXT PART RECORD OF SUPPLIER SET. IF ERROR-STATUS = 0307 GO TO ALL?FOUND. 6ET PART. Add PARTNUM in PART to result list. 60 TO NEXT.

SAIL Program: INDUSTRY := "ELECTRICAL"; FIND!CALC(WAR£HOUSE); IF EMPTY!SET(SUPPLIER) 60 TO NONE!SUPPLIED; WHILE TRUE DO BEGIN

FIND!NEXT(PART,SUPPLIER); IF ERRORfSTATUS = 0307 THEN DONE; GET(PART); ADDTOLI ST(HEAD,PARTNUM); END;

2.4. Control §Jr yc|y re.s.

In audition to the ususal control structures associated with ALSOL-like languages (e.g., FOR loops, WHILE loops, case statements, recursive procedures, etc.), SAIL has capabilities to enable parallel processing, backtracking, and coroutines. In SAIL, a process is » procedure that may ue run indepenoently of the main procedure. Thus several processes may ue run concurrently. Note that the main procedure is also a process.

A process is created with a SPROUT statement as follows:

SPROUT(<item>,<procedure call>,<options>)

where <item> names the process for future reference, <procedure call> indicates what the process is to do, and <options> is used to specify attributes of the SPROUTed and current process. Unless otherwise stipulated (in <options>), a SPROUTed process begins to run as soon as it is SPROUTed and in parallel with the SPROUTing process.

Similarly, there exist primitives which result in the suspension of a process, the resumption of a process, and in the blocking of a process until a number of other processes have terminated. These tasks are accomplished oy the SUSPEND, RESUME, and JOIN primitives respec t ively•

SUSPEND and RESUME have as their arguments single items while JOIN has a set of items as its argument. These items are the names that have been set up for the process oy an appropriate SPROUT command.

For follows:

example, a procedure to tighten a bolt may be defined as

ITEM P1,P2;

SPROUT(P1 , GRASP(HAND1,SCREWDRIVER));

ÜÜ.I

Page 11: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

mm •-II •!• • I «nil ......Öl— .• .in

SPROUT (P2 t6RASP(HAND 2» BOLT));

J0IN(<P1,P2>>; TURh(HAND 1,CLOCKWISE);

single le.

Since SAIL runs on multiprocessing is not possib. contains a scheduler -hich decides long. The programmer makes use statement to specif/ information the next process to be sizes, priority» whether process, etc.

processor computer system, true Instead, the SAIL runtime system

which process is to run and for he. of the <options> field of the SPROUT

»hich the scheduler uses to determine run. Such information includes time quantum or not to immediately run the ' SPKOuTtu

A process may result in the binding of ITE.PVARs by use of <. HATCHING PRoCEDURc which is basically a Boolean procedure. When one of the parameters is an unbound FOREACh itemvar, then upon success the parameter will be bound . The matching procedure is actually SPROUTtC as a coroutine process and SoCCEED and FAIL are variants of RESUL which return values of TRUE or FALSE respectively. in addition, FAIL causes the process to terminate whereas when the matching procedure is called by the surrounding FOREACH via backup, then the procedure is resumed where it left off on the last SUCCEED.

a box screws ,

cont a in i ng For example, consider fasteners (nails, regular is to oDtoin »hillips screws. This can be achieved by MATCHINo PROCEDURE which returns a different Phillips it is invoked.

number of different bolts, nuts, tacks, etc.). The goal

the following sc rew each t ime

Note t h, bound.

MATCHING PROCEDURE GETfFASTENER (7ITEMVAR FASTENER,F!TYPE ) ; BEGIN

FOREACH FASTENER I FASTENER IN BOX AND TYPE XOR FASTENER EQV F!TYPE

DO SUCCEED; FAIL; EMD;

>t FASTENER is a FOREACH ITEMVAR which upon success will oe

backtracking is supported by variables of type CONTEXT. However, the programmer must specify the points to which backup is to occur (for example, recall SUCCEED). State saving and restoring is achievea ty use of CONTEXT variables which act as pointers to storage areas uf undefined capacity in which are stored the entities to be saved and restored. Actual state saving ana restoring is accomplished by use of the primitives REMEMBER and RESTORE.

Processes ma $ communicate with each other by use of the SAIL event mechanism. This is a message processing system which enables the programmer to classify the messages and to wait for certain events to occur. Events occur via the CAUSE construct which has as its arguments the event type, the actual notice, and instructions with respert to the disposition of the event. Similarly, there is a construct known as INTERROGATE which specifies a set of event types and instructions with respect to the disposition of the event notice associated with the desijnatec event types» A variant of this facility has been usec extensively in the implementation of the Stanford Hand Eye Project t Fe laman7 1 j .

Page 12: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

'• ' •L' •• ' -'•"• ' • —"'-"—•""

2*5. Sy.ste.rn. äuüsiDä £iBftfeilili£ft

SAR includes »any features which language

designed may oe i START »CODE

to aid in system De interspersed with

and CUICK'CODE be used with the

- . - • » «re building. Assembly language statements regular SAIL statements by use of the constructs» A number of different files which art to prograir c»n be specified via use of REQblRE statements

The statements:

RtQUIRE "TOOLS" LOAD'MODULE; REQUIRE "CAKL1BC1.33" LIBRARY;

will cause SAIL to inform the loader that the file TOOLS.PEL must te loadeü. In addition, the file CAMLIL on disk area [1,33 serves as a library and is searched for needed routines.

The state men t:

REQUIRE "HEADER.SAI" SOURCE'.FILE;

will cause the compiler to save the state of the current input filt, and scan HEADER.SAI for program text. When HEADER.SAI is exhausted scanning of the original file resumes at a point immediately following the REQUIRE statement. This feature is particularly useful when dealing with libraries since in this case the REQUIREd file can contain EXTERNAL aeclarations thereby freeing the application programmer from such work and possiole errors.

A rather extensive conditional compilation capability is associated with SAIL. This enables the development of large programs which can be parameterized to suit a particular application without compiling unnecessary code and thereby Masting memory for progr^ir. segments which are never used. This capability is used to enahance a macro facility to include compile-time type determination; for loops, while statements, and case statements at compile-time; generation of unique symbols, ana recursive macros. For example:

DEFINE GRASP(SIZE) = CIFCR SIZE

F Mt CD;

> 1 THENC VISE

results in parameter,

the definition of a macro named GRASP having one formal SIZE. The result is the name of a tool that is appropriate

for the size of the item that is to be grasped - i.e., a vise in case size is greater than 1 (assuming size is measured in centimeters, etc.) and pliers otherwise. For example:

TC0L1 := oRASPCIO.O); TO0L2 := GRASP(Q.5>;

will result in the following statements:

T00L1 := VISE; T00L2 := PLIERS;

Note that the choice is made at compile-time and thus the programmer need not be concerned with the available grasping mechanisms Thus the program compilation step can be used to aid in the writing of the program. The example illustrates the importance of such a feature when certain tasks can be achieved by similar, yet not identical, means.

SAIL also provides an excellent system. This enables its use for control of external devices. In fact. the user has at his disposal all assembly language programmer has. Thi

interface with the operating real-time applications such as

interrupts can be handled ano of the I/O capabilities that an

s enables the development of

L. —•_ -^.^_:—i—^L^^^L^^^+^tma**L*M~***^~A~*. mmk iiw± '••*?•'

Page 13: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

r n.....i .».mm., ••I...i.p..i,,.iini im mi ii iji.n

programs ranging from scanners to mechanical arm controllers. In addition to compatibility with assembly language deouggers, SAIL has a high-level breakpoint package known as LAIL CReiser75J.

2.6. Sjandardiiaiign

unde Ther SAIL capt part deve mach The prog An e stru data *AIN

Curr r bo e is

k no are icu la lop a ine s. langu rams x tens ct uri

base SAIL.

tnt ly th th sn ef wn a the r th Ian •a

age i will

ive r ng f

c apa

, S e T for s fea e uag e s c

ha un aci bil

AIL na LNtX C t unde MAIN SA ture s ease e that orient onsi ce veto

time lity . ity of

s only bBNEXEC rwoy at IL [Wi that

of inte is cap

ati on rably d be modi li brar It i

SAIL

been 3 an SUM

I cox make rac t able of t iffe f ied y i s st (i.e

impl o TOP EX to 763.

SAI ion w of b

he pr rent

i n o s be ill u .» L

emen S-1G de v Th

L a ith eing c je c th«.

rde r ing nee r LAP)

ted o CTOP

eloc e goa n at the o run

t is n SA to b prcv

tain wil

n th S103 a la I of t rac pera on a t owa II e ca i ded whet I b

e POP- opera

ncuage that

t i ve ting s

I ar§ rds mi and e pable

as her th e inc

10. ting

s 1 proj lang ystc e n ni -c xi s t of c is e as or pc

It r syste

rr i la r e ct is uage m) ana umbe r ompute ing S ompiIi a rec soci at rated

uns ms. tc to

(ir, to of

rs. AIL na. crd ive

i n

•i

L —- •--

Page 14: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

wi -'• • •••'-» "-' "

IÖ£ USE £2li±X Si LäDayages

3.1 LISP LI

P racess i s an i Iambaa recurs i i mplerne conput a resulte FORTRAN changed genera I origina

SP (C in„ I mp le m ca leu ve f nt at i tiona d in

as cons

pur I ele

McCar angua entat lus • uncti ons o I pa a fir a pra idera pose gance

thy60D ye dev ton of McCart on t he f LIS raui sm st ver ctical bly, s proyr

, CLevin eloped b parts o

hy's int ory as a P relie

(i.e., sion of program

o that t a mm i ng

65^, [Weissman67D , CS i k los sy763 ) , a list y John McCarthy at MIT in the late 5C i» f Alonzo Church's work Cchurch41j in the ention was to recast the elegance of theory of computation* Thus» the first

d exclusively upon recursion as the no iteration), which, although elegant,

LISP which was not competitive with ming tool. However, LISP's character has oday LISP is an extremely powerful ar.o language which nevertheless retains its

The most

(1)

interesting features of LISP «re

(Z)

<3)

U)

(5)

(6)

The language is practically devoid of syntax; constructions in LISP fall into two categories: atoms compositions of atoms.

all and

Program ana represent ed P os s io I e for data, then regard it as code may be

data are interchangeable, since they are in the same format. Therefore, in LISP it is one function to construct another function as execute it by indicating to the LISP system to code; alternatively, an existing function s

examined, modified or augmented by another function'at run-time. In fact, a function is capable self-modification if appropriate care is exercized.

Memory allocation ana management are. automatic and transparent to the user, except where the user explicitly desires to influence them, with the exception of arrays, there are no space declarations to be made, freeing the programmer from the details of space allocation, ana generally allowing for the unlimited growth of any given data structure. (For the most part, LISP data structures have no size or complexity constraints.) Used memory which is no longer involved in the computation is recycled automatically by a garbage collector either on demand from the user at specified points or automatically.

LISP i s a function with a ny a rgume nt LISP sy s tand-a lo Typica lly speedup w I engages i nterp ret possio le i nte rp ret p roduc tio

n in of

LliP to b stem ne , c hich , or ed to

er, n ap

te rpr one a data

e rey s 1 machi ompil make even

and reta whi

pl i ca

eted rgume st ru

arded nc lud ne c ation s LIS with

comp i in t le t ions

langu nt, ( cture as c

e a ode

pro P com well

led he f obtai

ace • T EvAL X as it

ooe an compi for

vides pet iti -coded code lex ibi niny

he ), s s a d ex ler int an

ve ass

may lity the

system uch tha rgument ecuted* wh i ch erprete order

with o embly I be int and

speed

pro t ca

ca HOW wil

d of

ther angu e rmi p owe

rea

per i I ling uses e ve r, I pro functi

magni comp

aae . S xed , i r of uirea

s a EVAL that mos t djc e ons . tude iled ince t i s

the for

LISP a Igori thms i terat ive sect ions.

while vi a a prog ramming are

accommodat i ny iture. bo' '

iI lust rated

remains recursive, while also duumiuuduny iterative so-called PROG feature, both recursion and

iterative

in subsequent

Because of the technique LISP uses in storing local and global variables, some very powerful context-switching can

e carriea out, providing a fast way to enter and exit hypothetical planning environments and to cause the

^ ^» ........ •......-V,«--^..

Page 15: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

behavior of a program environmental context.

to vary as function of its

3.1.1. LISP Baia suu£iur.£ LlSP's Oata structure, called the S-expression, is simplet yet

extraordinarily flexible« providing a substrate upcn which a programmer may oesian his own complex data structures. An S-expression is either an "atom" or a "CONS node". An atom can be regarded as eitner a variaott, a constant (a passive symbol), or both. There are no declarations in LISP; new atoms are simply admitted to the systeir «• s they are scanneo at the input level» and atoms with the same name are guaranteeo by the system to be unique (i.e., they have the san.e internal pointer* or address).

The other type of S-expression. the CONS node« provides a means of structuring atoms and other CONS nodes into hierarchical data structures. A CONS node is ordinarily implemented as a single computer word (say« 36 bits long) which contains a left pointer, callea its CAH, and a rignt pointer, called its CCR. CONS nodes are created dynamically via the function ICON» X Y), where X ano Y are any other S-expressiens« or passively (as oata constants) via the construction (X.Y). CCNS nooes can be composed to form arbitrarily complex hierarchies« the bottommost elements of which are usually atoms (i.e., pointers to atomic S-express ions).

To illustrate« suppose we wish to represent a particular tool« it) a screworiver« in a LISP data structure, tare first decide upon a narre for it« say« SCREwDKIVER-1« and what characteristics of it we wish to encode. Let us suppose the characteristics are: type is Phillies, coLr is yellow« shaft length is 10 centimeters, and head size is C.3 centimeter. There are many ways to encode this in LISP; the external representation of the one we adopt here is:

((NAME SCREWDR1VER-1) (TOOL-TYPE SCREWORIVER) (STYLE PHILLIPS) (SHAFT-LENGTH 10 CM) (COLOR-CODING YELLOw) (HEAD-SIZE 0.3 CM))

Here« all symbols such as NAME« YELLOW« etc. are LISP atoms. (So too are the numoers; however numbers are not entirely equivalent with symbolic atoms.) The particular hierarchy we have adopted is a list of lists« where each sub-list consists of an initial atom describing that sub-list's role in the structure, and a list of the information associated with that role in the description.

This structure would be graphically represented as follows:

10

•••*»"'»-'••••"•"• --•- -----

Page 16: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

• • • 4 4-—4 4-—+ 1*1*1 >l*l*l >l*l*l- >l*l*l- 4 —-4 •_ — • 4.-4 4 4

I I I • 4 4 4 4 • • 4 • • 4- 4 l*l*|->l*l/l l*t*|->l*t/l I * I * I->I *I /I + ——f 4—- 4 «...4 «-..4 •-— 4 4 —-4

MA«t TOOL-TYPE STYLE PHILLIPS

SCfcEWDRIVER-1 SCREWDRIVER

4_- -4 •>l*l*l- 4-—4

4 4 >l*|/| 4---4

COLOR-C

4 4 4 4 l*l*|->l*|/| 4---4 4---4

0CIN6

YELLO'-

I 4 — * •- 4 4—4 4-~4 4 4 4 — -4 |*M->M*|->|*|/| l*|*l->l*l*l->l*l/l 4 -• 4 • • • • • 4 4 4 4

iHAFT-LENGTH 19 CM I 0.3 HEAD-SIZE

CM

and could be constructed passively (as a fully constant structure) a quoted S-exoression :

vi,

'((NAME i>CREWDRIVER-1) (TOOL-TYPE SCREWDRIVER) •••)

or dynamically via CONS:

(CONS (CON;, (CONS

'NAME (CONS 'SCREWDR1VER-1 NIL)) 'TOOL-TYPE (CONS 'SCREWDRIVER NIL))

(CONS 'HEAD-SIZE (CONS 0.3 (CONS 'CM NIL)))

Since it «ould be a rather harrowing experience to construct very lar*,e S-expressions dynamically in this fashion, LISP provides a spectrum of higher-level functions for constructing» modifyinq ano accessing S-expressions. Some highlights of these will be covered briefly in a subsequent section. For our example, a more concise expression of coae which would build this structure dynamically would be:

(LIST (LIST 'NAm : 'S CREWDRI VER-1 ) (LIST 'TOOL-TYPE 'SCREWDRIVER)

(LIST 'HEAD-SIZE 0.3 'CM)

Presumably* as one availaole tool numerous

description

having defined this tool ol i of doing th

wn to as a new tool on this

method; lobal list of all known tools in

•• a large supply of Is.

we would want to record it tools. Again, there would be

One way would simply be to maintain a the system, and to add this entire list:

(SETQ NEW-TOOL '((NAME SCREWDR IVER-1 ) (TOOL-TYPE SCREWDRIVER) (SETO. MASTER-TOOL-LIST (CONS NEW-TOOL MASTER-TOOL-LIST))

.))

(SETQ is one of LISP'S assignment wish to put only the name of t' and associate all the remaining on SCREWDRIVER-1's kCflB££t* Hit*

t statements.) Alternatively« we might he screwdriver on the master tool list, information with property DESCRIPTION •

11

M^^aMkmimMmdmAHtfMMi .JLm,

Page 17: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

um .11 iiiiipijiiiiii ..' !"••' •• m •"• "

(PUT 'SCREwDRIVER-1 'DESCRIPTION '((TOOL-TYPE SCREWDRIVER) ... (HEAD-S

ISETQ MASTtR-TOOL-LIST (CONS 'SCREWDRIVER SIZE G.3 er«))) -1 KASTER-TOOL-LIST))

.1 . c . £l2E£££X kill! Any LlbP atom may have a property list (built up *roir CONS nodes).

Conceptually, the property list allows the attachment of an arbitrary number of attribute-value pairs to the atom, thereby serving to describe the characteristics of the real-world entity represented Ly the atom. This is a powerful feature for any; prog ramm ing language, since it allows "micro-oescriptions" of atoms which ordinarily will net be seen by the processes that manipulate the hierarchical structures in which the atom participates. These microdescriptions can be maintained and accessed by the functions PUT, GET and REMPRüP in case more aetail about an atom is aesired.

Properties are attached to an atom via the function (PUT <atcm> <öttritutfe> <value>), looked up via (GET <atom> <attribute>) , ar.u removed via (REMPKÖP <atom> <attribute>)• We have seen one way to associate the screwuriver information with the atom SCREWDRiVER-1 usin* property lists. Another, more convenient way would be to split apart all the various attributes of this atom, making each a different entry on the property list:

(PoT 'SCREWDRI VER-1 'TOOL-TYPE 'SCREWDRIVER) (PUT 'SCREWDRI VER-1 'STYLE 'PHILLIPS)

(PoT 'SCREWDRI VER-1 'HEAD-SIZE '(CT CM))

To determine SCRfcWDRIVER-1's heaa size, we would 'SCREWDKIVER-1 'HEAD-SIZC). If such an attribute exists, it will be located and returned.

then «rite: (ClT of SCREWDfilVER-1

3.1.3. ReB£e.S£ni£t iye LIS.P fcata. Struc.£yre. HaDiBUialiDfl £u.n£tio.QS.

«e include here a definition and brief example of several of the more standard, hi^h-level LISP functions that pertain to data structure creation, modification and searching.

3.1 .3.1 . (H£3&£R I 11

If S-expression X is a member of S-expression Y (assumed to be « list), return "TRUE", otherwise, return "FALSE".

EXAMPLE: (MEM3ER 'SCREWDR1VER-1 MASTER-TOOL-LIST) returns a pointer tc the atom T ("true") if SCREWDR1VER-1 is on the hASTER-TOOL-LIST, and a pointer to the atom ML ("false") otherwise•

12

— ttUtm '•^ "- Mtmmmm

Page 18: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

•"•^•

.1.3.2. iÄ£S2£ £ 12 of Y is a list of lists. Y is scanned, comparing the first item cf

ejch sublist to X until a natch is foand, or until Y is exhausted, in case a match is founo, ASSOC returns the entire sublist whose first item matched X .

EXAMPLE: (ASSOC 'HE*D-SIZE '((NAME SCREWDR 1vER-1) ... CM))) uoulc return the sublist (HEAD-SIZE 0.5

(HEAD-SIZE C.3 CM).

3.1.3.3. (§yasT £ Y Z)

creates a with X*s.

new co».y At Y and 2 are arbitrary S-expressions. SU&ST of Z, where all occurrences of Y in Z are replaced

EXAMPLE: (SUBST 0.2 3.3 '((NAME SCREWDRIVtR-1) ... (hEAD-SIZc C.2 CM))) would produce a new structure for our screwdriver« identical in all respects to the original» except that its head width would be 0.2 instead of 0.3.

3.1.3.4. (A.eeEU& X I)

X anc Y a re appending Y onto

lists. A new the eno of X

list is created which is the result of

EXAMPLE: (APPEND '((NAME SCREWDRIVER-1) (STYLE PHILLIPS)) '((COLOR-CODE YELLOW) (HLAD-SIZE 0.3 CM))) would produce ((NAME SCREWDRI VER-1) (STYLE PHILLIPS) (COLOR-CODE YELLOW) (HEAD-SUE Ci.3 CM))

3.1.4. Ui£ Uli

In addition to following other data

IY.B££ a tons and

types: CONS nodes» nost LISP systems include the

1. integer numbers 2. real nunbers 3. strings 4. arrays 5. octal nunDers (for bit-level manipulations)

Some versions numeri cal compile rs g softwa re.

ns of LISP (notably MACLISP LMoon743) have highly and trigonometric facilities and accompanying eared to the efficient generation of "number

developed optimi zin- crunchinc,"

3.1.5. LI5E EyQ£tjons

of functions. No program". Functions

function is are generally

A LISP "program" Is a collection syntactically declared as the "main . typeless (i.e.. no distinction such as "integer"« "real"« "string « etc. is made). However« each function may be declared so that its calling arguments are passed to it either evaluatea (as in most programming languages)« or unevaluated. Except for this distinction« there is no need for function-related declarations.

13

-« '.. J

Page 19: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

•»••*"• ' ' "

A function is regarded as simply another one typically defines a function by assigning as the «torn s value« Strictly speaking. nameless, and is identified by the form:

type of data. As such« to some atom the function the function itself is

(LAMBDA <argument-list> <body>)

When * "lambda expression" is stored as the value of an atom, we say that a function has oeen defined. Although the implementation details governing how a lambda expression comes to be associated with an «tern vary considerably» one common format for defining a function in LISP i s :

(DEFuN <name> <arguments> <body>)

DEFUN is o macro which creates the appropriate lambda expression ana assigns it to the atom <name> as the function's body. A function may De annihilated or altered simply by reassigning the value of the atom which represents it. Another virtue of this separability of a function from its name is that nameless functions can oe created and passed *.s arguments to other functions without having to oother to name them if they are needed only once.

To illustrate LISP functions« let us define a function of t»c arguments« (LOCATE-AcL <tool-type> <tool-l ist>) , which« given the name of a tool type (e.g.« SCREWDRIVER)« and a master tool list, will search the tool list for tools of the specified tvve and report back a list of all tools of that type it finds. Framing this as a recursive function« we write:

(DEFUN LOCATE-ALL (TYPE MASTER-LIST) (CQND ((NULL MASTER-LIST) NIL)

((EQUAL (GET (CAR MASTER-LIST) (CONS (CAR MASTER-LIST)

(LOCATE-ALL TYPE (CDR MASTER-LIST)))) (T (LOCATE-ALL TYPE (CDR MASTER-LIST))).))

'TOOL-TYPE) TYPE)

that is« if (C0ND) the master list is (or has been reduced to) NIL« then report back "nothing"; otherwise« if the next item on the master list (its CAR) is of the correct type (as determined by the GET), then add this tool to the list to be reported (i.e., CONS it onto the front of this list) and proceed with the search on the remainder of the list (its CDR); otherwise (T...)« simply proceed« without recording the current tool.

via A Ite rnati veIy« we

the PnOG feature: could express this algorithm in iterative form

(DEFUN LOCATE-ALL (TYPE MASTER-LIST) (PROG (RESULT)

LOOP (COND ((NULL MASTER-LIST) (RETURN ((EQUAL (GET (CAR MASTER-LIST) *T00L-TVPE) TYPE)

(SETQ RESULT (CONS (CAR MASTER-LIST) RESULT)))) (SET«. MASTER-LIST (CDR MASTER-LIST)) (GO LOOP)))

"ESU.L.T))

i.e.« enter a PROG (akin to an ALGOL begin-end block)« defining one temporary local variable, RESULT; then, while the master-list remains non-nil« repeatedly examine its next item, collecting those with the

type on the RESULT list (via SETQ, LISP's "assignment *') , scanning to the next tool on the master list (SETQ

(CDR MASTER-LIST)).

correct statement MASTER-LIST

14

'-- "'-"- - ammrn. M*.

Page 20: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

'-• '" • •»•"——~^m*^imm^a^mmmmmmm—mmt

3.1.6. The PR.OG Ffätyre.

As just illustrated. LISP accommodates iteratively-phrasto algorithms via a construction called a "PROG". A PROG has the form:

(PROS <local-variab les> <statement-1> ... <statement-n>)

As a PROG is entereu, the local the scope of the PROG, and

variables (if any) are each is initialized t<

a Uocatej NIL. Next,

for the

statements which comprise the PROo's body are sequentially executed either "falls bottom" of the PROG

a GO or RETURN is interpreted as labels

execution. When a GO occurs, and sequential

(evaluated) until execution either "falls off the (an implicit exit from the PROG), or until encountered. Statements which are atoms are within a PROG, ana are ignored during sequential is encountered, a branch to the specified laoel execution proceeds from that point.

Since a PROG introduces some temporary variables which must te reclaimed as the PROG is exited, there must be some way of informing LISP that a PROG is aoout to be exited. The function RETURN is used for this purpose, informing the system that a PROG is being exited, and specifying what value the PROG is to return to the calling environment.

in in

LILP more

PROG's may be nested and may appear at any point program. The PROG construction will typically result efficient implementation of an algorithm than the recursive implementation. Although some feel that PROG makes "impure", it is in reality the feature which is probably most responsible for LISP s present widespread acceptance in both the AI community and elsewhere.

cor re sponainj LISP

3.1.7. L..S.P SäfiEflS

M compiI more result f inal interp interm functi recogn form powerf

ost e-t tha • b

r ret edi ons i ie whi ul

be co given [Norm whi ch <char any scann possi poi nt del im

Host ndit

ch an69 con

> is comp (P $ ble whe

itcr

LIS ime n n a ut an esult er, a ate f

ar & mac ch i imp le

LISP ioned aract J, th ui tio dete utati inpu to

re LI s, et

P acr fu

oth

'is orm e ros t men

sc to

er ere ns cte on, t s sup SP c.)

iiriHl em os and nction er S -e Thus,

compi ?nd e

then tati on

anne rs ini ti in t exi st

the sc o in t

ana t ream. erimpo can mo . MLI

entations scanner ma which, w

xpression w when a

valuation i second to r led into valuates th compiles. of the mac

support two types of macros: cros. A compile-time macro is nothing hen evaluated. computes not a final hich, when evaluated, will compute a macro is encountered by the LISP s performed (the first to compute the un the intermediate form). When LISP actual machine code, the compiler em once to obtain the intermediate This technique is a very general and ro concept.

are ate he s a anne he i wha Thi

se del SP C

quite an arb input facili r to c nput s tever s styl additi anothe Smith?

mod itra stre ty c all t rea <fun e of onal r I 03 i

ul ar» ry co am . F ailed <f unc m. <f ct ion

tab synt angua s an

in mput er e (RE

tion unct > re le-d ax o Se's exam

the at io xamp AD*A > (n ion> turn rive n LI

Pie

sens n up le, C <c oar

i s s is n s SP i ntax of t

e that on enc in W is har> < ?ument

ree spl ic

canner nput ,

(by his .

they ounter consin functi s) whe to pe ed int

make even t

redef

can ing a LISP

on>) , never rf orm o the s it o the ining

5.1.8. y-rjaßlg Sfifißinu,

LISP variable values are derived as a function of the run-time environment rather than as a function of lexical environment. As a program executes, there »re two times at which new variables are introduced, or "bound": (1) at function entry time (these are the names of the function s arguments that are mentioned in the LAMBDA

15

«*»**. «dill ii- - ii • #.„*.•«•

Page 21: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

expression)« and (2) at PROG entry time (i.e., the PROG s temporary variables)« Variables are "unbound" at the corresponding exit times: when a function returns or when a PROG is exited.

A eiecut "glob, execut i nt rod calls* record user-a l ist, mai nta bound dynami at the (ones a t run farthe into",

t i ng I" ion uce

Al ea c ce fr

ine (i

c c ti wh

-ti r

or

the )f a to

t th Q via I the on

ss ibl om mo cat • ••i al lin me f u ich me wh up t

bor?

"top-le ny var the sy ere wi

LAMBDA se vari a stru e l ist st rece run-tim are o

g envir net ions have no ich is he call ows the

vel" iable stem* 11 b or P

ables ct ure of CO nt to e, th n th onmen were b ind

depen ing h vari

of s w

Th e a ROG and ca

NS n lea

e qu e A t t r def

ing dent iera able

LIS hich eref

po on the

lleo odes st r esti -LIS athe ined at t

up rchy s of

P (when receiv

ore, at ol of gl the cu

ir assoc the "

. All va ecent. S on of wh T) is r than t • Thi s m he curre on thei . In thi another

no e val

any obal a rrent late a a ssoci riable ince t at var exclus he lex eans nt lev r def s mann

f unc ues

vjiv t oms

sec; va lu at io loo

his iabl i vel i cal that el) ini t er,

t i on are

en mo p lus

uence es ("b n list kups list i es are y det e

scope "f re

will a i ons one f u

is c thoug me nt all t of

indin " (A- consu s dyn and

rmi ne of v

e" v ssume in f nc t io

urr e ht o

au he a f unc gs") LIST It ami c are d oy aria ari a

a v unc t n "p

nt ly f cS ring t oms t icn

are >j « this, a [\.y

nc t the

bits D It S a lue i ons eexs

by changing the system's A-LIST pointer while inside a function, that function's entire environment can be altered* For this reason, LISP is a very powerful tool wherever hypothetical reasoning (involving switches to altered contexts) is necessary. Most other languages either lack such an ability, or make it difficult to carry out. In LISF, context switching and "taking snapshots" of contexts to which execution is to be returned are very natural operations*

3.1 .9. L.JSP 1/0

Traditionally* input/output has been LISP'S weakest systems define at least the following I/O-related functions

link. Most

(READ) read an S-expression (READCH) read an individual character (PRINT X) print S-expression X, skipping to a new line (PRIN1 X) print S-expression X on the current output line (TERPRI) skip to beginning of new line on output

While these functions provide adequate formatting control, most LISFs are deficient in file-handlino operations* (1NTERLISP CTeite l«an?4j is the exception, with more highly developed interfaces to the TENtx virtual operating system)* We regard this deficiency as more of a historical accident than as an inherent problem of LISP (since addinc these features is simply a matter of writing the code). In fact, there are efforts underway for improved multiple-file interaction and ranoom access facilities both at MIT (MACLISP) ana at Maryland (Wisconsin LISP).

3.1.10. Gir.fea.3e. Co.llec.iifin

Since LISP data structures can ,ro. in unrestricted ways, a crucial part of any LISP system is a conceptually asynchronous process called the "garbage collector". The role of this process is periodically to take control, mark parts of storage that are still referenced by the ongoing computation, then reclaim all storage that is not so referenced (garbage). Garbage collection is an unavoidable overhead of any system with no declarations, and in which aat* structures can grow in unrestricted ways.

une potentia i system runs out of

disadvantage of free storage,

garbage collection is that, once the a garbage collection must occur.

16

- •••-•• -'••'•• •• • - ...

Page 22: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

S ince garbage suspended, if LISP

collect causes current computing activity to be is controlling a real-time process» disastrous

consequencs can accrue. Such problems can normally be avoided by forcing the system into a premature garbage collect prior to entering real-time critical sections of computation. Alternatively, there is growing interest in truly asynchronous (parallel) garbage collection techniques which could obviate the problem altogether (see COijkstr«7S3 for instance).

3.1.11 . LISP as o SeLfrConiä|ne<i JnUS

LISP interpreters are typically implemented in fter this basic facility has been brought up* mo oftware can be written in LISP itself. Typical soft

assembly language. St other supporting ware i ncludes

(1)

(Z)

* £fiSßÜS£ which will generate (potentially quite gooa) machine code for LAMBDA expressions (i.e., functions) and PftOGs. Typically, the LISP compiler will be written in interpreted LISP, then used to compile itself. The compiled version is subsequently used as the LISP system compiler.

i nt era (toyet ent ry return of va variab potent system (in p langua comple i ntera be co produc

bug Hi her ti ti

le* ial

i art ges X s cti nte tio

ve wit

me, me. bles s va s of s t ) f

fo oftw on w nded n wi

ckage 3eveT h the

and Most

(i. lue i LISP

he mo or L r th are. ith s with

thin

which opment ir call (toget

LISPs w e.» in s about are es

st adva ISP s e effi In part ystem c ; a pro the con

wi of f i ny her i U form to

sent need repu c ien i cul ompi u ram fine

11 S- uncti arg urn with al so

the be ially to d

tat io t an ar , t le rs, can

s of

ermi t ons. Ty ents) c their r accommo

user changed unl imi

ate) , a n as d rapi here is loader

be deve the LIS

the pica an etur date whe

>. ted nd a one d d no

s an lope P sy

tra

be ned

th neve The (the re r of

eve I time d I d an stem

c ing func t

t raced values e tra r a t r

debug INTER

espons the

opment -consu i nkers d put itsel

and ions

at ) at cing aced ging LISP ible best

of ming

to into f .

(3) An S-expression editgr (or system editor makes possible fRe'cönvenient editing of maintenance of files.

interfac e) which S-expressions and

3.2. 51CkgPL.AÜ«E.R

while LISP is generally accepted as the standard for computing in AI, it ooes not supply the user with any a-priori conceptions aoout intelligence. LISP is simply the blank tablet onto which the user must write his theory of intelligence or control. Not surprisingly, this resulted in numerous reinventions of the wheel in areas like database organization, problem solving, hypothetical reasoning, and language understanding. Most reinventions were at a fairly low level, but occurred often enough to warrant some investigations into some of the undercurrents of AI programming techniques.

MICROPLANNER CSussman, winograd, Charniak 713 is the outcropping of some of these undercurrents» particularly where automatic problem solvina is concerned. MICROPLANNER was written in 1970-71 as a small-scale implementation of ideas originally proposed by Hewitt in 1969 CHewitt691. The intent of the language was and is to provide some automatic mechanisms of database organization, context, and heuristic search •

MICROPLANNER is implemented entirely in LISP. Because of this, its syntax is essentially LlSP's syntax, and while in the MICROPLANNER environment! the user has full access to all of LISP. To distinguish MICROPLANNER (hereafter abbreviated MP) functions from pure LISP

17

- - -1 am i _£.„:-.. "\-

Page 23: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

11,1

functions» the convention about 50 of them) with "TH" notion in MP).

is to prefix all MP functions (there art (standing» we presume, for "theorem", a kty

The most salient features of MP are these:

(1)

(Z)

(3)

Comp Cell c omp when goa I norm e xpe W hen data Pott trie This stan very e xpe in t

ut at i ing ut a t i ever

i s ally rt s w ever ba se er ns d in

i s a da rd

n odu rt s he po

on i fun

on ( a so

pos mea

ith a n

of e mat

turn rad par

ler by pula

n MP i ct ions often a I req ted t ns a patter eed is xpe rt s ch th unti I

ically ad igm system name; ti on a

s indue by t

called ui res s o the large

ns wni c posted looki

e need one su differ of "na where

prob lern t large

ed by hei r "pat

oluti enti popu

h aav , the ng f • Ea cceed ent c me ca the r s a re

P na

ter on, re lat ert sy

or ch St omp Hi equ so

attern, mes. I n-di rec a pat t system

ion of ise ea c stem se those

e xpe rt or unti utin; p n s"» si estor I wed by

r a n t ted em

•i

P h on arch who

so I I al a rad nee need

ano

ther t his st

invoca tiesc r it Entire r obi ein- e's exp es t h ro se adv ocat ed I have i qm f r it ma ke n't kn nymous

ban uy y le of tion"), ing the system" solving e rt i se . ugh the ert i sed is then failea . om the s f or a ow any experts

Mr automatically maintains a context-sensitive database of both factual assertions and the experts just mentioned. The factual database is a collection o,f highly indexed n-tuples. expressed as LI3P S-expressions . Any one n-tuple ("assertion"), or collection of n*tuples can oe "associatively" accessed by presenting the lookup routines with a pattern containing zero or more variables. Only those facts that are deemed active in the current "context", regardless of whether they physically exist in the memory, will be located.

MP o nono dec i (tit heu r ref e "oac disc a Ite back init reco the not h mai n t ree sugc, to s

oe s et erm si on he r a is t ic re nee kup" ards rnati up pr ia I rd of syst

ing h ta in, ) for es t uc h a

all inis of a rbit s), , an to

the ve, oces (b«d all

em od e

at eac

late uto»

the tic p ny sor ra rily recor

d then that

cur ren and

s, a I ) cho

c hang pi cks ve r JO least

h prob r, the at ic c

book rogr t in

ds pro

dec i t (f then I c i ce es t up

ne w imp

lem re a ont r

kee pi ny amming.

MP, t under t

the alte ceeds. I sion poi ail ing)

attemD omputati and the

o the da from t

rong. licitly, it attern re both ol.

requi r That i

he sys he cont mat ive f a fai nt, the choice

ts to ons pe fa ilur

tabase he dec Thus , an ent

L. ts to advanta

ed for s, anyt tern ma rol of s for p lure e sys tern

, se'.e proceed rf ormed e point is ma i i s i on p KP can ire goa soIve .

ges and

de i me kes user ossi ve r

aut c t s

aga be

are ntai oint

be I tr

As dis

pth the

a -sp b le

ca oma

th i n. t we

un neo

as s

ee w

adv

-f i re

ch eci

fu use tic e

In en don

»l. aid (se e ant

rst , is a oice f ied ture s a ally nex t

the the

e (a and

oujh t o

arch wil I ages

These are the three main contributions of "P. In the following sections we highlight and illustrate some of the specific features of this problem solving language.

3.2.1. The MICRO PINNER Database

Conceptually, the MP database is divided into two segments: facts and theorems. Theorems are further classified into three categories: "antecedent" theorems, "erasing" theorems,? and "consequent" theorems. Theorems are discussed in section 3.2.2.

Both facts and theorems are entered into the database via the function THASSERT; an item is deleted from the database via the function THERASE. Facts are fully-constant LISP n-tuples. Thus, to represent our screwdriver in MP, we might augment the database as

18

Page 24: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

•' I-1 ' UUIIMJII IIIII.JI.BI ..I I .11, .1 in "IK")« • i i • i i inn • - » " *

follows:

(THASSERT (TOOL-TYPE SChEWDRIVER-1 SCREwDRI V ER)) (THASSERT (STYLE SCRE«DRIVER-1 PHILLIPS))

(THASSERT (HEA0-SI2E SCREWDRIVER-1 0.3 CM))

Database lookups and fetches are accomplished via the function THGOAL. Therefore, if at some point in a MP program« we required a Knowledge of SCREwDRIWER-1 s head width, we could write a fetch pattern of the Tor«:

(THbOAL (HEAD-SIZE SCREWDRI VER-1 (THV X) (THV Y)))

For our example, this would respond with "success" (i.e., a fact which Hatched this template was located in the database, and it would produce the side effects of binding the MP variables X and Y to 0.3 and Cr, respectively. The THV form is used in MP to signal references to variaoles (all else is implicitly constant).

Ever whenever

also of in oh/sic all changed t present , copy of t databa se: the fact* the fact was arisi

K y fac a fac t •b

o "pr THAS

he fa it

s log (i.e

Dili*

t and t t or th esent

ut mark esent". SERT Oo ct. THE

ca uses icaI co ., if t

THASSE

heorem eorem in th

pres ed as If th

es not RASE e

a fac ntext he fac RTed).

in the is THAS e datab ent. 1 log i ca I e fact hing, c xerts t to be marking t i s be

MP database has a context SERTeo, if such a fact is not ase, it is created and then m f the THASSERTed fact is ly QP.1 present, its logical s is already logically and ph ut reports a "failure" to sto opposite effects on facts logically masked, either by

« or by actually physically ing THERASEd at the level at

mar al

art pr

tat ysi re in

cha del whi

ki n3 . reacy ed as esent us is ca I ly a nti

the n«jir. ä et ing ch it

Context markings allow KP to keep track of the history of the logical status of each fact and theorem. This enables the system to back up to prior context levels, thereby restoring the database to the c or resoonui ng prior state. Thuj>« although there are mechanisms for makin9 permanent oataoase changes (e.g., after some segment of MP cooe is cunfiuent that what it has done is absolutely correct), normally (except at the top level), THASSERT's and THERASE's are not permanent; instead, they normally exist only for the duration of some stretch cf planning or hypothetical reasoning.

3.2:.2.

A THANTE rather in int r espon factua THERAS any f that t respon cap»Di pat ter

tU£RCjP.LA*b£& Iheoremi

11 reaso , THERA

than by ernal fo ds. A I databa IMG theo act ua I p hese two se to an lity. A ns match

nine (i SINS,

name . rm, exc

THANTE se of a rem i s att ern

c lass y parti

THCON its in

n fac and T The t ept w

the ny pa trigu wh ich es o cu lar SE t vocat

t, a HCON hree ith orem tter e red

mat f t

req heor ion

11 c SE " typ

rega i s

n wh

ches heor ues t em r patt

omput theor es of rd to

ich m the T its

ems ), th espon ern.

ati ems th th

ere ate HER inv res ey as

on) " wh eore e ty d by hes ASEu ocat pona repr to T

in MP ich ar n . are pe of the T

its in re fro ion pa

spon esent HGOAL

i s ca e cal

ind event HASSE vocat m the ttern t aneo a gen reque

r ried led by i sting to wh

RTion ion pa data

. In t usly eral i sts wh

out pa t

uish ich into tter base he s (not nte r ose

Ly tern able each the

n . A of

ense in

rue t gOkl

THGOAL's and because of this last interaction between . _ _ THGOAL can amount to considerably more than a simple database fetch. In MP, when a THGOAL is issued, the system first attempts to locate the desired goal directly as a fact in the database. If this fails, the THGOAL request has indicated that it is permissible to do so, will begin searching for THCONSE theorems whose invocation patterns

THCONSE, ase fe locate

and MP

19

-atti mllmVJlimTfclftjmiMlttfMI

Page 25: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

" "W wim

match the desired aoal. If any are found, each is executed in torn until one reports success (in which case the THGOAL is satisfied), «r until all THCONöE theorems have bailee (in which case the THcC*;. fails). It is in this manner that more complex knowledge li.e., theorems, problem solving techniques, etc) can be automatically brought to bear on some goal if that ^oal is not alreaoy explicitly present in the factual database.

The forms of these three KP theorem types are:

(THANTE <opt ion a l-n0me> <variables> < i nvocat ion-pa t tern> <bcc;y>)

(THERAS1N6 <optional-name> <variables> <invocation-pattern> <Louy>)

(THCONSt <op t iona l-name> <variailes> < in voca t i on-pa t ter n> <Lo3y>)

As a brief illustration of the uses of each cf these, suppose -t wish to implement the following three capabilities in KP: (a) whenever a new screwdriver is oefined to the system, automatically cause its name to be added to the master tool list; (b) whenever a screwdriver is deleted from the system, automatically remove its name from the master tool list, and also remove all its accompanying information: (c) whenever, during some assembly task, a THGOAL of the form: (SCREw-i;> <some scrtw> <some threaded hole>) is announced, automatically .earth for, and return the name of an appropriate screwdriver for the task (basea on the screw's style and heaa size). Task (a) will be modelea os a MP THANTE theorem, Lart (b) by a THERASIKO theorem, and part (c) cy a THCONSE theorem as follows:

(THANTt (X) (TOOL-TYPE (THV X) SCREWDRIVER) (SETQ MASTEk-TOOL-LIST (CONS (THV X) »ASTER-TOOL-LIST)))

(THERASING (X) (TOOL-TYPE (THV X) SCREWDRIVER) (THPROG (ST CC ... HS HSU)

(SETQ MASTER-TOOL-LIST (DELETE (THV X) MASTER-TOOL-LIST)) (THAND (THGOAL (STYLE (THV 1) (THV ST)))

(THEKASE (STYLE (THV X) (THV ST)))) (THAND (Th&üAL (COLOR-CGDt (THV X) (THV CO))

(TnEKASE (COLOR-CODE (THV X) (THV CO)))

(THAND (TriGOAi. (HEAD-SIZE (THV X) (THV HS) (THV HSU))) (ThERASE (HEAD-SIZE (THV X) (THV HS) (THV HSU))))))

(THCONSE (SCREW HOLE) (SCREW-IN (THV SCREW) (THV HOLE)) (ThPROG (ST hS HSU DRIVER OST DHS DHSU)

(ThGOA.. (STYLE (THV SCREW) (THV ST))) (THGOAL (HEAD-iIZE (THV HOLE) (THV HS) (THV HSU))) (THGOAL (TOOL-TYPE (THV DRIVER) SCREWDRIVER)) (THAND (THGOAL (STYLE (THV DRIVER) (THV DST)))

(EQUAL (THV DST) (ThV ST))) (THAND (THOOAL (HEAD-SIZE (THV DRIVER) (THV DHS) (THV

(EQUAL (THV DHS) (THV HS))) (THRETURN (THV DRIVER))))

DHSU)))

3.Z.3. HjyMstic Guidance of Iheorem A^gl jc.at ion

it is possible, by including special indicators in THGOAL, THASSERT and THERASt calls, to influence the order in which theorems are applied, or in fact to indicate whether or not they should be applied at all. Specifically, a THGOAL (similar remarks apply to THASSERT and THERASL) with no. indicators will fail unless the requesttü

20

i ilium« i im i—

Page 26: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

i.nmiwl'Mi- i... —I i-min

goa I c be app purpos a "fil by na t heore proper has t l ist w the ge to In create settin more s who i filter will which

an be sa lieo). ( es.) If ter" or me) . 4 «s whose ty lists he for» i It be a neral th sert lin

or nodi g in wh t ructure n the i ng and dis cuss to encod

tis f ied This is th ere

a speci hen o pr oper

) will o f a

pplieo eorem b iteu he fy anot i ch a c d confi past ha rec omme

la tert e heun

e xcl the

is an fie " f i Ite ties oe ca speci first ase a ur i st her N ol lee «u rat s pro ndati

CON stic

US1V form ind

reco r is pass ndid fie (in

re a i c i P th tion i on ven ons NIVE know

ely we

i cat mmen inc the

ates reco ord

t tern nf lu eore of

on t to u are R pr led3

by aatab have b

or prese dat ion I luded in f i Iteri for app

mmendati er) befo ptea. bo ences . A m, the theorems he Da sis e the mo a step i ovides a e.

ase een nt, ist" a T

n^ t I i ca on I re a th f I so, filt the of

st r n th «or

fete US i

it h of HGOA est tion ist, ny orms sin

er mse I pas

el i a e r i e fl

hes ng as e theo L re (the . I all othe all

ce o f aci ves t e ble ght ex i b

(no for i the rems ques orem f t the

r t ow t ne M lity can xpe r expe dire le e

theor i I lu

r the (re

t, on s can he i o r e • s heore he pr P the

pro evol v ience rt). ct ion nv i ro

ems stra for

fere ly t pos

ndi c on

ms ogr a orem viae ein

le Alth » «s nmen

will t ion m of nctu hose sess a tcr t hot f roir. mmt r

can s a to a • 9*i oubn

•e t in

?.2.<». Starchjng and §a.£kuß ic ÜE

Search and backup in PP can occur for two reasons: (1) sent THCONSE theorem which was run to accomplish a THGOAL fails, and another theorem must oe invokeo (restoring the environment to the state a« which the first theorem took over), or (2) some object to whicn the system has committeo itself is Discovered to be inappropriate, giving rise to the need of locating another candidate object and retryint. The THGOAL-THCONSE mechanism underlie the selection and backup where theorems are concernea, but object selection is handled differently, via the ThPROG MP construction«

the In the previous THCONSE example, the goal was to locate some screwdriver which satisfied some set of features (in that case, the correct STYLE and HtAD-SIZE). This was accomplished by a THPROG which "conjectures" that such an object, say X, exists, then proceeds to determine whether or not this conjecture is true. In the example above, the THPROG searched for a screwdriver of type and si2e which matched the type ana size of the particular screw which was to be inserted. For the sake of illustration, suppose the screw was of type Phillips of head size 0.3. Then, the THPROG in the example above would have performed essentially the same starch as the tollowina, more specific, THPROG :

(THPROG (X) (THGOAL (TOOL-TYPE (THV X) SCRE-OR IVER )) (THGOAL (STYLE (THV X) PHILLIPS)) (THGOAL (HEAD-SIZE (THV X) G.3)) (THRETURN (THV X)))

i.e., objec an öD this) obj ec have unt i I choos THGOA keep objec propa

int t b j ect « A t fo

bee so»

e a L, o

t ra ts r gate

roduc eincj

whic t tha und. n sa e TH3 nothe r eve ck o «main o bee

e a se

h i t p Con tis OAL r n t f w

to aus

n in arch s of uint t inu fied fai

cand

hat De

e of

itial ly ed for.

T00L-T , X wil e with

(in Is (in idate). but not objec t tested. bad ob

unc Fir

YPE I be this whi c whic

S all

it i Thi

ject

ommi t te St, Out SCREwD tentat candid

h case, h case, ince s three,

s curre s is th select

ova ain RIVE ive I ate the the

ome the

ntly e so ions

r i a 11 e a cand R (th y boun unti I candi syst e objec syst e consi

urce o

idate represent

for X by fi nd e first THGOAL d a to the first such

either all THGO date is a success), m must back up ts may pass the fi m must automatica dering, and what ot f backups which

the tng oes an

ALs or

and rst

he r are

To Keep track of theorem and object selection backups, NF maintains a decision tree, THTREE, which is essentially a record of every decision maoe, ana what to oo in case the decision leads to a failure. The strength of THTkEE is. of course, that it frees the programmer from having to worry aoout failures: if there is a solution,

21

- ~-;.-r, ... - _- J^±-

Page 27: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

it of on any i mp sub i s dep an cor par who occ to

wil THT th ot

oss goa

a th- ent rec t Us ur . do

I e REE e s her ibl Is I so fir i re t. of ale ün

i n

ventuall i s that

tarcti (i s ubg oal

fc» to cannot c

qui te st organ b ranch It WOUl the tr resynth

fortjnat HP. CONN

y .be it

.e., s ca

fa ommu a»k

i zat of T o be "i e sis ely, iVcR

f oun impos one

n be or ica ni cat -a i d ion o HTREE more reta of I this has

d by es a subg atta te e la in

f TH to des inin arge

a be

an n of oal eked comp te ra its

TREE be u i rab o t par aga

tter

exhausti t n unde must be ). This lexly i lly in t

bac Kup • Often, ndone, - le to be he oart ts of th

con very t rol

ve sea s irabl solved makes ntertw he t re

tech one s

hen in able

s whi e THTR diff i struc

rch. e dep in i

it d i ned e . Th n i que moll fact

to di ch ar Et d cult , t ure

The f t h-f i t s en i f f i c solu

e M» oec

tai lu most

scar d e cor oes if n

in th

atal rst ti ret ult , t i ons o rga ause re w i

of only

re c t, not ot im ese r

wed kn orae r y De f

i f t si ni eat of

11 Co it the so t

have pos s i espec

ess ing ore not nee ion the ute WoS to J hot tc

ble ti.

3.2.5. Sibgr RgB£§S£Qiätiü£ ?!?. £sC§£ U i j.i es

To complete our description of MICROPLANMER, representotives of the other functions available together with a brief example of each.

we i nc I ude t >o in this lang uagt»

3.2.5.1. ilütlND <mog.e> <yariab±es> <skel> <oody.>)

which THFIND provides a way of finding all objects in the syste satisfy a certain set of criteria. A THFIND is essentially a INPHOL which is made to fail artificially after each successful location of an ooject which satisfies the criteria. <mode> indicates how many oojects are to be located (e.g., "ALL", "(AT-LEAST <count>)",...); <variables> serve the same role as THPROG variables; <skel> specifies what form to return as each object is found; <body> contains the THGOAL's, etc. which define the criteria. THFIND returns either a failure (in case <mode> number of objects could not be found), or a list of <skel>'s, each <skel> corresponding to one successful object thus found.

EXAMPLE (THFIND ALL (THGOAL ( THGOAL

(X) (THV X) (TOOL-TYPE (THV X) SCFEUDRIVER)) (STYLE (THV X) PHILLIPS))

would return a list of all tools which were Phillips screwdrivers.

3.2.5.2. (IHJIESSAGE <variables> <£attern> <bogy.>)

t ree) "hook such THKES THME5 (its provi check it w THMES can to De

As s t T s" w fai

SAGE SAGE <bod des i no i it SAGE c orr

rea

ubooa HMcSS hich lures <p«it

who y> wi

a » for t neve (in

ect t tt emp

Is AGE wil

P ter se 11 ay hem r son he ted

a rt st

I in roja n>).

pat De e

of bef

run; e wa prob

de see oteme te rce jate

Upo te rn xe tut §Dli

oreha ho we

y the lern a

nded nts

bac n b

mat ed).

na?*' ve r,

THM nd t

int hav

ai lu k u ein3 ches Thu log if

ESSA hen

o (i. e no res b p to

bac the

s, th pos

11 ao someo GE is cause

e . e

ene t

ked THF e sib es ne pr th

"on f fee oth he

up AIL THME le well gets epar e pa

the way t. The them in TH*IISSA

to b pattern SSAGE-T pröD lern Deneat into t

ed for rt of t

dow y a r the

GE v y a will

HFAIL s wit h th roub I

2' * he t r

n" e es goa I la THF tak cc

hout e T e be he ee b

the sent tre

a (T AIL, e co mbin act

HMES neat THMt enea

.90.il ia lly e as HFAIL

any nt rol at ion ua 11/ SAGL , h the SS AGE th it

22

:.•._•:....-—sAif-.r ^..:—*~— -• - • •

„i^ —...... „..., #.*.-

Page 28: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

-r^-•-~- - "- •" m '•'• • " i

EXAMPLE: ... (anticipate difficulty in insertin (THMESSAbE (X V) ((THV X) WILL NOT TURN IN (

(THGOAL (LUBRICATE (THV X))) (attempt a (THSOAL (SCREW-IN (THV X) (THV Y)))) (retry)

?a screw HV Y)>

)

r emeoy )

... (attempt to insert some screw in some hole)

... (report a failure back up to the THHESSAGE) (THFAIL THr.ESSAGE ((THV SCREw) WILL NOT TURN IN

(THV HOLE)))

would anticipate, detect, report» and correct a problem, then retry.

T I angua I angua deve lo def ic i A Ithou pat ter sophis to ma then t sträte par t i a aspect

CQNNIVER

he most aes was ge call Pment encies o gh the n-d irect t icated) i nt «i n 0 switch gie s in 1 compj of the

rec th

ed was f N re ed t t num am

uni tat pro

ent st e re su

CONN pri

P t as we re

i nvoca he mos e runs on^ t son ra ions b lern s

age It o IVER nci p sugg

s tion t si com

hem, ther need olvi

in the f McDer

CMcD ally m esteo i ome i cont ro

g n i f i c a putat i o

work i than o not

ng has

evol mott' ermot ot i va n the mprov I (e. nt fe ns ng ne be

l o

at u

gone

ut i en s anJ t, tea earl

e m e n t a . , t ature n s ta n it, a a t i

ndone awry.

of th Sus sman

S u s s m a n by t he ie r disc s in he patte of CONN

tes of s ny subg me. In s

si mply

e LI 's de

cont us sio the

rn ma IVER uspen oa Is uch a ceca

SP fa ve lopm

CO rol s n of 4atab

t eher is its deo an or a

n e n v i use so

mi ly ent o NNIVE trjet TnTR

ase is m aoi I

ima t i Ite rn ronme me sm

cf f a R's ure it . ana ore ity on , ate nt , all

CONNiVfcR is less a programming lanbua~-e than it is a collection of ideas about control structure. (The language apparently has never been used for more than one or two significant programming tasks CFahIman7j]). Because of this, our discussion will omit most references to syniux, and highlight only the asoects of CONNIVtR's control structure which are unusual or unique to it.

3.3.1. EtaiEssi ftyriExfiii and *fli£u

calls cal led funct i anew, begin. call-r under and re while ann ihi

in C rathe f rame fund its etc.) user- a Iter f ree c aus i to be c hron contr perma

In C ONNI r th

wi ion f ree . Th acce

its var

ng t alt

0 log 01 * nent

CNNIV VER an to II c at an

var ere a ssibl

own iab le he id er ed. icall s Ire ly c

ER» is

pu ont y m iab re e or s ent

Se y e t los

thi to c sh i ain omen le», triU LIl>P anot to ity cond push o me ina

ng s a reate nf orm all

t (e. to

impor oat

her f ue I of th , bee ed a ander

any

re q a s

at io the

who tant a s unct ooke e fu ause nd

fr fun

ui te o-ca n on

in f ron m i

fea t rue ion* d u net i

the popp on c t io

a bi lied to a forma what

t is tures ture. s f ra p on on to re i ed a one n. T

t d "fr

c tio A- to of

T me som

wh s t f fun hus

iffe ame" ent r n n LIST

ret a

his in e ot ich no unct ctio » at

rent. T for th

al sta eeded t it de

urn whe frame, means t arbitra her fun cont rol cent ra I ion ent n to

any mo

o ca e ca ck. 0 eh r i ve n it

Fir hat fy. c 110

is st

ry/t the ment

II a lied

A f a ract s va

has st, a fun ways, n s A to be ack x it ,

ne xt , the

f unc t func t i unct i o e rize lues finish it is c t ion

caus -LIST,

ret ur which exec ut

wi th re can

ion on, n's the for eo,

a may in^ or

ned i s

icn out te

23

U44I >«>t—HIIMitut • 1 u.

Page 29: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

IM

numerous suspendeo functions which may te resumed at the point at which they last relinquishes) control» or in fact, at an arbitrary labeled point w it ni n t hem .

A t ec hni Partie funct i actual speci f suppos type stack- lives t he t to mas meanae

T whe re c onti n per man a p p I i c genera THFIND f iIter amount possio c andio for a t es t i n e ff ic i gener« mai nta which

s one que uUr, on (t I y w y f or ed to of m like on so r ee . k and r ins

o d is a f

ue, C ent ati on t ion

in M ing

of t le t ate s

mor g f un ent t or s, i ni ng c on tr

mi for

si he ill

ev be

ark arr me

Al u

of

t in unc ONN ret

o of

P) tes ime o one e cti sea

C •I

ols

ght i

nee su ery lo

i ng ang bra tho nma exe

gui tio IVE urn f

a to ts in

cal at

int ons rch ONN pos th

txpe terns con t r

tern in ), eve suspe

alca I I • t he em en t nch of ugh th sk fa cuti on

ct, in t o I ma gene

ry fa nded y pre

MP to a the

ere i cts cont

this he y e v ra I et i f unc sent con

tree tree s co in rol

abi li da tabas entuall has no n the d t i on. F while

text s of co

, and f ns ide ra the aa from on

sh t n me K oe ) a the Iter jene 0 re the

1 a a t

imat tha

es IVtR sioi e tx

he pe re ly f i nes nd A AU-R

nat iv rate appli

i nit "gen

ime , e fo n is becau

has li t ie tract

rman re I i two

U-RE EVOI es. all ed ( ial e rat susp rm

po se o

so s I i on

ent nqui

me VOIR R f Rat

poss a pr coll or" endi of i ssib f th me i st s of p

ret ur shes thocs

(su eat ur her ible ocedu ect in f unct ng it ntera le i is in rath

". ,J oss lb

ty t y b way o t a t w F l ehe nte unc ble tab e f

n o con

o spe e tha can re U ion sei cti n t im e r ncl i li

mak more e re of

base heth s ru me x t s. t ion ove

ase unct

es the c omp I

turned know inc must h

er or n nn i ng. wa s je faSH

s have rhead. in sy

ion to

co e x to whe

a ve ot To a nera <• I ly a cce the nchr t he

nte xt than in a ny s u t he r or mar k i nc t hat c c o m p I I i<teo , eve ss to system ony w next«

ma r K *p.

spen not

s wh act sn t fron. >. i

ubs rr. J n o tn

in in

dt J it

ich i L

hi < u

oC t

»<• s the

f a fun t rol| r f ret u ns ion). is in n ca 11 i didates which m phase) , whi ch

f acros on oetw NP, an acy. To

e I abo uding t ies f r

c 11 o e se r rni n

On the

ng a Sef

ay w in

»ill s c een J c

f ac rate a f om s

n f r v ing - : A e ve

(of * unc

ore äste

CON loca

alls, the g an I i lita

TI a unct i uch I

om t the o D1EU r> i ten t i on any an in Ml VE" te an

Tpi ene ra ead te th chine on , T is t s .

he pti (f

mpo co

(su det ora

i d r s tin to e u ry RY-

cetf- on t c i na 11 r t ant St I/) c h fes a i le w. i na 11 t i s (turn make t g and more

se of for

NEXT ,

C omc_ ut at i on in CONMVER is similar computation in MP. The counterparts of theorems are, respectively. IF-ADDED, "methods". Except for differences in pattern-directed invocation scheme, these as the hP versions. CONNIVER counterparts of goal-statement functions, THASSERT, THERASE respectively, ADO, REMOVE ana FETCH.

in most other reoarus to THANTE, THERASIM6 anc TnCüN.L

IF-REMOVEO and IF-NEi.D£0 synt thre

ntax. anc a e T one t i ons

MP'S and

more general are the sane oataba^e ar. j THGOAL art,

3»*» Lili£i£Q£v. 2l lB£ kI§P Lanaya^e. Fjjmiii.

beina an interpreted langua by between on be compet it ive

between one and two orders of magnitude. a*., f m,

LISP is s lowe r

with a good FORTRAN compiler, the best of both «cries, in the sense that the easy program development and debugging, while transform debugged cooe into production-leveI

than, say, FOKTRAN, However, CQmp.ilec LlaP c.n «e feel that CT" provides

interpreter provides fcr the LISP compiler can

efficiency.

MICROPLANNER ano CONNIVER, on the other hand, are inherently Ieas efficient, primarily because of the control structures they superimpose on LISP. The fatal flaw with MP is its backup system, which can ie extremely, slow; compilation will not typically remedy the problem. tüRRIvFR is sloa for similar reasons; however, in addition to data structures, processes must also be garbage collected, and an elaoorate context tree must oe maintained. Although these two languaoes contain many noteworthy features, we feel that neither (as currently implemented) is appropriate for production applications.

24

*"•*"* •"-'ifrl TiliYT •-•=!-'*••-- -..-•'• i *•••

Page 30: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

TBPiWIF-J "^ P>»W"P«"J"' PP -*• • Hill • *W^WP"W*»i»^ ^••«•••l

3.5. äiandacjiuiisQ si ibt LliE Liosuiflfi Uoiix T

ÜNIVAC others ant ic i i nclad there the s are ac about c ha rac Finall wri tte

here 11 G<

• c pate i ng ist ema n ces s

one t er i y t.» n i n

are t 1

e inj no

mic xact tics ec,

da zea ost

L1S

LI 108

a s

roc ly

o sue y s as LIS P i

SP s . 11

re ioni ompu one f ho h "i

wo a la f s t St I

ystems for the following machines: PDP-1C, P 10, CDC 6500, 66CD, IB* 360, 370, SIGPA 5 latively easy language to implement, we ficant development problems for any ma ters. Since LISP's syntax is nearly non-exi oialect. Although there are minor different w functions are defined, and how variables ncompatibilities" can normally be ameliorat rth of macro-writing, because of this, LISP nguage which is fairly standard and transpor ystems have an accompanying compiler, u f •

DP- 11, , an j wou;

th i ne , stent, es in values ed in can b« t at It. su.ll;

25

WM. ..,.-**> ^, .*-

Page 31: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

.-..-. - -,.. „ immmpniii

R£ i.at ed Languages

4.1. AL

AL is a hign-level programmin manipulatory tasks, developed Laooratory LFinkel7«,3. It is a runtime support for controlling devices.

system „ford

SAIL-Uke language

for specification cf ial Inte Hi gence

and i ncluoe s larbt at Stanford" Artificial Intelli

Trajectory calculation is a crucial feature AL contains a wide range of primitives to

as possible is done at run-t ime only

As much computat ion are mod i fiec

of mani pula t or/ support efficient

at

c ont ro I • trajectory calculations* c ompi ie-t ime ana calculations necessary.

besiaes a uinie ns i on less scalar data type (i.e., ctAi), AL retOjjnues and manipulates TIME. MASS and ANGLE SCALARs. di mensi on 11 ss and typed VECTORS. ROT (rotation). FRAME (coordinate system), PLAt._ (region separator) ano TRANS (transformation) data types. Proper composition of variables of these types gives a simple ireans of performing calculations of any type of movement.

Also includeJ are PL/1-like GN-conaitions, of the outside worlu, and concurrent processes.

which allow monitor inn

Examglez

PLANE P1;

i statements initializing p1 }

SEARCH yellow

ACROSS «1TH I REPEAT

3 EG

P1 NCRE* 1NG IN FRAME set _ MOVE

ENT = 3*CM

< SEARCH is a primitive which cause a hand to move over a specifiec area. yellow is a hand }

{ hand moves across plane ) f eu.rv '. e • }

set; ye How;

ON

MOvc

END,

v iio'iu inwvc s a' •C every 3 cm >

< do at every iteration >

•. c-» , < yellow is also coord system of hand i el low XOR - Z*C*

•C move hano 1 cm down from current position alon, Z-axis )

FORCt(Z) > 3000*DYNES DO TERMINATE; { keep in touch with real world > el Low TO set DIRECTLY; <. move the hanc back to where

it was in a straight line >

26

•— - •-•- • -

Page 32: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

- •••mmmmi

4.2. MtISP

MLISP (meta-LISP) is a high-level I ist-processing developed at Stanford University CSmith703. HLISP translatec into LISP programs which are then executed or MLISP translator itself is written in LISP.

Droc compiled.

language rams art

The

HLISP is an attempt to improve the readability of LISP programs as well as alleviate some inconveniences in the control structure of LISP (e.g.« no explicit iterative construct). Since run-time errors bri

detected by the LISP system (when actually executing the program), only user« This so me »hat defeats the purpose of any

executing tg the trans' high-level I

system users frequently find themselves debugging the translated LISP code.

"anguaoe.

translated in f.LISF, but the replaced by standard infix (PLUS X Y) one may write X •

All LISP functions are recognized and Cambridge prefix notation of LISP has been anc prexix function notation. Y, ana (FüO 'A B C) becomes

Instead of FOOCA, 9, C).

MLlSr also proviues a powerful set of iterative statements and ft large number of "vector operators." Vector operators are used to apply standard operators in a straightforward manner to lists. Thus, in «ILISP, <1, 2, 3> *3 <6, 5, 4> yields <7, 7, 7>. *3 is the vector addition operator and <A, a, C> is. equivalent to (LIST A 6 C) in LISP.

§££8!ul£i

of the form <obj1» obj2, •••* list of the form <<obj1» holderi>.

Given a list will ret urn a where holderi is either PLIERS« VISE or to hold the object. * ...X is an KLISP

objn>» this function ..., <oojn, holjern>>

N0THIN6 accordingly as needed comment.

EXPR HOLD-LIST(OBJ-LIST); BEGIN

NEW S; RETURN

FOR NEW GPJ IN OoJ-LlST COLLECT

* EXPR Starts a regular func

A local declaration * RETURN is a unary operator

IF

A X 'M

X % X * X %

SIZE))

END

(S GtTCObJ, THEN

«OBJ, 'PLIERS>> ELSE

S LEwUAL 10 THEN

«OBJ, 'VISE>> ELSE

«OBJ, 'NuTHlN6>>

OBJ is local to the FOR loop. OBJ will be bound in turn to each element of OBJ-LIST. COLLECT indicates that the result cf each iteration is to be APPENOed to the previous result and this whole list returned as the result of the FOR. LEwUAL 5

% X

I X X X X X X X X

IF

27

-"—»---••—•- •-- •• - •--»- •• *,.«.»•• J

Page 33: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

' • •

4 »3« E2Ez2

POP-t is a conversational language desianeo by R. M. Burstall anu fc. J. Popplestone at the university OT fcdinburgh LBurstalI 71J .

POP-i features an Algol-like syntax and draws heavily from LISF. Integers, reals» LlSP-like lists and atoms (callea 'names ), function constants (lambda expressions)* records» arrays, extensible data types, and run-time macros are supported. A unique feature of the POP-- system is the heavy use of a system stack, which the user may easily control to enhance the efficiency of programs*

A full complement of Iist-manipulation, numeric ant storage-management functions are available»

Suppose we wish to ootain a list of all machinery not currently functioning. A useful function would be,

COMMENT sublist returns a list of all elements of argument list xl which satisfy argument predicate p ;

FUNCTION subli St xl p; V AR £ x * IF null(xl) THEN nil

{ arguments are xl and L > < declaration of local, no type > < just like LISP )

FLSt hd(xl) -> x; { ha(a) = (car a) >

CLOSE END;

IF p(x) THEN x: rsublist(tl(xl), p)

{ tl(a) = (cdr a), x::l = (cons x I) > ELSt sutlist(tl(xl), p)

CLOSE

A call mibht then look like,

suolist(machine-list, LAMBDA m; not(functioning(m) ) ENO);

which right return,

Cpunch-pressl drill-press? unittCD

which is a POP-2 list.

4.4. 3L.1SE

«LISP is an extended version of BA4 (a PLANNER-like LISF derivative) CRulifson 19733 embedded in the sophisticated INTCRLISP system. «LISP supports a wide variety of oata types designed to aic in the flexible handling of large t_ata cases. Among the data types supported art "TUPLt," "BAG" ano "CLASS." A TUPLE is essentially . LISF list that can ce retrieved associatively (see below). A BA« is a multiset, an unoroereo collection of (possibly duplicated) elements. Bags have been found to be useful for describing certain commutative associative relations. A CLASS is an unordered collection of

28

• - ^ " —......

Page 34: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

•"•"

non-duplicated elements (i.e.» basically a set)*

Arbitrary expressions may be storeo in the system data base ano manipulated associatively. The QLISP pattern matcher is used to retrieve expressions in a flexible manner« The system function MATCHUi may be used to invoke the pattern matcher explicitly, as in:

(hATCHQQ (<-X <-Y) (A B>>

which causes X to be oound to A and for d binding"). The patterns to as in:

Y to B ("<-" indicates this "need MATCHGQ may be arbitrarily complex,

(HATCHQQ (A (<-X <-Y>) ( <-X (A (B C))))

in which X is bound to A and Y to (B C) .

QLISP expressions are represented uniquely in the data base, unlike LISP where only atoms are unique. To distinguish between "identical" expressions, "properties" may be associated with any expression by QPUT.

(wPUT (UNION (A B)> EfcUIV (UNION (B C))>

The above puts the expression (UNION (B C>) unoer the property EQL'IV for the expression (UNION A B).

QLISP provides facilities for backtracking and pattern-directed invocation of functions, as illustrated by:

(«LAMBDA (FRIENDS JOE (CLASS <-F <-5 <-<-REST)) (IS (FATHER fS $F)) BACKTRACK)

This function will find an occurrence of a CLASS denoting FRIENDS of JOE. F and S will be bound to the first two elements of the CLASS and REST will be bouna to the remainder of the CLASS (indicated by "<-<-"). If S is a father of F, then the function succeeds. ("$" causes the current binding of its argument to be used.) BACKTRACK causes re-invocation of the function with new bindings for S, F and REST until the function succeeos or there are no untried bindings.

The user may collect teams of functions to be invoked under desired circumstances. Many QLISP data base manipulation functions may have optional arauments which denote a team of routines to be used to perform antecedent-type functions (as in PLANNER).

QLISP provides a general context and generator mechanism similar to that of CONMVEft. Also provided is a smooth, readily accessible interface to the underlying INTERLISP system which aids in the development and maintenance of large systems.

1, multiprocessing Future plans fur QLISP include

semantic criteria for syntactic information), and the atility for the pattern return more information than a simple match or fail.

pattern matching (as opposed to primit1ves, the current matcher to

29

»-•-»• - - '•-•W,I.-^-,;TI

Page 35: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

1 ••'•'," "—'

5« E*äEßi£5

5.1. lotrefiyclifio

Problem statement:

Given two distinct assemblies (say A1 and A2), attempt to unscrew »-. 1 from AZ, and inoicate success or failure accordingly. The "worlo" if the example is assumed to include:

(1) Two hdnos, LEFT and RIGHT, capable of moving, araspinb, twisting and sensing force and motion.

(2) A fixed number (possibly zero) of PLIERS

(3) A fixed number (possibly zero) of VISES

(O A fixed number of "assemblies"

For each PLIfcRS .no VISE, the data base contains an assertion if the form. "PLIERS (VISE) # n is «t location (X, Y, 2) and is of capacity C cm." In addition, for each assembly the data base contains an assertion of the form« "assembly A is at location (x, Y, Z) and is of size S cm." As we shall see, the languages are distinguished in part by the methods each uses to represent such knowledge.

iach example assumes the existence of the routines described be U* in ALöOL-like notation.

ATTACHED(A1, A2> - TRUE if and only if the assembly represented ay Al (her»after referred to as A1) is attached to the assembly represented oy A2 (referred to as A?). The routine has no side effects.

MOVE(HAND, LOCATION) - Moves HAND* (LEFT or RIGHT) to LOCATION (but PLANNER'S oescription of MOVE).

ste

TwlST(HANO, DIRECTION) - Twists HAND (LEFT RIGHT) 0. DIRECTION; - Twists HAND ILEFT or RIGHT; in the given DIRECTION (CLOCKWISE or COUNTER-CLOCK*ISE). The DIRECTION is oriented looking down the length of the arm. Except for SAIL, all programs assume a routine called TwIST-BOTh, which causes both hanos to twist at once.

GRASP(HAND, OBJECT) - Causes HAND (LEFT or RIGHT) to grasp OoJtCT, whici must De within some fixed r»ni* of HAND (i.e., the hano must MOVc to the OBJECT first).

ATTEMPT (0bJ1, OBJi, A1, A2) - Attempts to do the actual unscrewing of assembly A1 from A2 using objects nBJT and 0EJ2 (which, in our examples, are either VISES or PLIERs). ATTEMPT returns TRuE if and only if the attempt is successful.

tach program applies the following sequence to solve the proolem:

(1) Attempt to unscrew the assemblies using the hands. This entails ootaining the location of the assemblies, moving the hands to their respective locations, grasping« and then twisting.

30

..„**•.

Page 36: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

_..... . i. minvmniHi

(2) If the objects are no longer attached, then return "success*1

(3)

U>

(5)

At this point, it is assumed that the hands weren't strong enough. It is proDoseo to try two pairs of PLIERS next. A search ensues for a suitable set of available PLIERS (i.e., large nough to hole the assemblies). If one set of PLIERS fails, the search is continued for another sett with the hope that the differences among PLIERS (grip» size? etc.) will eventually lead to success.

An attempt to use PLIERS has failed, holding one of the assemblies in appropriate VISE. This search proceeds in (3).

Try to solve the problem Ly a VISE. Perform a search for an

1n a fashion similar to thöt

All attempts "failure".

nave failed. Output an appropriate message and return

31

^ — rx~r.: -=3r-- '"• ,.-iL..~'».-

Page 37: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

5.2. jAU

5.2.1. SiBBl£ £EfiS£&!fi

c I 4 5 6 7 8 9

10 11

ji 14 15

\S 18 19 20 21 2c 23 24 25 26 27 2i 29 30 31 32 33

B

INTEGER PROCEDURE ßIGENOUGH (ITEKVAR HOLDER, MOLDEE);

BEGIN

• RETURN TRUE IFF OBJECT HOLDER IS LARGE ENOuGH TO HOLD OBJECT HOLDEE "

INTEGER ITEMVAR C, S;

C COPCCAPACITY XOR hOLDER); S " COPCS1ZE XOR HOLDEE); R ETuR.\i(DATUM(C) GEG DATUK(S))

END;

INTEGE

" A

BtGIN

DEFI

ITEM

INTE

IF N

MOVE GRAS

R PROCEDURE UNSCREW( ITEMVAR A1, AZ);

TTEMPT TO DISASSEMBLE ASSEMBLY A1 FROM A2, E» Y UNSCRcWINC "

NE RUN«

VAR V1,

GER FLA

OT ATTA

(LEFT, P(LEFt,

= 1;

L1, PL2, P1, P2;

E

PI

«»;

CHED(A1, A2) THEN RETURNd); " DON'T BOTHER "

LOCATION XOR A1); MOVE(RIGHT, LOCATION XOR A«.); A1); GRASP(RIGHT, A?);

" GET BOTh HANDS TWISTING AT ONCE "

SPRO SPRO JOIN IF N

" HA

FORE

UT(P1, UT(P2, (<P1, P OT ATTA

NDS NUT

ACH PL1 IS

AND IS AND (B

DO RETURKd

• El OR VI

THER TH THE PL

SE &N 0

FOREACH VI. IS

AND IS AND (A

ETURNd

TW1ST(LEFT, COUNTEk!CLOCKwISE ) , RUNME); TWIST(RI6HT, COUNTER!CLOCKWISE) , RUNME); 2>); CHEDCA1, A2) THEN RETURNd);

STR0N6 ENOUGH, TRY PLIERS •

t PL2 I A XOR PL1 EQV PLIERS AND (BI6EN0UGHC PL1 , AD) A XOR PL2 EQV PLIERS AND (PL1 NEG PL?) IGEN0UGH(PL2, A2)) AND (ATTEMPT(PL1, PL2, A1, A2)) >;

tRE -EREN'T ANY PLIERS LARGE ENOUGH, IERS WEREN'T STRONG ENOUGH. TRY A NE SIDE •

PL1 | A XOR V1 EQV VISE AND (BIGENOUGH (V1. AD) A XOR PL1 EQV PLIERS A;,D (BIGENOUGH(PL1 , A2)) TTLMPT(V1, PL1, A1 , AZ)) >; DO Rl

• ALL ATTEMPTS FAILED "

32

*M

-~""r •i—...

Page 38: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

65 66 67 6b

OUTSTR("CAN'T UNSCREW • £ CVJS (A 1 ,,FLAG ) l> & ( 15 6 i c) ) i

RtURN( & CV1SCA2, FLAG:

E.ND;

33

•'t--r-' -•"-:: ------ I, ' '

Page 39: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

5.2 • c . CCBÜlDläti

2.

9.

11.

13.

23.

47.

4S.

50.

64.

In SA*L, FALSt • ü, TRUE <> 0. BICENOuGH is «i BOOLEAN procedure.

C and S are items whose DATUM is assumed to be of INTEGER typt*

C0P(<set>) returns the first item of <set>. We are assuming thot there exists only one triple of the form CAPACITY XOfc <object> E*.v <cap«city> for each <object>.

C «no S are necessary because DATUK(CCP(<set>)) is illegal* SAIL must know at compile-time «hat the type of a DATU»* is. GE- is d numeric test for greater than or equal.

UNSCKEW is a BOOLEAN procecure which returns TRUE (non-zero) if it succeeos in unscrewing the objects*

This is a macro definition. whenever RUNME is encountered by the SAIL compiler, it will be replaced t>y the constant 1. (See Zi• for its use.)

sc hecu ler .

bOGLtAN tests in a FOREACH must be enclosed ir, parentheses.

Notice (PL1 NEW PL2) to insure that two distinct pairs of pliers are found.

If the body of the FOREACH is entered, then all went well and »« return success.

CVIS is a SAIL function which will return a character string 'name" associated with an item. FLA6 is set by CVIS to indicate the presence of an error.

34

Page 40: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

"" Tl 5.3. use

5.3.1. 5i«fei£ P£ßfl£äi

I !

c 3 4 5 o 7 8 9

1Ü 11

\i u 15 16 17 18 19

i! 22 23 24 25 26 27 26 29 3D 31 32 33 34 35 36 37 38 39

a 42 43 44 45 46 47 4b 49 53 51 52 53 i4 55 56 57 5a 59 60 61 62

(liEFUN UNSCkta (Al

? ATTEMPT iJlSAS

(PROG (PL1 PL.: V1

(COND C(NOT

(MOVE 'LEFT (MOVE 'MIGHT (GRASP 'LEFT (TW1ST-EOTH (COND [(NOT

A2>

SEMBLY OF OBJECT A1 FROM A2, BY UNSCREWING

IN)

(ATTACHED A1 A2)) (RETURN T>3)

(GET A1 'LOCATION)) (6ET Ac LOCATION)) AD (GRASP 'RIGHT A2)

'COUNTER-CLOCKWISE) (ATTACHED A1 A2)) (RETURN T)3)

HANDS NOT STRONG ENOUGH, TRY PLIERS

(COND [(FORE

DO (RETU

PLIERS NOT TRY A VISE

ACH PL1 PL2

(ATTEMPT RN T)3

LARGE EN ON 1 SID

C(FOREACH V1 I PL1

DO (ATTEMPT (RETURN T)J

IN PLIERS-LIST (BIGENOUGH PL1 A1) IN PLIERS-LIST (AND (NOT (EG PL1 PLZ))

(BIGENOUGH PL2 A2)) PL1 PL2 A1 A2))

OUGH OR NOT STRONG ENOUGH. E

N VISE-LIST (BIGENOUGH V1 A1) IN PLIERS-LIST (BIGENOUGH PL1 A2)

V1 PL1 A1 A2))

))

ALL ATTEMPTS FAILED

CT (»RIN1 "CAN'T UNSCREW ") (PR1N1 A1) (PRIN1 M S M) (PRIN1 A2) (TERPRI) (RETURN NID3)

(DEFUN BIGENOUGH (HOLDER HOLDEE)

? RETURN T IFF OBJECT HOLDER IS LARGE ENOUGH TO ? HOLD OeJECT HOLDEE

(NOT (LESSP (GET HOLDER 'CAPACITY) (GET HOLDEE 'SIZE)))

(DEFSPEC FOREACH (LAMBDA (OBJ1 IM LIST1 PRED1 OBJ2 IN2 LIST2 PRED2 DO TRY)

? MIMIC SAIL FOREACH IN SIMPLE CASE

(PROG (TEMPI TEMP2)

4

35

- -?--•'.- -•"-" T": — 'i ..r.T - •^..rjJ.^ZL^Z?^. •'• • I •-"•-- »-..-.»•• •• *<•** T

Page 41: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

63 5«. 65

» 6t 69 70 71

H 74 75

?? 7b 79 S3 31 32 il it. 85 36 i>7 iti 89 90 91 92 93 94 95 96 97 96 99

100 101 132 103

LOOP1

LOOP2

)))

(SETO T£MP1 (EVAL L1ST1))

(COND C(NULL TEMP1) (RETURN NIL)]) ? RAN OUT (SET 05J1 (CAR TEMPI)) (SETQ TEMPI (CDR TEMPI)) (COND [(NOT (EVAL PRE01)) (GC LOOPD3) ? FAILED 1ST TEST (SETQ TLMP2 (EVAL L1ST2))

(COND C(NüLL TEMP2) (60 LOOP1)]) (SET OBJ2 (CAR TEMP2)) (SETQ TEMP2 (CDR TEMP2)) (COND C(NOT (EVAL PRED2)) (GC LOOP2)3

C(EVAL. TRY) (RETURN T) 3 IT (CO LOOP2)!)

? IT FORKED

(DEFMAC FüRtACH (LAM6DA (oBJ1 IN1 LIST1 PKED1 OBJ2 IN2 LIST2 PRED2 DO TRY)

? MACRO VERSION OF FORcACH

(LIST

'LOOP1

'PROG '(L1 L2) (LIST *iETQ *L1 LIST1)

LOOP£

))

(COND C(NULL L1) (RETURN NIL)]) (LIST 'SETQ OBJ1 '(CAR L1)) (SETQ L1 (CDR L1)) (LIST 'COND (LIST (LIST 'NOT PRED1) '(GC LOOP1))) (LIST 'SETQ 'L2 LIST2)

(COND C(NULL L2) (GC LOOPD3) (LIST 'SETQ 03J2 '(CAR L2 ) ) (SETQ LL (CDR L2)) (LIST 'COND (LIST (LIST 'NOT PRED2) '(GO LOO«>2))

(LIST TRY '(RETURN T)) '(T (GO LOOP2))))

36

Page 42: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

mm^^WT»mmm+i i

5.3.2. £u||tQlä£x

••''•••' " m

13,

18,

19.

34.

35.

47,

55.

63.

66.

66.

72,

UNSCRoJ is th a i sa ssemDly

Unlike SAIL, primitive fu

FOREACH i s a FOREACh. F predicates s Note that th

e main function. It returns T if and only if «as successful.

LISP does not support concurrency. We thus assume a nction to get both hanas twisting.

n iterative special form which mimics a simple SAlc OKtACH will try pairs of pliers until the given ucceed or it runs out of pliers (and returns NIL), e arguments to a special form need not be quoted.

Check to insure that distinct pairs of pliers are found.

PRIM is a L output buffe

TERPfcl is a

Return T if

DEFSPEC defi special for arguments ar

ISP function which loads its argument into the stream r.

LISP function which dumps the output buffer.

capaci ty >• size .

nes a special form (sometimes called a FEXPR). A m is identical to a LISP function except that its e passed unevaluated.

EVAL Is necessary since the argument was passed unevaluated,

Note the use to s,et the does not) •

Note the use

Note the use

This is an a a PROG whi Note the abs

of SET rather than SETQ. ObJl needs to be evaluated intenoed atom (SET evaluates its first argument, SETQ

of EVAL (see 63.).

of SET (see 66.).

Iternative macro version of FOREACH. It expands into ch is similar in nature to the special form FOKEACH. ence of SET or EVAL.

37

" —*^—- -•- -^•-i .. Jb^awa^

Page 43: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

1 5.4, PLi&Nkfi iBItES£L*NNtR)

5.4.1. ä£Bfii£ E£üJ£äS

1 2 3 4 5 6 7 & 9

13 11 n 13 14 15 16 17 1s 15 23 <:1

IS 24 25

I? 28 29

!? 32 33 34 35 36 37

it H 42 43 <*4 45 46 47 4S 49 50 51

is 54 55 5o 57

II 63 61 62

(THCONSE UNSCREW (A1 A2) (UNSCREW (THV A1) (THV A2))

? ATTEMPT DISASSEMBLY OF 09JECT A1 FROM A2, EV UNSCREWING

(THOR (THNOT (ATTACHED (THV AD (THV AZ>>> (THAND

(THGOAL (MOVE LEFT (THV A1>) (THT^F THTRUE)) (THGOAL (MOVE ÄI6HT (THV A2>> (THTBF THTRUt)) (SRASP 'LEFT (THV AD) (GRASP 'RIGHT (THV A2D (TwIST-BOTH 'COUNTER-CLOCKWISE) (THNOT (ATTACHED (THV AD (THV A2)))

)

i HANDs NOT STRONG ENOUGH, TRY PLIERS

(THPROfa (PL1 PL2) (THGOAL (ISA (THV PL 1) PLIERS) (THTSF THTRUE)) (ThGOAL (BIGEN0U6H (THV PLD (THV AD) (THNODB)

(THUiE BIGENOUGH) (THTBF THTRUt)) (THGCAL (ISA (THV PL2) PLIERS) (THTßF THTRUE)) (THNOT (EC (THV PLD (THV PLZ))) (THGOAL (BIGENOUGH (THV PLZ) (THV A?)) (THNODB)

(THUSE EIGENOUGH) (THTbF THTRUD) (ATTEMPT (THV PLD (THV PL2) (THV AD (THV A2))

)

? NO PLIERS LARGE ENOUGH, OR NO PLIERS STRONG ENOUGH. ? TRY M VISE ON 1 SIDE

(THPROG (V1 PL) (TtiGOAu (ISA (THV V1 ) VISE) (THTBF THTRUE)) (THGOAL (BIGENOUGH (THV VD (THV AD) (THNCDB)

(THUSE BIGENOUGH) (TMTBF ThTRUD) (THGOAL (ISA (THV PL) PLIERS) (THTEF THTRUE)) (THGOAL (BIGENOUGH (THV PL) (THV A2D (THNCDB)

(THUSE LUGENOUGH) (THTBF THT&L'E)) (ATTEMPT (THV Vl) (THV PL) (THV AD (THV *2))

)

? NOTHING «ORKED, JUST FAIL

(THNÜT (THDO (PR1N1 "CAN'T UNSCREW ") (PRIN1 (THV AD) (PC1N1 " ") (PR1N1 (THV A2)) (TERPRI)

)) (THFAIL THEOREM)

))

(THCONSE oIutNOUGH (HOLDEK HOLDEE C S) (BIGENOUGH (THV HOLDER) (THV HOLDEE))

SUCCtEwS ONLY IF ObJtCT HOLDER IS LARGE ENOUGH TO HOLD OBJECT HOLDEE

(THGOAL (CAPACITY (THV HOLDER) (THV C>> (THTBF THTRUE)) (THGOAL (SUE (THV HOLDEE) (THV S) ) (THTBF THTRUE))

38

Page 44: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

rw II....H i l Jl. ,. . .11 I I •• •! | l». . .J.UI .»HL.I.HHI.I III »II I.DWMII I" -•• ' •• • »•••i —r- —, I W—p——

63 (1HC0ND C(NoT (LESSP (THV C) (ThV S>>) 64 ITHSJCCEEO)] 65 CT (ThFAlL THEORE?.)}) 06 )

39

• '- - - - - ^..-^^. *m*ä . J

Page 45: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

5.4.2. £fiiB£Q*i£X

3.

7.

9.

10.

19.

Z J.

Z1.

24.

45.

49.

Defines and asserts a consequent theorem with name UNSCREW»

This is the pattern on which to invoke this theorem if needeo (e.g., (UNSCkEw ASSEMBLY1 AS S EMRLY 2 )) .

THOR sequentially executes each of its arguments until cne succeeds* and then the THOR succeeds. The THOR is used here to prevent undesireo uackup.

(THNOT p) is defined as (COND Ip (THFAIL)] CT (THSUCCEFD)1) .

THAND succeeds if and only if all of its arguments succeeo. onlikt THOR, backup m«y occur among the arguments of a THAND.

Attempt to move the left hana to object Al. There may be several experts (theorems) on moving hands, PLANNER will try as many as it needs. (THTBF ThTRUE) is a theorem base "filter" which is satisfied by every theorem.

THPROG behaves in a similar manner to THANU except that locil 'arpH. variables may be declared.

Attempt to fino ö pair of pliers

See if the pair of pliers is large encugh. (THNODe) indicates to PLANNER not to LOther searching the data base. (THUSE <theoretr>) indicates to try <theorem> first.

Hake sure that we have two distinct pairs of pliers.

THDO executes its arguments and then succeeds, nowever, ! at this point we know that we have failed, and THNOT is used to generate e failure from THDO. This is necessary because PRIN1 returns its first argument as its result, which (being non-ML) would cause the THOR to succeeo.

Generate explicit failure of the theorem.

40

ZiL_

Page 46: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

5.3. taNNIittS

5.5.1. £2Bfci£ £rfi£räO!

1 2 x i 5 t 7 t

i5 11

H 14 15 16 17 16 19 20 21 22 23 2- 25 26 27 26

SS 31 32 33 34 35 36 37 36 39

41 42 43 44 45

tf 46 49

1?

i 56 57

S H 62

(CDEFuN U

? ATTE

(CO

(PR (PR (MO (GR (CO

l.SCRdrf (A1 A2>

MPT TO DISASSEMBLE A1 FROK A", BY UNSCREwIUC

"AUX" (L0C1 L012 6EN1 GE,\2 V1 PL1 TL2)

>\0 [(NOT (ATTACHED Al A2>) (RETURN T ) ] )

EStNT '(LOCATION !,A1 !>L0C1>> ESLNT '(LOCATION !,A2 >>LOC:)) VE 'LEFT L0C1) (MOVE 'RIGHT LCC2) ASP 'LEFT A1) (GRASP 'kIGhT A2) ND KNOT (ATTACHED A1 A2>) (RETURN T)3)

? nA,\DS NOT STRONG ENOUGH« TRY FLIERS

(CS

»-L00P1 (es (CS

tT«. V.EN1 '"((»POSSIBILITIES) »1GNG*F (»GENERATOR (NEXT-OLJ 'PLIERS '(PIGfc^CUGH S »1)))>>

:PL00P2 (CS (CO

7 ?

.•TRY-VISE (CS

tT« PL1 (TRY-NEXT GEN1 '(GO 'TRY-VISE))) tT>. oEN2 !"((*POSSIElLlTIti) »I6U0RE

(•GENERATOR (NEXT-OBJ 'PLIERS '(AND (NOT (E« PL1 \\\

(ältENOuCh $ At))))))

cTu PL2 (TRY-NEXT GEM '(£0 'PL00P1))) NC [(ATTEMPT PL1 PL2 Al A2) (RtToRN T) j

[T (GO 'PL00P2)J)

!>0 PLIERS LARGE ENOUGH, OR »LIERS NOT STRONG ^NUUGH. TRY A ViSE GN ONE SIDE.

:VLOOP (CS (CS

: r-L00P3 (CS (CO

LTV. bEhl !"((*POSSIBILITIES) «IGNORE (»GENERATOR (NEXT-OLJ 'VISE '(PIGENOUG* % A1)))))

£Tt V1 (TRY-NEXT CEN1 '(GC 'NC-CAN-DO))) LT* «EN2 «"((»POSSIBILITIES) «IGNORE

(»GENERATOR (NEXT-OBJ PLIERS '(PIGENUU6H I At)))))

cT». PL1 (TRY-NtXT GEN? '(GC 'VLOCP))) til [(ATTEMPT VI PL1 A1 A2 ) (RtTURN T)D

[T (GO 'PLOOP3)3)

ALL ATTEMPTS FAILED

:NO-CAN-D (PR (PR (RE

)

IM "CAN'T UNSCRcW ") (PRIN** Al) IN1 " ") (PRIM A2) (TERI-RI) TURN NIL)

(CDEFJN BiGENOUGH (HOLDER HOLDEE)

? RETURN T IFF OBJECT HOLDER IS ? ENOUGH TO HOLD OBJECT HOLDEE

"AUX" (C S)

.ARGE

41

-:i.?.:?:-r;?-Ta..r.- ... — •-"--• • -—•—>•!-- MH

Page 47: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

—- —mmmm

(PRESENT '(CAPACITY !,HOLDER !>C)) (PRESENT '(SIZE !,H01DEE »>S)) (NOT (LESiP C S)) > /

75

(CDEFUN NtXT-OBJ (TYPE PRcD)

LOOP

3ENERAT0R TO RETURN NEXT ObJECT OF 'TYPE' aHICh iATISFIES 'PREü*

••AÜX" (OBJ TEMP)

(CStT*. TEKP (FETCH '(ISA !>0tJ %TYPE)>>

(TRY-NEXT TEMP '(AOIEü)) (COND KCVAL (SUBST OBJ '* PFEO))

(NOTE ObJ) (AU-REVOlk)3)

(60 'LOOP)

42

•*-•,

Page 48: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

—•»•••••w

5.5.£. £fiBB£Qlä£X

2.

6.

1C.

15.

CDEFUN Defines function to CONNIVtR.

1?.

21.

24.

6 H .

66.

79.

51.

22.

S3«

'AUX" <list> aefines local variables.

Pftfc.St.NT is a CONNIVER function which searches the data base for «n item which matches its pattern argument« If one is founo, PRESENT sets the indicated variables (marked with !< or !> ) ana returns the ite.D. !,A1 indicates the current CONNIVER value cf Al. !>I0C1 indicates that L0C1 is to be oound if possible.

SEN1 is oeina assigned ä TRY-NtXT possibilities list. !" tells CONNIVtR to do a "skeleton expansion" of the followinq list (which is necessary to CONNIVER's internals). The («POSSIBILITIES) .n. •IGNORE are syntatic markers to TRY-NEXT whose function we can ignore. (*t»ENERATOR <func-call>) indicates to TRY-NEXT to use <func-call> to generate additional possioiIities if needtd,

NEXT-ObJ will continue to generate objects of type PLIERS which satisfy the predicate (2nd argument). It will generate one PLIERS at o time. (bIGENOUGH $ AD is a skeleton predicate which NExT-OBJ will use to screen each possibility. The current candidate is substituted for $ before the predicate is CVALuatto (CONMVER's form of EVALuation).

when GEN1 contains no more possibilities» TRY-NEXT will execute (GO 'TRY-VISE). Unlike LISP, GO evaluates its argument here.

Check to insure that two distinct pair, of pliers will be fOunc .

See 13.

RETUfcN is not necessary since the value of a CONNIVES function is the last expression evaluates.

Define the generator, NEXT-OtJ. Note that NEXT-G?J looks like a regular function to CONMVER until it is called.

FETCH is a CGNNlvER primitive which returns a possibilities list of all items in the data base which match its pattern argument. !>0BJ indicates that CBJ should be bound by TRY-NEXT to each possibility in turn.

TRY-NEXT binas OoJ from the possibilities list TEMP and removes the current possibility. If there is no current possibility (AOIcU) is evaluated which causes termination of the generator.

The oesired predicate object into tne skeleton. (SUBST returns a list which is the result occurrence of fa in list C.

is CVALuated after substituting the current A B C) is a LISP function which of substituting A for every

(NOTt OoJ) is a CONNIVER function which places the of OuJ oito the current possibilities list. .

current value

(AU-REVOIR) returns control from NEXT-OBJ out leaves the generator in a suspended state. when TRY-NEXT returns control to NEXT-OBJ, execution will resume at (GO 'LOOP).

43

J^ -1"*- lllUlfc J

Page 49: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

•»^ ••••'. iiii.iiiinnii'inii •' ••"' in"

Either SAIL or LISP could provide an excellent basis for real-time Dlanning and execution control of a large automated shop. However, each language possesses features which facilitate certain types cf operations. In particular, SAIL is generically better at the low levtl control of I/O devices, and has «ore extensive abilities for interacting with the operating system (especially where file manipulations are concerned). LISP, on the other hand, is more flexible at the higher planning levels and where system development ana debugging are concerned.

nie envision an "ideal" system as one which merges all tr.t desirable features of these two language classes. Such a merger woulc incorporate LISP's program and data structure format, augmented where necessary to accommodate SAIL-line file operations, and possibly LtAfr-. SAIL features would be implanted in this environment, and, at tr.e implementor s discretion, an ALGOL-like syntax (such as MLISP) coulu te grafted onto the front of the system to make it more tractable.

in aodition, such a merger should take following desirable features of SAIL anc LISP:

care to preserve

(1 )

(«. )

(3)

CO

(7)

uata structures should accommodate complex symbolic infornation as well.as primitive types. As in LlSF, data structures should be free to grow in unrestricted ways, and storage declarations should be optional to the user.

Program and data should, as in LISP, be in the same format. Such a representation underlies (a) a strong macro facility, (b> rapid editing, modification ano debugging of programs, ano (c> seIf-modifying and se If-ex tending systems. The last capability, for example, enables tne system, given the description of a new type of tool, automatically to synthesize the programs for controlling the tool from a library of sub-functions.

Strong I/O ana file manipulation facilities, as are found in SAIL, must be included. A good ranoom-access file system is imperative for even moderately large databases. The system should have both high and low level control over input and output formatting which provides control down to the bit level of the machine*

highly-aeveloped interrupt subsystem would be desirable, ith. the merger of SAIL's bit-wise interrupt control, and

A if LISP's symbolic capabilities, such a system as is described in [Rieger 763 could be efficiently implemented. This would serve as the network protocol for a large collection of highly autonomous processes where the synthesis and control of many parallel events is important.

(5) For software development and debugging, an interpreter should exist for the language. Nevertheless, the language should be have a compiler for production usage. LIi>P currently satisfies these requirements.

(6) The system a ssociative

should provide database,

engineering to coordinate efficient random-access file some ideas on this topic.

for a large This would

a MP-like database with an system. [Wc0ermott75a3 surveys

, context-sensitive, involve some new

There shoulo be some degree of automatic problem-solving control which includes a CONNIVER-like context-switching and process-suspending mechanism. Accommodations should be made for SAIL-Iike parallel process control, and emphasis should be placed on inter-process communications protocols. Most of the ideas already exist in CONNIVER and SAIL, but they need to be synthesized into a unified system.

tne

kk

Mtw ttmäiii^m^^mmmttmmitimätiimaimamn\\tm\\\ nimin *h;y **.*•••

Page 50: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

7« kitiiwäcäßbx

[ boutija rt 723 Baumgart, o. G. "Micro-Planner Alternate Refe rence Manual," Stanford AI Lab Operating Note No* 67, April 1972.

CßBNcXEC3

[£eech7C3

[E>obrow74

bol

deec

J LOO

t. Eeranek and Newman. "TENEX Executive ^anu-l," Cambridge* Massachusetts» April 1973.

h, 0. "A Structured Viet» of FL/1," ACM Computing Surveys, March 1970» pp. 33-64.

row» D. G. and Raphael» B. for Artificial Intell" September 1974» pp. 153

[burst a 11713 b

CChurch4l

CC0B0L7*,j

CC0DASYL7

COECi DEC

3 Chu

C03

13 CO

. "DE

CDijkstra753 D

LFahlman7

CFelanan6

33 Fa

93 F

"New Programming Languages for Artificial Intelligence," A£M CSBEytlDfi lu.r.yey.s»

* ""*-"74 .

urstall, R. M.» Collins» J. S. and Popplestone» n. j. Programming in P0P-2» The Round Table and Edinburgh OniversTTy Prfss» T97T.

rch | A. The £a.l£uli gf kamfeÖä Convgrsipn, Princeton UnIversiTy~Press» Princeton, New JerseyT T951 .

0L. "American National Standard Programming Language CODOL»" X3.32 - 1974» American National Standards Institute» Inc.» New York» 1974.

DASYL Data Base Task Group. "April 1971 Report»" ACil» Nth York, 1971.

C System-10 Data Base Management System Programmer's Procedures Manual»" Document DEC-1O-APPMA-B-P, Maynaru» Ma ssac nusetts.

iikstra» E.W.D.» Lamport, L., Martin, A.J., Schölten, C.S.» Steffens» t.F.M. "On-the-fly Garbage Collection: An Exercise in Cooperation," Burroughs* Plataanstraat 5, NL-4565 NUtNEN» The Netherlands» EWD496-G.

hlman» S. "A Planning System for Robot Construction Tasks," MIT AI Memo 283, 1973.

eld man

CFeldman713 Fe

Idman. J. A. and Rovner» P. D. "An ALGOL-Based Associative Language»" Communications of the AC*» August 1969, pp. 439-449.

loman* J • A. and Sproull, R. F. "System Support for the Stanford Mana-Eye System," Second International Joint Conference on Artificial Intelligence, London, September 1-3, 1971.

CFinkel743 Finkel, *•» Taylor» R.» Bolles, P., Paul, R. and Feldman, J. "AL. A Programming System for Automation," Stanford Artificial Intelligence Laboratory, Memo AIM-24I, November 1974*

itt, C.» "PLANNER: A Language for Proving Theorems in Robots," Proc. IJCAI-1, 1969

slie, w.H.P. (editor)* Numerical £o.nt£2i ElßSIäEliDä L2Cgu£i4£S» North-Hoi lane Publishing Company, London,

n, M.I. "LISP 1.5 Programmer's Manual," The M.I.T. Press, Cambridge, Massachusetts, 1965.

cCarthy, J. "Recursive Functions of Symbolic Expressions ano their Computation by Machine," Communisatjoo* y* IbS Ä£ö» April 1960, pp. 164-195.

[Hewitt69

[Leslie7Z

CLevin653

CM.c Car thy

3 Hew

3 Le

Levi

oOD 1

45

iüä.

Page 51: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

[He Der mot

[Moon743

CNaur603

t7Z3 McOermott, D. V. Reference Manual»1

1972.

and Sussman, 6* J. "The Conniver AI Memo No. 259, HIT Project MAC, May

Moon, D.A. "MACLISP keference Manual," Project MAC Massachusetts Institute of Technology, Cambridge, Massachusetts, 1974.

Naur, P. (tditor). "Revised Report on the Algorithmic Language ALUOL 60," Communications of the ACM, May 1960, ct. 299-314. *»••»«*«***«*« *- *--

CNormanfc9J Norman, t.

CParsons7

LISP," University of Wisconsin Computing Center, Madison, Wisconsin, April 196°.

43 Parsons, F. G. , Dale, A. 6« and Yurkanan, C. V. "Data Manipulation Language Requirements for Dataoase Management Systems," Computer Journal, May 1974, cp.

CRAPIöATA:

CReise r75i

C R e i s e r 76'.

CRiege r7t.

LSamet?63

RAPIDATA Corporation. "A FORTRAN DML Imnlementation for DBMS-1ÜV* Fairfield, New Jersey.

Reisert J. F. "BAIL—A oebubger for SAIL," Stanford Artificial Intelligence Laboratory, Memo AIM-27C, October 1975.

Reiser, J. F. (Editor). "SAIL," Stanford Artificial Intelligence Laboratory, Memo AIM-289, August 1976«

Rieger, C.J. "Spontaneous Computation in Cognitive Mooels," Department of Computer Science, University of Marylanc, TR-459, July 1976.

Samet, h. "The SAIL Data Base Management System," Computer Science Department, University of Maryland, College Park, Maryland, Unpublished, 1976.

CSiklossy763 Siklossy, L. IfiJ^s läiM LI5E» Prentice-Hall, Inc., 1976.

CSmith7G3 Smith, D. C. "MLISP," Stanford Artificial intelligence Project, Memo AIM-135, 1970.

Cstacey74j Stacey, b. M. "A FORTRAN Interface to the CODASYL Dataoase Task oroup Specifications," Computer Journal, May 1974, pp.12 4-129.

CSussman7

CTaylor76

CTeiteIma

CTOPS103

Cue issman

Cuilcox76

pp

ii.1 Sussman, <*•, dinograd, T., and Charniak, E.» "MICROPLANNER Reference Manual," M.I.T. AI-TR-203a, 1071

j Taylor, R. w. and Frank, R. L. "CODASYL Data-Base Rana.ement Systems," A£M tfiSEyllDS &UEX£y.s., March 1976, pp. 6?-lCi.

n743 Teitelman, *, "INTERLISP Reference Manual." XEPOX Palo Alto Research Center, Palo Alto, California, 1974.

DEC. "DECSYSTEM-10 Operating Systems Command Manual," DEC-1G-0SCMA-A-D, Digital Equipment Corporation, Maynaro, Massachusetts, May 1974

673 rfeissman, C. "LISP Company, 1967.

j Uilcox. C. R. "MAINSAIL Language Manual," SUMEX, University, May 1976.

1.5 Primer," Dickinson Publishing

Stanfore

46

-——-' • ••ii -'—-'"-' ' -"•-••*- - U—A ».-#*•• . JM

Page 52: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

8. Summary Chart

M • »-J«

* ••• • -»- •• f -•• M

• jh * -c • {•-•a-c >•*

? tnp! _ is*v*ft - a— * —

i

1 5

-•

i 5

i

i! i! 3

!? !•; HI m

c-c -

us-* sfsj* •-•23

zsztatt .«*;

: u

::s

; K~ • •*->•» .::: =

• »

.*:

=•*

i I

H:

§ .tin |KI| hir • *» » ;:~r»

|= •a *

L H

5. : f uJ • -- • ;r: ^ 1

: •VMS • •»- • i

si:! * •

• .. . : * • •>*.•-••• EM • • •*. * • rtu

mm •• c • *> • »• * •••.••«• • *» •••

»rw-:r J:i ;. SZiliil issttil

n • •> •* RSI ü

I

I i

• i

it!:: rfifi mit

! !

tp.1« iinsM llisrli

y ;: t:

47

'I~r •—r-—

Page 53: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

r — , i >-m. .... i i , " ••

VMCUSSIFIEO SCCUHITV CLASSIFICATION OF THIS PAGE (Wh.n Oaf« Bnlorod)

REPORT DOCUMENTATION PAGE 1. REPORT NUMBER 2. COVT ACCESSION NO

*• T

\^J ITUE (ltd Subtltlo)

QJArtificial Intelligence Programming Languages for Computer Aided Manufacturing^ ^

Cd AUTHORO;

/t^Jchuck Aieger, Hanan/Samet. Jonathan/Rosenberg i

•• PERFORMING ORGANIZATION NAME AND ADDRESS

Computer Science Dept. Univ. of Maryland College Park. Md. 2Q742

II. CONTROLLING OFFICE NAME AND ADDRESS

Informations Systems Branch Office of Naval Research Wash., P.C. 20305

BE MONITORING AGENCY NAME » AOORESSfff dlltoront from Controlling Ottleo)

READ INSTRUCTIONS BEFORE COMPLETING KORM

3 RECIPIENT'S CATALOG NUMBER

S^YPEOF*

(T/Technical /bgj<f»-*C>

«• -eefiEOBtUMG ORG. REPORT NUMBER

'/JgR-595 \ !! ZCfllHMCT ft« ORANT NUMBERf«;

HOjb0i4-76Jc^ -,0477

10. PROGRAM ELEMENT. PROJECT, TASK AREA a WORK UNIT NUMBERS

NUMBER OF PAGES

47 ASS, fo/ Inl« r«jVoHT-» IS. SECURITY CLASS, (of (hl« r.pört

Unclassified

IS«. DECLASSIFICATION/OOWNGRAOING SCHEDULE

I«. DISTRIBUTION STATEMENT fa/ III«« Roport)

Approved for public release; distribution unlimited.

17. DISTRIBUTION STATEMENT (of tho afeatract onto rod In Black 20, If different from Roport)

I«. SUPPLEMENTARY NOTES

It. KEY WORDS (Conilnuo en »vor«« olio It noeooomry and Identity by black numbor)

20.

Artificial Intelligence Programming Languages Computer Aided Manufacturing

Systems Control

RACT fConilmio on tovotmo «Id« It noeooomry and Identify fey Mock numbor)

ight Artificial Intelligence programming languages (SAIL, LISP, MICROPLANNER, CONNIVER, MLISP, P0P-2, AL and QLISP) are presented and surveyed, with examples of'their use in an automated shop environment. Control structures are compared, and distinctive features of each language are highlighted. A simple programming task is used to illustrate programs in SAIL, LISP, MICROPLANNER and CONNIVER. The report assumes reader knowledge of programming concepts, but not necea«-rilv of thi language» «nrvpved

DO ,SM- '4?3 EOli'lON OF I NOV «S IS OBSOLETE '\ irNCTASSTTTRT) JTOJ O &) qk %>

SECURITY CLASSIFICATION OF THIS PAGSTfWh.n Dal« EtSMJt) • V '

at*.

Page 54: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming

^^^mmm»

Off of Naval Research Branch Office, Boston 495 Summer St. Boston, Mass. 02210

New York Area Office 715 Broadway-5th Floor New York, N.Y. 10003

Mr. E. H. Gleissner Naval Ship R+D Center Computation and Math Department Code 18 Bethesda, Maryland 20084

Capt. Grace M. Hopper NAICOM/MIS Planning Branch OP-916D Off, Chf. of Naval Op. Washington, D.C. 20350

Mr. Kin B. Thompson Technical Director Information Systems Div. 0P-91T Off., Chf. of Naval Op. Washington, D.C. 20375

Naval Research Lab. Technical Info. Division Code 2627 Washington, D.C. 20375

Dr. A.L. Slafkosky Scientific Advisor Commandant, USMC Code RD-1 Washington, D.C. 20380

National Security Agcy. Attn: Dr. Maar Fort Meade, Maryland 20755

Off. of Naval Research Code 1021P Arlington, Va. 22217

Asst. Chief for Tech. ONR Dept. of Navy Code 200 Arlington, Va. 22217

Off. of Naval Research Information Sys. Program Code 437 Arlington, Va. 22217

Off. of Naval Research Code 455 Arlington, Va. 22217

Off. of Naval Research Code 458 Arlington, Va. 22217

Defense Documenta. Cent. Cameron Station Alexandria, Va. 22314

Off. of Naval Research Branch Office, Chicago 536 South Clark St. Chicago, 111. 60605

Off. of Naval Research Branch Off., Pasadena 1030 East Green St. Pasadena, Calif. 91106

Naval Electron. Lab. Ctr. Adv. Software Tech. Div. Code 5200 San Diego, Calif. 92152

-.—rreir- • It M —

Page 55: AO-A007 179 MARYLAND UNIV COLLEGE PARK OEPT OF … · 2014-09-27 · ao-a007 179 unclassified maryland univ college park oept of computer science f/o 9/2 artificial intelligence programming