01 1024x768

01 1024x768



The iń the Wasi* ot'bot h progrnms and data siruelures in LISP: LISP Uanacron>n fT>r LlSt Processing. LISP pcovidcs a pa^nful set of list-handling functions implcrocnttd intemalK as linkcd poi mer siructurcs. t-ISP givcs programmers ihe fuli power and gcocr* altt> of linkod data structures whilc frecing ihcm from tlić responsibility for explicxd) managing poinicrs and pointer operałions.

Onginally. LISP was a compact languagc. consisting of lunet ions for constructng and accessing lists. defining nos functions. dctecting eciuality. and cvaluating cxpreisioM. The onł> mcans of program control w ere rccursion and a single condif ional. Morę eotnplt-cated functions. when nccdcd. were defined in terms of thcsc primitivcs. Through linie, ihc best of these ncw functions bccamc part of the languagc itself. This proces* of nutki-•ng the languagc by adding nov functions led to the dcvelopmcnt of numerous dialects of LISI* ottcti inctuding hundreds of spccializcd functions for data struci u ring. program cos troi. real and integer arithmctic. input output c I Ok cditing LISP functions. and tracing program cxecuiion. These dialects arc the vchiclc by which LISP has cvolvcd from a sita* ple and elegant thcorccical model of eomputing into a rich. powerful. and practical envi-ronment for building large software systems. Because of the prolifcration of carly LISP dialects. the Defense Adv*aneed Research Projects Agcncy in 1983 proposcd a standard dialcct of the languagc, known as Common LISP

Although Common LISP has cmcrgcd as the lingua franca of LISP dialects. a numher ofothcr dialects continuc to be widcly used. One of these is SCMEME, an elegant relhink-tng of LISP that has been used botki for Al devclopment and for tcaching the fundameaul concepts of eomputing. The dialeot we usc throughout our tcxt is Common L1SR

Selecting an Implementation Language_

As artifśeial Intel ligence has matured and dcmonstratcd its applicability to a rangę of practical problcms. its almosl exclusive reliance on LISP and PROLOG has diminished. The circumstances of software dcvclopmcnt. such as the need to easily interfacc with Icgacy codę. the usc of Al as module* of large. comentional programs. and the nced to eon form to dev elopment standard* imposcd Wy corporntc or govemment customcrs has led to the development of Al systems in a variety of language*. including Smali talk, C. and Java Nonethcless. LISP and PROLOG continuc to be important for prototyping acd dcvc 1 opment and an important part of any Al programmers skill set.

In addition. these languages havc scrvcd as proeing grounds for many of the feaws that continuc to be incorporatcd into modem programmi ng languages. Perhaps the bet cxamplc of this is the Jasa languagc. which profit* from its usc of dynamie binding. automat ie mcmory management, and olher features that were pioneered in Al languages. li sccms a* ihough the rest of the programming world is still trying to catclt up to the sta-dard* set by Al Languages. As this evolution continucs. knowlcdge of LISP. PROLOG, cr Smali talk and the programming tcchniques they cnablc will only inercase in value. We ar confidcnl that this will bc truć. whether you continuc to usc one of these classie Al Us* guage*. or find ytnirsclf programming in C++, Objcetivc C, Javu or one of their other ooo-petitors. dcscendants. or disiant cousans.

AN INTRODUCTION TO PROLOG

AU the objects ofhuman reason or iiufuiry may naturally be dirided into f*o tinds. to kił "Rdations ofIdeas " and "Matters of Faci."

—Dayid Hi mi . An łiu/uiiy Conceming Human Undersianding

The only way to rcctify our reasonings is to make them as tangible as those of the mathe-maticians. so that wv can find our error at a glance, and when there are disputes among persons we can sintply say, "let us calculate... to sec who Is riglii."

-UBM2. The Art ofDiscoverv

14.0 Introduction

Asa impłcmcntation of logie programming. PROLOG makes mam’ interes ing contnbo-oons 10 Al problem solving. These include its decłanuiw semantics. a mcans of dircctly rapressing problem relationships in Al. as well as wilh built-in unitkadoo. some high-powered tcchniqucs for panem matching and search. Wie address man>' of the important issues of PROLOG and logie programming in this ehapter.

In Scction 14.1 we present the basie PROLOG syntax and sevcral simplc programs. These programs dcmonstrate the use of the predkate calculus as a representation lam guage. We show how to monitor the PROLOG emironmem and demonstratc the usc of the cut with PROLOG's built in depth-ftrst search.

In Scction 14.2 we ereate abstract data types (ADTs) in PROLOG. Those ADTs faditdc stada, ąueues. and priority queue$. which are then used to build a produclion system in Scction 14.3 and to design contro) structures for the search algoritltms of Chaptcrs 3.4. and 6 in Scction 14.4. In Section 14.5 we create a pianwr. arter the materiał pre-sented in Scction 7.4. In Section 14.6 we introducc metapnedicates. predicarcs whosc domains of interpretntion are PROLOG iwprcssions ihcmschc*. For csamplc. atom(X) succccds if X is bound to an atom. Mcta-predicatcs niay be used for imposing óP*


Wyszukiwarka

Podobne podstrony:
pg076 Stretch fabrics Stretch lab*ics arn used for body conformmg garments. The degree ot stretch te
cover — -w CHRIS ROBERSON It holds tbe key to the mysteries ot tle ages, and mym wants itBGDKOF
3.4.3 Implementation The system design provides the architecture, components, modules, interfaces, a
h4398 READY-TO-READ (iby Cynthia Rylant lllustratcd by Carolyn BracKcn In the style ot Suęto Stcvons
milo 01 21 Regular Exerci»e No. 15 For ihc dcvcIopment ot iriceps, dcltoids. and smali ot the back.
MR293R19005 1 0D - 3nrn In the canr: ot ihe iear syncnioO, tłe winy panel ir.us-t bf: ffcLiited jc
MR293R19086 1 Part no. 77 01 407 419 In the SONHATCH II rangę only roof 77 01 407 419 i3 rec-oamend
I13 01 periodictable2 The Periodic Tobie of the Elements, in Picture; Periods Alkali Metals Gro
The numbers to the ńght ot the grapłn mdicate how many beads are in each row. w.
dpp35 everyone the importancc ot moderation in drinking. Spirits 1 havc proved to )ie disadvantageou
6 (383) FIGURĘ 15-20 Four sta ges in the origin ot an oxbov lakc. In (a) and (&), the meand
left1 What is a Design Pattorn? Design Patterns in Smalltalk MVC Describing Design Patterns The Cata

więcej podobnych podstron