Lynn H, STANFORD ARTIFICIAL INTELLIGENCE LABORATORY OPERATING NOTE 28,6. Quam and Whftflsld Dlffle

Size: px
Start display at page:

Download "Lynn H, STANFORD ARTIFICIAL INTELLIGENCE LABORATORY OPERATING NOTE 28,6. Quam and Whftflsld Dlffle"

Transcription

1 I i STANFORD ARTIFICIAL INTELLIGENCE LABORATORY OPERATING NOTE 28,6 STANFORD LISP 1,4 MANUAL by Lynn H, Quam and Whftflsld Dlffle C ABSTRACTl Thls manual des~rlbes the PDP-10 LISP 1,6 system drvelo~rd by the Stanford ArtIficlaI Intel ligenoe ProJeot, Thr manual Is not a tutorlal on LISP but 18 intended to rup~lement rwirtlng LISP tutor!als In order to Prapare one to undsrstand and use thls LISP system, ~ h f work s was sup~orted by the Advanced Research ProJeots Agency of the Department of Defense under Contract SD483, C The vfehe and conclusions oontalned In thls documant are those of the authors and should not be Interpreted as ne~essarll~ representhe the official pollcles, either erprersed or \mol/ed, of the AdVlnoed Researoh ProJects Agency or the U,S, Government,

2

3 PREFACE Thls manual is the result of 8rvrrrl relatlvrl~ mhor ohangrs and a d d l t l ~ n to ~ SAILON 28,41 It SUPer~rdrS and rgpi.~~s SAlLONS ir 4, 2882m4, and 41, The changes change8 in LISP and may br oumrnari~rd as fol lowst The rllocrtlon prooedure, and LISP lnltlallzrtfon have been ohangedl S.ctlonr 2,1 and 2,2. There are some new drbugglng fa61 l ltlrs in A P P I ~ ~ N ~ X rnd the fo~umantrtlon for some old ones has been out Into thr manual, The expandsd Appandlx F, cornpi ler has been revlsrd, and Is dasorlbed in r greatly

4

5 SAZLON 28,6 LISP 11 Tho STANFORD A,I, Ll8p 1,6 Syttem war orlu~rp(ly an rdrptet Ion of one drva lo~ad by the ~ r1 f t t6hl l I at M I Slnor 1966, that syrtrfn hrr bran Irr9olv rrwrlttrn by John Allrn and Lynn Quam, John R, A l 1 en Imp l amentad tho storago rrr l looatlon rvrtam whfoh makas f t ~oss\blr for tha u8rr to ahrnma the rlzar of the vat lour momory 8DatQS, He also derlgnrd and oodrd the rd I tor ALVINE, wrotr thr f Irst loadof Intarfaaa, and Qrnaral ly ma ntrlned and drbuflgod thr ryrtam, John Al lrn oontrfbutrd the ALVINE dooumrnt~tlon in ~ ~ ~ e n A, d l x ~ a rlyn l Mul llnt ha8 arrlrtrd In the ~ro~at8tlon of the' arerant adttlan,

6

7 TABLE OF CONTENTS CHAPTER 1.1 GuI~Q to the N ~ ~ I e e e e! e o e e o o a e p o v,. o e o o e, o, o lil 1.2 Guldr to the U~or wlth Another LISP S ~ l f Q ~ e e e e ~ e ~ e e e o e a a o o ~ e e,, o, ~ *, ~ fa2 o o o lei Culdr to Umful ~unotion* and Dooumont 1.4 ' < INTERACftVE USE OF THE SYSTEM e o, r e * e o o o e o o, e e o,,, 2 m i 2,1 ~ r ~ nthr o Systar,, e ~ O, ~, O ~ e ~ e ~ e., e.. O ;., e.. : e O ~pnolal T~lotyne Control Chrracter~o,,.,,,.,c, 2.1 6, LAMBDA E X P R E S S I O N S, e, e e e e, e e e, e e a o e a,, u, * e, u * e e 611 6,1 EXPRs and S U B R 8 ~ e ~ e e e e e. o. e q ~ e ~ e e ~ e a 6m2, ~, ~ o e, e ~ o 6,2 FEXPRa AND F S U B A s e e, m e e, o o e. e,,, ~ e e *, e, e o e e e,,, 6m2 6e3 LEXPR8 AN0 L S U B R ~ e, e,, e o e, o e a, o e e o, e *,, m,, e 6.4 M A C R O ~ e ~,, e o o, a o e e e o,,. o e e e e,, o e e e e o v e o e e o 6 ~ , EVALUATION OF S * E X P R E S S I O N S m, o, e, o v e e f i a e, e o e o o o e e e, 7-1

8 10, FUNCTIONS ON 10,i 6ulldln0 F~not~onr,,,~,~,,,,~,~,~10~1. l0,2 S-Ex~ress'fon ~rr~rnrnf in0 Funat 10,s S-Ex~rrsrfon Hodlf~ino F~notlonr,,,,~,.,,,.,,,,10.12 l0,4 S-Ex~rerslon Transformlna ~unotlone,,,,,,,,,,,.,10a S-Ex~rrssfon Ma~plng F~natIon8~~.,~.,,~,,,~.,~,,l0-4 10,6 SmEx~rrsa'fon F~notlona,,~,,,,,.,..,~,..10~6 10,7 Character List Transformlno ~un~tlonr,,,,,,.,~lb17 11, FUNCTIONS ON I D E N T I F f E R S,,, e e, e e e,, e e e ~ e v e e e ~ e ( i e,,, l l ~ l llel Pro~ert~ ~ 1 9 t 11,2 OBLIST 11.3 ~drntlflsr Creatln~ F~net~onr,~,~,~.,..,~~,~,, e FUNCTIONS ON N U M B E R S ~ e, r e e, e,, e e e, e e e e,, * e,,, e e e, m e l 2 ~ 1 l4,l F ile 14,2 Channel Nan0s,,,,,,~,,,~,~,,,~~,,,~,,,,~,,~,14~ I n ~ ~ t,. ~,,. ~, ~ ~, ~ ~ ~ ~ ~ ~ ~ ~, ~ ~., ~ 14e4 0 ~ t ~ ~ t e r c e e e e e 8 ~ e e e e e e, e ~ e e. e e e e * e a, e ~ ~., e 1 4 ~ 4 15,1 Exainlnr and De~o~ltt,~e~t~~~~~e~,,~,,,.,,.,,~,l5-2 APPENDIX A, APPENDIX 0, APPENDIX C, APPLNOIX D, APPENDIX Et APPENDIX F t APPENDIX G, APPENDIX H, APPENDIX I t ALVIN by John A l l e n c, e, c, e,, e e, e e, r,,, c, Am1 ERROR Bm1 MEMORY ALLOCATIONe,,,,,eee,e,,,,c,,c,,q,,,ta Cal GARBAGE COLLCCTION,,~~,~~,,~,,,,,,~,~,,I, Dm1 COMPILED FUNCTION LINKAGE AND ACCUMULATOR U S A C ~,, e,,,,, e,,, e,, e e e e e e, e, ~,,, e,,,, Em1 THE LISP C O H P I L E R,, e,, q e e, e e e t, e q e a l,, ~ e e F-1 THE LISP ASSEMBLER LAP,,,,,,,e,,qa,,ee.t, G-1 THE LOADER,,t,ee,..ee,,eeo,v.e,*ee,eteeee~, BIGNUHS - ARBITRARY PRECISION INTEGERS,,,,, Hm1 frl

9 APPENDIX J, A USER MODIFIABLE LISP SCANNER,v,,evfip,eeI, ~.1 APPENDIX K, S O S m L I N K, o, v v v e v. v, v v,,,, w,,,,. e e e, e Urn1 APPENDIX L, SOME DIFFERENCES BETWEEN THIS AND OTHER L I Q P S,, o e *, ~. * e, e e ~ ~, e e ~ e * *. e e e *. *.,. ~ l.11 APPENDIX Hc LISP DISPLAY PRlMITlVESvovee,env,,,vfiv.e*e, MI$ APPENDIX Nt T R A C E, e v e,. e e e v v. v e v e n v v e e, e,, w e e N-i bppen0ix 0, SMILE,~,~.~.,~..~.~.~,~~,~e.,e~e.ee,e,~,,~ 0.1 APPEND I X P CONSTRUCT I ON OF A LISP Dl SK-DECTAPE SYSTEM,, Pmp

10

11 CHAPTER 1 CHAPTER 1 INTRODUCTION Thlr manual 19 intended to rwolaln the lntrrrctlvr LlSP 1,6 system whloh has born d ~ v r l o ~ for ~ d the PDP-10 at the stanford un!vrtrity ~rtlflolal Into l l torno. ProJeot, It /r arrumrd t h ~ t the trader lr frmillar with either romr other LISP rystom or the LISP 1.5 PRIMER by Clark WofssmanC2Jm Thr LISP 1,6 rvrt8m drser (bad ha8 rr a rubsrt moat bf the 9ratur.r and funotlonr of other LISP 185 syrfrn8. in addition, thrrr are naw ferturar such as an rrbltrrrv ~rrolr/~n Intr~er paoka~e, an Srner~rrtrlon rdltor, up to 14 actlvr 1n~ut.outdut ohannrlr, thr ablllty to oontrol thr rlze of mrmory,spapro 8 rtand8rd rr l ooat lng 1ord.r to l o&d arrrnb ly langurgr or comd led Thlr ryrtem use8 an lntrr~ratarl howrvrr, thaw 18 rlro a compl lar whlch Produoas machlnr coda. ~ b n led ~ l funotlona are appro~~mrtal~ 20 tlmrs as fast and trkm Ira8 nrmorv rpr~r, Thlr manual ir oroanlzrd In a functional manner, ~lrat the baslo data rfructurer are dract!brd! then the tunotlonr foi o~rrrtlnp on them, Tho a~prndicer rer rant more dotal led tnformrtlbn on the ayrtern, ltr lntorna l rtrueturr, thr comd ler, and rrvrrai auxf l hry e

12 SAILON 28,6 CHAPTER The who (s not ewpsr lenord wlth any LISP SYBCI~ 18 rdvlsrd to fol low the (nstructlons brlowt I) Become famlllrr wlth Welssmrn's LISP 1,6 PrlmerC23 or rbme Introductory LISP Manual. 2) Learn the dooument oonventtons (1,4), 3) Baoomr su~arflc~all~ famlllrr wlth LISP 1.6 idrntlflrir, 3 numbers and S-rxprrsslonr (Chapters 3,4, and 9); 4) Understand the moat uleful functlonrl Those ~ieoedrd by ewclrmat~on marks "!" In chrotrra 6 through 14, 5) Lawn how to drtlnr tunot~ons (6,1), 4) Learn how to lntsraot wtth LISP (Cha~tor 2), 7) Try some rxamplrr, WelsrmrnC13 has somr good 8) Laarn what other useful funutlans and fertuta8 ate 3 avallnbls t1,3), $,2 Gulde to the User Experlenord wlth Another LISP S~strm Thr user who has used another vlisp ry8tem 1s rdvlrrd to follow these Instruatlonat 3 3 2) Learn top l e v ~ l of LISP 1,6 is EVAL, not EVALQUOTE, 3) U I ~ DE, DF and DEFPROP for drflnlng funotlon8, ( ~ r ~ t l ol1,l)j n 4) Many tunctlonr dllfrr from those In other syatgrna, ~brt of these are noted In the Index, 9) The syntax of atoms IS dlfferrnt from other ry~trrns (cha~ters 3 and 4). 3 6) Learn how to lntrract with LISP (Chaotrr 21, 7) Try some exarn~lea. 8) Learn what other useful tunotlonr and?rrturrr are 3 available (i,s),

13 G SAILON 28.6 CHAPTER 1 1,3 Guldr to Umful Funatlons and Features C The tollowlng 1s n partfrl list of usatul traturer and tunotibnr 1,n LlSP 1,6 and what thry mhht be useful form 1) ALVINE (~~prnd!x A) u8rtul for odltlng tunctlon8 and manl~ulatln~ I/O flies, 2) READ ha8 romr very useful oontrol ohrrrotorr Mrttlon 14,s); 3) In~ut/Output (Chapter 14) I8 very fleilblr. 4) One orn oontro) error mrs8aga8 (Chr~tor 161, 5) Thrra Ir a LISP com~iler (Ap~lndlx F) whlah ornrrrter oodr that rung ~ D D ~ O N ~ twenty ~ ~ ~ Qtimer I Y r8 frat ru lntrrdrrtrd funottons, 6) Thrrr err aux)llrry t)ler on the dirk whloh are often uretulr I CJ t l lenamr, U ~ Q dooumant I SYS I TRACE trrolno tunofl~na ~ppandlx N and rrptd turn-around SOS and LISP ~odrndlx K I LISP,CORCS~DOCJ oorrrotlonr to thlr nanua l 7) One aan load and Ilnk LISP to amernbly and Fortpan eompllrd proqfam8. See Appondlr H, 0) One oan have f 1 1 as automat 1 or 1 l y 1 oaded by urr Q( the lorded INIT,LSP whlch is rutomrt~orlly on entry,

14 In the degcrlptlon of datr atructurrs, tho fol notatlonrl oonvrntlon8 wlll be urad, raprrsrnts a 3 6 m b l t word in FREE STORAGE wl th 2 18lbl t polntorr, - m O l W ~ w w W w ~ ~ m W ~ r l I I I I 1 NIL I * rr~rorrntr the lrrt word in r Ilst, w r ~ m a ~ m v ~ v w ~ ~ ~ r - ~ r 36-blt word In I I VULL WORD SPACE. I I A r 1 lghtly modlf led form of BNF ir uard to drflnr r~ntar oqurtlonr, O~tlonal trrmti ara rurraundrd by ourl~ brrokrfs ( and 1, 1 4 Calllno Saaurnor Conventions C.1 l lna srpurnors to LISP funotlona are progentrd In S.rr~rrsslan form, with thr CAR of tha bdng the name of the tunotlon, An argument to a funotlon 18 rvnluated unlar~ that argunent I8 surrounded by quotes (n) In the arl llng rrquenoa dailnltlono Quotes morn that the function t m ~ l t o l t l QUOTE8 ~ that argument, 1,4,4 Other Convrntlonr (QUOTE " V V V 1s not rvaluatrd; ID la not rvrlurtrd, but V 1s 3 evaluatedo The blank oharaot0t' (ASCII 40) Ir lndlcatrd by "," whcln appro~rlate for ~ l a r h ~, A spe~ia1 drgrre of utlltt~ or dlffleult~ notatlor! in the left rnrroln 18 u8rd to lnd1eatr the of each 8rotlon of thlr manuall 3 3

15

16

17 CHAPTER 2 CHAPTER 2 INTERACTIVE USE OF THE SYSTEM 2,l U11ng tha System Tho followlno dlalog shows how to lo9 into tho the-8harlng ry8tam, atart the LISP r~strm, and Interact wlth the top lrvrl at ISP, ~ l n r ~ brglnnlno with ~orlod arr ty~ad by the user to the t 'f mrrn8hrr1no rystrmt rnd the llnrs boglnnlno with artrrtsk rrr ty~od to LISP, Thr rymbol <or) r~aoltlrr ~arrlfage-raturn, and mrrnr altmodr,,r LISP FREE STORAGE a <or> Thls 20K of S ~ O ~ ~ Q O Inatead of tho ururl FULL WORDS <or> Thls glvas tho dofault value. Cj of 5K, BIN, PROC, SP, Thlg glvrs 12K of ~lnrry ~iogram sirarc and ends tho rlloortlon, For a full dlrcu~don of rl locrtfon aae Ap~andlx C, A t thls ~olnt, after allooatlon and brforr anything rlar, the (110 LISP,LSP is raad from the 8ystom, Thfr define8 varlou8 maoror, G rrcrnt rddltlona to the syltrm, bootstta~ drflnltlona tor the?unctlonr in thr verlous aalf lordln~ utllltv Cllrr, Traoe, SOSLNK, LAP ate, In rddltlon, If there Is r by the name INIT',LSP In the user's dlrrctorl, it w l I I be loadrd too, Thlr the urrr to hava lnythln9 he laadod IY, T T and NIL alwa~s evaluate to thomrrlvor,.(quote ta B C)) <cprrlag~ return) (A c) Value of QUOTE G (CONS i (QUOTE A)) return) Numbars always evaluata to thomsolvoa and thus need not bo quoted, b ' <a long sequanoa of outout) Thls output urn be ruo~rrr~od with *O,

18 SAILON 28,6 CHAPTER 2 2bQ *!DEFPROP CDRQ (LAMBDA (L? (CDAR L) ) FEXPR) <car f fago CORQ e(cdrq CAR) <o&rrtagr roturn) (SUBR #addrrrs PNAHE (#fullword?) *(OE TWICE (NUMI (TIMES 2 NUM)) Coarrlr~a return) TWICE 2.2 S~aclal T ~ l r t ~ pcontrol r Chrtrotrrr Tho tlmr-shrrlng r~rten treat8 many eonsrol oharrotert In r~~olal ways. For r comolrtr d1rcusrlon of 00ntt~l ohrrrotrrr the PDPmle TIME SHARlNG MONITOR MANUAL. Brlrtly, the following rpuotal oontiol aharactrrs avo usod in LISP, Tr I c rt~~a III Dlu~lrv Wean I na CALL Control 2 I lnrtrrd Control i I lnrfrad Stop the Job and talk to tlmrm8harino ryrbrm, Supproas oonro la pilntout unti I rn Input ir ieauertod, DO I ote the rnt I to lndut I 1 na now be In9 Wmdr (Only vlth (DDTlN NIL)). stop the LISP t ntoi~totar rnd return oonfrol to hhe too I eve I of LISP, on I'Y offrctlva whrn LISP 18 asklng for conrolr input, Sae INITFN (161,

19 CHAPTER 3 IDENTIFIERS Identtflers are strings of characters ~ h l c h taken togsther rrprrsent a single atode auantlty, I i <comments> ::s<ascii 32) <any aeauence of chapactera not lncludlne line-feed> CIIna teed> <dellmlter> :r= 0) I ti3 1 3 <blank> I <altmode> I aarriaer-return I <Ilne-fwd> I <trb> I <formfeed> <any extended ASCII otha, than null and ASCII 176) <dlglt>l:= 0(11213(41516)7(8)9 <letter>::= <any character net a dlglt and not a drl!rnlter> <tdsntlfter>::= <letter> :t=<ldentlfler> <dlglt> 1;s / Ccharaoter> ::a <Identlfler>/<character> Identlflers are normally strings of characters brglnning wlth letter and followed by letters and dlglts, It is sowrtlrnes convsnlent to create identifiers whloh contaln dellmltrrs or brdn with dlglts, The use of the dellmltrr ''I" (sllrh) causq8 the to1 lowlna eharactey be taken 1 lteral IY, and tha slash itself 18 nqt part of the Identifier, Thus, /AB is the some PS AB i$ the same as /A/B, Comments are useful for allowlno destrlptlve text in ti lea which w l l l be completely Ignored when read, Comments also make it posslblr to extend atoms (Identltlrrs, strlngs and number$) aoross nine boundaries without any of the characters in the comment brooming part of the atom, ASCII 32 cannot be tyaed directl~ into LISP, In STOPGAP, 33 deslenatrs ASCII 32, on the llne ~rlnter and 111 displays, ASCII 32 prtnts as tl lde "'", ASCII 32 does not ~ r h on t telrty~rs, (See CHRCT In 14,1,4,) Exarr,~ 10s t A a FOObaz TIME-OF-DAY A102

20 SAILON 28,6 CHAPTER An idrntlfler 13 lnternall,~ rs~rrarnted a8 a dotted pair of the following formt wklch ir called an atom herder, Thus CDR of rn identlflrr 9lvea the pro~erty llat of the Idsntiflrr, but CAR of an ldrntlfler glvrs the ~olntrr , which if used PS ~n address w I I I oauae tan lllbqal memory refrrrncr, and an error messagq, An Identlfler I8 referred to in symbol l c eorn~utrt1on by the addreas of Its atom header, The property list of an ldentlflrr la a Ilat of ~riirt name, property value) rssoclated with that ident"filrr, The (pro~ert~ nornal klnde of propertbs whleh are found in ~ r o ~ e r t y 11stg are ~r lnt names, values, and funotlon def hi tions correspondtna tb Identif'lrrs, Every ldentltlrr has a ~ r l n t name (PNAME) on its property nlst, The ~rlnt name of an idrntlflrr is r list of full wordr, each oontatnlng five ASCII oharaotsrs, Examplea The Idrntltlrr TIME-OF-DAY would be lnltlrlly irpre8rntrd i s followsj 11w1w.10.Lw *--ww- mowv-1)1-1), atom * I I I ' I INILl headrr I,,,,I-,,I l*--l"--l l.,--l*--l means null or ASCII 0,

21 SAILON 28,6 CHAPTER When a value is rsslgned an idrntlfler, the ~rodrity name VA\UE Is put on the Identlflerts ~ r o ~ e r tlfrt y with props ty Value be ng a pointer vo a s~rtlal cell. The CDR of the s~sc f a1 cell (soretlmes 6.1 led VALUE oel I) holds the value of the idrntjfirr4 af~d the eddrrss of 4 s~eolal cell rernalns oonstont for that jdenttct~r unless REMPROPed to enable complied function, to dlrrotly reference the vdues of s~eclal varlablos, Global varlablrs and all varlrblrs bound In interpreted functlona atore thrlr values in speclal eel Is, The atom NIL has the f0l lowing form1 atom header ~ r o ~ e r tl13t y 3,2 The OBLIST In order that occurrences of ldentlfiers with the same ~ r l n t names have the same Internal address (and hen06 value), a a~aclal nlst whhh Is the VALUE of a global varlablr oalled OBLIST is used to rerne~ber all ldrntlflrrr whleh READ and some other function8 have seen. For the sake of searehlng efflelrnoy, thld list has two nevrlsr the first level contains sequentlally stored ~buokrts" vhloh are "hashedft into as a functlon of the ~ r l n t name of thr (dentltlrr. Each buokrt Is a llst of all dlrtln~t idrntiflera whloh have hrshrd into that buokrt, Thus, (CAR OBLIST) 1s the flrst buokrt, and (CAAR OBLIST) Is the Clrst fdentlifer of the flrst bucket. Syntax t rtr lngj t = "<any sequenae ot characters not containing ">"

22 SAILON 28.6 CHAPTER A strlng Is an arbltrary sequence of oharrctrrs rurroundod by double quotes and not contalnlno double ~uotes, ~trlngs are rrpr~srnted ldentlc~lly to ldrntlfbrs except that gtrfngg rrs not sutomatloall~ INTERNed on tho OBLIST. The doublr quotes qurroundjng strlnq8 actuall~ beeome part of the PRINT NAME of the atring unlike slashes In slarhfflsd tdenttflrr#,

23 CHAPTER 4 CHAPTER 4 NUMBERS There are two syntactic types of numbers: lntegrr and real, <number> 1:s (integer) 1 <real> 4,1 Integers Synttaxr < I ntegar) $ 1 (<8lan>l ~ <dlaita> (*) The global variable IBASE s~ecfftes the Inout radix tot fnteeers whlth are not fo(lowed by tt," Integers followed by are declral Integers, IBASE is Inlttallv = 8, Slmtlarlv, the globrl varlable BASE controls out~ut radix for Integers, If BASE 3 10 then Integers will Print with a foll~wlng ",", Unless the global va?lable &NOPOINT = T, Examalas wlth IBASE = 8 i' i There are three representatlon~ for inteeers depending on the numer lcal magnitude of the integer: INUh FIXNUM, and BIGNuM, ~ h d r ranges are as follows: INUF1 Inl <K K Is usually 2'16 F I XNUM c- INUMa are small Integers re~resented by ~olnters outsldr of the normal LISP addressing sdaoe, INUMs are addressrs in tha range K to , The lnum r~~resentstion for zero la a 8 2t18-K-1.

24 I NUM Reoresentatton FIXNUMs are reproranted by llrt structure of the tollowlna form: 2 Atom header where value Is the 2's com~lemrnt re~resentrtlon of tho fixed point r, BIGNUM~ are represented by l 1st struoturr of the fol lowln~ forms;

25 SAILON 28.6 CHAPTER S here NdI are ~osttfve 36 blt Integers ordered from least tb most slgniflc~nt, The value of a BICNUM 1s Note: BIGNUMs are not norm all^ a part of the interpreter, Apnsndlx H drscrlbes the pro~edures for lopdlng the BIGNUM Packagel Restrlctfonsr The radlx for real numbers I S always decimal, A real numbei x must be In the (ap~roxfmate) range: A real number has apdroxlmatsl~ eight signlflcant digits o) taccuracy. atom header.cz~i-m-cc- -wrrrrr-r-r-r-r -~"IcI-*.I)cI I -1 I I + IFLONUMI I * I value I 1 ---r I *----- I 1 -*----- I where value 1s in PDP-C/Ig 2's complernrnt fl~atlng ~olnt representatlono

26

27 CHAPTER 5 CHAPTER 5 S-EXPRESSIONS Syntax! the ldentlffer NIL is the ldrntlllrr whlch represrnts the e r n ~ t ~ list, 0,

28

29 CHAPTER 6 CHAPTER 6 LAMBDA CXPRESSIONS LAMBDA expressions provide the moans of conatruot/ng oornp~tatl,nal procedure^ (often called funotionsc or proceduros),hlch compute answers,hen values are asdgned to their paraseters, A LAMBDA expression can be bound to an ldentlllrr so that any referenee to that identlfter in functional context refers to the LAMBDA srpresslon, In LISP 1,6 there are several ty~er of tunctlon deflnltion whlch determine how arguments are bound to the LAMBDA exprersfon, The following Is a LAMBDA rx~resslont 1 (LAMBDA "ARGUMENT~LI ST" "B.OOYf0 LAMBDA defines D functlon by s~eclfy~no an ARGUMENT-LIST, which Is a Ilst.of identlflers (exce~t tor LEXPRg, see 6,3) and a BODY, khkh Is an S-expression, LAMBDA expressions may hnva no more than flvs arguments If they are to be aomplled. 'Examp l ear (LAMBDA NIL 1) thls LAMBDA expressian of no arguments alwa~s evaluates to one, (LABEL (LAMBDA ( X I (TIMES X XI) This LAMBDA e%dr~sslon Gom~UteS squat. of Its argument, If x is a number, Otherw18e an error will result, "LAMBDA-EXPR") LABEL orrates a temporary name ID for its LAMBDA axprrssibn, This makes It ~osslble to aonstruct reourslve functions wlth temporary names, e ; (DE REVERSE (L) ((LABEL REVEVSEI (LAMBDA (L M I (CON0 ((ATOM L) M) (7 (REVERSE1 (C6R L) (CONS (CAR L) MI))))) L NIL)) LAMBDA expressions are evaluated by nblndlngfl aotual argurents to dummy varfables of the LAMBDA expression, (see Chapter 14) then evaluatlng the body lnslde the LAMBDA expressron with the current dummy vartable blndlngs, However, actual arguments to LAMBDA expresslens are handled In a varlet^ of ways, Normal(Y, there Is a one-to-one correspondsnce between dummy variables and actual argufleflts, and the actual arguments are evaluated before they are

30 SAILON 2816 CHAPTER bo nd, However, there are three s~eolal forms QC f'unotlon daflnhlon wh 1 oh dltfrr In thrfr hsndllng of aotual argurnrnfs, I 6,i EXPRs and SUBR~ An EXPR 1s an ldsntlflrr whlch has a LAMBDA sxprrsrion on its ~roprrty ll8t with ~ r o ~ e rname t ~ EXPR, EXPRs are evaluated by blndlng th5r vrlurs of the actual ircluments to their ~oi~rlrpondfng dumry variables. DE (see 11,l) I8 useful for drtlnlng EXPRI, The oompllod form of an EXPR Is a SUBR, I (DE SQUARE (X) (TIMES X XI) (DE *MAX (X Y) (COND ((GREATERP X V) X) (T Y))? 6,2 FEXPRs and FSUBRs A FCXPR 1s an Identifier which has a LAMBDA ex~rrr8ion of an0 dummy variable on its ~roperty list with p r o ~ e r t name ~ CEXPR. FEXPRs are evaluated by bfndlng the aotual aroument llrt to the dummy varlablr wlthout evaluating any arguments, OF (see 11,1) Tr ~86ful for def Inlng FEXPRs, Thr aompl lrd form of an FEXPR is an FSUBR, (DF LISTQ (L) L) (LISTQ A (B) C) = (A (0) C) (LISTQ) NIL (OF DEFINE (L) (MAW (FUNCTION (LAMBDA (XI (PUTPROP (CAR X) (CAQR X) (QUOTE EXPR)))) L) (DEFINE (LEO (LAMBDA (X yl (OR (LESSP x y) (EQUAL X Y ) ) ) ) (GEQ (LAMBDA (X Y) (OR [CREATERP X Y) (EQUAL X Y))))) # 6,3 LEXPR~ and LSUBRs An LEXPR is an EXPR who80 LAMBDA e~~rerrlon ha, an atomic arguwent "Ilstw of the form: LEXPRs may take an arbltrar~ number of actual aroumentr whloh are evaluated and referred to by the s~eolrl funotlon ARG, ID /r bound vo the number of arguments whlch are passed, thr oom~llrd form of an LEXPR Is an LSUBR,

31 SAILQN 28,6 CHAPTER ARC returns the value of the Nth argument to an LEXPR. (DE MAX N (PRO6 (M) (SETQ M L (SETQ N (COND (GO L))) (MAX 1 1, ) = 4 (ARG N)) (SUB1 N)) ((ZEROP N) (RETURN MI) ((GREATERP (ARG N) M) (SETQ M (ARG N)))? SETARC sets the value of the Nth argument to V and returns V, A MACRO Is an Id~ntlfier whlch has a LAMBDA ex~ression of one dumry varlable on Its property llst Nth ~ r ~ P e name r t ~ MACRO, MACROS are evaluated by blndtng the list containing maero nrma and the actual argument list to the dummy varlrble, The body in the LAMBDA exoresston 18 evaluated and should result In another wexdandedav form, In the intrr~rrter, the expandad form is evaluatrd, In the eompller, the rx~anded form is c~rnplled, DM( ser 11,l) 1s useful tor detfnlng MACROS, 1) We could define CONS of an arbitrary number of arguments by! (DM CONSCONS (L) (COND ((NULL (CDDR L)) (CAOR L)) (T (LIST (QUOTE CONS) (CADR L) (CONS (QUOTE CONSCONS) (CDDR I.)))))) (CONSCONS A 8 C) would call CONSCONS with L a (CONSCONS A B C) CONSCONS then forms the llst (CONS A(C0NSCONS B C)), ~valuatlng this wlll again call CONSCONS wlth L = (CONSCONS C), CDNSCONS will tlnall~ return C, The effect of (CONSCQNS A E3 C) 1s then (CONS A (CONS B C)), 2) re aould deflne a tunctlon EXPAND which 1s more generally usqful for MACRO expansfon: (DE EXPAND (L FN) (COND ((NULL (CDR L)) (CAR L)) (T (LIST FN (CAR L) (EXPAND (CDR L) FN))))))

32 Then we oou(d define CONSCONSt (DM CONSCONS (L) (EXPAND (CDR L) (QUOTE CONS))) It should be noted that MACROs are more general than FEXPRs and LEXPRs, In fact the D ~ ~ V ~ Qdsfinltions U S can be re~laoed by the ~ollowlna MACROs: (DM LISTQ (L) (LIST (QUOTE QUOTE) (CDR L)))) (DM MAX (L) (EXPAND (COR L) (QUOTE #MAX))) (MAX A 0 C would exnand to! (*MAX A (*MAX B (+MAX C D))) #EXPAND and &EXPAND1 are MACRO rxpandlng Cunctlon8 usrd by PLUS, TIMES, etc, They are equivalent tot (DE *EXPAND (L FN) (*EXPAND1 (REVERSE (CDR L)) FN)) (DE *EXpANDi (L FN) (COND ((NULL (CDR L)) (CAR L)) tt (LIST FN (*EXPAND1 (CDR L) FN) (CAR L))))) Wlth PLUS defined as (DM PLUS (L) (*EXPAND LtQUOTE 4PLUS))) (PLUS A 0 C 0) ~xpands to: (+PLUS (*PLUS (*PLUS A 0) C) D)

33 SAILON 28,6 CHAPTER EVALUATION OF S-EXPRESSIONS Thls chapter desorlbes the heart of the LISP inter~retrr, the meohanfsm for svaluattng S-expressions, t (*EVAL E) (EVAL E) *EVAL and VAL (see 7,2) evaluate the value of th; S-ex~resslon E, Examp l as: (EVAL (LIST (QUOTE ADD11 3)) 8 4 The top level of LISP 1st (PROG NIL L (PRINT (EVAL (READ))) (TERPRI) (GO I.)) APPLY evaluates and binds eaoh S-expression In ARCS to the oorres~ondlng arguments of the functl~n FN, and returns the value of FN, See 7.2, 8~ r! (QUOTE "EW) (APPLY (FUNCTION APPEND) (QUOTE ((A B) (C Dl))) m (A 8 C D) the S-ex~resslon E without evaluatlnp it, (FUNCTION "FNV FUNCTION is the same as QUOTE fn the Inter~r6tar, In the eompller, FUNCTION causes the S-ex~resrlon FN to be eomdiled, but QUOTE generates an S-expreaslon aonstant, See *FUNCTION in 7,2 tor the specfal FUNIRG feature, The folnowing function def)nltlons lack some details but explain the essence of EVAL and APPLY, The A-LIST feature of these functions Is not shown, (DE FVAL (X) 'i (PROG (Y) (RETURN < * (CON0 ((NUMBERP X) X I but will be ex~lalned in 7,2, c ((ATOM X) (CON0 ((SETQ Y (GET X (QUOTE VALUE))) (CDR Y)) (T (ERR (QUOTE (UNBOUND VARIABLE)))))

34 SAILON 28,6 CHAPTER ((ATOM (CAR XI) (COND ((SETQ Y (GETL (CAR X) (QUOTE EXPR FEXPR MACRO)))) (COND UEQ (CAR Y) (QUOTE EXPR)) (APPLY (CADR Y) (MAPCAR (FUNCTION EVIL) (CDR X ((EQ (CAR Y) (QUOTE FEXPR) (APPLY (CADR Y) (LIST (CDR XI))) (T (EVAL (APPLY (CADR Y ) (LIST XI))))) ((SETQ Y (GET (CAR X) (QUOTE VALUE))) (EVAL (CONS (CDR Y) (CDR X)))) (7 (ERR (QUOTE (UNDEFINED FUNCTION)))))).3 (T (APPLY (CAR lo (MAPCAR (FUNCTION EVIL) (CDR %)))I (DE APPLY (FN ARGS) (COND ((ATOM FN) (COND ((GET FN (QUOTE EXPR)) (APPLY (GET FN (QUOTE EXPR)) ARCS)) (T (APPLY (EVAL FN) ARGS)))) ((EQ (CAR FN) (QUOTE LAMBDA)) (PROG (Z) (BIND (CADR FN) ARGS) (SETQ i! ( VAL (CADDR FN))) (UNBIND (CADR FN)) (RETURN Z))) (T (APPLY (EVAL FN) ARGS)?)) The functions BIND and UNBIND implement varlablr byndin98 described In the next sectlon, ar Thls seotton attempts to rxplaln the different ty~er of varlrblr blndln9s and the dlffrrrnos batween lntrr~rrter end oom~ let blndlnor, 7,1ri Bound and Free Ocaurrenoes An occurrence of a vrrlablr is r.bound ~~c~rrrnoe" if the varlrblr is tit variable In rny LAMBDA or PROG contalnfnu the ocourranor so lonp as thr ooourrenoe 19 not eontalnrd In a FUNCTIONAL ~rgusent whloh Is oontalnrd in the drflnfng LAMBDA or PROG, the deflnlng LAMBDA or PROC I8 the lnnrrmo8t LAMBDA or PRO6 whlch oontainr the varlablr in fts parrmstrr list, (LAMBDA (lo (TIMES X Y)) X has a bound ocqurrencee y hae r f ee opo~r engi, (LAMBDA (Y 2) (MA~CAR ~FUNETION (LAMBDA(%) (CONS x y ) ) ) ~ ) X and 2 hav only bound occutrena re Y 1, bound 8y the,uter LAMBDA an! tree in thr lnnrr, 3

35 j SAILON 28,6 CHAPTER * 7,1,2 Scope of Blndlng~ C vat l6b l e bound 1 n a LAHBDA or PROC i r d8f inad dur lng the dynarlc exroutlon of the LAMBDA or PROG, Frre of, - vrrlrbler are deffned if and only If rlthrr the varlrblr fa globally detlned or the varlable Is bound in any LAMBOA or PROG which dynamical ly eontrtns ooourrrnoe, A variable /r global ly d~flned If and only if it has r value at thr top iavpl of LISP, ~arlabir8 aan be global IY defined by SEtQ at the too In oom~llod functions, any varlable which 1s bound in a LAMBDA Or PRO6 and ha$ a free Ocourr~nor elsewhere must be SPECIAL (APPENDIX E), (LAMBDA (A B) (MApCAR (FUNCTION (LAMBDA (X) (CONS A XI)) 8)) The varlitble A whloh has a tree ocourrrnor muat be drolaied SPECIAL If the outer LAMBDA rx~rasrton 1s to be oompfled, * 7,1,4 Blndtno Mechanisms A l l varlrblrs In lntrr~teted functions, and SPECIAL varlrblrs In com~lled funotlons store their values in SPECIAL (or VALUE) L. Thrsr var lab les are bound at the entry to a LAMBDA or?roc8 by rrvlna thrlr prrvlous values on the SPECIAL pushdown llat and rtarlng their new values in the SPECIAL oells, A l l referenere to there var(ablrr are dlreotly to their SPECIAL cells, When the LAMBDA,or PROG. 1s rxltrd, the old values are restored from the SPECIAL purhdown 1 Irt, (_ In oom~lled funotlons~ all variables not dsalared SPECIAL rrs stored on the REGULAR ~ushdown list, and the SPECIAL ce l lr (If they exist) are not teferanced, # 7,2 The AmLIST and FUNARG Features.L The A-LIST which is usad in some LISP systems to Tmd~rmant rraurslvr varlablr blndlng!s dose here, but its aftrota are 8lWulated through a special A-LIST feature, The functions EvAL rnd APPLY al low an extra last argument to bb D I S S ~ ~ ~hloh 1s rlthrr it nlst of ~alrod Identif!etS and (Ilke an A-LIST) or nblndtna oontext PO 1 nter!', L In the case of an A-LIST second argument, EVAL and APPLY w! l I blnd the s~rolal cells of the variables in the A-LIST to their spec l f led va l uas,, raving the1 r ptevlous bindings on tha a~ea1al aurhdown I lat, When EVAL and APPLY rrturn, the vartablr btndlng~ are restored to thelr prevlous values,

36 SAILON 28,6 CHAPTER A "blndlng context polntrrff (BCP) is o potntar Into the SPECIAL PUSHDOWN LIST deglgnat In!J a v 1 ~ in var lab lr binding, When EVAL and APPLY reaelvr a BCP as thelr second aroumrnt, all SPECIAL (VALUE) CELLS are restored to the values t h y had ot the vlme BCP wa8 generatad, Th 1 r then oaures EVAL, and APPLY to pafetenor thrse var jab les In the bl ndlno context whleh oxi8ted,at the vlma of BCP genrratlon, Thls feature ~ r f m r r l Itti l ~ useful to Qrrvrnt varleble name confl lcts wh~n uslne EVAL, APPLY, and funot/onrl rrgurenta, wlth the A-LIST, when EVAL and APPLY rxk, the previous blndings arr reator~d, There are two ways to generate a BCPt It an FEXPR 1s defined wfth two rrgumrnts, than the srcbnd argument w l l l be bound to the SPECIAL PUSHDOWN LIST level at the tima the FEXPR Is called, The srcond way to genetote a BCP Is wlth *FUNCTION; #FUNCTION returns a Ilat of the following Form; (FUNARC FN + <BCP>) whrrr BCP Is tho SPECIAL PUSHDOWN LIST level at the t lmr *FUNCTION 1s 6.1 led, Whenever auah r funotlonal form 18 used in funotional qontaxt, all SPECIAL blndln08 rrr restored to the values they had at the tine *FUNCTION wag evaluatrd, When the functional argumrnt ha8 been AppLYed, the prsvtour blndln~s restored re with the A~.IsT, The use of FUNARGS Example using the BCP featurot Is dlsousrrd further by Robert SaundrrrCII, (OF EXCHANGE (L SPECPOL) (PROG(2) (SETQ t(eval (CAR L) SPECPDL)) (APPLY (FUNCTION SET) (LIST (CAR L) ( VAL (CADR L) SPECPDL) SPECPDL (APPLY (FUNCTION SET) (LIST (CADR L) t SPECPDL))) In thls rxrmplr, the uar of the extra argument SPECPDL has only one rffectr to wold confllcts between internal and external vrrlrbl'ea wlth names L and SPECPDL, (EXCHANGE L M) wlll eaus* the value8 of L and M to,br exahangod, he variable L In EXCHANGE ir not rrfaranord by the calls an SET*

1.- L a m e j o r o p c ió n e s c l o na r e l d i s co ( s e e x p li c a r á d es p u é s ).

1.- L a m e j o r o p c ió n e s c l o na r e l d i s co ( s e e x p li c a r á d es p u é s ). PROCEDIMIENTO DE RECUPERACION Y COPIAS DE SEGURIDAD DEL CORTAFUEGOS LINUX P ar a p od e r re c u p e ra r nu e s t r o c o rt a f u e go s an t e un d es a s t r e ( r ot u r a d e l di s c o o d e l a

More information

B y R us se ll E ri c Wr ig ht, DV M. M as te r of S ci en ce I n V et er in ar y Me di ca l Sc ie nc es. A pp ro ve d:

B y R us se ll E ri c Wr ig ht, DV M. M as te r of S ci en ce I n V et er in ar y Me di ca l Sc ie nc es. A pp ro ve d: E ff ec ts o f El ec tr ic al ly -S ti mu la te d Si lv er -C oa te d Im pl an ts a nd B ac te ri al C on ta mi na ti on i n a Ca ni ne R ad iu s Fr ac tu re G ap M od el B y R us se ll E ri c Wr ig ht,

More information

Chapter 15 Functional Programming Languages

Chapter 15 Functional Programming Languages Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,

More information

Basic Lisp Operations

Basic Lisp Operations Basic Lisp Operations BLO-1 Function invocation It is an S-expression just another list! ( function arg1 arg2... argn) First list item is the function prefix notation The other list items are the arguments

More information

Universitetet i Linköping Institutionen för datavetenskap Anders Haraldsson

Universitetet i Linköping Institutionen för datavetenskap Anders Haraldsson list functions TDDC65 Artificial intelligence and Lisp Lecture 2 in Lisp Recursion, symbols and lists (chapter 4, 5, 6 Haraldssons book) local variables and local functions recursion over sequences * patterns

More information

T e s t e xp re s s i o n B o d y o f i f E xi t F i g u re 1 - F l o w c h art o f th e i f s tate m M u l ti S tate m s i n th e i f B o d y : L ik

T e s t e xp re s s i o n B o d y o f i f E xi t F i g u re 1 - F l o w c h art o f th e i f s tate m M u l ti S tate m s i n th e i f B o d y : L ik MQL4 COURSE By Coders guru w w w. f orex -t sd. c om -6- Loops & Decisions Part 2 ---------------------------- We l c o m e t o t h e s ix t h l e s s o n in m y c o u r s e a b o u t M Q L 4. I h o pe

More information

SCO TT G LEA SO N D EM O Z G EB R E-

SCO TT G LEA SO N D EM O Z G EB R E- SCO TT G LEA SO N D EM O Z G EB R E- EG Z IA B H ER e d it o r s N ) LICA TIO N S A N D M ETH O D S t DVD N CLUDED C o n t e n Ls Pr e fa c e x v G l o b a l N a v i g a t i o n Sa t e llit e S y s t e

More information

The current topic: Scheme. Announcements. Numeric operators. Review: car, cdr, and cons

The current topic: Scheme. Announcements. Numeric operators. Review: car, cdr, and cons The current topic: Scheme! Introduction! Object-oriented programming: Python Functional programming: Scheme! Introduction Next up: Numeric operators, REPL, quotes, functions, conditionals Types and values

More information

13 Variables, Datatypes, and Search

13 Variables, Datatypes, and Search 13 Variables, Datatypes, and Search Chapter Objectives Chapter Contents Variables introduced Basic support for type systems Fundamental to search Creating and binding variables set let Depth-first search

More information

C o a t i a n P u b l i c D e b tm a n a g e m e n t a n d C h a l l e n g e s o f M a k e t D e v e l o p m e n t Z a g e bo 8 t h A p i l 2 0 1 1 h t t pdd w w wp i j fp h D p u b l i c2 d e b td S t

More information

Robot Programming with Lisp

Robot Programming with Lisp 4. More Functional Programming: Map/Reduce, Recursions Institute for Artificial Universität Bremen Outline 2 Mapping Mapping in functional programming is the process of applying a function to all members

More information

Magic Tutorial #S-1: The scheme command-line interpreter

Magic Tutorial #S-1: The scheme command-line interpreter Magic Tutorial #S-1: The scheme command-line interpreter Rajit Manohar Department of Computer Science California Institute of Technology Pasadena, CA 91125 This tutorial corresponds to Magic version 7.

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University (revised October 8, 2004) 1 Introduction The PCAT language (Pascal Clone

More information

Final Exam Review. CS 1428 Fall Jill Seaman. Final Exam

Final Exam Review. CS 1428 Fall Jill Seaman. Final Exam Final Exam Review CS 1428 Fall 2011 Jill Seaman 1 Final Exam Friday, December 9, 11:00am to 1:30pm Derr 241 (here) Closed book, closed notes, clean desk Comprehensive (covers entire course) 25% of your

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

Chapter 2: Problem Solving Using C++

Chapter 2: Problem Solving Using C++ Chapter 2: Problem Solving Using C++ 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common

More information

H ig h L e v e l O v e r v iew. S te p h a n M a rt in. S e n io r S y s te m A rc h i te ct

H ig h L e v e l O v e r v iew. S te p h a n M a rt in. S e n io r S y s te m A rc h i te ct H ig h L e v e l O v e r v iew S te p h a n M a rt in S e n io r S y s te m A rc h i te ct OPEN XCHANGE Architecture Overview A ge nda D es ig n G o als A rc h i te ct u re O ve rv i ew S c a l a b ili

More information

Adjusted/Modified by Nicole Tobias. Chapter 2: Basic Elements of C++

Adjusted/Modified by Nicole Tobias. Chapter 2: Basic Elements of C++ Adjusted/Modified by Nicole Tobias Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types

More information

Campus Sustainability Assessment and Related Literature

Campus Sustainability Assessment and Related Literature Campus Sustainability Assessment and Related Literature An Annotated Bibliography and Resource Guide Andrew Nixon February 2002 Campus Sustainability Assessment Review Project Telephone: (616) 387-5626

More information

Victims Compensation Claim Status of All Pending Claims and Claims Decided Within the Last Three Years

Victims Compensation Claim Status of All Pending Claims and Claims Decided Within the Last Three Years Claim#:021914-174 Initials: J.T. Last4SSN: 6996 DOB: 5/3/1970 Crime Date: 4/30/2013 Status: Claim is currently under review. Decision expected within 7 days Claim#:041715-334 Initials: M.S. Last4SSN: 2957

More information

I n la n d N a v ig a t io n a co n t r ib u t io n t o eco n o m y su st a i n a b i l i t y

I n la n d N a v ig a t io n a co n t r ib u t io n t o eco n o m y su st a i n a b i l i t y I n la n d N a v ig a t io n a co n t r ib u t io n t o eco n o m y su st a i n a b i l i t y and KB rl iak s iol mi a, hme t a ro cp hm a5 a 2k p0r0o 9f i,e ls hv oa nr t ds eu rmv oedye l o nf dae cr

More information

Assembly language programs are made up of statements. Each statement may be composed of constants, literals, names, mnemonics, operands, and comments.

Assembly language programs are made up of statements. Each statement may be composed of constants, literals, names, mnemonics, operands, and comments. CS221 Assembly Language Fundamentals : Irvine Chapter 3 While debug is good for writing very small programs and experimenting with memory, interrupts, and function calls, it is not very good for larger

More information

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0 VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...

More information

Models of Natural Language In modeling English (or another natural language) we ignore meaning and even grammar. That is, we ignore semantics.

Models of Natural Language In modeling English (or another natural language) we ignore meaning and even grammar. That is, we ignore semantics. Models of Natural Language In modeling English (or another natural language) we ignore meaning and even grammar. That is, we ignore semantics. Instead, we treat English as being the result of some random

More information

Introduction to Artificial Intelligence 人工智慧. Lecture 4 March 14, 2012 洪國寶

Introduction to Artificial Intelligence 人工智慧. Lecture 4 March 14, 2012 洪國寶 Introduction to Artificial Intelligence 人工智慧 Lecture 4 March 14, 2012 洪國寶 1 Outline Review Lisp (cont.) Search Methodologies Problem Solving as Search Properties of search methods 2 LISP LISP (LISt Programming):

More information

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays A First Book of C++ Chapter 2 Data Types, Declarations, and Displays Objectives In this chapter, you will learn about: Data Types Arithmetic Operators Variables and Declarations Common Programming Errors

More information

Lecture 03 Bits, Bytes and Data Types

Lecture 03 Bits, Bytes and Data Types Lecture 03 Bits, Bytes and Data Types In this lecture Computer Languages Assembly Language The compiler Operating system Data and program instructions Bits, Bytes and Data Types ASCII table Data Types

More information

C Primer. Fall Introduction C vs. Java... 1

C Primer. Fall Introduction C vs. Java... 1 CS 33 Intro Computer Systems Doeppner C Primer Fall 2016 Contents 1 Introduction 1 1.1 C vs. Java.......................................... 1 2 Functions 1 2.1 The main() Function....................................

More information

Lecture 4. Announcements:

Lecture 4. Announcements: Announcements: Lecture 4 HW1 posted on Saturday morning. We gave a little over a week. We are going to discuss relevant material over the next two lectures. Lab1 posted. But if you start doing it, you

More information

Dept. of CSE, IIT KGP

Dept. of CSE, IIT KGP Programming in C: Basics CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Types of variable We must declare the

More information

Data Structure. Lecture 3

Data Structure. Lecture 3 Data Structure Lecture 3 Data Structure Formally define Data structure as: DS describes not only set of objects but the ways they are related, the set of operations which may be applied to the elements

More information

Form & Function in Software. Richard P. Gabriel phd mfa

Form & Function in Software. Richard P. Gabriel phd mfa Form & Function in Software Richard P. Gabriel phd mfa Confusionists and superficial intellectuals... ...move ahead... ...while the deep thinkers descend into the darker regions of the status quo...

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

HD44780-Based LCD Modules. Introduction to the LM018L

HD44780-Based LCD Modules. Introduction to the LM018L HD44780-Based LCD Modules Hitachi LM018L 40 character x 2 lines Built-in LSI HD44780 controller +5volt single power supply Display Colour: Grey LM018L: Introduction Interfacing Display Pattern and Character

More information

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals: Numeral Systems Which number is larger? 25 8 We need to distinguish between numbers and the symbols that represent them, called numerals. The number 25 is larger than 8, but the numeral 8 above is larger

More information

PROBLEMS (Cap. 4 - Istruzioni macchina)

PROBLEMS (Cap. 4 - Istruzioni macchina) 98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary

More information

Introduction to the TI-83/TI-83+ and TI-84+ for College Algebra.

Introduction to the TI-83/TI-83+ and TI-84+ for College Algebra. Introduction to the TI-83/TI-83+ and TI-84+ for College Algebra. Turning it on and off: To turn the calculator on, press the ON key in the lower left corner. You should now see a flashing rectangle, the

More information

Microsoft Access 3: Understanding and Creating Queries

Microsoft Access 3: Understanding and Creating Queries Microsoft Access 3: Understanding and Creating Queries In Access Level 2, we learned how to perform basic data retrievals by using Search & Replace functions and Sort & Filter functions. For more complex

More information

198:211 Computer Architecture

198:211 Computer Architecture 198:211 Computer Architecture Topics: Lecture 8 (W5) Fall 2012 Data representation 2.1 and 2.2 of the book Floating point 2.4 of the book 1 Computer Architecture What do computers do? Manipulate stored

More information

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine 7 Objectives After completing this lab you will: know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine Introduction Branches and jumps provide ways to change

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 2: Basic Elements of C++

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with the basic components of a C++ program,

More information

Programming languages C

Programming languages C INTERNATIONAL STANDARD ISO/IEC 9899:1999 TECHNICAL CORRIGENDUM 2 Published 2004-11-15 INTERNATIONAL ORGANIZATION FOR STANDARDIZATION МЕЖДУНАРОДНАЯ ОРГАНИЗАЦИЯ ПО СТАНДАРТИЗАЦИИ ORGANISATION INTERNATIONALE

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY PROJECT MAC. Memorandum-M-352 July 21, 1967 ABSTRACT

MASSACHUSETTS INSTITUTE OF TECHNOLOGY PROJECT MAC. Memorandum-M-352 July 21, 1967 ABSTRACT MASSACHUSETTS INSTITUTE OF TECHNOLOGY PROJECT MAC Memorandum-M-352 July 21, 1967 To: From: Subject: Project MAC Participants Martin Richards The BCPL Reference Manual ABSTRACT BCPL is a simple recursive

More information

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Functional Programming. Functional Programming Languages. Chapter 14. Introduction Functional Programming Languages Chapter 14 Introduction Functional programming paradigm History Features and concepts Examples: Lisp ML 1 2 Functional Programming Functional Programming Languages The

More information

12 Lists and Recursive Search

12 Lists and Recursive Search 12 Lists and Recursive Search Chapter Objectives Chapter Contents Lisp processing of arbitrary symbol structures Building blocks for data structures Designing accessors The symbol list as building block

More information

Integer Multiplication and Division

Integer Multiplication and Division 6 Integer Multiplication and Division 6.1 Objectives After completing this lab, you will: Understand binary multiplication and division Understand the MIPS multiply and divide instructions Write MIPS programs

More information

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Digital Fundamentals

Digital Fundamentals Digital Fundamentals with PLD Programming Floyd Chapter 2 29 Pearson Education Decimal Numbers The position of each digit in a weighted number system is assigned a weight based on the base or radix of

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

ASCII CODES WITH GREEK CHARACTERS

ASCII CODES WITH GREEK CHARACTERS ASCII CODES WITH GREEK CHARACTERS Dec Hex Char Description 0 0 NUL (Null) 1 1 SOH (Start of Header) 2 2 STX (Start of Text) 3 3 ETX (End of Text) 4 4 EOT (End of Transmission) 5 5 ENQ (Enquiry) 6 6 ACK

More information

So far we have considered only numeric processing, i.e. processing of numeric data represented

So far we have considered only numeric processing, i.e. processing of numeric data represented Chapter 4 Processing Character Data So far we have considered only numeric processing, i.e. processing of numeric data represented as integer and oating point types. Humans also use computers to manipulate

More information

MLR Institute of Technology

MLR Institute of Technology MLR Institute of Technology DUNDIGAL 500 043, HYDERABAD COMPUTER SCIENCE AND ENGINEERING Computer Programming Lab List of Experiments S.No. Program Category List of Programs 1 Operators a) Write a C program

More information

Specifications of Paradox for Windows

Specifications of Paradox for Windows Specifications of Paradox for Windows Appendix A 1 Specifications of Paradox for Windows A IN THIS CHAPTER Borland Database Engine (BDE) 000 Paradox Standard Table Specifications 000 Paradox 5 Table Specifications

More information

URL encoding uses hex code prefixed by %. Quoted Printable encoding uses hex code prefixed by =.

URL encoding uses hex code prefixed by %. Quoted Printable encoding uses hex code prefixed by =. ASCII = American National Standard Code for Information Interchange ANSI X3.4 1986 (R1997) (PDF), ANSI INCITS 4 1986 (R1997) (Printed Edition) Coded Character Set 7 Bit American National Standard Code

More information

Programming Languages in Artificial Intelligence

Programming Languages in Artificial Intelligence Programming Languages in Artificial Intelligence Günter Neumann, German Research Center for Artificial Intelligence (LT Lab, DFKI) I. AI programming languages II. Functional programming III. Functional

More information

Programming Languages CIS 443

Programming Languages CIS 443 Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception

More information

Syntax and logic errors

Syntax and logic errors Syntax and logic errors Teacher s Notes Lesson Plan Length 60 mins Specification Link 2.1.7/p_q Learning objective Candidates should be able to: (a) describe syntax errors and logic errors which may occur

More information

«С e n tra l- A s ia n E le c tric - P o w e r C o rp o ra tio n», JS C

«С e n tra l- A s ia n E le c tric - P o w e r C o rp o ra tio n», JS C J o in t - s t o c k c o m p C E N T R A L - A S IA N E L E C T R IC P O W a n y E R C O R P O R A T IO N I n t e r n a l A u d i t P O L IC Y o f J o in t - S t o c k C o m p a n y C E N T R A L - A S

More information

Loop Example. CMPE 325 Computer Architecture II. Loop Solution. Loops in C. Improved Loop Solution. Loop Efficiency. Assembly Language (cont)

Loop Example. CMPE 325 Computer Architecture II. Loop Solution. Loops in C. Improved Loop Solution. Loop Efficiency. Assembly Language (cont) CMPE 325 Computer rchitecture II Cem Ergün Eastern Mediterranean University ssembly Language (cont) Loop Example Consider the code where array is an integer array with 100 elements Loop: g = g + [i] i

More information

The Clean programming language. Group 25, Jingui Li, Daren Tuzi

The Clean programming language. Group 25, Jingui Li, Daren Tuzi The Clean programming language Group 25, Jingui Li, Daren Tuzi The Clean programming language Overview The Clean programming language first appeared in 1987 and is still being further developed. It was

More information

Common C Errors. Compiled by: Leela Kamalesh Yadlapalli

Common C Errors. Compiled by: Leela Kamalesh Yadlapalli Common C Errors Compiled by: Leela Kamalesh Yadlapalli This document shows some of the common errors and warnings that you may encounter during this class. Always remember to use the Wall option if you

More information

10/24/16. Journey of Byte. BBM 371 Data Management. Disk Space Management. Buffer Management. All Data Pages must be in memory in order to be accessed

10/24/16. Journey of Byte. BBM 371 Data Management. Disk Space Management. Buffer Management. All Data Pages must be in memory in order to be accessed Journey of Byte BBM 371 Management Lecture 4: Basic Concepts of DBMS 25.10.2016 Application byte/ record File management page, page num Buffer management physical adr. block Disk management Request a record/byte

More information

Utility Software II lab 1 Jacek Wiślicki, jacenty@kis.p.lodz.pl original material by Hubert Kołodziejski

Utility Software II lab 1 Jacek Wiślicki, jacenty@kis.p.lodz.pl original material by Hubert Kołodziejski MS ACCESS - INTRODUCTION MS Access is an example of a relational database. It allows to build and maintain small and medium-sized databases and to supply them with a graphical user interface. The aim of

More information

Enterprise Data Center A c h itec tu re Consorzio Operativo Gruppo MPS Case S t u d y : P r o g et t o D i sast er R ec o v er y Milano, 7 Febbraio 2006 1 Il G r u p p o M P S L a B a n c a M o n t e d

More information

Primitives and Arithmetic

Primitives and Arithmetic CS106A, Stanford Handout #29 Fall, 2004-05 Nick Parlante Primitives and Arithmetic Objects vs. Primitives Types in Java are divided into two camps: objects and primitives. Objects are relatively complex

More information

Introduction. What is an Operating System?

Introduction. What is an Operating System? Introduction What is an Operating System? 1 What is an Operating System? 2 Why is an Operating System Needed? 3 How Did They Develop? Historical Approach Affect of Architecture 4 Efficient Utilization

More information

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) Subject Description: This subject deals with discrete structures like set theory, mathematical

More information

8051 Programming. The 8051 may be programmed using a low-level or a high-level programming language.

8051 Programming. The 8051 may be programmed using a low-level or a high-level programming language. 8051 Programming The 8051 may be programmed using a low-level or a high-level programming language. Low-Level Programming Assembly language programming writes statements that the microcontroller directly

More information

The IC Language Specification. Spring 2006 Cornell University

The IC Language Specification. Spring 2006 Cornell University The IC Language Specification Spring 2006 Cornell University The IC language is a simple object-oriented language that we will use in the CS413 project. The goal is to build a complete optimizing compiler

More information

MULTIPLE COMPUTER NETWORKS AND INTERCOMPUTER COMMUNICATION. Lawrence G. Roberts Advanced Research Projects Agency Washington, D. C.

MULTIPLE COMPUTER NETWORKS AND INTERCOMPUTER COMMUNICATION. Lawrence G. Roberts Advanced Research Projects Agency Washington, D. C. MULTIPLE COMPUTER NETWORKS AND INTERCOMPUTER COMMUNICATION Lawrence G. Roberts Advanced Research Projects Agency Washington, D. C. There are many reasons for establishing a network which allows many computers

More information

Quiz for Chapter 3 Arithmetic for Computers 3.10

Quiz for Chapter 3 Arithmetic for Computers 3.10 Date: Quiz for Chapter 3 Arithmetic for Computers 3.10 Not all questions are of equal difficulty. Please review the entire quiz first and then budget your time carefully. Name: Course: Solutions in RED

More information

Number Systems, Base Conversions, and Computer Data Representation

Number Systems, Base Conversions, and Computer Data Representation , Base Conversions, and Computer Data Representation Decimal and Binary Numbers When we write decimal (base 10) numbers, we use a positional notation system. Each digit is multiplied by an appropriate

More information

C programming. Intro to syntax & basic operations

C programming. Intro to syntax & basic operations C programming Intro to syntax & basic operations Example 1: simple calculation with I/O Program, line by line Line 1: preprocessor directive; used to incorporate code from existing library not actually

More information

1) String initialization can be carried out in the following ways, similar to that of an array :

1) String initialization can be carried out in the following ways, similar to that of an array : Strings in C : Overview : String data type is not supported in C Programming. String is essentially a collection of characters to form particular word. String is useful whenever we accept name of the person,

More information

Solution for Homework 2

Solution for Homework 2 Solution for Homework 2 Problem 1 a. What is the minimum number of bits that are required to uniquely represent the characters of English alphabet? (Consider upper case characters alone) The number of

More information

i n g S e c u r it y 3 1B# ; u r w e b a p p li c a tio n s f r o m ha c ke r s w ith t his å ] í d : L : g u id e Scanned by CamScanner

i n g S e c u r it y 3 1B# ; u r w e b a p p li c a tio n s f r o m ha c ke r s w ith t his å ] í d : L : g u id e Scanned by CamScanner í d : r ' " B o m m 1 E x p e r i e n c e L : i i n g S e c u r it y. 1-1B# ; u r w e b a p p li c a tio n s f r o m ha c ke r s w ith t his g u id e å ] - ew i c h P e t e r M u la e n PACKT ' TAÞ$Æo

More information

Data types. lecture 4

Data types. lecture 4 Data types lecture 4 Information in digital computers is represented using binary number system. The base, i.e. radix, of the binary system is 2. Other common number systems: octal (base 8), decimal (base

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Exam Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) The JDK command to compile a class in the file Test.java is A) java Test.java B) java

More information

Writing Portable Programs COS 217

Writing Portable Programs COS 217 Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

Arithmetic Processing. Basic Fixed Point NRS. Number Representation. Digit Values. Rule of Interpretation CS/EE 5830/6830 VLSI ARCHITECTURE

Arithmetic Processing. Basic Fixed Point NRS. Number Representation. Digit Values. Rule of Interpretation CS/EE 5830/6830 VLSI ARCHITECTURE CS/EE 5830/6830 VLSI ARCHITECTURE Chapter 1 Basic Number Representations and Arithmetic Algorithms Arithmetic Processing AP = (operands, operation, results, conditions, singularities) Operands are: Set

More information

Data Integrator. Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA

Data Integrator. Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA Data Integrator Event Management Guide Pervasive Software, Inc. 12365-B Riata Trace Parkway Austin, Texas 78727 USA Telephone: 888.296.5969 or 512.231.6000 Fax: 512.231.6010 Email: info@pervasiveintegration.com

More information

Primitive Data Types Summer 2010 Margaret Reid-Miller

Primitive Data Types Summer 2010 Margaret Reid-Miller Primitive Data Types 15-110 Summer 2010 Margaret Reid-Miller Data Types Data stored in memory is a string of bits (0 or 1). What does 1000010 mean? 66? 'B'? 9.2E-44? How the computer interprets the string

More information

UPPAAL tutorial. Timed Automata in UPPAAL. What s inside UPPAAL The UPPAAL input languages (i.e. TA and TCTL in UPPAAL) Location Invariants

UPPAAL tutorial. Timed Automata in UPPAAL. What s inside UPPAAL The UPPAAL input languages (i.e. TA and TCTL in UPPAAL) Location Invariants UPPAAL tutorial What s inside UPPAAL The UPPAAL inut languages (i.e. TA and TCTL in UPPAAL) 1 Timed Automata in UPPAAL Clock Assignments Location Invariants Variable Assignments n x=5, y>3 clock

More information

School of Informatics, University of Edinburgh

School of Informatics, University of Edinburgh CS1Ah Lecture Note 5 Java Expressions Many Java statements can contain expressions, which are program phrases that tell how to compute a data value. Expressions can involve arithmetic calculation and method

More information

QUERYING THE COMPONENT DATA OF A GRAPHICAL CADASTRAL DATABASE USING VISUAL LISP PROGRAM

QUERYING THE COMPONENT DATA OF A GRAPHICAL CADASTRAL DATABASE USING VISUAL LISP PROGRAM University 1 Decembrie 1918 of Alba Iulia RevCAD 16/2014 QUERYING THE COMPONENT DATA OF A GRAPHICAL CADASTRAL DATABASE USING VISUAL LISP PROGRAM Caius DIDULESCU, Associate Professor PhD eng. - Faculty

More information

CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles CS 16: Assembly Language Programming for the IBM PC and Compatibles First, a little about you Your name Have you ever worked with/used/played with assembly language? If so, talk about it Why are you taking

More information

6.096 Lab 1. Due: 7 January 12:30:00. September 20, 2011

6.096 Lab 1. Due: 7 January 12:30:00. September 20, 2011 6.096 Lab 1 Due: 7 January 1:30:00 September 0, 011 1 Additional Material 1.1 Constants A constant is an expressions with a fixed value. Kinds of constants: Literals: used to express particular values

More information

ARM instruction set. ARM versions. ARM assembly language

ARM instruction set. ARM versions. ARM assembly language ARM instruction set ARM versions. ARM assembly language. ARM programming model. ARM memory organization. ARM data operations. ARM flow of control. ARM versions ARM architecture has been extended over several

More information

STEEL PIPE NIPPLE BLACK AND GALVANIZED

STEEL PIPE NIPPLE BLACK AND GALVANIZED Price Sheet CWN-616 Effective June 06, 2016 Supersedes CWN-414 A Member of The Phoenix Forge Group CapProducts LTD. Phone: 519-482-5000 Fax: 519-482-7728 Toll Free: 800-265-5586 www.capproducts.com www.capitolcamco.com

More information

1. Oblast rozvoj spolků a SU UK 1.1. Zvyšování kvalifikace Školení Zapojení do projektů Poradenství 1.2. Financování 1.2.1.

1. Oblast rozvoj spolků a SU UK 1.1. Zvyšování kvalifikace Školení Zapojení do projektů Poradenství 1.2. Financování 1.2.1. 1. O b l a s t r o z v o j s p o l k a S U U K 1. 1. Z v y š o v á n í k v a l i f i k a c e Š k o l e n í o S t u d e n t s k á u n i e U n i v e r z i t y K a r l o v y ( d á l e j e n S U U K ) z í

More information

2) Write in detail the issues in the design of code generator.

2) Write in detail the issues in the design of code generator. COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage

More information

C Compiler Targeting the Java Virtual Machine

C Compiler Targeting the Java Virtual Machine C Compiler Targeting the Java Virtual Machine Jack Pien Senior Honors Thesis (Advisor: Javed A. Aslam) Dartmouth College Computer Science Technical Report PCS-TR98-334 May 30, 1998 Abstract One of the

More information

Lecture 22: C Programming 4 Embedded Systems

Lecture 22: C Programming 4 Embedded Systems Lecture 22: C Programming 4 Embedded Systems Today s Goals Basic C programming process Variables and constants in C Pointers to access addresses Using a High Level Language High-level languages More human

More information

Chapter 7D The Java Virtual Machine

Chapter 7D The Java Virtual Machine This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

More information

C AND C++ PROGRAMMING

C AND C++ PROGRAMMING C AND C++ PROGRAMMING Bharathidasan University A Courseware prepared by University Informatics Centre Part I - Programming in C Getting Started This courseware is intended to be an introduction to C programming

More information

Introduction to Programming (in C++) Data types and visibility. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. Computer Science, UPC

Introduction to Programming (in C++) Data types and visibility. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. Computer Science, UPC Introduction to Programming (in C++) Data types and visibility Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. Computer Science, UPC Outline Data types Type conversion Visibility Introduction to

More information

WELCOME to UNIX/Linux II Shell Scripting OUTLINE 1. Parameters 2. Variables 3. Some commands 4. Control structures 5. getopts

WELCOME to UNIX/Linux II Shell Scripting OUTLINE 1. Parameters 2. Variables 3. Some commands 4. Control structures 5. getopts UNIX Operating Systems II Part 2: Shell Scripting Instructor: Stan Isaacs Shell Scripts Parameters/arguments - what s on the input line Control structures for - repetition if then else - conditional execution

More information

Advanced Bash Scripting. Joshua Malone (jmalone@ubergeeks.com)

Advanced Bash Scripting. Joshua Malone (jmalone@ubergeeks.com) Advanced Bash Scripting Joshua Malone (jmalone@ubergeeks.com) Why script in bash? You re probably already using it Great at managing external programs Powerful scripting language Portable and version-stable

More information