lps algorlthmas a crltleal analysis - academic commons · lps algorlthmas a crltleal analysis addj...

14
CUCS-l13-84 LPS Algorlthmas A Crltleal AnalysIs ADdJ Low.,. Supbea Taylo. Salvatore J. Stolfo Columbia Uninrait1 Department or Computer Science Much 1084 Abstnet We ILre interested in high speed execution or logic programs using IL puticulu model or computing devices. In a complLnion paper we present. a detailed expluation or current. implementMion strategies and develop an ILbstrlLct. proor procedure encomp&aaing those &1gorithms aa well a.s the standard sequenti&1 Prolog &Igorit.hm. Here we explore a number or alternative strategies ILnd provide a comparative ILnalysis in the context or thlLt. &bstra.ct. procedure. We innstigate issues or performance. storage requirements, and ILpplicability or the algorithms under vuioua usumptions concerning the program under execution. We asaume that the reader is familiar with the material developed in the companion paper. This reseucb is supported cooperatively by: Derenal Advanced Research Projects Agency under contract NOOO3g.S2-C-0427. New York State Science and Technoloc Foundation. Intel Corporation. Digital Equipment Corporation. Valid Logic Systems Inc., Hewlett-Packard. AT&T Bell L&boratories and International Bu.sinesa Machines Corporation.

Upload: ngokhuong

Post on 18-Jun-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

CUCS-l13-84

LPS Algorlthmas A Crltleal AnalysIs

ADdJ Low.,. Supbea Taylo.

Salvatore J. Stolfo

Columbia Uninrait1

Department or Computer Science

Much 1084

Abstnet

We ILre interested in high speed execution or logic programs using IL puticulu model or p~lel computing devices. In a complLnion paper we present. a detailed expluation or current. implementMion strategies and develop an ILbstrlLct. proor procedure encomp&aaing those &1gorithms aa well a.s the standard sequenti&1 Prolog &Igorit.hm. Here we explore a number or alternative strategies ILnd provide a comparative ILnalysis in the context or thlLt. &bstra.ct. procedure. We innstigate issues or performance. storage requirements, and ILpplicability or the algorithms under vuioua usumptions concerning the program under execution.

We asaume that the reader is familiar with the material developed in the companion paper.

This reseucb is supported cooperatively by: Derenal Advanced Research Projects Agency under contract NOOO3g.S2-C-0427. New York State Science and Technoloc Foundation. Intel Corporation. Digital Equipment Corporation. Valid Logic Systems Inc., Hewlett-Packard. AT&T Bell L&boratories and International Bu.sinesa Machines Corporation.

1

1. Introduetloa

We hue proposed ~mput.in, model which WI beline may b. suit.abl. tor the panllel execut.ion ot logic

programs [5, 71. In a companioD paper [21 we den lop det.ailed algorit.hms by which this might. be

achilnd. Our dnelopmlnt. is cut. iD t.h. tramework of aD abat.ract. proor procedun [21 which

encompuaes our algorit.hmJ (t.he LPS 4Igoritla",,·,) U WIU as t.he standard sequent.ial Prolog

algorit.hms [81. ID t.his paper we ioyestigat.. seYeral alternatin panllel execution strat.egies and analYJe

t.hem in the cont.ext. or this same ahstract. proor procedure.

We include diac~ion or t.he trade-orr. amonl unous execution strategies in terlTll or perrormance,

stora&e requirements, and appropriat.enlSl to unous types or . logic programs. Much or t.he analysis

presented here is intuitive in nat.ure, due to a lack. or obsened pertormance meuurementa. Meaninsful

me~urementa are dimcult to obbin because:

• Our current implementat.ion is in the torm ot a simulation on a sequential machine, 50 that. sample execution ot any but. the tiniest programs is prohibitively expensive. Implementations on :L tunctioning p:LnJlel machine are currently underway .

• The algorithms do not as yet provide tor extensions to the Horn clause rormalism such as :legated condition element.a, naluable predicat.es, and goals with side-errects. These teatures are generally required by logic programs tha.t. attempt. to do anything subst:Lntial and usetul, so most existing programs cannot. b. execut.ed in our current. rramework.

It is hoped that. tuture work will remon t.hese obstacles and allow tor statistical analyses providing

greater insight into the err.ctl or the unous strategies. This should in turn suggest opportunities ror a

more general mathematical analysis.

We assume an understanding on the part. or the reader or the material developed in the companion

paper [21. No summary is attempted here.

aNamed alter LPS, the name we han chosen tor our Logic Programming System

2

2. Unlfteatloa Pbue Straceslet

Two .tnte&i .. ban bHIl id.ntilttd ror Lb. uDirie"ion or l0ala in a loal I~t.. whieb Wt eall cs,,,.cA,.onQt&,

and 'PcMonou ."i/icotiOfl.

2.1 AqnehronoUl Unlfteatloa

In Lht uYDehroDoUl e .... a l0al lin ia broadeaa u a aiql. unit. to t.h. PE net.work. aDd the PE's ate

inat.rucud to 10 to work uDitJiq t.b. enUn lilt. of loa1&. Th. CP waita aDt.il aU PE'. ban complet.td Lhia

t.uk. " whicb poiDt. all ~blt aJdttcUiou at t.ht ,oeJa ltan t.&t •• plact. and Lb. reaalt.iq biDdilll Nta

an residtDt. ill t.b. PE D.t.work. Thil at.nteu allow onrtappiq of ,oa! allilicat.iol amolll t.h. indiyidual

PE's. Til" ia, tac' PE may .. Oil to t.h. Il.xt. loa! u 1001 U it. bu txhal&lted ita OW1l Joeal supply or

IiteraJa witb which to aUtmpt. UIliliCaUOD ot Lh' clUnnt. ,oal. "audita or t.h. Iiat. or Prosrtsa ill t.he

ot.ber PE's.

A.. all enmpl., cODlid.r t.he rollowin, aomlwb" id .. liI.d Ie.DanO:

Gow to b. unitied: a. b

Literals resident. in PE 1: 1.1'

Liter&l.s resident. in PE 2: b1.

The rollowing sequence of evenr... result.3:

The CP broadcuta the loal1iat. '{a. b}' to t.b. PE net.work.

PE 1 begin. uniryin, <a. 1.1 > At the s~mt t.ime PE 2 beaiDi uniryilll <r.. bl >, raita quickly and progresatS

to uniry <b, bl >

PE 1 campl.t.ea uniryin, <a. 1.1 >, aLt.empta to uniry <b, 1.1> and (aita quickly

PE 2 compl.t.es uniryin, <b, b1 > PE 1 and PE 2 han completed thl uniticat.ion ph ...

A3 we ste, unitication or goal • in PE 1 ia oYfrlappld in t.im. wiLh unificat.ion of goa.l b in PE 2.

Benefieia.l overlappinl occurs ror two reuona:

- A succesatuJ unification ,.nerally requires more time thaD aD uDluccesatul attempt. Failure is usually detect.ed Ion, bero" the two lit.eralJ han beell completely scanned (indeed, railure is immediate in tht cue or ditrerent. predicate .ymbota). whereu succesa is not "coglliltd until tbe scaD ia complet.. Furtb.rmo", additioDa.l work ia required al\er a lucceaatul unification, ror tbe conatruction or a biDdiD, set.

3

• One PE may Deed to attAmpt unification or a puticular goal with more literaJs than another PEe It Wt Ulumt a Yef1 small number or literals resident in each PE (due to a large PE network), Wt can exptct. t.h&t moet. PE's will be uuble to uniry moet. soala, so this will be a higb sourct or onrlap. EnD without. this Ulumption, unous strategies ror distributing the litenJa and indexiq ncb PE's local literal pool b1 predicatA symbol can increaae the likelihood or this type or onrlap.

Again u"uming a very sm&ll number or literals resident. in each PE, we see th&t the entire unifie&tion

phaae takes time th&t ia lineu in the sill or ~he broadcut goal list. Furthermore, we expect. the ent.ire

process to be exception&lly rut. due to a smaJl co natant. ractor in our linear complexity. Contribut.ing

componenta ue: (1) the time required to transmit the goal Iiai, and (2) the time required ror the PE's to

indiyidu&lJy scan the go&l list and create binding seta tor succeaal'ul unifiers. The'second component. is

lineu because the b'-sie unj.ficatioD algorithm i. lineu in the silt or the terms beinl matched, and the sum

ot thOllt sizes is no ipger thaD the size or the entire loal list.

Gener&!ly, we would expect a sin&le liter&! to unit1 with a.t. moet one go&l in a go&l list, so tha.t. the

constant factor in our lineu time complexity will be heayily domiuted by the time for failure, rather

th&! the time ror succe!.1tul unification. This accounts tor the hi&h pertormance we expect trom

a.synchronous unirication, since railure time is quite sm&ll.

2.2 Synehl'Onous Unlneatloll

In the synchronous unirication strateu the goals in a go&l list are broadca.st one at a time rather than u

a single unit. Unirication ot each loal is performed in the PE's betore the next go&l is. broadcut, so that

none or the oYerlapping that we witness iD the uynchronous strategy can occur.

The synchronous strateu orrers a potential benefit only in the c&:le ot the railure of a single goal

throughout. the entire PE network. In this ea.se, the entire goal list can be thrown out immediately

without attempting unification ot the remaining gow.

Whether or not such opportunities uise with a frequency tha.t merits adoption or a synchronous

unificatioD strate&1 is a quest.ioll t.hat. will be innstiga.t.ed through statist.ical an &.lyses of logie

programs 161. We hope also to dnelop methods ror identitying local characteristi~ or a search space that.

may indicate an increued likelihood tor global tailure ot a sin&le goal. It this can be done, a dynamic

selection meehanism may be implemented tha.t. is capable ot using uyncbronous or synchronous

unification depending on the proot history and eurrent. state.

A hlbrid ILr~&1 mal also bt tll,iaioned, ill whicb tbt l0al liat ia partitioned accordinl to some suitable

heuriatic, &ad eacla portiOD it broadcut u & uDit (or UlllcbrolloUi unification, while ultification or the

onrall ,oal IiR it IJllcbroDOUI amOD, tbt poniou.

S. Jola Pbue S&raustn

We noh t.hu out panllel executioa or a pair-wile "latioDal joiD resulta iD a lo,(n) improY.ment. ia tbe

time required ror t.hia operatioD bl a aequ,nt.iaJ altorit.bm 17). Out alt.erutin joia nnteai .. iaYeIt.icu,

metbods (or minimiliq t.bt namber or pair-wiN joill.l required i. a aiqle join pbUt, a,oidiq reduadant.

computatioll.l, &ad cont.tollilll deplet.ioD or PE atonet.

Th, reconciliatioD oper&tioD itaelt it perl'ormtd u a aeri .. at reftllemuta OD a colltctioa of bindiap. Th,

collection belina witb t.b, uDioD or t.he biDdinp (ouad iD t.he t.wo compolllDl. aubatitut.iona. A refine menlo

consista or identirli~ t.wo biDdinll (or tht sam. ,viable &ad replaciq ODt or t.hem with t.he uDilier at t.he ,- -"

two terma. When n~ucb ilait of billdinp it lett, reconciliUioD it compltt.e.

Altboulb pathological cues C&ll &e 'const.ructed, Wt beli"e thu iD practice the unincation'that t.at .. plac",

durinl reconciliation 3eldom produces new bindinll ror yviabl .. alread1 bound, so that (again recallinl

that unification itselr ia linear iD the size or the ttrl11l beinl combined) w, will expect a perl'ormaDc, that. -

is rougbly linear in the size or the component subst.itutions. We int.end to inYestigatt tbe ,alidity or our

LSaumption throulh st.at.istical analYlia.

3.1 RetalnlDI Goala

It. hu been point.ed oul. t.bu 0111 LPS implement.at.ion nner retaina a goal (rom ont soal 1i3t to its

successor. Instead, eacb ,oal it eit.her remond or expanded. W, expect this strate" to 'be quite

beneficial in m&D1 applicatioll.l, bowenr there ar. at leut two potential pitfalls, which we call the bile

small problem aDd t.b, cortuilS" J1f'od.d problem.

3.1.1 The 811· Small Problem

Consider the soal set. {blc(X). amaU(Y)} wbett, u ita nam, lu"eata, blc(X) is a soal tbat. repreaenta

an extremely lensthy comput.atioa in,ol'in, 1011.1 cbaill.l or infertnc,. Likewis., smaU(Y) is a goal t.bu is

nry quickly aatiali.d, wit.b multipl, IOlutioll.l. It t.1II11.1 out t.bu a strict policy, or nOD-r,t.,ntion or goal.

will perl'orm subataatially mort work in locatio, mult.iple IOlutioll.l or tbia diteetin than would a more

ne,oble approacb.

5

To see this, co~ider the very tint step in the solution ot our go&l, and suppose that our databue contains

the two racta .ma11(ftea) and .mall(pebble). Thea. two tacta will uniry immediately and produce

simple bindinll [Y Iftea] and [Y lpebble], mpectinly. Meanwhile, bls(X) unifies with a rule head

somewhere iD the databue, produciDg a complex bindinl that repreaeDta a I<?ng computatioD iD its

inrancy.

With these binding seta in place, our join phase will produce two complex bindinp, both containing the

statUi ot the jUit-started big computation, aDd each cODtaiDilll one ot the small solutions. ODe ot these

complex bindinp will be selected during the next cycle, and thu selection will begiD t.he long computation

ot bla(X).

Meanwhile, t.he second complex bindiDg will lie dormant. iD the PE network awaiting selection but not.

benefiLing trom the ongoing computation. When it. is tinaJIy selected, t.he big computation will be

repeated almost in ita entirety. This is the duplication ot e"ort that we would like to &Yoid.

To see .. possible way out, consider the behavior ot this go&l in th. standard sequenti&l algorithm. Here

the bla(X) computat.ion is carried out until a eolution tor it is achiend, all t.he while rebining the original I

smaU(Y) goal in elie goal1ist.. It is not until the bil comput.ation haa terminat.ed in a solution that the

small goal is finally ~ned, resulting in its removal by the tact .mall(ftea). Next. the algorithm bacu up

its computation to ita last choice point, which wu its choice ot a unitying tact ror small(Y), and makes a

new choice. This time the • mall 10&1 is remond by t.he tact. amaU(pebble) without lustling to

recompute the CUM'mt ,olution lor bla(X).·

Thus we see that by rdGining the sm&ll goal-we have avoided a large redundant computa.tion.

It. is instructive here to consider the tree ot goal lists genera.ted by our proor procedure, in which the

decision to retain a goal at a certain point has the errect ot postponing wha.tever branching might be

caused by the choice ot clauses with which the goal may unity. It each ot the resulting branches gives rise

to a deep subtree, the postponement. may turn out to be quite beneficial. The cloSe ot our eXI..mple is

diagrammed in figure 3-1.

eNote that the Prolog algorithm would encounter the big-smaJI problem it the goalliat were reversed, u in {small(Y),bls(X)}.

NOfl-RKMlti9Q Policy results in ..rty bnAchi"1

I 8i1 ComputatiOCl

Retain.cs Goal eaUMe d.ef.tnd branchi"1

rtcure 3-11 Goal retention poetpones bruching aad may result in considerable aa,inlS or errort ia the bil • small p.toblem

3..1.2 Cartesian Produeta

One other possible benefit or loal "tention is containment or tbe potentially explosive growtb ia tbe

number or binding seta rwd.nt in the PE network. ~ an exam pl., suppose our goal list is

{plentlruU(X). plendrull(Y)}. wh.,. taeb &oal unin .. witb a nf7 large (act baae (say M (acta (or I .

plenti(ull and N I'dta (or ~.atitu12). Thus in on. proor step w. acbine two large, independent relations,

whoa. joia is their kmplete Croll product conaistinl or M x N binding aet..s. In such a situation it might

b. desirablt (or ena aecesa&r1) to limit the accumulation or biading set..s by generatin, only ont "slice· o(

tbe c1l'Usiaa produd at a t.ime.

This might be accomplished by retaininl plentlrult(Y) during the first cycle. Tbe result will b. M

binding seta containin, the solutiona (or plentlruU(X). aad each containing our retained goal aa well.

Thea. bindina seta arl select.ed ont by onl (or (urth.r .Iaboratioa, and each one. gins ris •. to N bindinp

seta that ar. reported and discarded ia turn. Thl maximum number or biadin& seta resident. ia tb.

network i.I thus M + N • I, ratb.r thall M x N.

7

3.1.3 Implementation Of Goal Retention

Two problema need to be addressed it goal retention is to be accommodated in our algorithms:

1. The actual mechanisms tor retaining l0ala muat be worked into the implementation. This requires a slight modiltcaUon or the bindinl set representation 110 that actual goala can be represented, u well u mechanisms that allow the CP to identity to the PE's which ot the broadcast goala are to be retained.

2. The means by which goala are selected ror retention must be decided. Possibilities include automatic selection bued on static and/or dynamic proanm analysis; marking of procedures, rules, or eYen indiyidual condition elements by the procnmmer; and combinationa ot these two strategies. We preter a compMtely automatic mechanism, consistent with the philoeophy that­logic proanmming orrers opportunities tor parallelism without burdening the programmer with this goal.

3.1 •• Beneftts Of A Non-Retention Polle),

It should be noted here that. a policy or non-retention ot goala proyidea at least. two potential benefits.

Fi"t, the total path length ror any succesatul proof is minimized by such a policy. generally translating

into reduced errort for a single proof. A3 the big-small problem illustrates, however, siwatioDS may euily

arise in which much greater benelita due to commonality or proof paths are missed bI this eager strateu.

Second, a retained goal does not constrain the search space under consideration. One benefit of the _

reconciliation model over the depth-lirst search strateu or the Prolog algorithms is that a much larger

range of interactions are possible among the goals in a single goal list. In the Prolog strateu, the errecu

of computations on a goal may only prop&&ate rorward in the goal list, whereu if seYeral goals are unified

in one step, constraining interactions are c&l'1"ied in both directions. The program presented below is an

example where the Prolog algorithms will nenr terminate, whereu a non-retention strateu terminates

quite quickly. Here the second l0al in the goal list cOll!trains the lirst goal so as to aYoid the infinite

search that. tbe Ii"t goal produces on ita own. Since this "backward" constraint is not possible in the

Prolog algorithm, we find the unconstrained Ii"" goal generating an infinite sequence of resulu, all but the I

first of which are d1bllowed by the second goal.

Rule I: appenf(;,ns(A,Tl).L,cOns(A,T2)) <- append(Tl.L,T2) Fact 1: append(NIL,L,L) <-

Directive: <- append(Xl,x2,Yl) • append(Yl,Y2,NIL)

8

3.t Slncie Feed Jolu

Tht cll'ksiu produe\ probltm mtntion.d in the lu\ aeetioll ia jua~ oat patticularly sner. cu. or t.h.

lea.ral probltm t.llu our pata11el txecudoa model may tead to accumulat. biadinl seta t.1l" lJ'e waitinl

ror stltctioD. Goa! rtt.atioa wu , .. n u oDt atnUl7 ror allni"iq tlUl problem by rxpaadiftl t.he selJ'ch

space oa. "slice- &t & t.ime.

Anot.her st.rueu ia to perform OUl' joil1 op.ratioDi iD Imall mpi by broadcutiq only one reeder relat.ion

member to t.he coaaumer "lwOD U a t.ime. Tile biadial seta produced b, thu siaale reeder are processed

ont b, one util t.h., rUD ou~, " wbieb paia&. the am r-.de, (rom the luapel1dtd joiD ia broadcut.

This ainllt-reed st.raLeu olrers a Meoad pouibl, beaenL uide (rom coat.&inmeat. or the bindial aet

popul&tion. 111 maay cues, a que"1 wiU b, prtMat.td wiLla tbe il1tnt.ioD or produeiac oaly & sinale

solut.ioa, ratber t.hu pursuial all ~blt IOlutioDi. ID t.1UI cue, mueb or tbe e"ort th" I~ into our

join oper&t.ioaa will be wut.d aiDee it a IOhltioD ia eDcoQDt.rtd earl, ill t.be MlJ'ch space, a laree

perceDt. ... or the bindinl $eta ltD. rued (rom joiu wm be dilearded. The sin&Jt-reed strateu detera t.bia

ecrort unt.i1 it is required in ordtr to cont.inue tbt searcb.

It is expected t.hat. the implementation or a sinsJe reed strateu will requirt con~iderably more complic&ted

control mecbanisms th&n lJ'e needed ror tbe e .. er joiD strueU. At t.his point in time no sucb

implement.at.ion b&a been &tLempted, nor haa clJ'etu! thoulht been &iTen 105 to t.be exact control

mechanisms that would be required.

3~ RedIstribution ot Stndlnc Set8

On. fina! approacb to t.be problem or txploGn &rowt.b in t.ht bindinl set population t.&kesa mo" loc&1

yi.w. Speciric&1ly, wb&1. cu be done about. tbe CUt wber. bindinl sets besin &ccumulat.ins &t a tew "bot

spou- in the PE n.twork!

In sucb a sit.uuioD it. would be beneficia! to ban a mecbuism ani!ablt wbereby beuily loaded PE's

could .xport lOme or tbeir biDdiq aeta to other PE'I. Sucb a mechanism is dimcu!1. to imacin. in our

comput.inl model siDc, &11 communication muat be tunneled t.broulb the CP. It, bowner, some direct I

PE-PE communication me~baniam ia provided- .meitat. redinributioa milbt be realiuble. We ma, eTen r

envi!ion redi!t.ributiol1 wit.bia tht PE Dftwork onrlappinl comput"iona! tub witbin t.he CP, such u t.be

const.ruct.ion ot a Dew lOa! Ii!L rrom a "ported biadial set.

·Such a mechani!m ia availabl., ror example. ia tb. DADO bin&l'1 tree IJ'cbihctUH. iD wbich t.ree neilbbors rna, commuaicate wit.houl. burdtaiac tbt CP 13, 41.

o

3.4 Rule lAfer Caeblnl

We diacuSll on. otb.r join ph ... nriut. in which rule layen an stripped from binding seta wbenenr they

p&Sll throup t.h. CP and an replaced by unique t&&l. The rule layen are stored in the CP and are

retrienble yia tbeir t&lll. The adnntage of thia scbeme ia reduced communicati~n of reeder binding seta

during tbe pair·wise join operat.ion. Tbe strateu ia jU!tiriable on tbe basi5 tbat no U!e is made of rule

layen except in tbe cP, so that t.bey are Iitt.le more tban "excesa bag"e" in tbe binding seta during the

join phase.

One major drawback or t.hia scheme, hown.r, ia that it pncludn the remonl of common layer bindings

from binding seta during the join. Thia ia impoeaible becaUH any common layer binding might. be needed

in order to update the instantiaton in tbe bindinl set., and inatantiaton that. are start out. identical may

in this way end up dirrering in t.beir final form. In order to enaure correct. updating of inatantiators before

instantiation, tben, tbe common layer bindings muat. be fully maintained and reported to tbe CP along

with the binding set.

In addition, sucb a scheme would, P!'Obably require some metbod for determining wben a rule layer may be_

discarded by the CP owing to all referencing binding seta baving been reported and elaborated. Sucb a

mechanism seems feasible given tbe current sequence number scbeme.

The trade-oCTs involved have not yet been studied, altbougb tbere seems to be reason to suspect tbat

overall communication costa will not. be greatly aCrected, tbe two errecta largely cancelling eacb other.

3.6 Multlple Independent. JolM

A particularly intriguing prospect. for optimization of tbe join pbue i5 tbe idea of performing two or more

pair·wise joiru in unison in tb. PE network. Our standard join algorithms may be adapted (or this

purpose by extending our model or computation to include a facility for temporarily partitioning t.he PE

net.work into independently functioning subnet.works. One PE in each subnetwork would act as CP for

tbe subnetwork.· With sucb a facility, our pair-wise join ma, be migrated to the subnetworks, so that

sneral pain or relations may be joined simultaneously. This strat.egy requires tbat the eacb subnetwork

contain each relation to be joined, in ita tot.ality.

As aD eumple or how a mUltiple join straLeu miabt. b. realiud, and to illustrate the potential SAYings,

, I

-The DADO archjtRture 13, 41, ror example, &lIon for such .. "multiple SIMD" execution mode.

10

we eoaaider a ratber "brll~ rorce- approach. The PE network ia djyided into two subnetworu, aDd tach

ract ud rule head La stond olce il eacb lubaetwork.

The uailtc&t.iOI ph ... will produce twice u muy biadiq NLa u ia our Jt.uda.rd model, eacb bindiq Nt

appea.rinl ia both subnetworu. We note tbat tbe errart expended duriq the unilteation will be doubled ia

wont cue, sinee the concentraiiol ot 1i~n1a i. tilt PE's bu do.bled 10 tbat eacb PE'I scan or Iiten1a will

tue twici u loq.

The joiD ph ... procttda ia two Rae"' Durial the tltH stace, ODe or tbe PE subaetworu joina halt ot the

relationa resultin, h'om the uailtcat(oa ph ... while the otber aubaet.work aimult.aaeoualy joina t.be other

relationa. The seeoDd ph ... ia a uaale pair-wiN joia pn(ormed by tbe CP ia the ltud.,. rullioD,

combining tbe reslllt.a or tbe subnetwork joina. The total errart required by tbe joia pb ... startinl wit.b "

relatioDJ is tbat required ror ,,/t pair' wise joina, u eompared wit.b ,,·1 pair-wiN joina ir mult.iple

independent joins &l'e not utilind.

It we consider tb. oYerall sayillll realized by mult.iple joina ia t.be abon leenw we see t.bat wbile tbe

time ror unification bu ben doubled in worst cue, we han halnd t.be t.ime required in tbl joiD pha ...

In the c..,e or communicatioa coeu, we see .that there hu been no increue durinl unificat.ion, wbere..,

costs have been halved durin, t.be join pbue. The situation La promisinl, to I&y the leut. Further

analysis may be able to identiry more intellilnt. partitioninl strategies, possibly bued on data

dependency analyses simila.r to t.boH under in'ftsti,ation by lahida 111 in his work on panllel execution or

production systems.

4. Substitution Ph .. Stn&eat_

The only major alLernatin uader consideration ror tbe substit.ution ph ... 1 is the postponement or the

compoaition or indiyidllal reconciliations in the proor path. Rather than keepinl a completely updated

reconciliatioa in each bindiq Nt, common layers would represent only the substitution required to

complete tbl lut. proof ltep. The onrall lubltitut.ioa would be comput.ed by the CP wbeanl' a SolutioD

wu encountered.

The only subst.ut.ial benefit. t.hat may be obtained rrom thia 1t.r&teC La that. the ent.ire subst.it.utioD

bisto"., alonl with a hiato". at coal seta t.hat. could &lao be maintained by the CP, would allow t.he

reconatruction or the entire proal' ror reportinl purpoMS. The dnwbacu an aneral:

I

11

• The hiator)' meehaniam required in the CP apptlll aubatantiaUy more complicated than whu ia prulD&.ly rtqWnd. BiDdiq seta would Deed additional taging information to identify deptb iD the .. arch Ipa.ee, aDd the CP'a hiatol1 mecbaniam would han to monitor thit information in order to kno. wh.ther to atack a new compon.nt, replace the top component, or pop the stack.

• The history mechanism would seem to pr..,eDt much nexibility in the order of selection of binding seta. A predictable order of tranraal througb tb. search space is potentially beneficial to programmers. Th. hiatory mechaniam would fit well into the ordering imposed by our current sequence number scheme, but. as indicated in 121, it ia questionable wbether thia ordering is useful. We hop. to be able to identity a dirrerent ordering that tits well into t.he algorithms, but. a history mechaniam would s..,ertly conat.raia our option ••

• We would no longer b. lobi. to reman common layer biDdinp prior to reporting the binding set to t.he CP.

4.1 A PrevlolU ImplementatIon

Earlier published work on LPS described a aubatiLuLioD ph .... tbaL ia substantially dirrerent. from t.hose

currently under consideration. In facL, in early implementationa the substitution phue was probably lobe

most. complex phu. of tbe· algoritbm. Tbe currenL approach i. a direct result or iD1'eaLigationa prompt.ed

by discontent with the earlier techniques. For historical complet.entsS we brieny discU!S t.hia approadl and

relate it to current work.

The task of tbe substitution phue can be regarded u pushing forward a/rontit:f' ,et 01 bindings. Prior to

a proof cycle, we are equipped wit.h a collection 01 bindings that. relate our tOJrlevel variables to variables

in the rules about to be tired, as well as urious created uriables. We call these uriables middle-level

v&l'iables. A.! t. result or unifict.tion t.nd reconciliation. we are len. with another collection 01 bindings. this

time between middle-level variables t.nd 6ottam-level variables, which &l'e variables from the facts and rule

heads with which our goals unified. Tbe sub.tit.ution pbase must resolve tbese two collections into a new

collection or bindings relt.ting tb. top-level vari,bles to tbe bottom-level vuiables. During the next proof

step, 01 course, those .bottom-Inel variables play the role of the middle-level variables. and the frontier set.

is adunced one mort 1..,,1.

The innovation that haa allowed us to discard our old substitution algorit.hm is the filling ·out. 01

instantiators with "dummy bindinp· lor unbound rule variables. As a result 01 this operation, our new

Irontier set and instantiater rall directly out or the composition procedure. Previously our approac:h was

u rollows:

1. Claaaily bindinp into five dirrerent cattgorie., as rouo .. :

12

• Upper Inel unable bound to lower 111'.1 unable

• Uppn lenl ",nable bound to lower le .. larouDd term

• Upper le .. 1 unable bound to lower Inel DOD-around term

• Lower Inel unable bound to upper Inelaround term

- Lower Inti uriable bound to upper 1 ..... 1 DOD-around term

2. Liat all pouible combin&t1oDl or a top-to-middJe blndiq of one tIpe and a middJe-to-bottom bindiDI or &Dother t.IP" Th. resultiq At of twentI-n .. bindiqlCenuioe, aloq with tbe tin CUH wb.rt a top-t.o-middJ. bhufiq ia lel\ bI itaell (UDpaired with a middle-to-bottom bindinl) eompna. aJJ ~ible bindilll interactioDl.

" 3. Consider .ach bindinl interactioll in tlltD ud deeide how it cu be reeosDiud and wbu

cODt.ribut.ioDi it caD make to tbe rtaultiq billdiq Nt.

4. Dnelop an &l&oritbm to budJe int.eractioDi aceordilll to th. an&J,aia just performed.

We do not. int.end to eoMider t.hia approacb rurtber.

i. Conelualon.

We bave presented a number or alternat.ives (or execution or logic prolrams OD a particular model or -

parallel computat.ion. Altboulb w. bave bun able to identify some trade-orrs, it. is apparent. tbu no

single choice ot strategies will b. optimal. in aJJ circumst.ances. Future reseucb aims to turtber our

undentandinl o( tbese and otber all0ritbrru ud to ident.ify cb&l"&Ct.erist.ics or logic programs that. may be

used u a criterion (or strate..,. .. Ieetion.

Statiat.ical analysia of logic Proaramt ia CWT.Dtly underwa, 181. W. bope to identity starc.b space

cbaract.erist.iea t.bu arise rrequentlI in practice and wbicb dict.at.. part.icular strat.e..,. cboices. This

analysia will be rurtber aided bI tb. implementat.ion or our algorithms on a tunctioninl protot.'ype machine

bued on the DADO arcbitecture.

A tactor that. baa DOt. beeD conaidered in tbia paper but. wbicb will arrect. our algorithm choices to & &reat.

tXtent is the need to implemnt. .xten.sioDi to tbe horn clause (ormalism into LPS. Such extension.s u

negated condition elementa, naluable predicates, &Dd goala eausin& I/O or other side errects will be

necessar, it LPS ia to be usetul aa a Pl'Olrammilll lanluace in a wide yuiety ot applicatioDl~

13

Re'erene~

I. Ishida, Toru, Salntore J. Stolto. Simultaneous Firing or Production Rules on Tree Structured Machines. Columbia Universit.y, New York City, March, 19S •.

2. Lowry, Andy, Stephen Taylor, Salvatore J. Stolto. LPS Algorithms: A Detailed Examination. Columbia Uninrsity, New York, NY 10021, Much, 199.f.

3. Stolro, S. J. and Shaw, D. E. -DADO: A Tree-Structured Machine Architecture For Production Systems.- Proceeding. 0/ the N4litmtU Ctm/erence em Arli/icitU Intelligence Vol. 1 (August 19S2) .

•• Stolro, S. J., Miranker, D. and Shaw, D. E. Architecture and Applications or DADO, A Large-Scale Panllel Computer ror Artificial Intelligence. Proceedinp 01 the Eighth International Joint Conlerence on Artificial Intemaence, International Joint. Conterences on Artificial Intelligence. Inc .• Kularuhe, West Germany. August, 1083, pp. SSO-8S.f.

5. Taylor. S., Lowry. A., M&&uire. G. Q. Jr., Stolto, S. J. Losic Programming U!ing Pa.rallel AMociatin Operations. 19S4 International Sympoeium on Loaic Provamming, ALiantic City, February. 19S., pp. 58-68.

5. Taylor, Stephen, Andy Lowry, G. Q. M&&uire Jr., Saluto" J. Stollo. AnalYling Prolog Programs. Columbia University, New York, NY 10021, Much. 199.f.

1. Taylor, S., C. Maio, S.J. Stollo, D.E. Shaw. ProlOC On The DADO Machine: A Parallel System lor High-Speed Logic Programming. Third Annual Intern&tional Phoenix Conlerence On Computers And Communications. IEEE, March. 19S4.

8. Warren. D. H. D. Implementing Prolog· Compiling Predicate Logic Programs. Tech. Rept. D.A.I. 39/40, Department or Artificial Intelligence, Edinburgh University. May, 1977.