AboutthelogicProgramminglanguage
Prologisbasedontheprocessingoffirst-orderpredicatecalculus,duetoitssimplegrammar,richexpressivenessanduniquenon-procedurallanguageThecharacteristicsofitareverysuitableforexpressinghumanthinkingandreasoningrules,whichhaswonthewidespreadinterestofartificialintelligenceresearchandapplicationdeveloperswhenitcameout.Особено навестоен -европейскиджапан, theprolylanguagehasbeenpoularizedinmanyApplicationFields, suchasrelationalDatabases, математикаллигични, абстрактнипроблемсивни, естествени езикови раздяла, и сексуални вещества.JapanalesolistEdPrologaStheCorelAnguageInitsFifft-GenerationComputErresearchPlanProposedIn1979.
ProloSactualeduductivereneseryingtechniqueBasedOnReverserules, ButTheReeRestricRestrictionsontheexpressionofrulesAndGoals.Съвместим с theSimplicityoftheductiver-ensinescontrolmechanismitself, itisdifficulttoApplyToComplexApplicationDomanains.
Thebasicconceptsoftheprologlanguage
ThebasicComponentOfTheprologlanguageiSthehornclause, expressInTheFefollowingForm:
∧∧∧p;
Intheprologlanguage, thehornclausetakeShreeformstheyRespectiveRepresentTheThreePartSofTheProblem-solvingDescriptionInreverseDuctiverysense: цели, правила и фактите.
Мишена
Itisexpressedasahornclausewithonlytheleftpart:
∧∧∧;
Thatis, inTheProloglanguage, thetargetformulaislimitedtobeexpressedastheconjunctionofatomicFormulas, andcannotbeanytextandorformformyform.
Правила
ExpressedAsatypicalhornclause:
∧∧∧p
ThisistenormalizedbruleusedInreverseDuctiversense, buttheleftpartoftheruleislimitedtotheconjunctionofatomicFormulas.По -скоро от това, че арбитражните wordsandorshapes.
Факти
ФактиareRepresentedAsacollectionFofcactelements, andeachfactelementisreprepresentedasahornclausewithonlytherightpart, thatis, asingleatomicformulap.ImplocicitConjunctiVerelations между Factelements.
AslongastheThreePartSofTheProbleMdeScriptionAreexpressEdInProlOlAgyage, ThereserinAningMechanismismhatsupportSprolySentencsencesWillautomaticatyPerforMrule-reanVerveDeDuctiveRiverysense и finallyGiveAnswers на базата.
BecauseThegoAlandTheleftPartOfTheRuleSarelImitedTotheConjunctionOfatomicFormulas, theSeatomicformulascanactivatemultiplerules (thereimplitorrelationsbetweentheserules)).Следователно, и Orgraphastabledbybyprolog'sdeDuctiveriverensingprocesshasanand-rerelationshipshathatalternateslayerbylayer.WithTheDownwardExpansionOfTheAndorGraph, aconsistentsolutiongraphwilleventialbeatual е формиран (търсен) и в основни продукти, които ще бъдат изхвърлени;.
Theatomicformulascontainedinthetargetaregardedassub-goals.Винаги, което еактивира от ъгъла-goalisinsertedIntotheand-orgraph, theatomicformulasontheleftoftherulebecomenewsub-goalsAndEnedectiveAneWrule; inthisway, с орефативация..
Характеристика
ThegrammaticalstructureofTheprologlanguageiSquitesimple, нотцестриращи се, че едро.Forexample, когато factsandrulesdescribetheaxiomsofacerinediscipline.Thentheproblemithepropositiontobeproved; когато factsandruleSdescribectistendataandRellationships, thentheproblemisadataqueryStatement; когато factsandruleSdescribecistenstatechangelaws, theentHeproblemisThetArgetate.Следователно, prolaganguageisanintelligentprogramminglanguage.
Theprologprogramhasnospecificrunningsequence, и TheSequenceOfrunningTheprogramiscarniedOtComplelyinAcdanceAnsenceWithmathamaticAllogeduction (DigestionMethod).ItisnotDetermined отpheprogrammermer.PrologisAdescriptivelanguagethatusesespecificmethodtodescribeaproblem, и течкомпортиратоутоматично findstheanswertotheproblem.Takeanextremeexample: whenthefactsandruleSarestabled, youonlyneedtotellitaceratequestion, anditwillautomaticatyfindtheanswer.
Therearenocontrolflowstatementssuchasif, случай и fornetheprologprogram.Undernormalcircummspances, programmersdonotneedtounderStandTherunningProcessOfTheProgram, само neeedtopayattiontowHetherTheDescriptionofTheProgramisCompherective.Въпреки това, prologalsoprovidessomethodsforcontrollingprogramflow, който arequitedifferentfromthoseinotherlanguagesganyganguages е.