您好,欢迎访问三七文档
FromConcurrentLogicProgrammingtoConcurrentConstraintProgrammingFrankS.deBoerDepartmentofMathematicsandComputerScienceFreeUniversitydeBoelelaan1081,1081HVAmsterdam,TheNetherlandsfrb@cwi.nlCatusciaPalamidessiDipartimentodiInformaticaeScienzedell’Informazione(DISI)Universit adiGenovaviaBenedettoXV3,16132,Genova,Italycatuscia@di.unipi.itAbstractTheendeavortoextendlogicprogrammingtoalanguagesuitableforconcurrentsystemshasstimulatedinthelastdecadeanintensiveresearch,resultinginalargevarietyofproposals.Acommonfea-tureofthevariousapproachesistheattempttode nemechanismsforconcurrencywithinthelogicalparadigm,thedrivingidealbeingthebalancebetweenexpressivenessanddeclarativereading.Inthissurveywepresentthemotivations,theprincipallinesalongwhichthe eldhasdeveloped,thevariousparadigmswhichhavebeenpro-posed,andthemainapproachestothesemanticfoundations.1IntroductionAmongthevariousreasonswhichhavecontributedtothepopularityoflogicprogramming,oneistheopinionthatitisaninherentlyparallellan-guage,thereforesuitableforparallelanddistributedarchitectures.Thepurelanguagecanalreadyberegardedasamodelforparallelcomputa-tion:intheso-calledprocessinterpretation(vanEmdenanddeLucena1982;Shapiro1983),thegoalisseenasasystemofparallelprocesses.Thesingleprocessevolvesviaresolutionsteps;di erentclausalde nitionsforthesamepredicateprovidenondeterminismandthesharedvariablesamongprocessesrepresentcommunicationchannels.12ConcurrentLogicandConcurrentConstraintProgrammingHowever,inaconcurrentsystemprocessesinteractwitheachother1,henceaconcurrentlanguageshouldembodysomesynchronizationmecha-nismsandconstructstospecifythedependencyofchoicesupontheenvi-ronment.Furthermoreonceacertainchoiceisselected,theprocesscannotbacktrack.Thisprincipleisincontrastwiththekindofnondeterminismoflogicprogramming,accordingtowhichallpossiblesolutionsarepursued(don’tknownondeterminism).Sincemorethanadecadetherehasbeenanactivelineofresearchaimedatextendinglogicprogrammingwithmechanismsforconcurrency.1.1Don’tknowversusdon’tcarenondeterminismInconcurrentsystemsaprocesscannot‘undo’achoice,evenifitrevealstobewrong(forinstancebecausetheprocessgetsstuck).Thereasonisthatachoice,andtheactionsdoneafterwards,havealreadyin uencedtheenvironment:tomaintainconsistencythewholesystemshouldbacktrack,butthisistooine cient.Itisratherpreferabletoprovidethelanguagewithmechanismstocontrolthechoices,sotoavoidasfaraspossiblethatwrongdecisionsaretaken.Themostcommonsuchmechanismistheguard:aconditionassociatedwitheachalternativewhichistestedbeforeselectingthatalternative.Almostalltheconcurrentlogiclanguagesandconcurrentconstraintlanguagesadoptdon’tcarenondeterminism:clausesareprovidedwithaguardpartandaprocesschooses(commitsto)onlyoneclause,provideditsguardpartissatis ed.Thefewlanguageswhichmaintaindon’tknownondeterminism,thuspreservingthecharacteristicsoflogicprogrammingtocomputeallsolu-tions,areDistributedLogic(Monteiro1981,1982),thelanguageofGener-alizedHornClauses(Falaschietal.1984),DeltaProlog(PereiraandNasr1984)andthelanguagecc(#;!;))(Saraswat1986,1989).AndorraPro-log(HaridiandBrand1988;Haridi1990;HaridiandJanson1990,1991;Haridietal.1992)combinesdon’tcareanddon’tknownondeterminism.1.2SynchronizationandcommunicationmechanismsRoughly,asynchronizationmechanismspeci eswhenaprocesscanbeactivated.Inmanyconcurrentparadigmssynchronizationisinsymbio-siswithcommunication.Thisisthecasealsoinmostconcurrentlogiclanguages.Someofthe rstconcurrentlogiclanguages,theRelationalLanguage(ClarkandGregory1981),ConcurrentProlog(Shapiro1983,1986,1988),thelanguageofGuardedHornClauses(Ueda1987,1988)andPARLOG(ClarkandGregory1986;Gregory1987),enforcedsynchroniza-1Thedichotomysequentialprogramming/concurrentprogrammingiscloselyrelatedtothedistinctionbetweentransformationalsystemsandinteractive(orreactive)sys-tems,see(HarelandPnueli1985).FrankS.deBoerandCatusciaPalamidessi3tionbyintroducingadirectionalityonthecommunicationchannels.Inthisway,someprocessesareseenasproducers(ofbindings)onacertainvariable,othersasconsumers.Theadvantageofsuchasolutionisthattheresultinglanguageisquite‘faithful’tothe(parallel)executionmodeloflogicprogramming:onlytheuni cationmechanismneedstobemodi ed.Thekindofcommunicationmechanismdescribedaboveisasynchronous2,inthesensethattheprocessproducingabindingandtheprocesscon-suming(or,moreprecisely,testing)thebinding,performtheiractionsatdi erenttimes.Asoppositetothisprinciple,synchronouscommuni-cationrequiresthepartnerstoexchangetheinformationsimultaneously.ThislattermechanismhasbeenadoptedinDistributedLogic,GeneralizedHornClauses,DeltaPrologandthelanguageofCommunicatingClauses(JacquetandMonteiro1990,1991,1992).Aratherdi erentapproachtosynchronizationhasbeenproposedinP-Prolog(Yang1986;YangandAiso1986).Theideaistosuspendaprocessuntilenoughbindingsareproducedsothatthenumberofconsistentalternativesforthenextstepreducestoone.Thissolutionissemanticallyclean,inthesensethatitdoesnotmodifythedeclarativereadingofthelanguage.Ofcourse,thedisadvantageisthatonlydeterministicprocessescanbespeci edinthisway.Suchamechanism
本文标题:From Concurrent Logic Programming to Concurrent Co
链接地址:https://www.777doc.com/doc-6346521 .html