Warren's AbsMtarcahcitn e LogiPcr ogramming EhuSdh apierdoi,t or KoichFiu rukawaJ,e an-Louis LFaesrnsaezn,dP oe reiraan,d D aviHd. D .W arren, associaetdei tors TheA rto fP rologA:d vancePdr ogrammiTnegc hniquLeeosn. S terlainngd EhuSdh api1r9o8,6 Fourth LogiPcr ogramminPgr:o ceedionfgt sh e InternatiCoonnafle rence (volu1ma ens2d ) e,d itbeydJ ean-LouLisa ss1e9z8,7 ConcurrePnrto loCgol:l ectPeadp er(sv olu1ma ensd2 )e.d itebdy E hud Shapiro1,9 87 LogiPcr ogramminPgr:o ceedionfgt sh Feift hI nternaCtonifoenraeanlnc de Symposiu(mv,o lu1m aensd2 )e.d itbedyR obeArt.K owalsakin dK enneth A.B owen1, 988 ConstrSaatiinstfa citnLio ogni Pcr ogrammiPnags.c vaaln H enten1ry9c8k9. Logic-BaKsendo wleRdegpree sentaetdiointb,ey Pd e tJearc ksHoannR ,e ichgaenldFt r,an vka nH annelen1.9 89 LogiPcr ogrammiPnrogc:e edinogtfsh Se ixItnhte rnatCioonnfaelr enecdei,t ed byG iorgLeivoi anMda uriMzartielol i1.9 89 Meta-ProgramimniL nogg iPcro grammineg.d itbyeH darv eyA bramsoann d M. H.R ogers.1 989 LogiPcr ogramminPgr:o ceedionfgt sh eN orAtmhe riCcoannf e(rveonlce umes1 a n2d) e.d itbeyEd w ingL uLska. n dR ossA .O verbee1k9.8 9 LogiPcr ogramminPgro:c eedinogfst he1 99N0o rtAhm ericaCno nference. editbeydS aumyDa ebraandy M anuHeelnn enegi19l9d0o . LogiPcr ogramminPgr:o ceegdsio nft heS eveInntthe rnatiCoonnafle rence. editbeyDd a vHid.D .W arreann Pde ter S1z9e9r0e di. ThCer afotfP rolgo.R ichOa'rKde e1f9e9,0 Ecological Eco-LogLiocg:i c-BaAspepdr oachteos ModelliDnagv,i Rdo bert sonAl,a nB undyR,o bertM uetzelfMeladntd,Hy a ggiatnhMd,i ch ael Uschold, 1991 Warren's AbMsatcrhaicntAe :T utorial ReconsHtarsucsAtaiinlo- nK,a 1c9i9,1 WarrenA'bss traMcatc hine A TutorRieaclo nstruction HassAan'i t-Kaci The MIT Press Cambridge, Massachusetts Lond,o Enngland 10199M1a ssachusIentsttsi otfuT teec hnology Allri ghtrse servNeopd a.rto ft hbioso k mbaeyr eproduicnae nydf ormb ya ny photocopying, electroonrim ce chanimceaaln (si ncluding recordoirn g, illformatiosnt oraagnedr etrievawli)t hopuet rmisisnwiri toinngfro m the publisher. This book wass eitn C omputMeord em bthye a uthaonrdp rinteadn bdo unind the United SotfAma teerisc a. Library ofC ongreCsast aloging-in-PDuabtlai cation Ait-KaHcaiss.a 1n.9 54- Warrena'bss trmaaccth i:na e tutorrieaclo nstruIcHt iaosnAis ta·nK acl. p. e-m.(Lo gicp rogramming) Inclbuibdleiosg rarpehfiecraelan cneidsn dex. ISB0N· 262-0(1h12c3)I-.S9 B 0N- 262·5(p1b0k58.·)8 - 1.Pr ol(ogCo mpuptreogrlr aanmg uag2.eLo )g ic gprraommin3g..E lectronic digitcaolm puteIrTs..i tIlIeS..e ries. QA76.73.P761A93981 0036--d.c20 91-10776 CIP 11 MIT Pr ••• 0262510588 11111111111111 AIrKA CI WARRENSA BSTRACT Becautshee hya vseee n itg row ftrhosemt art. thimso deswto rki sd edicattoe:d EuesJ,a yNda,s sainmJd,u lieta form ucnhee deldo ve andt rustmie,n agl ways Nanie fotrr anquuniclo nditfioaniatl h anbde intgh ere Fori/des Flambertins fopre acmeofruniln gs andc onniwlhi'sipnergs gi�'mien sgom e answers Contents LisotfF igures ix SerieFosr eword xi Foreword xiii DavidH . DW.a rren Acknowledgments xv 1 Introduction 1.1 Exislittienrga ture 1 1.2Th istu torial 3 1.2D.i1s clanadim moetirv ation 3 1.2O.r2g anizatoifpon r esentation 4 2 Unification-aPnudrS ei mple 5 2.1T ermre presentation 5 2.2C ompiliqnuge ri£e0s 6 2.3C ompilipnrgo g£0r ams 9 2.4A rgumreengti sters 16 3 FlaRte solution 21 3.1F acts 22 3.2R ulanedsq ueries 22 4 Prolog 27 4.1En vironmpreontte ction 28 4.2Wh at'insa c hoipocei nt 30 5 OptimiztihngDe e sign 37 5.1H earpe presentation 37 5.2 Constantlsi,s antdans o,n ymovuarisa bles 39 5.3A notones eti nstructions 44 5.4R egiasltleocra tion 45 5.5Las t calolp timization 46 5.6C haruilne s 48 Contents viii 5.7 Environmterinmt ming 49 5.8 Stacvka riables 51 5.8.V1a riabbilned ianngdm emory layout 53 5.8.U2n safvea riables 54 5.8.N3e stesdt acrke ferences 58 5.9 Variablcel assifirceavtiisoint ed 60 5.01 Indexing 65 5.11 Cut 72 6 Conclusion 77 A Proloigna Nutshell 79 B The WAaMt a g lance 85 References 105 Index 109 LisotfF igures 2.1 Heapre presentaotfp(i Zo,nh (ZW,) I,( W». 7 2.2 Mo machiinnes tructfiooqrnu se ryt enns 9 2.3 Compilceodde f o£r 0q uery? -p(hZ(,ZW ,) I,( W». 10 2.4 Compilceodd feo £r0 p rogrpa(mf( X),h eIy(a,» ,Y ). 11 2.5 Thed eroepefr ation 12 2.6 Mo machiinnes tructfiooprnr so grams 13 2.7 The unify operation 15 2.8 M. instructionsf ovrari ablaer guments 18 2.9 Argumetrn egistfeorCrs .q uery? -P(Zh,( ZW,) ,I (W.» 19 2.10 Argumernetg istfeo£rr.s f act p(hfe(IYX(a,») ,,Y) . 19 3.1 M2 machicnodee f orurl ep( X,Y ): -q(XZ),r, ( ZY,) . 26 4.1 M3 choipcoei nintst ruction try..me_else 34 4.2 M3 choipcoein ti nstructrieotrny ...me_else 34 4.3 M3 choipcoei nitn structtirounst ..me 35 4.4 M3 codef oarm ulticpllaeu dseefi nition 36 5.1 Bettheera rpe presenftoattrei nnop n( Zh,( ZW,) I,( W» 38 5.2 Specialiiznesdt ructfioocrno sn stants 41 5.3 Specialiinzsetdru ctfioolrni ss ts 42 5.4 Specialciodzeef do qru ery? -p([ZZ,W, l f,( W». 42 5.5 Specialiczeodd feo fra cpt( f(X[)YI,,( aY)))., 43 5.6 Anonymouvsa riabilnes tructions 44 5.7 Instructfioofrna scp t( g_,( X1)(,Y.. ,-, » . 44 58. Bettreerg isutseefr o pr (XY,) : q-(XZ,) r,( ,ZY ). 46 5.9 M2 codef opr (XY,) : q-(XZ,) r,( ZY,) .wi,t LhC O 48 5.10E nvironmternitm micnogd e 52 5.11 Unsafceo dfeo P(r X): q-(YX,) r,( Y,X ). 55 5.12 Code foar : b-(XX,) c,.b ,y o urc lassification 62 5.13 Codef oar : -Xb)(c,.X ,b ,yW arren'csl assification 62 5.14 Delayteridm minfgo ar :b (-XX,) c,. 63 LisotfF igures x 5.15 Useldeeslsa tyriemdm ifnogar :- b(XX),c, . 64 5.16 Indexicnogd feo sru bseque8n1c e 70 5.17 Indexicnogd feo sru bseque8n4c e 71 S.18 Encodinogfc onc/3 72 SeriFeosr eword The logiprco gramminga pproactho c omputingi nvestigtahteue sseo fl ogci asa programmilannggu age ande xplorceosm putatimoondale blass eodn controdlleeddu ction. The fieldo fl ogipcro gramming hasse ena tremendogurso wtihn t he lassetv eraly ears.bo thi nd epth and ins cope.Th isg rowthi sre flectiend then umbeorf art iclejso.urn al.s thesesb.o oksw.o rkshoanpds .c onferences devotetdot hes ubjecThte. MIT Pressse rieis nlo gic programminwga s creatteoad c commodatteh diesv elopmaenndtt on urturiet .I ti sd edicated tot hep ublicaotfih oin gh-quteaxltibtooymk osn.o grapchosl.l ectiaonnds . proceediinnlg osg ipcrog ramming. EhuSdh apiro ThWee izmIannsnt iotSfuc tiee nce RehovIostr,a el
Description: