avram.info-2 286 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133
  1. This is avram.info, produced by makeinfo version 4.13 from
  2. avram.texinfo.
  3. This file documents the `avram' command which is a virtual machine code
  4. interpreter
  5. Copyright (C) 2000, 2003, 2006-2010, 2012 Dennis Furey Permission is
  6. granted to make and distribute verbatim copies of this manual provided
  7. the copyright notice and this permission notice are preserved on all
  8. copies.
  9. Permission is granted to copy and distribute modified versions of
  10. this manual under the conditions for verbatim copying, provided that
  11. the entire resulting derived work is distributed under the terms of a
  12. permission notice identical to this one.
  13. Permission is granted to copy and distribute translations of this
  14. manual into another language, under the above conditions for modified
  15. versions, except that this permission notice may be stated in a
  16. translation approved by the Free Software Foundation.
  17. 
  18. File: avram.info, Node: Command Line Parsing, Next: Execution Modes, Prev: Invocation, Up: Invocation
  19. 3.4.1 Command Line Parsing
  20. --------------------------
  21. A couple of functions declared in `cmdline.h' can be used to do all the
  22. necessary parsing of command lines and environment variables needed by
  23. virtual code applications.
  24. -- Function: list avm_default_command_line (int ARGC, char *ARGV[],
  25. int INDEX, char *EXTENSION, char *PATHS, int
  26. DEFAULT_TO_STDIN_MODE, int FORCE_TEXT_INPUT_MODE, int
  27. *FILE_ORDINAL)
  28. The purpose of this function is to build most of the data
  29. structure used by parameter mode applications, as described in
  30. *note Input Data Structure::, by parsing the command line
  31. according to *note Command Line Syntax::. The parameters have
  32. these interpretations.
  33. `ARGC'
  34. is the number elements in the array referenced by `ARGV'
  35. `ARGV'
  36. is the address of an array of pointers to null terminated
  37. character strings holding command line arguments
  38. `INDEX'
  39. is the position of the first element of `ARGV' to be
  40. considered. Those preceding it are ignored.
  41. `EXTENSION'
  42. is the address of a string that will be appended to input
  43. file names given in `ARGV' in an effort to find the
  44. associated files
  45. `PATHS'
  46. is the address of a null terminated character string
  47. containing a colon separated list of directory names that
  48. will be searched for input files
  49. `DEFAULT_TO_STDIN_MODE'
  50. is set to a non-zero value by the caller if the contents of
  51. standard input should be read in the absence of input files
  52. `FORCE_TEXT_INPUT_MODE'
  53. is set to a non-zero value by the caller to indicate that
  54. input files should be read as text, using `avm_load' (rather
  55. than `avm_preamble_and_contents', which would allow them to
  56. be either text or data). The `PREAMBLE' field of the returned
  57. file specifications will always be empty when this flag is
  58. set.
  59. `FILE_ORDINAL'
  60. is set to a pointer to an integer by the caller if only one
  61. file is to be loaded during each call. The value of the
  62. integer indicates the which one it will be.
  63. The result returned by this function is a list whose `head' is a
  64. list of file specifications and whose `tail' is a list of command
  65. line options intended for input to a virtual code application.
  66. The list of file specifications returned in the `head' of the
  67. result follows the same conventions as the `DATA' parameter to the
  68. function `avm_output_as_directed', except that the `head' of the
  69. `head' of each item is a list representing the time stamp of the
  70. file as given by `avm_date_representation'. If the file is
  71. standard input, then it holds the current system date and time.
  72. If the `FILE_ORDINAL' parameter is `NULL', then all files on the
  73. command line are loaded, but if it points to an integer N, then
  74. only the Nth file is loaded, and N is incremented. If there is no
  75. Nth file, a `NULL' value is returned as the entire result of the
  76. function. For a series of calls, the integer should be initialized
  77. to zero by the caller before the first call.
  78. If standard input is indicated as one of the files on the command
  79. line (by a dash), then it is also loaded regardless of the
  80. `FILE_ORDINAL', but a cached copy of it is used on subsequent
  81. calls after the first, so that the function does not actually
  82. attempt to reread it. If standard input is to be loaded, it must
  83. be finite for this function to work properly.
  84. The search strategy for files is described in *note Environment::,
  85. and makes use of the `EXTENSION' and `PATHS' parameters.
  86. In the list of command line options returned in the `tail' of the
  87. result, each item is a list with a non-empty `head' and `tail',
  88. and is interpreted as follows.
  89. * The `head' of the `head' is a list representing a natural
  90. number, as given by `avm_natural', indicating the position of
  91. the option on the command line relative to the initial value
  92. of the `INDEX' parameter.
  93. * The `tail' of the `head' is a list which is `NULL' in the
  94. case of a "short form" option, written with a single dash on
  95. the command line, but is a list whose `head' and `tail' are
  96. `NULL' in the case of a "long form" option, written with two
  97. dashes.
  98. * The `head' of the `tail' is a list representing a character
  99. string for the keyword of an option, for example `foo' in the
  100. case of an option written `--foo=bar,baz'.
  101. * The `tail' of the `tail' is a list of lists representing
  102. character strings, with one item for each parameter
  103. associated with the option, for example, `bar' and `baz'.
  104. If multiple calls to the function are made with differing values of
  105. `*FILE_ORDINAL' but other parameters unchanged, the same list of
  106. options will be returned each time, except insofar as the position
  107. numbers in the `head' of the `head' of each item are adjusted as
  108. explained in *note Input for Mapped Applications::.
  109. Any of the i/o errors or fatal errors associated with other file
  110. input operations are possible with this function as well. This
  111. non-fatal warning message is also possible.
  112. `PROGRAM-NAME: warning: search paths not supported'
  113. This error occurs if the library has been built on a platform that doesn't
  114. have the `argz.h' header file and the `PATHS' parameter is
  115. non-`NULL'.
  116. -- Function: list avm_environment (char *ENV[])
  117. This function takes the address of a null terminated array of
  118. pointers to null terminated character strings of the form
  119. `"variable=value"'. The result returned is a list of lists, with
  120. one item for each element of the array. The `head' of each item is
  121. a representation of the left side of the corresponding string, and
  122. the `tail' is a representation of the right.
  123. This function is therefore useful along with
  124. `avm_default_command_line' for building the remainder of the data
  125. structure described in *note Parameter Mode Interface::. For
  126. example, a virtual machine emulator for non-interactive parameter
  127. mode applications with no bells and whistles could have the
  128. following form.
  129. int
  130. main(argc,argv,env)
  131. ...
  132. {
  133. FILE *virtual_code_file;
  134. ...
  135. avm_initialize_lists();
  136. avm_initialize_apply();
  137. avm_initialize_rawio();
  138. avm_initialize_formout();
  139. avm_initialize_cmdline();
  140. virtual_code_file = fopen(argv[1],"rb");
  141. operator = avm_received_list(
  142. virtual_code_file,argv[1]);
  143. fclose(virtual_code_file);
  144. command = avm_default_command_line(argc,
  145. argv,2,NULL,NULL,0,0,NULL);
  146. environs = avm_environment(env);
  147. operand = avm_join(command,environs);
  148. result = avm_apply(operator,operand);
  149. avm_output_as_directed(result,0,0);
  150. avm_dispose(result);
  151. ...
  152. }
  153. The `avm_environment' function could cause the program to abort due
  154. to a memory overflow. For security reasons, it will also abort
  155. with an error message if any non-printing characters are detected
  156. in its argument. (See *note Other Diagnostics and Warnings::.)
  157. -- Function: void avm_initialize_cmdline ()
  158. This function initializes some local variables and should be called
  159. before any of the other functions in this section is called, or
  160. else their results are unpredictable.
  161. -- Function: void avm_count_cmdline ()
  162. This function should be called after the last call to any of the
  163. other functions in this section, as it reclaims some locally
  164. allocated storage. If the `avm_count_lists' function is used, it
  165. should be called after this one.
  166. 
  167. File: avram.info, Node: Execution Modes, Prev: Command Line Parsing, Up: Invocation
  168. 3.4.2 Execution Modes
  169. ---------------------
  170. Some functions declared in `exmodes.h' are useful for executing
  171. interactive applications or filter mode transducers in a manner
  172. consistent with the specifications described in the previous chapter.
  173. -- Function: void avm_interact (list AVM_INTERACTOR, int STEP_MODE,
  174. int ASK_TO_OVERWRITE_MODE, int QUIET_MODE)
  175. This function executes an interactive virtual code application. The
  176. parameters have these interpretations.
  177. `AVM_INTERACTOR'
  178. is the virtual code for a function that performs as specified
  179. in *note Output From Interactive Applications::.
  180. `STEP_MODE'
  181. will cause all shell commands to be echoed if set to a
  182. non-zero value, and will cause the program to pause after
  183. each shell command until a key is pressed.
  184. `ASK_TO_OVERWRITE_MODE'
  185. can be set to a non-zero value by the caller to cause the
  186. program to ask permission of the user to overwrite any
  187. existing files in cases where the virtual code returns a file
  188. list as described in *note Mixed Modes of Interaction::.
  189. `QUIET_MODE'
  190. can be set to a non-zero value to suppress console messages
  191. in the case of file output per *note Mixed Modes of
  192. Interaction::.
  193. The meaning of this function is accessible to any reader willing
  194. to slog through *note Output From Interactive Applications::. The
  195. only subtle point is that `AVM_INTERACTOR' parameter in this
  196. function does not correspond to the virtual code application that
  197. `avram' reads from a virtual code file, but to the result computed
  198. when the application read from the file is applied to the data
  199. structure representing the command line and environment.
  200. Any of the memory overflows or i/o errors possible with other
  201. functions in the library are possible from this one as well, and
  202. will also cause it to print an error message and halt the program.
  203. A badly designed virtual code application could cause a deadlock,
  204. which will not be detected or reported
  205. -- Function: void avm_trace_interaction ()
  206. This function enables diagnostic output for the
  207. `avm_recoverable_interact' function.
  208. -- Function: void avm_disable_interaction ()
  209. This function causes `avm_interact' and `avm_recoverable_interact'
  210. to terminate with an error instead of executing, as required by the
  211. `--jail' command line option.
  212. -- Function: list avm_recoverable_interact (list INTERACTOR, int
  213. *FAULT)
  214. This function is similar to `avm_interact' but always closes the
  215. pipe and performs no file i/o, and will return an error message
  216. rather than exiting. Otherwise it returns a transcript of the
  217. intereaction as a list of lists of strings represented as lists of
  218. character encodings. It implements the INTERACT combinator with
  219. the virtual code for the transducer function given as the
  220. parameter. A prior call to `avm_trace_interaction' will cause
  221. diagnostic information to be written to standard output when this
  222. function is executed.
  223. -- Function: void avm_byte_transduce (list OPERATOR)
  224. This function executes a filter mode byte transducer application,
  225. which behaves as described in *note Byte Transducers::. The
  226. argument is the virtual code for the application, which would be
  227. found in a virtual code file. There are limited opportunities for
  228. i/o errors, as only standard input and standard output are
  229. involved with this function, but fatal errors due to memory
  230. overflow are possible.
  231. -- Function: void avm_line_map (list OPERATOR)
  232. This function executes line mapped filter mode applications, which
  233. are explained in *note Line Maps::. The argument is the virtual
  234. code for the application. Similar comments to those above apply.
  235. -- Function: void avm_initialize_exmodes ()
  236. This function should be called before any of the other functions
  237. in this section in order to initialize some local variables.
  238. Results are undefined if this function isn't called first.
  239. -- Function: void avm_count_exmodes ()
  240. This function doesn't do anything in the present version of the
  241. library, but should be called after the last call to any of the
  242. other functions in this section in order to maintain compatibility
  243. with future versions, which may use it for cleaning up local
  244. variables.
  245. 
  246. File: avram.info, Node: Version Management, Next: Error Reporting, Prev: Invocation, Up: Library Reference
  247. 3.5 Version Management
  248. ======================
  249. The `avram' library is designed to support any number of backward compatibility
  250. modes with itself, by way of some functions declared in `vman.h'. The
  251. assumption is that the library will go through a sequence of revisions
  252. during its life, each being identified by a unique number. In the event
  253. of a fork in the project, each branch will attempt to maintain
  254. compatibility at least with its own ancestors.
  255. -- Function: void avm_set_version (char *NUMBER)
  256. This function can be used to delay the demise of a client program
  257. that uses the library but is not updated very often. The argument
  258. is a null terminated string representing a version number, such as
  259. `"0.13.0"'.
  260. A call to this function requests that all library functions revert
  261. to their behavior as of that version in any cases where the current
  262. behavior is incompatible with it. It will also cause virtual code
  263. applications evaluated with `avm_apply' to detect a version number
  264. equal to the given one rather than the current one. (See *note
  265. Version::.)
  266. The program will exit with an internal error message if any
  267. function in the library has already interrogated the version
  268. number before this function is called, or if it is passed a null
  269. pointer. This problem can be avoided by calling it prior to any of
  270. the `avm_initialize' functions with a valid address. The program
  271. will exit with the message
  272. `PROGRAM-NAME: multiple version specifications'
  273. if this function is called more than once, even with the same
  274. number. If the number is not recognized as a present or past
  275. version, or is so old that it is no longer supported, the program
  276. will exit with this message.
  277. `avram: can't emulate version NUMBER'
  278. Client programs that are built to last should allow the version
  279. number to be specified as an option by the user, and let virtual
  280. code applications that they execute take care of their own backward
  281. compatibility problems. This strategy will at least guard against
  282. changes in the virtual machine specification and other changes
  283. that do not affect the library API.
  284. -- Function: int avm_prior_to_version (char *NUMBER)
  285. This function takes the address of a null terminated string
  286. representing a version number as an argument, such as `"0.13.0"',
  287. and returns a non-zero value if the version currently being
  288. emulated predates it.
  289. If no call has been made to `avm_set_version' prior to the call to
  290. this function, the current version is assumed, and subsequent
  291. calls to `avm_set_version' will cause an internal error.
  292. The intended use for this function would be by a maintainer of the
  293. library introducing an enhancement that will not be backward
  294. compatible, who doesn't wish to break existing client programs and
  295. virtual code applications. For example, if a version `1.0' is
  296. developed at some time in the distant future, and it incorporates
  297. a previously unexpected way of doing something, code similar to
  298. the following could be used to maintain backward compatibility.
  299. if (avm_prior_to_version("1.0"))
  300. {
  301. /* do it the 0.x way */
  302. }
  303. else
  304. {
  305. /* do it the 1.0-and-later way */
  306. }
  307. This function will cause an internal error if the parameter does
  308. not match any known past or present version number, or if it is a
  309. null pointer.
  310. -- Function: char* avm_version ()
  311. This function returns the number of the version currently being
  312. emulated as the address of a null terminated string. The string
  313. whose address is returned should not be modified by the caller.
  314. If no call has been made to `avm_set_version' prior to the call to
  315. this function, the current version is assumed, and subsequent
  316. calls to `avm_set_version' will cause an internal error.
  317. 
  318. File: avram.info, Node: Error Reporting, Next: Profiling, Prev: Version Management, Up: Library Reference
  319. 3.6 Error Reporting
  320. ===================
  321. Most of the error reporting by other functions in the library is done by
  322. way of the functions declared in `error.h'. These function communicate
  323. directly with the user through standard error. Client programs should
  324. also use these functions where possible for the sake of a uniform
  325. interface.
  326. -- Function: void avm_set_program_name (char *ARGV0)
  327. The argument to this function should be the address of a null
  328. terminated string holding the name of the program to be reported
  329. in error messages that begin with a program name. Typically this
  330. string will be the name of the program as it was invoked on the
  331. command line, possibly with path components stripped from it. An
  332. alternative would be to set it to the name of a virtual code
  333. application being evaluated. If this function is never called, the
  334. name `"avram"' is used by default. Space for a copy of the program
  335. name is allocated by this function, and a fatal memory overflow
  336. error is possible if there is insufficient space available.
  337. -- Function: char* avm_program_name ()
  338. This function returns a pointer to a null terminated character
  339. string holding the program name presently in use. It will be
  340. either the name most recently set by `avm_set_program_name', or
  341. the default name `"avram"' if none has been set. The string whose
  342. address is returned should not be modified by the caller.
  343. -- Function: void avm_warning (char *MESSAGE)
  344. This function writes the null terminated string whose address is
  345. given to standard error, prefaced by the program name and followed
  346. by a line break.
  347. -- Function: void avm_error (char *MESSAGE)
  348. This function writes the null terminated string whose address is
  349. given to standard error, prefaced by the program name and followed
  350. by a line break, as `avm_warning', but it then terminates the
  351. process with an exit code of 1.
  352. -- Function: void avm_fatal_io_error (char *MESSAGE, char *FILENAME,
  353. int REASON)
  354. This function is useful for reporting errors caused in the course
  355. of reading or writing files. The message is written to standard
  356. error prefaced by the program name, and incorporating the name of
  357. the relevant file. The `REASON' should be the error code obtained
  358. from the standard `errno' variable, which will be translated to an informative
  359. message if possible by the standard `strerror' function and
  360. appended to the message. After the message is written, the process
  361. will terminate with an exit code of 1.
  362. -- Function: void avm_non_fatal_io_error (char *MESSAGE, char
  363. *FILENAME, int REASON)
  364. This function does the same as `avm_fatal_io_error' except that it
  365. doesn't exit the program, and allows control to return to the
  366. caller, which should take appropriate action.
  367. -- Function: void avm_internal_error (int CODE)
  368. This function is used to report internal errors and halt the
  369. program. The error message is written to standard error prefaced
  370. by the program name and followed by a line break. The code should
  371. be a unique integer constant (i.e., not one that's used for any
  372. other internal error), that will be printed as part of the error
  373. message as an aid to the maintainer.
  374. This function should be used by client programs only in the event
  375. of conditions that constitute some violation of a required
  376. invariant. It indicates to the user that something has gone wrong
  377. with the program, for which a bug report would be appropriate.
  378. -- Function: void avm_reclamation_failure (char *ENTITY, counter COUNT)
  379. This function is used only by the `avm_count' functions to report
  380. unreclaimed storage. The `COUNT' is the number of units of storage
  381. left unreclaimed, and the `ENTITY' is the address of a null
  382. terminated string describing the type of unreclaimed entity, such
  383. as `"lists"' or `"branches"'. The message is written to standard
  384. error followed by a line break, but the program is not halted and
  385. control returns to the caller.
  386. 
  387. File: avram.info, Node: Profiling, Next: Emulation Primitives, Prev: Error Reporting, Up: Library Reference
  388. 3.7 Profiling
  389. =============
  390. The functions declared in `profile.h' can be used for constructing and
  391. writing tables of run time statistics such as those mentioned in *note
  392. Files::, and *note Profile::. These functions maintain a database of
  393. structures, each recording the statistics for a particular virtual code
  394. fragment.
  395. Each structure in the database is identified by a unique key, which
  396. must be a list representing a character string. A pointer to such a
  397. structure is declared to be of type `score'. For the most part, the data
  398. structure should be regarded as opaque by a client program, except for a
  399. field `reductions' of type `counter', which may be modified arbitrarily
  400. by the client.
  401. The way these operations are used in the course of evaluating virtual
  402. code applications containing profile annotations is to add a structure
  403. to the database each time a new profiled code fragment is encountered,
  404. using the annotation as its key, and to increment the `reductions' of
  405. the structure each time any constituent of the code gets a quantum of
  406. work done on it. Other ways of using these operations are left to the
  407. developer's discretion.
  408. -- Function: score avm_entries (list TEAM, list *MESSAGE, int *FAULT)
  409. This function retrieves or creates a data base entry given its
  410. key. The parameters have these interpretations.
  411. `TEAM'
  412. is a list representing a character string that uniquely
  413. identifies the database entry to be retrieved or created.
  414. `MESSAGE'
  415. is the address of a list known to the caller, which will be
  416. assigned a list representing an error message if any error
  417. occurs in the course of searching the database or creating a
  418. new entry.
  419. `FAULT'
  420. is the address of an integer that will be set to a non-zero
  421. value if any error is caused by this function.
  422. The pointer returned by this function is the address of the record
  423. whose key is given by the `TEAM' parameter. If such a record is
  424. already in the database, its address is returned, but otherwise a
  425. new one is created whose address is then returned. The `reductions'
  426. field of a newly created entry will be zero.
  427. In the course of searching the database, the `avm_compare'
  428. function is used, so the associated lists may be modified as noted
  429. in *note Comparison::. It is not necessary for a client to
  430. include the header file `compare.h' or to call
  431. `avm_initialize_compare' in order to use the profile operations,
  432. because they are done automatically.
  433. If an error message is assigned to the list referenced by
  434. `MESSAGE', the integer referenced by `FAULT' will be set to a
  435. non-zero value. The form of the error message will be a list in
  436. which each item is a list of character representations as per
  437. *note Character Table::. It is the responsibility of the caller to
  438. dispose of the error message. Currently the only possible error is
  439. a memory overflow, which in this case is non-fatal.
  440. -- Function: void avm_tally (char *FILENAME)
  441. This function makes a table of the results stored in the data base
  442. built by the `avm_entries' function. The argument is the address
  443. of a null terminated character string containing the name of the
  444. file in which the results will be written. A file is opened and
  445. the table is written in a self explanatory text format, with
  446. columns labeled "reductions" and "invocations" among others. The
  447. latter contains the number of times the associated key was
  448. accessed through `avm_entries'.
  449. The data written to the file should be taken with a grain of salt.
  450. It is computed using native integer and floating point arithmetic,
  451. with no checks made for overflow or roundoff error, and no
  452. guarantee of cross platform portability. The number of
  453. "reductions" means whatever the developer of the client program
  454. wants it to mean.
  455. The following error messages are possible with this function,
  456. which will be written to standard error. None of them is fatal.
  457. * `PROGRAM-NAME: can't write FILENAME'
  458. * `PROGRAM-NAME: can't write to FILENAME'
  459. * `PROGRAM-NAME: can't close FILENAME'
  460. * `PROGRAM-NAME: invalid profile identifier'
  461. The last message is reported if any record in the database has a
  462. key that is not a list of valid character representations. The
  463. others are accompanied by an explanation from the standard
  464. `strerror' function if possible.
  465. -- Function: void avm_initialize_profile ()
  466. This function should be called before any of the other functions
  467. in this section in order to initialize the data base. Results are
  468. undefined if it is not called first.
  469. -- Function: void avm_count_profile ()
  470. This function can be called after the other functions in this
  471. section as a way of detecting memory leaks. If any storage remains
  472. unreclaimed that was created by the functions in this section, a
  473. warning message is written to standard error. If the
  474. `avm_count_lists' function is being used by the client program, it
  475. should be called after this one.
  476. 
  477. File: avram.info, Node: Emulation Primitives, Next: External Library Maintenance, Prev: Profiling, Up: Library Reference
  478. 3.8 Emulation Primitives
  479. ========================
  480. The functions documented in this section can be used to take very
  481. specific control over the evaluation of virtual code applications. It is
  482. unlikely that a client program will have any need for them unless it
  483. aims to replace or extend the `avm_apply' function.
  484. The virtual machine is somewhat removed from a conventional von
  485. Neumann model of computation, so emulating it in C or any other
  486. imperative language is less straightforward than one would prefer. An
  487. elaborate system of interdependent data structures is used to represent
  488. partially evaluated computations, which does not particularly lend
  489. itself to a convenient, modular API. The abstraction provided by the
  490. functions in this section is limited mainly to that of simple memory
  491. management and stack operations. Consequently, a developer wishing to
  492. build on them effectively would need to _grok_ the data structures
  493. involved, which are described in some detail.
  494. * Menu:
  495. * Lists of Pairs of Ports::
  496. * Ports and Packets::
  497. * Instruction Stacks::
  498. 
  499. File: avram.info, Node: Lists of Pairs of Ports, Next: Ports and Packets, Prev: Emulation Primitives, Up: Emulation Primitives
  500. 3.8.1 Lists of Pairs of Ports
  501. -----------------------------
  502. A `port' is the name given to a type of pointer used in the library as
  503. the address of a place where a computational result yet to be evaluated
  504. will be sent. Ports are discussed further in *note Ports and Packets::,
  505. but are mentioned here because it is sometimes necessary to employ a
  506. list of pairs of them. A pointer to such a list is declared as a
  507. `portal' type. It refers to a structure of the form
  508. struct port_pair
  509. {
  510. port left;
  511. port right;
  512. portal alters;
  513. }
  514. A small selection of functions for `portal' memory management is
  515. declared as follows in the header file `portals.h'. For reasons of
  516. C-ness, the type declarations themselves are forced to be in `lists.h'.
  517. -- Function: portal avm_new_portal (portal ALTERS)
  518. This function is used to create storage for a new `port_pair'
  519. structure, and returns a `portal' pointer to it if successful. If
  520. the storage can't be allocated, a `NULL' pointer is returned. The
  521. `alters' field of the result is initialized as the given parameter
  522. supplied by the caller. All other fields are filled with zeros.
  523. -- Function: void avm_seal (portal FATE)
  524. This function performs the reclamation of storage associated with
  525. `portal' pointers, either by freeing them or by consigning them
  526. temporarily to a local cache for performance reasons. Client
  527. programs should use only this function for disposing of `portal'
  528. storage rather than using `free' directly, so as to allow accurate
  529. record keeping.
  530. -- Function: void avm_initialize_portals ()
  531. This function should be called by a client program prior to calling
  532. either of the above memory management functions in order to
  533. initialize some local variables. Anomalous results are possible
  534. otherwise.
  535. -- Function: void avm_count_portals ()
  536. This function should be called at the end of a run or after the
  537. last call to any of the other functions in this section as a way
  538. of detecting memory leaks associated with `portal' pointers. A
  539. warning message will be written to standard error if any remains
  540. unreclaimed.
  541. 
  542. File: avram.info, Node: Ports and Packets, Next: Instruction Stacks, Prev: Lists of Pairs of Ports, Up: Emulation Primitives
  543. 3.8.2 Ports and Packets
  544. -----------------------
  545. A pointer type declared as a `port' points to a structure in the
  546. following form, where a `flag' is an unsigned short integer type, and a
  547. `counter' is an unsigned long integer.
  548. struct avm_packet
  549. {
  550. port parent;
  551. counter errors;
  552. portal descendents;
  553. list impetus, contents;
  554. flag predicating;
  555. };
  556. For reasons that make sense to C, the `avm_packet' and `port' types are
  557. declared in `lists.h', but a few memory management operations on them
  558. are available by way of functions declared in `ports.h'. The intended
  559. meaning of this structure is described presently, but first the memory
  560. management functions are as follows.
  561. -- Function: port avm_newport (counter ERRORS, port PARENT, int
  562. PREDICATING)
  563. This function attempts to allocate storage for a new packet
  564. structure and returns its address if successful. If storage can
  565. not be allocated, a `NULL' pointer is returned. The `errors',
  566. `parent', and `predicating' fields are initialized with the
  567. parameters supplied by the caller. The rest of the structure is
  568. filled with zeros. A local memory cache is used for improved
  569. performance.
  570. -- Function: void avm_sever (port APPENDAGE)
  571. This function reclaims the storage associated with a `port', either
  572. freeing it entirely or holding it in a local cache. None of the
  573. entities that may be referenced by pointers within the structure
  574. are affected. Only this function should be used by client
  575. programs for disposing of ports, not the `free' function directly,
  576. or some internal bookkeeping will be disrupted. An internal error
  577. results if the argument is a `NULL' pointer.
  578. -- Function: void avm_initialize_ports ()
  579. This function must be called prior to calling either of the two
  580. above, in order to initialize some static variables.
  581. -- Function: void avm_count_ports ()
  582. This function may be called after the last call to any of the other
  583. functions in this section in order to detect and report unreclaimed
  584. storage associated with ports. A non-fatal warning will be written
  585. to standard error if any is detected, but otherwise there is no
  586. effect.
  587. The interesting aspect of this data structure is the role it plays in
  588. capturing the state of a computation. For this purpose, it corresponds
  589. to a single node in a partially computed result to be represented by a
  590. `list' when it's finished. The nodes should be envisioned as a
  591. doubly-linked binary tree, except that the pair of `descendents' for
  592. each node is not yet known with certainty, so a list of alternatives
  593. must be maintained.
  594. Because the computation is not completed while this data structure
  595. exists, there are always some empty fields in it. For example, the
  596. `descendents' and the `contents' fields embody the same information,
  597. the latter doing so in a compact as opposed to a more expanded form.
  598. Hence, it would be redundant for both fields to be non-empty at the
  599. same time. The data structure is built initially with `descendents' and
  600. no `contents', only to be transformed into one with `contents' and no
  601. `descendents'.
  602. The significance of each field in the structure can be summarized as
  603. follows.
  604. `contents'
  605. If the computational result destined for the `port' pointing to
  606. this packet is not complete, then this field is `NULL' and the
  607. `descendents' are being computed. Otherwise, it contains the result
  608. of the computation.
  609. `descendents'
  610. This field points to a list of pairs of ports serving as the
  611. destinations for an ensemble of concurrent computations.(1) The
  612. `head' and `tail' of the `contents' are to be identified
  613. respectively with the `contents' of the `left' and `right' `port'
  614. in the first pair to finish being computed.
  615. `parent'
  616. If this packet is addressed by the `left' or the `right' of `port'
  617. in one of the `descendents' of some other packet, then this field
  618. points to that packet.
  619. `errors'
  620. A non-zero value in this field indicates that the result destined
  621. for the `contents' of this packet is expected to be an error
  622. message. If the exact level of error severity incurred in the
  623. computation of the `contents' matches this number, then the
  624. contents can be assigned the result, but otherwise the result
  625. should propagate to the `contents' of the `parent'.
  626. `predicating'
  627. A non-zero value in this field implies that the result destined
  628. for the `contents' of this packet is being computed in order to
  629. decide which arm of a conditional function should be chosen. I.e.,
  630. a `NULL' result calls for the one that is invoked when the
  631. predicate is false.
  632. `impetus'
  633. If the result destined for the `contents' of this packet is being
  634. computed in order to transform a virtual code fragment from its
  635. original form to an equivalent representation capable of being
  636. evaluated more directly, this field points to a `list' node at the
  637. root of the virtual code in its original form.
  638. One of the hitherto undocumented fields in a `list' node structure declared
  639. in `lists.h' is called the `interpretation', and is of type `list'. A
  640. client program delving into sufficient depth of detail to be concerned
  641. with ports and packets may reasonably assign the `interpretation' field
  642. of the `list' referenced by the `impetus' field in a packet to be a
  643. copy of the `contents' of the packet when they are eventually obtained.
  644. Doing so will save some time by eliminating the need for it to be
  645. recomputed if the same virtual code should be executed again.
  646. If this course is taken, the `facilitator' field in a `list' node,
  647. also hitherto undocumented, should contain the address of the packet
  648. referring to the list node as its `impetus'. The reason for this
  649. additional link is so that it can be followed when the `impetus' of the
  650. packet is be cleared by `avm_dispose' in the event that the `list' node
  651. is freed before the computation completes. This action is performed in
  652. order to preclude a dangling pointer in the `impetus' field.
  653. ---------- Footnotes ----------
  654. (1) Earlier versions of `avram' included a bottom avoiding choice
  655. combinator that required this feature, but which has been withdrawn. A
  656. single pair of descendent ports would now suffice.
  657. 
  658. File: avram.info, Node: Instruction Stacks, Prev: Ports and Packets, Up: Emulation Primitives
  659. 3.8.3 Instruction Stacks
  660. ------------------------
  661. A header file named `instruct.h' declares a number of memory management
  662. and stack operations on a data structure of the following form.
  663. struct instruction_node
  664. {
  665. port client;
  666. score sheet;
  667. struct avm_packet actor;
  668. struct avm_packet datum;
  669. instruction dependents;
  670. };
  671. In this structure, an `instruction' is a pointer to an
  672. `instruction_node', a `score' is a pointer to a profile database entry
  673. as discussed in *note Profiling::, and the `port' and `avm_packet'
  674. types are as described in *note Ports and Packets::.
  675. This data structure is appropriate for a simple virtual machine code evaluation
  676. strategy involving no concurrency. The strategy to evaluate an
  677. expression `F X' would be based on a stack of these nodes threaded
  678. through the `dependents' field, and would proceed something like this.
  679. 1. The stack is initialized to contain a single node having `F' in
  680. its `actor.contents' field, and `X' in its `datum.contents' field.
  681. 2. The `client' in this node would refer to a static packet to whose
  682. `contents' field the final result will be delivered.
  683. 3. The evaluator examines the `actor.contents' field on the top of the
  684. stack, detects by its form the operation it represents, and decides
  685. whether it corresponds to one that can be evaluated immediately by
  686. way of a canned function available in the library. List reversal,
  687. transposition, and comparison would be examples of such operations.
  688. 4. If the operation can be performed in this way, the result is
  689. computed and assigned to the destination indicated by the `client'
  690. field.
  691. 5. If the operation is not easy enough to perform immediately but is
  692. of a form recognizable as a combination of simpler operations, it
  693. is decomposed into the simpler operations, and each of them is
  694. strategically positioned on the stack so as to effect the
  695. evaluation of the combination. For example, if `F' were of the form
  696. `compose(G,H)' (`silly' notation), the node with `F' and `X' would
  697. be popped, but a node with `G' as its `actor.contents' would be
  698. pushed, and then a node with `H' as its `actor.contents' and `X'
  699. as its `datum.contents' would be pushed. Furthermore, the `client'
  700. field of the latter node would point to the `datum.contents' of
  701. the one with `G', and the `client' field of the one with `G' would
  702. point wherever the `client' of the popped node used to point.
  703. 6. If the operation indicated by the top `actor.contents' is neither
  704. implemented by a canned operation in the library nor easily
  705. decomposable into some that are, the evaluator can either give up
  706. or use virtual code to execute other virtual code. The latter
  707. trick is accomplished by pushing a node with `F' as its
  708. `datum.contents', and a copy of a hard coded virtual code
  709. interpreter `V' as its `actor.contents'. The `client' of this node
  710. will point to the `F' in the original node so as to overwrite it
  711. when a simplified version is subsequently computed. The
  712. implementation of `V' is a straightforward exercise in `silly'
  713. programming.
  714. 7. In any case, the evaluator would continue working on the stack
  715. until everything on it has been popped, at which time the result
  716. of the entire computation will be found in the packet addressed by
  717. the `client' in the original instruction node.
  718. What makes this strategy feasible to implement is the assumption of a
  719. sequential language, wherein synchronization incurs no cost and is
  720. automatic. The availability of any operand is implied by its position at
  721. the top of the stack. If you are reading this section with a view to implementing
  722. a concurrent or multi-threaded evaluation strategy, it will be apparent
  723. that further provisions would need to be made, such as that of a
  724. `data_ready' flag added to the `avm_packet' structure.
  725. The following functions support the use of stacks of instruction
  726. nodes that would be needed in an evaluation strategy such as the one
  727. above.
  728. -- Function: int avm_scheduled (list ACTOR_CONTENTS, counter
  729. DATUM_ERRORS, list DATUM_CONTENTS, port CLIENT, instruction
  730. *NEXT, score SHEET)
  731. This function performs the memory allocation for instruction
  732. nodes. It attempts to create one and to initialize the fields with
  733. the given parameters, returning a pointer to it if successful. It
  734. returns a `NULL' pointer if the storage could not be allocated.
  735. Copies of the `list' parameters `actor_contents' and
  736. `data_contents' are made by this function using `avm_copied', so
  737. the originals still exist as far as the caller is concerned and
  738. will have to be deallocated separately from this structure. The
  739. copies are made only if the allocation succeeds.
  740. Any fields other than those indicated by the parameters to this
  741. function are filled with zeros in the result.
  742. -- Function: void avm_retire (instruction *DONE)
  743. This function performs the storage reclamation of instructions,
  744. taking as its argument the instruction to be reclaimed. The `list'
  745. fields in the structure corresponding to the `list' parameters
  746. used when it was created are specifically reclaimed as well, using
  747. `avm_dispose'.
  748. The argument to this function is the address of an `instruction'
  749. rather than just an `instruction' so that the `instruction' whose
  750. address is given may be reassigned as the `dependents' field of
  751. the deallocated node. In this way, the instructions can form a
  752. stack that is popped by this function.
  753. This function cooperates with `avm_scheduled' in the use of a local
  754. cache of instruction nodes in the interest of better performance.
  755. Client modules should not attempt to allocate or reclaim
  756. instructions directly with `malloc' or `free', but use only these
  757. functions.
  758. It causes a fatal internal error to pass a `NULL' pointer to this
  759. function.
  760. -- Function: void avm_reschedule (instruction *NEXT)
  761. Given the address of an instruction pointer that may be regarded
  762. as the top of a stack of instructions threaded through the
  763. `dependents' field, this function exchanges the positions of the
  764. top instruction and the one below it. A fatal internal error is
  765. caused if there are fewer than two instructions in the stack.
  766. A use for this function arises in the course of evaluating virtual
  767. code applications of the form `conditional(P,(F,G))' (in `silly'
  768. notation). The evaluation strategy would require pushing nodes for
  769. all three constituents, but with `P' pushed last (therefore
  770. evaluated first). The result of the evaluation of `P' would
  771. require either the top one or the one below it to be popped
  772. without being evaluated, depending on whether the result is empty.
  773. -- Function: void avm_initialize_instruct ()
  774. This function should be called before any of the instruction memory
  775. management functions is called in order to initialize some local
  776. data structures. Results are unpredictable without it.
  777. -- Function: void avm_count_instruct ()
  778. This function should be called after the last call to any of the
  779. other functions in this section in order to detect and report
  780. unreclaimed storage associated with them. A warning message will be
  781. written to standard error if any unreclaimed instructions remain.
  782. This function relies on the assumption that the memory management
  783. has been done only by way of the above functions.
  784. 
  785. File: avram.info, Node: External Library Maintenance, Prev: Emulation Primitives, Up: Library Reference
  786. 3.9 External Library Maintenance
  787. ================================
  788. External mathematical library functions such as those documented in
  789. *note External Libraries:: that are invoked from virtual code by the
  790. `library' combinator (*note Library combinator::) are also accessible
  791. from C by way of a uniform API implemented by the functions declared in
  792. `libfuns.h'. This interface applies even to libraries implemented in
  793. Fortran such as `minpack'. This section briefly documents the functions
  794. in `libfuns.h' and sets out some recommeded guidelines for developers
  795. wishing to add support for other external libraries.
  796. * Menu:
  797. * Calling existing library functions::
  798. * Implementing new library functions::
  799. * Working around library misfeatures::
  800. 
  801. File: avram.info, Node: Calling existing library functions, Next: Implementing new library functions, Prev: External Library Maintenance, Up: External Library Maintenance
  802. 3.9.1 Calling existing library functions
  803. ----------------------------------------
  804. Whatever data types a library function manipulates, its argument and
  805. its result are each ultimately encoded each by a single list as
  806. explained in *note Type Conversions::. This representation allows all
  807. library functions to be invoked by a uniform calling convention as
  808. detailed below.
  809. -- Function: list avm_library_call (list LIBRARY_NAME, LIST
  810. FUNCTION_NAME, list ARGUMENT, int *FAULT)
  811. This function serves as an interpreter of external library
  812. functions by taking a LIBRARY_NAME, a FUNCTION_NAME, and an
  813. ARGUMENT to the result returned by the corresponding library
  814. function for the given ARGUMENT.
  815. The library and function names should be encoded as lists of
  816. character representations, the same as the arguments that would be
  817. used with the `library' combinator if it were being invoked by
  818. virtual code (with attention to the backward compatibility issue
  819. explained in *note Characters and Strings::).
  820. If an error occurs in the course of evaluating a library function,
  821. the integer referenced by FAULT will be assigned a non-zero value,
  822. and the result will be a list of character string representations
  823. explaining the error, such as `<'memory overflow'>', for example.
  824. Otherwise, the list returned will encode the result of the library
  825. function in a way that depends on the particular function being
  826. evaluated.
  827. -- Function: list avm_have_library_call (list LIBRARY_NAME, list
  828. FUNCTION_NAME, int *FAULT)
  829. This function implements the `have' combinator described in *note
  830. Have combinator::, which tests for the availability of a library
  831. function. The LIBRARY_NAME and FUNCTION_NAME parameters are as
  832. explained above for `avm_library_call', and `fault' could signal
  833. an error similarly for this function as well.
  834. The result returned will be an error message in the event of an
  835. error, or a list of pairs of strings otherwise. The list will be
  836. empty if the library function is not available. If the library
  837. function is available, the list will contain a single pair, as in
  838. <(library_name,function_name)>
  839. In addition, the list representation of the character string `'*''
  840. can be specified as either the library name or the function name
  841. or both. This string is interpreted as a wild card and will cause
  842. all matching pairs of library and function names to be returned in
  843. the list.
  844. -- Function: void avm_initialize_libfuns ()
  845. This function initializes some static data structures used by the
  846. two functions above. It may be called optionally before the first
  847. call to either of them, but will be called automatically if not.
  848. -- Function: void avm_count_libfuns ()
  849. This function can be used as an aid to detecting memory leaks. It
  850. reclaims any data structures allocated by `avm_initialize_libfuns'
  851. and should be called towards the end of a run some time prior to
  852. `avm_count_lists' *note Simple Operations::, if the latter is
  853. being used.
  854. 
  855. File: avram.info, Node: Implementing new library functions, Next: Working around library misfeatures, Prev: Calling existing library functions, Up: External Library Maintenance
  856. 3.9.2 Implementing new library functions
  857. ----------------------------------------
  858. Adding more external libraries to `avram' is currently a manual
  859. procedure requiring the attention of a developer conversant with C. To
  860. support a new library called `foobar', these steps need to be followed
  861. at a minimum.
  862. * Create a new file called `foobar.h' under the `avm/' directory in
  863. the main source tree whose name doesn't clash with any existing
  864. file names and preferably doesn't induce any proper prefixes among
  865. them. This file should contain at least these function
  866. declarations.
  867. extern list avm_foobar_call (list function_name,list argument,
  868. int *fault);
  869. extern list avm_have_foobar_call (list function_name,int *fault);
  870. extern void avm_initialize_foobar ();
  871. extern void avm_count_foobar ();
  872. There should also be the usual preprocessor directives for
  873. `include' files. The naming convention shown should be followed in
  874. anticipation of automated support for these operations in the
  875. future.
  876. * Add `foobar.h' to the list of other header files in
  877. `avm/Makefile.am'.
  878. * Create a new file called `foobar.c' under the `src/' directory
  879. whose name doesn't clash with any existing file names to store
  880. most of the library interface code. It can start out with stubs
  881. for the functions declared in `foobar.h'.
  882. * Add `foobar.c' to the list of other source files in
  883. `src/Makefile.am'
  884. * Execute the following command in the main `avram-x.x.x' source
  885. directory where the file `configure.in' is found.
  886. aclocal \
  887. && automake --gnu --add-missing \
  888. && autoconf
  889. This command requires having `automake' and `autoconf' installed
  890. on your system.
  891. * Make the following changes to `libfuns.c'.
  892. * Add the line `#include<avm/foobar.h>' after the other
  893. `include' directives.
  894. * Add the string `"foobar"' to the end of the array of
  895. `libnames' in `avm_initialize_libfuns'.
  896. * Add a call to `avm_initialize_foobar' to the body.
  897. * Add a call to `avm_count_foobar' to the body of
  898. `avm_count_libfuns'.
  899. * Add a case of the form
  900. case nn:
  901. return avm_foobar_call(function_name,argument,fault);
  902. after the last case in `avm_library_call', being careful not
  903. to change the order, and using the same name as above in the
  904. file `foobar.h'.
  905. * Add a case of the form
  906. case nn:
  907. looked_up = avm_have_foobar_call(function_name,fault);
  908. break;
  909. after the last case in `avm_have_library_call', being careful
  910. not to change the order, and using the same name as above in
  911. the file `foobar.h'.
  912. * Edit `foobar.c' and `foobar.h' to suit, periodically compiling and
  913. testing by executing `make'.
  914. * Package and install at will.
  915. The functions shown above have the obvious interpretations, namely
  916. that `avm_foobar_call' evaluates a library function from the `foobar'
  917. library, and `avm_have_foobar_call' tests for a function's
  918. availability. The latter should interpret wild cards as explained in
  919. *note Calling existing library functions::, but should return only a
  920. list of strings for the matching function names rather than a list of
  921. pairs of strings, as the library name is redundant. The remaining
  922. functions are for static initialization and reclamation.
  923. These functions should consist mainly of boilerplate code similar to
  924. the corresponding functions in any of the other library source files,
  925. which should be consulted as examples. The real work would be done by
  926. other functions called by them. These should be statically declared
  927. within the `.c' source file and normally not listed in the `.h' header
  928. file unless there is some reason to think they may be of more general
  929. use. Any externally visible functions should have names beginning with
  930. `avm_' to avoid name clashes.
  931. Some helpful hints are reported below for what they may be worth.
  932. * The reason for doing this is to leverage off other people's
  933. intelligence, so generally `foobar.c' should contain only glue
  934. code for library routines developed elsewhere with great skill
  935. rather than reinventing them in some home grown way.
  936. * The best numerical software is often written by Fortran programmers.
  937. Linking to a Fortran library is no problem on GNU systems provided
  938. that all variables are passed by reference and all arrays are
  939. converted to column order (*note Type Conversions::).
  940. * Most C++ programmers have yet to reach a comparable standard, but
  941. C++ libraries can also be linked by running `nm' on the static library
  942. file to find out the real names of the functions and `c++filt' to
  943. find out which is which. However, there is no obvious workaround
  944. for the use of so called derived classes by C++ programmers to
  945. simulate passing functions as parameters.
  946. * Anything worth using can probably be found in the Debian archive.
  947. * Not all libraries are sensible candidates for interfaces to
  948. `avram'. Typical design flaws are
  949. * irrepressible debugging messages written to `stderr' or
  950. `stdout' that are unfit for end user consumption
  951. * deliberately crashing the application if `malloc' fails
  952. * opaque data types with undocumented storage requirements
  953. * opaque data types that would be useful to store persistently
  954. but have platform specific binary representations
  955. * heavily state dependent semantics
  956. * identifiers with clashing names
  957. * restrictive licenses
  958. Some of these misfeatures have workarounds as explained next in
  959. *note Working around library misfeatures::, at least if there's
  960. nothing else wrong with the library.
  961. Those who support `avram' are always prepared to assist in the
  962. dissemination of worthwhile contributed library modules under terms
  963. compatible with *note Copying::, and under separate copyrights if preferred.
  964. Contributed modules can be integrated into the official source tree
  965. provided that they meet the following additional guidelines to those
  966. above.
  967. * source code documentation and indentation according to GNU coding
  968. standards (`http://www.gnu.org/prep/standards')
  969. * sufficient stability for a semi-annual release cycle
  970. * no run-time or compile-time dependence on any non-free software,
  971. although dynamic loading and client/server interaction are
  972. acceptable
  973. * portable or at least unbreakable configuration by appropriate use
  974. of `autoconf' macros and conditional defines
  975. * little or no state dependence at the level of the virtual code interface
  976. (i.e., pure functions or something like them, except for random
  977. number generators and related applications)
  978. * adequate documentation for a section in *note External Libraries::
  979. 
  980. File: avram.info, Node: Working around library misfeatures, Prev: Implementing new library functions, Up: External Library Maintenance
  981. 3.9.3 Working around library misfeatures
  982. ----------------------------------------
  983. As mentioned already (*note Implementing new library functions::), some
  984. common problems with external libraries that are worthwhile in other
  985. respects are that they may generate unwelcome console output while
  986. running, they may follow ill defined memory management policies, and
  987. they may handle exceptions just by crashing themselves along with the
  988. client module.
  989. An accumulation of techniques for coping with these issues (short of
  990. modifying the library source) has been collected into the API and made
  991. available by way of the header file `mwrap.h'. This section briefly
  992. documents how they might be put to use.
  993. * Menu:
  994. * Inept excess verbiage::
  995. * Memory leaks::
  996. * Suicidal exception handling::
  997. 
  998. File: avram.info, Node: Inept excess verbiage, Next: Memory leaks, Prev: Working around library misfeatures, Up: Working around library misfeatures
  999. 3.9.3.1 Inept excess verbiage
  1000. .............................
  1001. Although the author of a library function may take pride in putting its
  1002. activities on display, it should be assumed that virtual code
  1003. applications running on `avram' have other agendas for the console, so
  1004. the library interface module should prevent direct output from the
  1005. external library.
  1006. More thoughtful API's may have a verbosity setting, which should be used
  1007. in preference to this workaround, but failing that, it is easy to
  1008. dispense with console output generated by calls to external library
  1009. functions by using some combination of the following functions.
  1010. -- Function: void avm_turn_off_stdout ()
  1011. Calling this function will suppress all output to the standard
  1012. output stream until the next time `avm_turn_on_stdout' is called.
  1013. Additional calls to this function without intervening calls to
  1014. `avm_turn_on_stdout' may be made safely with no effect. The
  1015. standard output stream is flushed as a side effect of calling this
  1016. function.
  1017. -- Function: void avm_turn_on_stdout ()
  1018. Calling this function will allow output to the standard output
  1019. stream to resume if it has been suppressed previously by a call to
  1020. `avm_turn_off_stdout'. If `avm_turn_off_stdout' has not been
  1021. previously called, this function has no effect. Any output that
  1022. would have been sent to `stdout' during the time it was turned off
  1023. will be lost.
  1024. -- Function: void avm_turn_off_stderr ()
  1025. This function performs a similar service to that of
  1026. `avm_turn_off_stdout' but pertains to the standard error stream.
  1027. The standard error and the standard output streams are controlled
  1028. independently even if both of them are piped to the same console.
  1029. -- Function: void avm_turn_on_stderr ()
  1030. This function performs a similar service to that of
  1031. `avm_turn_on_stdout' but pertains to the standard error stream.
  1032. As an example, the following code fragment will prevent any output to
  1033. standard output taking place as a side effect of `blather', but will
  1034. allow error messages to standard error. Note that ouput should not be
  1035. left permanently turned off.
  1036. ...
  1037. #include <avm/mwrap.h>
  1038. ...
  1039. x = y + z;
  1040. avm_turn_off_stdout ();
  1041. w = blather (foo, bar, baz);
  1042. avm_turn_on_stdout ();
  1043. return w;
  1044. ...
  1045. One possible issue with these functions is that they rely on a
  1046. feature of the GNU C library that might not be portable to non-GNU systems
  1047. and has not been widely tested on other platforms.
  1048. Another issue is that a library function could be both careless
  1049. enough to clutter the console unconditionally and meticulous enough to
  1050. check for I/O errors after each attempted write. Writing while the
  1051. output stream is disabled will return an I/O error to the caller (i.e.,
  1052. to the verbose library function) for appropriate action, which could
  1053. include terminating the process.
  1054. 
  1055. File: avram.info, Node: Memory leaks, Next: Suicidal exception handling, Prev: Inept excess verbiage, Up: Working around library misfeatures
  1056. 3.9.3.2 Memory leaks
  1057. ....................
  1058. Incorrect memory management may undermine confidence in a library when
  1059. one wonders what else it gets wrong, but if the worst it does is leave
  1060. a few bytes unreclaimed, then help is at hand.
  1061. The first priority is to assess the seriousness of the situation.
  1062. Similarly to the way library functions are bracketed with calls to
  1063. those listed in *note Inept excess verbiage::, the following functions
  1064. are meant to be placed before and after a call to a library function
  1065. either for diagnostic purposes or production use.
  1066. -- Function: void avm_manage_memory ()
  1067. After this function is called, all subsequent calls to the
  1068. standard C functions `malloc', `free', and `realloc' are
  1069. intercepted and logged until the next time
  1070. `avm_dont_manage_memory' is called. Furthermore, a complete record
  1071. is maintained of the addresses and sizes of all allocated areas of
  1072. memory during this time in a persistent data structure managed
  1073. internally.
  1074. -- Function: void avm_dont_manage_memory ()
  1075. Calling this function suspends the storage monitoring activities
  1076. initiated by calling `avm_manage_memory', but the record of
  1077. allocated memory areas is not erased.
  1078. -- Function: void avm_debug_memory ()
  1079. After this function is called and `avm_manage_memory' is also
  1080. called, the standard output stream will display a running account
  1081. of the sizes and addresses of all memory allocations or
  1082. deallocations as they occur until the next call to either
  1083. `avm_dont_debug_memory' or `avm_dont_manage_memory'.
  1084. -- Function: void avm_dont_debug_memory ()
  1085. This function stops the output being sent to `stdout' caused by
  1086. `avm_debug_memory', if any, but has no effect on the logging of
  1087. memory management events preformed due to `avm_manage_memory'.
  1088. While the latter two are not useful in production code, they can help
  1089. to clarify an inadequately documented API during development by
  1090. experimentally identifying the functions that cause memory to be
  1091. allocated. They can also provide the answer to questions like whether
  1092. separate copies are made from arrays passed to functions (useful for
  1093. knowing when it's appropriate to free them).
  1094. Although the console output reveals everything there is to know about
  1095. memory management during the selected window, the question of
  1096. unreclaimed storage is more directly settled by the following functions.
  1097. -- Function: void avm_initialize_mwrap ()
  1098. This function has to be called before any other functions from
  1099. `mwrap.h' in order to clean the slate and prepare the static data
  1100. structures for use. This function might not have to be called
  1101. explicitly if the client module is part of `avram', whose main
  1102. program would have already called it. There is no harm in calling
  1103. it repeatedly.
  1104. -- Function: void avm_count_mwrap ()
  1105. This function should be called after the last call to any other
  1106. functions in `mwrap.h', when it is expected that all storage that
  1107. was allocated while `avm_manage_memory' was in effect should have
  1108. been reclaimed.
  1109. If there is no unreclaimed storage allocated during an interval
  1110. when memory was being managed, this function returns uneventfully.
  1111. However, if any storage remains unreclaimed, a message stating the
  1112. number of bytes is written to `stderr'.
  1113. If `avm_debug_memory' is also in effect when this function detects
  1114. unreclaimed storage, an itemized list of the unreclaimed memory
  1115. addresses and their sizes is written to standard output.
  1116. Of course, in order for `avm_count_mwrap' to report meaningful
  1117. results, any memory that is allocated during the interval between calls
  1118. to `avm_manage_memory' and `avm_dont_manage_memory' must have been
  1119. given an opportunity to be reclaimed also while this logging mechanism
  1120. is in effect. However, there may be arbitrarily many intervening
  1121. intervals during which it is suspended.
  1122. On the other hand, any storage that is allocated when memory is not
  1123. being managed must not be freed at a time when it is (except for
  1124. freeing a `NULL' pointer, which is tolerated but not encouraged). Doing
  1125. so raises an internal error, causing termination with extreme
  1126. prejudice. This behavior is a precaution against library functions
  1127. freeing storage that they didn't allocate, which would mean no memory
  1128. is safe and it's better for `avram' not to continue.
  1129. If these investigations uncover no evidence of a memory leak, then
  1130. perhaps the relevant library functions are reliable enough to run
  1131. without supervisory memory management. Alternatively, when memory leaks
  1132. are indicated, the next function provides a simple remedy.
  1133. -- Function: void avm_free_managed_memory ()
  1134. This function causes all storage to be reclaimed that was allocated
  1135. at any time while logging of memory allocation was in effect (i.e.,
  1136. whenever `avm_manage_memory' had been called more recently than
  1137. `avm_dont_manage_memory'). When the storage is freed, no further
  1138. record of it is maintained.
  1139. A side effect of this function is to call `avm_dont_manage_memory'
  1140. and therefore leave memory management turned off.
  1141. This last function when used in conjunction with the others is
  1142. therefore the workaround for library functions that don't clean up
  1143. after themselves. It may be important to do it for them if repeated
  1144. calls to the library function are expected, which would otherwise cause
  1145. unreclaimed storage to accumulate until it curtailed other operations.
  1146. One small issue with this function is the assumption that unreclaimed
  1147. storage is really a leak and not internal library data that is designed
  1148. to persist between calls. If this assumption is not valid, breakage
  1149. will occur. However, libraries deliberately making use of persistent
  1150. data are likely to have initialization and destructor functions as part
  1151. of their API's, so this assumption is often justified if they don't.
  1152. An example of using these functions is given below.
  1153. In this example, `allocated_library_object' is a hypothetical
  1154. function exported by an external library that causes storage to be
  1155. allocated, and `library_reclamation_routine' is provided by the same
  1156. library ostensibly to reclaim the storage thus allocated. However, the
  1157. latter is suspected of memory leaks.
  1158. The variable `my_data' is declared and used by an `avram' developer
  1159. who is presumably competent to reclaim it correctly, rather than it
  1160. being part of an external library. Memory management is therefore
  1161. enabled during the calls to the library routines but not at other times.
  1162. The call to `avm_count_mwrap' is redundant immediately after a call
  1163. to `avm_free_managed_memory', because with all managed memory having
  1164. been freed, no memory leak will ever be detected, but it is included
  1165. for illustrative purposes.
  1166. #include <avm/mwrap.h>
  1167. ...
  1168. {
  1169. void *behemoth;
  1170. char *my_data;
  1171. avm_initialize_mwrap ();
  1172. avm_manage_memory ();
  1173. behemoth = allocated_library_object (foo, bar);
  1174. avm_dont_manage_memory ();
  1175. my_data = (char *) malloc (100);
  1176. ...
  1177. free (my_data);
  1178. avm_manage_memory ();
  1179. library_reclamation_routine (&behemoth);
  1180. avm_free_managed_memory ();
  1181. avm_count_mwrap ();
  1182. return;
  1183. }
  1184. It might be a cleaner solution in some sense to omit the call to
  1185. `library_reclamation_routine' entirely, because the storage allocated
  1186. during the call to `allocated_library_object' will be reclaimed
  1187. perfectly well by `avm_free_managed_memory' without it. Doing so may
  1188. also be the only option if the library reclamation routine is either
  1189. extremely unreliable or non-existent. However, the style above is to be
  1190. preferred for portability if possible. The memory management functions
  1191. rely on the availability of the system header file `malloc.h', and GNU
  1192. C library features whose portability is not assured. If the required
  1193. features are not detected on the host system at configuration time,
  1194. conditional directives in the `avram' source will make the `avm_'*
  1195. memory management functions perform no operations, and the
  1196. responsibility for memory management will devolve to the possibly less
  1197. robust external library implementation.
  1198. 
  1199. File: avram.info, Node: Suicidal exception handling, Prev: Memory leaks, Up: Working around library misfeatures
  1200. 3.9.3.3 Suicidal exception handling
  1201. ...................................
  1202. An inconvenient characteristic of some external library functions is to
  1203. terminate the program rather than returning an error status to the
  1204. caller for routine events such as a failure of memory allocation.
  1205. Although in many cases there is no simple workaround for this behavior,
  1206. memory allocation failures at least can be detected and preventive
  1207. action taken by using the functions described in this section.
  1208. The general approach is to use memory management functions from
  1209. `mwrap.h' as described previously (*note Memory leaks::), while
  1210. additionally registering a return destination for a non-local jump to be
  1211. taken in the event of a memory overflow. The jump is taken when an
  1212. external library function calls `malloc' or `realloc' unsuccessfully.
  1213. The jump avoids passing control back to the library function, thereby
  1214. denying it the opportunity to abort, but restores the context to that
  1215. of the jump destination almost as if the library function and all of
  1216. its intervening callers had returned normally.
  1217. The interface is similar to that of the standard `setjmp' function
  1218. defined in the system header file `setjmp.h', and in fact is built on
  1219. it, but differs in that the client module does not explicitly refer to
  1220. jump buffers. Instead, the `mwrap' module internally maintains a stack
  1221. of return destinations.
  1222. If a jump is taken, it always goes to the most recently registered
  1223. destination. It may revert to the previously registered destination
  1224. only when the current one is cleared. This organization provides the
  1225. necessary flexibility for multiple clients and recursion, but it
  1226. necessitates a protocol whereby each registration of a destination must
  1227. be explicitly cleared exactly once.
  1228. The following functions implement these two features.
  1229. -- Function: int avm_setjmp ()
  1230. This function specifies the point to which control will pass by a
  1231. non-local jump if there is insufficient memory to complete a
  1232. subsequent `malloc' or `realloc' operation. Only the operations
  1233. that take place while memory is being managed due to
  1234. `avm_manage_memory' are affected (*note Memory leaks::).
  1235. The function returns zero when it is called normally and
  1236. successfully registers the return point.
  1237. It returns a non-zero value when it has been entered by a non-local
  1238. jump (i.e., when `malloc' or `realloc' has reported insufficient
  1239. memory while memory management is active), or when the return
  1240. point could not be successfully registered due to insufficient
  1241. memory. The client need not distinguish between these two cases,
  1242. because both correspond to memory overflows and the destination
  1243. must be cleared by `avm_clearjmp' regardless.
  1244. When a non-zero value is returned due to this function being
  1245. reached by a non-local jump, it has the side effects of reclaiming
  1246. all managed memory by calling `avm_free_managed_memory' and
  1247. disabling memory management by calling `avm_dont_manage_memory'.
  1248. -- Function: void avm_clearjmp ()
  1249. This function cancels the effect of `avm_setjmp ()' by preventing
  1250. further non-local jumps to its destination if the destination was
  1251. successfully registered, or by acknowledging unsuccessful
  1252. registration otherwise. It should be called before exiting any
  1253. function that calls `avm_setjmp ()' or anomalous results may ensue.
  1254. The memory management functions `avm_manage_memory' and
  1255. `avm_dont_manage_memory' can be useful with or without `avm_setjmp',
  1256. depending on how much of a workaround is needed for a given library. If
  1257. a library does not abort on memory overflows, there is no need to use
  1258. `avm_setjmp', while it may still be appropriate to use the other
  1259. functions against memory leaks.
  1260. Calling `avm_clearjmp' is particularly important if a client module
  1261. with memory management that doesn't use `avm_setjmp' is invoked
  1262. subsequently to one that does, so that memory overflows in the latter
  1263. won't cause an attempted jump to a stale destination.
  1264. A further complication that arises from careful consideration of
  1265. these issues is the situation of a client module that does not intend
  1266. to use `avm_setjmp' but is called (perhaps indirectly) by one that
  1267. does. The latter will have registered a return destination that remains
  1268. active and valid even if the former refrains from doing so, thereby
  1269. allowing a branch to be taken that should have been prevented.
  1270. Although it is an unusual situation, it can be accommodated by the
  1271. following function.
  1272. -- Function: void avm_setnonjump ()
  1273. This function temporarily inhibits non-local jumps to destinations
  1274. previously registered by `avm_setjmp' until the next time
  1275. `avm_clearjmp' is called. Thereafter, any previously registered
  1276. destinations are reinstated.
  1277. A sketch of how some of these functions might be used to cope with
  1278. library functions that would otherwise terminate the program in the
  1279. event of a memory overflow is shown below. The GNU `libc' reference
  1280. manual contains a related discussion of non-local jumps.
  1281. #include <avm/mwrap.h>
  1282. ...
  1283. int
  1284. function foobar (foo, bar)
  1285. ...
  1286. {
  1287. char *my_data;
  1288. my_data = (char *) malloc (100);
  1289. if (avm_setjmp () != 0)
  1290. {
  1291. avm_clearjmp ();
  1292. avm_turn_on_stdout (); /* reaching here */
  1293. free (my_data); /* means malloc */
  1294. return ABNORMAL_STATUS; /* failed below */
  1295. }
  1296. avm_turn_off_stdout ();
  1297. avm_manage_memory ();
  1298. ...
  1299. call_library_functions (foo, bar); /* may jump */
  1300. ... /* to above */
  1301. avm_free_managed_memory ();
  1302. avm_turn_on_stdout ();
  1303. avm_clearjmp ();
  1304. free (my_data); /* reaching here means */
  1305. return OK_STATUS; /* jumping wasn't done */
  1306. }
  1307. Portability issues with these functions are not well known at this writing.
  1308. If the configuration script for `avram' fails to detect the required
  1309. features in `setjmp.h' on the host system, conditional compilation
  1310. directives will disable the functions `avm_setjmp', `avm_clearjmp', and
  1311. `avm_setnonjmp'. However, it may still be possible for the other
  1312. `avm_'* memory management functions to be configured.
  1313. If `setjmp' is not configured, the `avm_setjmp' function is still
  1314. callable but will always return a value of zero, and will provide no
  1315. protection against external library functions aborting the program. The
  1316. other two will perform no operation and return.
  1317. 
  1318. File: avram.info, Node: Character Table, Next: Reference Implementations, Prev: Library Reference, Up: Top
  1319. Appendix A Character Table
  1320. **************************
  1321. This table lists the representations used by `avram' for characters.
  1322. The left column shows the character code in decimal. For printable
  1323. characters, the middle column shows the character. The right column
  1324. shows the representation used. For example, the letter `A' has
  1325. character code 65, and the representation
  1326. `(nil,(((nil,(nil,(nil,nil))),nil),(nil,nil)))'.
  1327. These representations were generated automatically to meet various
  1328. helpful criteria, and are not expected to change in future releases. No
  1329. character representation coincides with the representations used for
  1330. boolean values, natural numbers, character strings, pairs of characters,
  1331. or certain other data types beyond the scope of this document. An easy
  1332. algorithm for lexical sorting is possible. Subject to these criteria,
  1333. the smallest possible trees were chosen.
  1334. 0 (nil,(nil,(nil,((nil,nil),(nil,nil)))))
  1335. 1 (nil,(nil,((nil,nil),(nil,nil))))
  1336. 2 (nil,(nil,((nil,nil),(nil,(nil,nil)))))
  1337. 3 (nil,(nil,((nil,(nil,nil)),(nil,nil))))
  1338. 4 (nil,(nil,(((nil,nil),nil),(nil,nil))))
  1339. 5 (nil,(nil,(((nil,nil),(nil,nil)),nil)))
  1340. 6 (nil,(nil,((((nil,nil),(nil,nil)),nil),nil)))
  1341. 7 (nil,((nil,nil),(nil,nil)))
  1342. 8 (nil,((nil,nil),(nil,(nil,nil))))
  1343. 9 (nil,((nil,nil),(nil,(nil,(nil,nil)))))
  1344. 10 (nil,((nil,nil),(nil,(nil,(nil,(nil,nil))))))
  1345. 11 (nil,((nil,nil),(nil,((nil,nil),(nil,nil)))))
  1346. 12 (nil,((nil,nil),(nil,((nil,(nil,nil)),nil))))
  1347. 13 (nil,((nil,nil),(nil,(((nil,nil),nil),nil))))
  1348. 14 (nil,((nil,nil),((nil,nil),(nil,nil))))
  1349. 15 (nil,((nil,nil),((nil,nil),(nil,(nil,nil)))))
  1350. 16 (nil,((nil,nil),((nil,(nil,nil)),nil)))
  1351. 17 (nil,((nil,nil),((nil,(nil,nil)),(nil,nil))))
  1352. 18 (nil,((nil,nil),((nil,(nil,(nil,nil))),nil)))
  1353. 19 (nil,((nil,nil),(((nil,nil),nil),(nil,nil))))
  1354. 20 (nil,((nil,nil),(((nil,nil),(nil,nil)),nil)))
  1355. 21 (nil,((nil,(nil,nil)),(nil,nil)))
  1356. 22 (nil,((nil,(nil,nil)),(nil,(nil,nil))))
  1357. 23 (nil,((nil,(nil,nil)),(nil,(nil,(nil,nil)))))
  1358. 24 (nil,((nil,(nil,nil)),(nil,((nil,nil),nil))))
  1359. 25 (nil,((nil,(nil,nil)),((nil,nil),nil)))
  1360. 26 (nil,((nil,(nil,nil)),((nil,nil),(nil,nil))))
  1361. 27 (nil,((nil,(nil,nil)),((nil,(nil,nil)),nil)))
  1362. 28 (nil,((nil,(nil,nil)),(((nil,nil),nil),nil)))
  1363. 29 (nil,((nil,(nil,(nil,nil))),(nil,nil)))
  1364. 30 (nil,((nil,(nil,(nil,nil))),(nil,(nil,nil))))
  1365. 31 (nil,((nil,(nil,(nil,nil))),((nil,nil),nil)))
  1366. 32 (nil,((nil,(nil,(nil,(nil,nil)))),(nil,nil)))
  1367. 33 ! (nil,((nil,(nil,((nil,nil),nil))),(nil,nil)))
  1368. 34 " (nil,((nil,(nil,((nil,nil),(nil,nil)))),nil))
  1369. 35 # (nil,((nil,((nil,nil),nil)),(nil,nil)))
  1370. 36 $ (nil,((nil,((nil,nil),nil)),(nil,(nil,nil))))
  1371. 37 % (nil,((nil,((nil,nil),(nil,nil))),nil))
  1372. 38 & (nil,((nil,((nil,nil),(nil,nil))),(nil,nil)))
  1373. 39 ' (nil,((nil,((nil,nil),(nil,(nil,nil)))),nil))
  1374. 40 ( (nil,((nil,((nil,(nil,nil)),nil)),(nil,nil)))
  1375. 41 ) (nil,((nil,((nil,(nil,nil)),(nil,nil))),nil))
  1376. 42 * (nil,((nil,(((nil,nil),nil),nil)),(nil,nil)))
  1377. 43 + (nil,((nil,(((nil,nil),nil),(nil,nil))),nil))
  1378. 44 , (nil,((nil,(((nil,nil),(nil,nil)),nil)),nil))
  1379. 45 - (nil,(((nil,nil),nil),(nil,nil)))
  1380. 46 . (nil,(((nil,nil),nil),(nil,(nil,nil))))
  1381. 47 / (nil,(((nil,nil),nil),(nil,(nil,(nil,nil)))))
  1382. 48 0 (nil,(((nil,nil),nil),((nil,nil),(nil,nil))))
  1383. 49 1 (nil,(((nil,nil),nil),((nil,(nil,nil)),nil)))
  1384. 50 2 (nil,(((nil,nil),(nil,nil)),nil))
  1385. 51 3 (nil,(((nil,nil),(nil,nil)),(nil,nil)))
  1386. 52 4 (nil,(((nil,nil),(nil,nil)),(nil,(nil,nil))))
  1387. 53 5 (nil,(((nil,nil),(nil,nil)),((nil,nil),nil)))
  1388. 54 6 (nil,(((nil,nil),(nil,(nil,nil))),nil))
  1389. 55 7 (nil,(((nil,nil),(nil,(nil,nil))),(nil,nil)))
  1390. 56 8 (nil,(((nil,nil),(nil,(nil,(nil,nil)))),nil))
  1391. 57 9 (nil,(((nil,nil),((nil,nil),nil)),(nil,nil)))
  1392. 58 : (nil,(((nil,nil),((nil,nil),(nil,nil))),nil))
  1393. 59 ; (nil,(((nil,nil),((nil,(nil,nil)),nil)),nil))
  1394. 60 < (nil,(((nil,(nil,nil)),nil),(nil,nil)))
  1395. 61 = (nil,(((nil,(nil,nil)),nil),(nil,(nil,nil))))
  1396. 62 > (nil,(((nil,(nil,nil)),(nil,nil)),nil))
  1397. 63 ? (nil,(((nil,(nil,nil)),(nil,nil)),(nil,nil)))
  1398. 64 @ (nil,(((nil,(nil,nil)),(nil,(nil,nil))),nil))
  1399. 65 A (nil,(((nil,(nil,(nil,nil))),nil),(nil,nil)))
  1400. 66 B (nil,(((nil,(nil,(nil,nil))),(nil,nil)),nil))
  1401. 67 C (nil,(((nil,((nil,nil),nil)),nil),(nil,nil)))
  1402. 68 D (nil,(((nil,((nil,nil),nil)),(nil,nil)),nil))
  1403. 69 E (nil,((((nil,nil),nil),nil),(nil,nil)))
  1404. 70 F (nil,((((nil,nil),nil),nil),(nil,(nil,nil))))
  1405. 71 G (nil,((((nil,nil),nil),(nil,nil)),nil))
  1406. 72 H (nil,((((nil,nil),nil),(nil,nil)),(nil,nil)))
  1407. 73 I (nil,((((nil,nil),nil),(nil,(nil,nil))),nil))
  1408. 74 J (nil,((((nil,nil),(nil,nil)),nil),(nil,nil)))
  1409. 75 K (nil,((((nil,nil),(nil,nil)),(nil,nil)),nil))
  1410. 76 L (nil,((((nil,(nil,nil)),nil),nil),(nil,nil)))
  1411. 77 M (nil,((((nil,(nil,nil)),nil),(nil,nil)),nil))
  1412. 78 N (nil,(((((nil,nil),nil),nil),nil),(nil,nil)))
  1413. 79 O (nil,(((((nil,nil),nil),nil),(nil,nil)),nil))
  1414. 80 P ((nil,nil),(nil,nil))
  1415. 81 Q ((nil,nil),(nil,(nil,nil)))
  1416. 82 R ((nil,nil),(nil,(nil,(nil,nil))))
  1417. 83 S ((nil,nil),(nil,(nil,(nil,(nil,nil)))))
  1418. 84 T ((nil,nil),(nil,(nil,(nil,(nil,(nil,nil))))))
  1419. 85 U ((nil,nil),(nil,(nil,((nil,(nil,nil)),nil))))
  1420. 86 V ((nil,nil),(nil,(nil,(((nil,nil),nil),nil))))
  1421. 87 W ((nil,nil),(nil,((nil,nil),(nil,nil))))
  1422. 88 X ((nil,nil),(nil,((nil,(nil,nil)),nil)))
  1423. 89 Y ((nil,nil),(nil,((nil,(nil,nil)),(nil,nil))))
  1424. 90 Z ((nil,nil),(nil,((nil,(nil,(nil,nil))),nil)))
  1425. 91 [ ((nil,nil),(nil,((nil,((nil,nil),nil)),nil)))
  1426. 92 \ ((nil,nil),(nil,(((nil,nil),nil),nil)))
  1427. 93 ] ((nil,nil),(nil,(((nil,nil),nil),(nil,nil))))
  1428. 94 ^ ((nil,nil),(nil,(((nil,nil),(nil,nil)),nil)))
  1429. 95 _ ((nil,nil),(nil,(((nil,(nil,nil)),nil),nil)))
  1430. 96 ` ((nil,nil),(nil,((((nil,nil),nil),nil),nil)))
  1431. 97 a ((nil,nil),((nil,nil),(nil,nil)))
  1432. 98 b ((nil,nil),((nil,nil),(nil,(nil,nil))))
  1433. 99 c ((nil,nil),((nil,nil),(nil,(nil,(nil,nil)))))
  1434. 100 d ((nil,nil),((nil,nil),((nil,nil),(nil,nil))))
  1435. 101 e ((nil,nil),((nil,nil),((nil,(nil,nil)),nil)))
  1436. 102 f ((nil,nil),((nil,(nil,nil)),nil))
  1437. 103 g ((nil,nil),((nil,(nil,nil)),(nil,nil)))
  1438. 104 h ((nil,nil),((nil,(nil,nil)),(nil,(nil,nil))))
  1439. 105 i ((nil,nil),((nil,(nil,nil)),((nil,nil),nil)))
  1440. 106 j ((nil,nil),((nil,(nil,(nil,nil))),nil))
  1441. 107 k ((nil,nil),((nil,(nil,(nil,nil))),(nil,nil)))
  1442. 108 l ((nil,nil),((nil,(nil,(nil,(nil,nil)))),nil))
  1443. 109 m ((nil,nil),((nil,((nil,nil),nil)),(nil,nil)))
  1444. 110 n ((nil,nil),((nil,((nil,nil),(nil,nil))),nil))
  1445. 111 o ((nil,nil),((nil,((nil,(nil,nil)),nil)),nil))
  1446. 112 p ((nil,nil),(((nil,nil),nil),(nil,nil)))
  1447. 113 q ((nil,nil),(((nil,nil),nil),(nil,(nil,nil))))
  1448. 114 r ((nil,nil),(((nil,nil),(nil,nil)),nil))
  1449. 115 s ((nil,nil),(((nil,nil),(nil,nil)),(nil,nil)))
  1450. 116 t ((nil,nil),(((nil,nil),(nil,(nil,nil))),nil))
  1451. 117 u ((nil,nil),(((nil,(nil,nil)),nil),(nil,nil)))
  1452. 118 v ((nil,nil),(((nil,(nil,nil)),(nil,nil)),nil))
  1453. 119 w ((nil,nil),((((nil,nil),nil),nil),(nil,nil)))
  1454. 120 x ((nil,nil),((((nil,nil),nil),(nil,nil)),nil))
  1455. 121 y ((nil,nil),(((((nil,nil),nil),nil),nil),nil))
  1456. 122 z ((nil,(nil,nil)),(nil,nil))
  1457. 123 { ((nil,(nil,nil)),(nil,(nil,(nil,nil))))
  1458. 124 | ((nil,(nil,nil)),(nil,(nil,(nil,(nil,nil)))))
  1459. 125 } ((nil,(nil,nil)),(nil,((nil,nil),nil)))
  1460. 126 ~ ((nil,(nil,nil)),(nil,((nil,nil),(nil,nil))))
  1461. 127 ((nil,(nil,nil)),(nil,((nil,(nil,nil)),nil)))
  1462. 128 ((nil,(nil,nil)),((nil,nil),(nil,nil)))
  1463. 129 ((nil,(nil,nil)),((nil,nil),(nil,(nil,nil))))
  1464. 130 ((nil,(nil,nil)),((nil,(nil,nil)),nil))
  1465. 131 ((nil,(nil,nil)),((nil,(nil,nil)),(nil,nil)))
  1466. 132 ((nil,(nil,nil)),((nil,(nil,(nil,nil))),nil))
  1467. 133 ((nil,(nil,nil)),(((nil,nil),nil),(nil,nil)))
  1468. 134 ((nil,(nil,nil)),(((nil,nil),(nil,nil)),nil))
  1469. 135 ((nil,(nil,(nil,nil))),(nil,nil))
  1470. 136 ((nil,(nil,(nil,nil))),(nil,(nil,nil)))
  1471. 137 ((nil,(nil,(nil,nil))),(nil,(nil,(nil,nil))))
  1472. 138 ((nil,(nil,(nil,nil))),(nil,((nil,nil),nil)))
  1473. 139 ((nil,(nil,(nil,nil))),((nil,nil),(nil,nil)))
  1474. 140 ((nil,(nil,(nil,nil))),((nil,(nil,nil)),nil))
  1475. 141 ((nil,(nil,(nil,(nil,nil)))),(nil,nil))
  1476. 142 ((nil,(nil,(nil,(nil,nil)))),(nil,(nil,nil)))
  1477. 143 ((nil,(nil,(nil,(nil,nil)))),((nil,nil),nil))
  1478. 144 ((nil,(nil,(nil,(nil,(nil,nil))))),(nil,nil))
  1479. 145 ((nil,(nil,(nil,((nil,nil),nil)))),(nil,nil))
  1480. 146 ((nil,(nil,((nil,nil),nil))),(nil,nil))
  1481. 147 ((nil,(nil,((nil,nil),(nil,nil)))),(nil,nil))
  1482. 148 ((nil,(nil,((nil,(nil,nil)),nil))),(nil,nil))
  1483. 149 ((nil,(nil,(((nil,nil),nil),nil))),(nil,nil))
  1484. 150 ((nil,((nil,nil),nil)),(nil,nil))
  1485. 151 ((nil,((nil,nil),nil)),(nil,(nil,nil)))
  1486. 152 ((nil,((nil,nil),nil)),(nil,(nil,(nil,nil))))
  1487. 153 ((nil,((nil,nil),nil)),(nil,((nil,nil),nil)))
  1488. 154 ((nil,((nil,nil),nil)),((nil,nil),(nil,nil)))
  1489. 155 ((nil,((nil,nil),nil)),((nil,(nil,nil)),nil))
  1490. 156 ((nil,((nil,nil),(nil,nil))),(nil,nil))
  1491. 157 ((nil,((nil,nil),(nil,nil))),(nil,(nil,nil)))
  1492. 158 ((nil,((nil,nil),(nil,(nil,nil)))),(nil,nil))
  1493. 159 ((nil,((nil,nil),((nil,nil),nil))),(nil,nil))
  1494. 160 ((nil,((nil,(nil,nil)),nil)),(nil,nil))
  1495. 161 ((nil,((nil,(nil,nil)),nil)),(nil,(nil,nil)))
  1496. 162 ((nil,((nil,(nil,nil)),nil)),((nil,nil),nil))
  1497. 163 ((nil,((nil,(nil,nil)),(nil,nil))),(nil,nil))
  1498. 164 ((nil,((nil,(nil,(nil,nil))),nil)),(nil,nil))
  1499. 165 ((nil,((nil,((nil,nil),nil)),nil)),(nil,nil))
  1500. 166 ((nil,(((nil,nil),nil),nil)),(nil,nil))
  1501. 167 ((nil,(((nil,nil),nil),(nil,nil))),(nil,nil))
  1502. 168 ((nil,(((nil,nil),(nil,nil)),nil)),(nil,nil))
  1503. 169 ((nil,(((nil,(nil,nil)),nil),nil)),(nil,nil))
  1504. 170 ((nil,((((nil,nil),nil),nil),nil)),(nil,nil))
  1505. 171 (((nil,nil),nil),(nil,nil))
  1506. 172 (((nil,nil),nil),(nil,(nil,nil)))
  1507. 173 (((nil,nil),nil),(nil,(nil,(nil,nil))))
  1508. 174 (((nil,nil),nil),(nil,(nil,(nil,(nil,nil)))))
  1509. 175 (((nil,nil),nil),(nil,(nil,((nil,nil),nil))))
  1510. 176 (((nil,nil),nil),(nil,((nil,nil),nil)))
  1511. 177 (((nil,nil),nil),(nil,((nil,nil),(nil,nil))))
  1512. 178 (((nil,nil),nil),(nil,((nil,(nil,nil)),nil)))
  1513. 179 (((nil,nil),nil),(nil,(((nil,nil),nil),nil)))
  1514. 180 (((nil,nil),nil),((nil,nil),(nil,nil)))
  1515. 181 (((nil,nil),nil),((nil,nil),(nil,(nil,nil))))
  1516. 182 (((nil,nil),nil),((nil,(nil,nil)),nil))
  1517. 183 (((nil,nil),nil),((nil,(nil,nil)),(nil,nil)))
  1518. 184 (((nil,nil),nil),((nil,(nil,(nil,nil))),nil))
  1519. 185 (((nil,nil),nil),(((nil,nil),nil),(nil,nil)))
  1520. 186 (((nil,nil),nil),(((nil,nil),(nil,nil)),nil))
  1521. 187 (((nil,nil),(nil,nil)),(nil,nil))
  1522. 188 (((nil,nil),(nil,nil)),(nil,(nil,nil)))
  1523. 189 (((nil,nil),(nil,nil)),(nil,(nil,(nil,nil))))
  1524. 190 (((nil,nil),(nil,nil)),(nil,((nil,nil),nil)))
  1525. 191 (((nil,nil),(nil,nil)),((nil,(nil,nil)),nil))
  1526. 192 (((nil,nil),(nil,(nil,nil))),(nil,nil))
  1527. 193 (((nil,nil),(nil,(nil,nil))),(nil,(nil,nil)))
  1528. 194 (((nil,nil),(nil,(nil,(nil,nil)))),(nil,nil))
  1529. 195 (((nil,nil),(nil,((nil,nil),nil))),(nil,nil))
  1530. 196 (((nil,nil),((nil,nil),nil)),(nil,nil))
  1531. 197 (((nil,nil),((nil,nil),nil)),(nil,(nil,nil)))
  1532. 198 (((nil,nil),((nil,nil),(nil,nil))),(nil,nil))
  1533. 199 (((nil,nil),((nil,(nil,nil)),nil)),(nil,nil))
  1534. 200 (((nil,nil),(((nil,nil),nil),nil)),(nil,nil))
  1535. 201 (((nil,(nil,nil)),nil),(nil,nil))
  1536. 202 (((nil,(nil,nil)),nil),(nil,(nil,nil)))
  1537. 203 (((nil,(nil,nil)),nil),(nil,(nil,(nil,nil))))
  1538. 204 (((nil,(nil,nil)),nil),(nil,((nil,nil),nil)))
  1539. 205 (((nil,(nil,nil)),nil),((nil,nil),(nil,nil)))
  1540. 206 (((nil,(nil,nil)),nil),((nil,(nil,nil)),nil))
  1541. 207 (((nil,(nil,nil)),(nil,nil)),(nil,nil))
  1542. 208 (((nil,(nil,nil)),(nil,nil)),(nil,(nil,nil)))
  1543. 209 (((nil,(nil,nil)),(nil,(nil,nil))),(nil,nil))
  1544. 210 (((nil,(nil,nil)),((nil,nil),nil)),(nil,nil))
  1545. 211 (((nil,(nil,(nil,nil))),nil),(nil,nil))
  1546. 212 (((nil,(nil,(nil,nil))),nil),(nil,(nil,nil)))
  1547. 213 (((nil,(nil,(nil,nil))),nil),((nil,nil),nil))
  1548. 214 (((nil,(nil,(nil,nil))),(nil,nil)),(nil,nil))
  1549. 215 (((nil,(nil,(nil,(nil,nil)))),nil),(nil,nil))
  1550. 216 (((nil,(nil,((nil,nil),nil))),nil),(nil,nil))
  1551. 217 (((nil,((nil,nil),nil)),nil),(nil,nil))
  1552. 218 (((nil,((nil,nil),nil)),nil),(nil,(nil,nil)))
  1553. 219 (((nil,((nil,nil),nil)),nil),((nil,nil),nil))
  1554. 220 (((nil,((nil,nil),nil)),(nil,nil)),(nil,nil))
  1555. 221 (((nil,((nil,nil),(nil,nil))),nil),(nil,nil))
  1556. 222 (((nil,((nil,(nil,nil)),nil)),nil),(nil,nil))
  1557. 223 (((nil,(((nil,nil),nil),nil)),nil),(nil,nil))
  1558. 224 ((((nil,nil),nil),nil),(nil,nil))
  1559. 225 ((((nil,nil),nil),nil),(nil,(nil,nil)))
  1560. 226 ((((nil,nil),nil),nil),(nil,(nil,(nil,nil))))
  1561. 227 ((((nil,nil),nil),nil),(nil,((nil,nil),nil)))
  1562. 228 ((((nil,nil),nil),nil),((nil,nil),nil))
  1563. 229 ((((nil,nil),nil),nil),((nil,nil),(nil,nil)))
  1564. 230 ((((nil,nil),nil),nil),((nil,(nil,nil)),nil))
  1565. 231 ((((nil,nil),nil),nil),(((nil,nil),nil),nil))
  1566. 232 ((((nil,nil),nil),(nil,nil)),(nil,nil))
  1567. 233 ((((nil,nil),nil),(nil,nil)),(nil,(nil,nil)))
  1568. 234 ((((nil,nil),nil),(nil,(nil,nil))),(nil,nil))
  1569. 235 ((((nil,nil),nil),((nil,nil),nil)),(nil,nil))
  1570. 236 ((((nil,nil),(nil,nil)),nil),(nil,nil))
  1571. 237 ((((nil,nil),(nil,nil)),nil),(nil,(nil,nil)))
  1572. 238 ((((nil,nil),(nil,nil)),(nil,nil)),(nil,nil))
  1573. 239 ((((nil,nil),(nil,(nil,nil))),nil),(nil,nil))
  1574. 240 ((((nil,nil),((nil,nil),nil)),nil),(nil,nil))
  1575. 241 ((((nil,(nil,nil)),nil),nil),(nil,nil))
  1576. 242 ((((nil,(nil,nil)),nil),nil),(nil,(nil,nil)))
  1577. 243 ((((nil,(nil,nil)),nil),nil),((nil,nil),nil))
  1578. 244 ((((nil,(nil,nil)),nil),(nil,nil)),(nil,nil))
  1579. 245 ((((nil,(nil,nil)),(nil,nil)),nil),(nil,nil))
  1580. 246 ((((nil,(nil,(nil,nil))),nil),nil),(nil,nil))
  1581. 247 ((((nil,((nil,nil),nil)),nil),nil),(nil,nil))
  1582. 248 (((((nil,nil),nil),nil),nil),(nil,nil))
  1583. 249 (((((nil,nil),nil),nil),nil),(nil,(nil,nil)))
  1584. 250 (((((nil,nil),nil),nil),nil),((nil,nil),nil))
  1585. 251 (((((nil,nil),nil),nil),(nil,nil)),(nil,nil))
  1586. 252 (((((nil,nil),nil),(nil,nil)),nil),(nil,nil))
  1587. 253 (((((nil,nil),(nil,nil)),nil),nil),(nil,nil))
  1588. 254 (((((nil,(nil,nil)),nil),nil),nil),(nil,nil))
  1589. 255 ((((((nil,nil),nil),nil),nil),nil),(nil,nil))
  1590. 
  1591. File: avram.info, Node: Reference Implementations, Next: Changes, Prev: Character Table, Up: Top
  1592. Appendix B Reference Implementations
  1593. ************************************
  1594. This appendix contains some `silly' source code for several functions
  1595. that are mentioned in *note Virtual Code Semantics::, for specifying
  1596. the virtual machine code semantics, namely `pairwise', `transition',
  1597. `insert' and `replace'.
  1598. The intention is to specify the virtual machine mathematically with a
  1599. minimum of hand waving, by using only simple equations and small
  1600. fragments of `silly' code, which has a straightforward semantics.
  1601. However, the `silly' code fragments are more significant in some cases
  1602. than what could fit into a few lines or be mechanically derived from an
  1603. equation.
  1604. The purpose of this appendix is therefore to avoid leaving any gaps
  1605. in the construction by demonstrating that everything mentioned can be
  1606. done. None of this code is needed for any practical purpose, because its
  1607. functionality is inherent in the virtual machine, but it shows how
  1608. certain operations would be specified if they were not built in.
  1609. * Menu:
  1610. * Pairwise::
  1611. * Insert::
  1612. * Replace::
  1613. * Transition::
  1614. 
  1615. File: avram.info, Node: Pairwise, Next: Insert, Prev: Reference Implementations, Up: Reference Implementations
  1616. B.1 Pairwise
  1617. ============
  1618. This `silly' code fragment is mentioned in *note Reduce::, in the
  1619. discussion of `reduce', and is provided as an example of a solution to
  1620. equations _E1_ to _E3_. It is written in the style of a higher order
  1621. function, in that it takes a function `F' as an argument and returns
  1622. another function, [[`pairwise']] `F' as a result.
  1623. self = left
  1624. argument = right
  1625. head = left
  1626. tail = right
  1627. pairwise =
  1628. compose(
  1629. refer,
  1630. compose(
  1631. bu(
  1632. conditional,
  1633. conditional(argument,compose(tail,argument),constant nil)),
  1634. couple(
  1635. (hired couple)(
  1636. (hired compose)(
  1637. identity,
  1638. constant (hired fan head)(
  1639. argument,
  1640. compose(tail,argument))),
  1641. constant (hired meta)(
  1642. self,
  1643. compose(tail,compose(tail,argument)))),
  1644. constant argument)))
  1645. To see how this works, one should evaluate it symbolically with an
  1646. unknown `F', which will result in some `silly' pseudocode, and then
  1647. evaluate that symbolically with some sample lists.
  1648. 
  1649. File: avram.info, Node: Insert, Next: Replace, Prev: Pairwise, Up: Reference Implementations
  1650. B.2 Insert
  1651. ==========
  1652. This function is mentioned in *note Sort::, on sorting. It takes the
  1653. virtual code for a partial order relational operator and returns the
  1654. code for a function of two arguments. The left argument is a list item
  1655. and the right argument is a list of items of the same type, which is
  1656. already sorted with respect to the relational operator given as the
  1657. argument to `insert'. The result of the function returned by `insert'
  1658. is a list similar to its right argument but with the left argument
  1659. inserted in the proper position to maintain the order.
  1660. This code makes use of the `self', `argument', `head' and `tail'
  1661. declarations associated with `pairwise'.
  1662. insert =
  1663. bu(compose,refer) (hired conditional)(
  1664. constant compose(right,argument),
  1665. couple(
  1666. (hired conditional)(
  1667. (hired compose)(
  1668. identity,
  1669. constant compose(
  1670. couple(left,compose(head,right)),
  1671. argument)),
  1672. constant (
  1673. argument,
  1674. couple(
  1675. compose(head,compose(right,argument)),
  1676. (hired meta)(
  1677. self,
  1678. couple(
  1679. compose(left,argument),
  1680. compose(tail,compose(right,argument))))))),
  1681. constant argument))
  1682. As with the other higher order functions in this appendix, the only
  1683. feasible ways to verify it would be either by formal proof or by some
  1684. form of symbolic interpretation.
  1685. 
  1686. File: avram.info, Node: Replace, Next: Transition, Prev: Insert, Up: Reference Implementations
  1687. B.3 Replace
  1688. ===========
  1689. This code is needed in the discussion of assignment in *note
  1690. Assignment::. where it serves as a solution to equation _E0_. The idea
  1691. is that the function takes an argument of the form
  1692. `((LOCATIONS,VALUES),STORE)' and returns the store with the values
  1693. stored at the locations indicated.
  1694. locations = compose(left,compose(left,argument))
  1695. values = compose(right,compose(left,argument))
  1696. store = compose(right,argument)
  1697. replace =
  1698. refer conditional(
  1699. store,
  1700. (
  1701. conditional(
  1702. compose(left,locations),
  1703. (
  1704. conditional(
  1705. compose(right,locations),
  1706. (
  1707. (hired meta)(
  1708. self,
  1709. couple(
  1710. (hired fan right)(locations,values),
  1711. (hired meta)(
  1712. self,
  1713. couple(
  1714. (hired fan left)(locations,values),
  1715. store)))),
  1716. couple(
  1717. (hired meta)(
  1718. self,
  1719. couple(
  1720. couple(compose(left,locations),values),
  1721. compose(left,store))),
  1722. compose(right,store)))),
  1723. conditional(
  1724. compose(right,locations),
  1725. (
  1726. couple(
  1727. compose(left,store),
  1728. (hired meta)(
  1729. self,
  1730. couple(
  1731. couple(compose(right,locations),values),
  1732. compose(right,store)))),
  1733. values)))),
  1734. (hired meta)(
  1735. self,
  1736. couple(couple(locations,values),constant (nil,nil)))))
  1737. 
  1738. File: avram.info, Node: Transition, Prev: Replace, Up: Reference Implementations
  1739. B.4 Transition
  1740. ==============
  1741. This code is relevant to the discussion of `transfer' in *note
  1742. Transfer::, where its specification is described in detail. When this
  1743. code is evaluated on a virtual code application `F', the result is the
  1744. code for a transition function that takes one configuration to the next
  1745. in the course of evaluating a transfer function, as specified in
  1746. equations _E7_ to _E9_.
  1747. output_buffer = compose(left,argument)
  1748. input_buffer = compose(right,compose(right,argument))
  1749. active = compose(left,compose(right,argument))
  1750. state = compose(left,active)
  1751. output = compose(right,active)
  1752. transition =
  1753. bu(compose,refer) (hired bu(conditional,active))(
  1754. (hired conditional)(
  1755. constant input_buffer,
  1756. bu(compose,(fan bu(hired meta,self))) (hired apply)(
  1757. constant fan bu(couple,couple(output,output_buffer)),
  1758. couple (fan bu(compose,couple))(
  1759. couple(
  1760. (hired apply)(
  1761. hired,
  1762. constant (state,compose(head,input_buffer))),
  1763. constant compose(tail,input_buffer)),
  1764. couple(
  1765. (hired apply)(hired,constant(state,constant nil)),
  1766. constant constant nil)))),
  1767. constant compose(flat,compose(reverse,output_buffer)))
  1768. 
  1769. File: avram.info, Node: Changes, Next: External Libraries, Prev: Reference Implementations, Up: Top
  1770. Appendix C Changes
  1771. ******************
  1772. This section is reserved for brief updates due to changes in the
  1773. software that may be important enough to note temporarily until more
  1774. thorough revisions to the document can be made.
  1775. The lack of content here indicates that the current version is either
  1776. completely up to date or in such a sorry state of neglect that even
  1777. this section is obsolete.
  1778. 
  1779. File: avram.info, Node: External Libraries, Next: Copying, Prev: Changes, Up: Top
  1780. Appendix D External Libraries
  1781. *****************************
  1782. Various functions are callable from virtual code applications by way of
  1783. the `library' combinator as explained in *note Library combinator::. An
  1784. expression (shown in `silly' syntax) of the form `library('foo','bar')
  1785. x' applies a function named `'bar'' from a library named `'foo'' to an
  1786. argument `x'.
  1787. A brief overview of the libraries and functions can always be had by
  1788. executing
  1789. $ avram --external-libraries
  1790. The listing displayed by this command may show some that are not
  1791. included here if this version of the documentation is not current or
  1792. your installation has been locally enhanced. It may also lack some that
  1793. are documented here if your installation is not fully equipped.
  1794. Although the overview from the command line is adequate for a
  1795. reminder, it is not informative enough to explain how each function
  1796. should be used. The purpose of this section is to provide this
  1797. information in greater detail.
  1798. Some general comments are applicable to all libraries.
  1799. Each library documented in this section can generate error messages
  1800. in the event of exceptional conditions, that are documented
  1801. individually. In addition to those, it's also possible for any library
  1802. function to return error messages of
  1803. <'unrecognized library'>
  1804. <'unrecognized XXXX function name'>
  1805. where XXXX is the name of a library. These indicate either that the
  1806. library name is invalid, or the library name is valid but the function
  1807. name is invalid, or that they're both valid but the library wasn't
  1808. detected on the host when `avram' was compiled. A virtual code
  1809. application can always avoid these errors by testing for the
  1810. availability of a function using the `have' combinator (*note Have
  1811. combinator::).
  1812. In addition, any library function that operates on numerical values
  1813. or lists thereof can return these messages in cases of invalid input.
  1814. <'missing value'>
  1815. <'invalid value'>
  1816. <'bad vector specification'>
  1817. <'bad matrix specification'>
  1818. These messages indicate that an input parameter that was required to be
  1819. a valid representation of a floating point number, a vector, or a
  1820. matrix was something other than that (*note Type Conversions::). The
  1821. last could also occur if a parameter that is required to be a square
  1822. matrix has unequal numbers of rows and columns.
  1823. * Menu:
  1824. * bes:: Bessel functions
  1825. * complex:: native complex arithmetic
  1826. * fftw:: fast Fourier transforms
  1827. * glpk:: simplex linear programming
  1828. * gsldif:: numerical differentiation
  1829. * gslevu:: series acceleration
  1830. * gslint:: numerical integration
  1831. * harminv:: harmonic inversion
  1832. * kinsol:: constrained non-linear optimization
  1833. * lapack:: linear algebra
  1834. * math:: native floating point arithmetic
  1835. * mtwist:: random number generation
  1836. * minpack:: non-linear optimization
  1837. * mpfr:: arbitrary precision arithmetic
  1838. * lpsolve:: mixed integer programming
  1839. * rmath:: statistical and special functions
  1840. * umf:: sparse matrices
  1841. 
  1842. File: avram.info, Node: bes, Next: complex, Prev: External Libraries, Up: External Libraries
  1843. D.1 `bes'
  1844. =========
  1845. An interface to the Bessel functions as defined in the GNU Scientific
  1846. Library (gsl) is available to virtual code applications by invoking a
  1847. function of the form
  1848. library('bes',f)
  1849. where f is a character string identifying the Bessel function family.
  1850. All functions in this library return a floating point number encoded as
  1851. in *note math::.
  1852. * Menu:
  1853. * Bessel function calling conventions::
  1854. * Bessel function errors::
  1855. 
  1856. File: avram.info, Node: Bessel function calling conventions, Next: Bessel function errors, Prev: bes, Up: bes
  1857. D.1.1 Bessel function calling conventions
  1858. -----------------------------------------
  1859. The virtual code interface simplifies the gsl C language API by
  1860. excluding the facilities for error estimates, omitting certain array
  1861. valued functions, and subsuming sets of related functions within common
  1862. ones where possible.
  1863. The functions with names in the following group take an argument of
  1864. the form `(n,x)', where `n' identifies the member of the function
  1865. family, and `x' is the argument to the function.
  1866. * `J' regular cylindrical Bessel functions
  1867. * `Y' irregular cylindrical Bessel functions
  1868. * `I' regular modified cylindrical Bessel functions
  1869. * `K' irregular modified cylindrical Bessel functions
  1870. For these functions, `n' can be either a natural number encoded as
  1871. in *note Representation of Numeric and Textual Data::, or a floating
  1872. point number encoded as in *note math::. The latter case specifies
  1873. functions of a fractional order. The relevant gsl function is called
  1874. based on the value and type of the parameter.
  1875. Two further related families of functions follow the same calling
  1876. convention.
  1877. * `Isc' scaled regular modified cylindrical Bessel functions
  1878. * `Ksc' scaled irregular modified cylindrical Bessel functions
  1879. The foregoing functions are related to those above by an exponential
  1880. scale factor as documented in the gsl reference manual.
  1881. Functions with names in the following group also take an argument of
  1882. the form `(n,x)', but are not defined for fractional orders and so
  1883. require a natural number for `n'.
  1884. * `j' regular spherical Bessel functions
  1885. * `y' irregular spherical Bessel functions
  1886. * `isc' regular modified spherical Bessel functions
  1887. * `ksc' irregular modified spherical Bessel functions
  1888. The functions in the remaining group follow idiosyncratic calling
  1889. conventions.
  1890. * `zJ0', `zJ1' These take a natural number `n' and return the `n'th
  1891. root of the regular cylindrical Bessel functions of order 0 or 1,
  1892. respectively.
  1893. * `zJnu' This takes a pair `(nu,n)' where `nu' is the (fractional)
  1894. order of a regular cylindrical Bessel function, `n' is a natural
  1895. number. It returns the `n'th zero of the function.
  1896. * `lnKnu' This takes a pair of floating point numbers `(nu,x)' where
  1897. `nu' is the (fractional) order of an irregular modified
  1898. cylindrical Bessel and `x' is the argument to the function, and it
  1899. returns the natural log of the function.
  1900. 
  1901. File: avram.info, Node: Bessel function errors, Prev: Bessel function calling conventions, Up: bes
  1902. D.1.2 Bessel function errors
  1903. ----------------------------
  1904. Memory overflows and unrecognized function names can happen as with
  1905. other library interfaces. A message of
  1906. <'bad bessel function call'>
  1907. means that invalid input parameters were given, such as a fractional
  1908. order to a function family that is defined only for natural orders.
  1909. 
  1910. File: avram.info, Node: complex, Next: fftw, Prev: bes, Up: External Libraries
  1911. D.2 `complex'
  1912. =============
  1913. Complex numbers are represented according to the ISO C standard as arrays
  1914. of two IEEE double precision floating point numbers of 8 bytes each,
  1915. with the number representing the real part first.
  1916. A small selection of operations on complex numbers is available by
  1917. function calls of the form `library('complex',f)'. These functions are
  1918. implemented by the host system's C library.
  1919. One example is `library('complex','create')' which takes a pair of
  1920. floating point numbers `(X,Y)' to a complex number whose real part is X
  1921. and whose imaginary part is Y. See *note math:: for information about
  1922. constructing floating point numbers.
  1923. Other than that, the `complex' library functions `f' fall into three
  1924. main groups, which are the real valued unary operations, the complex
  1925. valued unary operations, and the complex valued binary operations. All
  1926. of these operations are designated by their standard C names as
  1927. documented elsewhere, such as the GNU `libc' reference manual, except
  1928. as noted.
  1929. * real valued unary operations
  1930. creal cimag cabs carg
  1931. * complex valued unary operations
  1932. ccos cexp clog conj csin csqrt
  1933. ctan csinh ccosh ctanh casinh cacosh
  1934. catanh casin cacos catan
  1935. * complex valued binary operations
  1936. cpow vid bus mul add sub div
  1937. The last four correspond to the C language operators `*', `+', `-',
  1938. and `/' for complex numbers. The functions named `vid' and `bus' are
  1939. similar to `div' and `sub', respectively, but with the operands
  1940. interchanged. That is,
  1941. library('complex','vid') (x,y)
  1942. is equivalent to
  1943. library('complex','div') (y,x)
  1944. All functions in this library taking complex numbers as input may
  1945. also operate on real numbers, and binary operators can have either or
  1946. both operands real. For real operands, a value of zero is inferred as
  1947. the imaginary part. The result type of the function is the same
  1948. regardless.
  1949. 
  1950. File: avram.info, Node: fftw, Next: glpk, Prev: complex, Up: External Libraries
  1951. D.3 `fftw'
  1952. ==========
  1953. Some functions in the `fftw' fast Fourier transform library are callable
  1954. by virtual code programs of the form `library('fftw',f)', where `f' can
  1955. be one of the following character strings.
  1956. `u_fw_dft'
  1957. (uni-dimensional forward Discrete Fourier transform)
  1958. `u_bw_dft'
  1959. (uni-dimensional backward Discrete Fourier transform)
  1960. `b_fw_dft'
  1961. (bi-dimensional forward Discrete Fourier transform)
  1962. `b_bw_dft'
  1963. (bi-dimensional backward Discrete Fourier transform)
  1964. `u_dht'
  1965. (uni-dimensional Discrete Hartley transform)
  1966. `b_dht'
  1967. (bi-dimensional Discrete Hartley transform)
  1968. These stand for the discrete Fourier transform, in one dimension and
  1969. two dimensions, either backward or forward, and the discrete Hartley
  1970. transform in one dimension and two dimensions. The `fftw' library
  1971. documentation (`http://www.fftw.org') can give more information about
  1972. the meaning of these transformations.
  1973. The interface is somewhat simplified compared to the API for the
  1974. `fftw' C library because there are no considerations of memory
  1975. management or planning, nor any provision for dimensions higher than
  1976. two.
  1977. Furthermore, from the virtual side of the interface, these functions
  1978. operate on lists rather than arrays. The one dimensional Fourier
  1979. transforms take a list of complex numbers to a list of complex numbers
  1980. (see *note complex::), and the one dimensional Hartley transforms take
  1981. a list of reals to a list of reals (see *note math::). The two
  1982. dimensional transforms are analogous but they take a matrix represented
  1983. as a list of lists. Error messages pertaining to invalid input
  1984. documented at the beginning of this section (*note External
  1985. Libraries::) are relevant.
  1986. Finally, unlike the native API for `fftw', these transformations are
  1987. scaled so that the backward transformation is the inverse of the
  1988. forward, and the Hartley transformations are their own inverses
  1989. (subject to roundoff error).
  1990. 
  1991. File: avram.info, Node: glpk, Next: gsldif, Prev: fftw, Up: External Libraries
  1992. D.4 `glpk'
  1993. ==========
  1994. The `glpk' library (`ftp://ftp.gnu.org/pub/gnu/glpk/') solves linear
  1995. programming problems by the either the simplex algorithm or an interior
  1996. point method.
  1997. The API for C client programs involves a complicated protocol with
  1998. many optional settings, which is simplified for the virtual machine
  1999. interface. Specifically, the library gives a choice of only two
  2000. functions, which can be expressed in the following forms.
  2001. library('glpk','simplex')
  2002. library('glpk','interior')
  2003. These functions have the same calling convention and should return
  2004. generally the same output for identical inputs, but differences in
  2005. performance, precision, and maybe correctness can be expected. The
  2006. remainder of this section applies to both of them.
  2007. * Menu:
  2008. * glpk input parameters::
  2009. * glpk output::
  2010. * glpk errors::
  2011. * Additional glpk notes::
  2012. 
  2013. File: avram.info, Node: glpk input parameters, Next: glpk output, Prev: glpk, Up: glpk
  2014. D.4.1 `glpk' input parameters
  2015. -----------------------------
  2016. The argument must be a triple of the form, `(C,(M,Y))', subject to the
  2017. following specification.
  2018. * C is a list of cost function coefficients as floating point
  2019. numbers (see *note math::). There should be one item of C for each
  2020. variable in the linear programming problem (Note that there is no
  2021. additive constant, which would require one extra).
  2022. The interpretation of C is that an assignment of non-negative
  2023. values to the variables X is sought to make the vector inner
  2024. product C X as small as possible.
  2025. * M is a sparse matrix represented as a list of triples in the form
  2026. <((I,J),A)...>
  2027. where I and J are row and column indices as natural numbers
  2028. starting from 0 and A is a non-zero floating point number. The
  2029. presence of a triple `((I,J),A)' in the list indicates that the
  2030. I,J-th entry in the matrix has a value of A. Missing combinations
  2031. of I and J indicate that the corresponding entry is zero.
  2032. The interpretation of M is that together with Y it specifies a
  2033. system of equations the variables in the solution X must satisfy
  2034. simultaneously, as explained below.
  2035. * Y is a list of floating point numbers, with one number for each
  2036. distinct value of I in M, above, needed to complete the equations.
  2037. The interpretation of Y is that in matrix notation, the condition
  2038. M X = Y must be met by any acceptable solution X.
  2039. To put it another way, for each distinct value of I, the I-th item
  2040. of Y has to equal the sum over all J of XJ A, where A is the real
  2041. number appearing in the triple `((I,J),A)' in M, if any, and XJ is
  2042. the J-th variable of the solution.
  2043. 
  2044. File: avram.info, Node: glpk output, Next: glpk errors, Prev: glpk input parameters, Up: glpk
  2045. D.4.2 `glpk' output
  2046. -------------------
  2047. If a solution meeting the constraints is found, it is returned as a
  2048. list of pairs of the form `<(I,X)...>', where each I is a natural
  2049. number and each X is a floating point number giving the value obtained
  2050. for the I-th variable numbered from zero. Any values of I that are
  2051. omitted from the list indicate that the corresponding variable has a
  2052. value of zero.
  2053. If no solution is found due to infeasibility or because `glpk' just
  2054. didn't find one, an empty list is returned. The lack of a solution is
  2055. not treated as an exceptional condition.
  2056. 
  2057. File: avram.info, Node: glpk errors, Next: Additional glpk notes, Prev: glpk output, Up: glpk
  2058. D.4.3 `glpk' errors
  2059. -------------------
  2060. Possible error messages are
  2061. <'bad glpk specification'>
  2062. which means that the input did not conform to the description given
  2063. above, and
  2064. <'memory overflow'>
  2065. It is not considered an exceptional condition for no feasible
  2066. solution to exist, and in that case an empty list is returned.
  2067. The `glpk' documentation gives no assurance as to the correctness of
  2068. reported solutions, so the user should also take the possibility of
  2069. incorrect results into account.
  2070. 
  2071. File: avram.info, Node: Additional glpk notes, Prev: glpk errors, Up: glpk
  2072. D.4.4 Additional `glpk' notes
  2073. -----------------------------
  2074. A sparse matrix representation of M is used because in practice most
  2075. linear programming problems have very sparse systems of equations.
  2076. Only the constraint of non-negativity is admitted. Other constraints
  2077. such as upper bounds must be effected through a change of variables if
  2078. required.
  2079. The `glpk' library has a small memory leak, which `avram' corrects
  2080. by methods described in *note Memory leaks::.
  2081. 
  2082. File: avram.info, Node: gsldif, Next: gslevu, Prev: glpk, Up: External Libraries
  2083. D.5 `gsldif'
  2084. ============
  2085. Numerical differentiation of a real valued function of a single real variable
  2086. can be done by a library function of the form
  2087. library('gsldif',method)
  2088. where `method' is one of
  2089. * `'backward''
  2090. * `'central''
  2091. * `'forward''
  2092. * `'t_backward''
  2093. * `'t_central''
  2094. * `'t_forward''
  2095. * Menu:
  2096. * gsldif input parameters::
  2097. * gsldif output::
  2098. * gsldif exceptions::
  2099. * Additional gsldif notes::
  2100. 
  2101. File: avram.info, Node: gsldif input parameters, Next: gsldif output, Prev: gsldif, Up: gsldif
  2102. D.5.1 `gsldif' input parameters
  2103. -------------------------------
  2104. The argument to the functions with mnemonics of `backward', `central'
  2105. or `forward' is a pair `(F,X)', where F is the virtual machine code for
  2106. a real valued function of a real variable, and X is the input to F
  2107. where the derivative is sought. Real numbers are represented according
  2108. to *note math::.
  2109. The argument to the functions with mnemonics of `t_backward',
  2110. `t_central' or `t_forward' is a pair `((F,T),X)', where F and X are as
  2111. above, and T is a tolerance represented as a floating point number. The
  2112. tolerance is passed through to the GNU Scientific library (GSL)
  2113. differentiation routines.
  2114. When no tolerance is specified, the default is `1.0e-8'.
  2115. 
  2116. File: avram.info, Node: gsldif output, Next: gsldif exceptions, Prev: gsldif input parameters, Up: gsldif
  2117. D.5.2 `gsldif' output
  2118. ---------------------
  2119. The result returned by `library('gsldif',method) (f,x)' or
  2120. `library('gsldif',method) ((f,t),x)' is an approximation of the first
  2121. derivative of F evaluated at X.
  2122. The result is obtained by the one of the GNU Scientific Library (GSL) functions
  2123. for numerical differentiation that matches the virtual code function
  2124. name. These functions are documented in the GSL reference manual. The
  2125. three methods should have approximately the same results but may differ
  2126. in numerical properties.
  2127. 
  2128. File: avram.info, Node: gsldif exceptions, Next: Additional gsldif notes, Prev: gsldif output, Up: gsldif
  2129. D.5.3 `gsldif' exceptions
  2130. -------------------------
  2131. An error message of
  2132. <'bad derivative specification'>
  2133. will be returned if the either the whole argument, F, or X is `nil'.
  2134. Any error message caused by the evaluation of F will propagate to
  2135. the result.
  2136. 
  2137. File: avram.info, Node: Additional gsldif notes, Prev: gsldif exceptions, Up: gsldif
  2138. D.5.4 Additional `gsldif' notes
  2139. -------------------------------
  2140. The function F may be any expressible virtual machine code function
  2141. that takes a real argument to a real result, including one that uses
  2142. other library functions. However, if F passes functions to other
  2143. library functions as arguments, there is a constant overhead in stack
  2144. space for each level, and a remote possibility of a segmentation fault
  2145. if they are very deeply nested.
  2146. Numerical instability is an issue for higher derivatives (i.e.,
  2147. differentiating a function that is obtained by differentiating another
  2148. function). Some experimentation with larger tolerances may be needed.
  2149. 
  2150. File: avram.info, Node: gslevu, Next: gslint, Prev: gsldif, Up: External Libraries
  2151. D.6 `gslevu'
  2152. ============
  2153. This library exports a pair of functions of the form
  2154. library('gslevu','accel')
  2155. library('gslevu','utrunc')
  2156. that take a list of real numbers X to a pair of real numbers `(S,E)'.
  2157. The idea is that X represents the first few terms of an infinite series
  2158. whose sum converges, but only very slowly. The functions extrapolate an
  2159. estimate of the infinite summation by the Levin u-transform as
  2160. documented in the GNU Scientific Library reference manual.
  2161. For well behaved series, considerably fewer terms are needed for an
  2162. accurate estimate than a direct summation would require.
  2163. * Menu:
  2164. * gslevu calling conventions::
  2165. * gslevu exceptions::
  2166. 
  2167. File: avram.info, Node: gslevu calling conventions, Next: gslevu exceptions, Prev: gslevu, Up: gslevu
  2168. D.6.1 `gslevu' calling conventions
  2169. ----------------------------------
  2170. The input to either of these functions is a list of real numbers
  2171. represented as explained in *note math::.
  2172. The result is a pair `(S,E)' holding an estimate of the sum, S, and
  2173. an estimate of the error in the sum, E, each being a real number.
  2174. Both functions compute the same sum, S, but the `utrunc' function is
  2175. faster and more memory efficient, using a less trustworthy method of
  2176. estimating the error.
  2177. 
  2178. File: avram.info, Node: gslevu exceptions, Prev: gslevu calling conventions, Up: gslevu
  2179. D.6.2 `gslevu' exceptions
  2180. -------------------------
  2181. If an empty list is passed as a parameter to a function in this library,
  2182. an error message of `<'empty gslevu sequence'>' is returned.
  2183. If there is insufficient memory, an error message of `<'memory
  2184. overflow'>' is returned.
  2185. Other than that, no exceptional conditions are relevant other than
  2186. the general ones documented at the beginning of *note External
  2187. Libraries::.
  2188. 
  2189. File: avram.info, Node: gslint, Next: harminv, Prev: gslevu, Up: External Libraries
  2190. D.7 `gslint'
  2191. ============
  2192. An interface to a selection of numerical integration routines from the GNU
  2193. Scientific Library is provided by functions of the form
  2194. library('gslint',q)
  2195. where q can be one of `'qng'', `'qng_tol'', `'qagx'', `'qagx_tol'',
  2196. `'qagp'', or `'qagp_tol''.
  2197. * Menu:
  2198. * gslint input parameters::
  2199. * gslint output::
  2200. * gslint exceptions::
  2201. * Additional gslint notes::
  2202. 
  2203. File: avram.info, Node: gslint input parameters, Next: gslint output, Prev: gslint, Up: gslint
  2204. D.7.1 `gslint' input parameters
  2205. -------------------------------
  2206. The library functions `qng' and `qagx' take an argument of the form
  2207. `(F,(A,B))', where F is a function to be integrated, A is the lower
  2208. limit, and B is the upper limit, both limits being floating point
  2209. numbers as in *note math::.
  2210. The `qng_tol' and `qagx_tol' functions take an argument of the form
  2211. `((F,T),(A,B))', where F, A, and B are as above, and T is a specified
  2212. tolerance.
  2213. The `qagp' and `qagp_tol' functions take arguments of the form
  2214. `(F,P)' and `((F,T),P)', respectively, where F and T are as above, and
  2215. P is an ordered list of real numbers specifying the limits of
  2216. integration along with arbitrarily many intervening breakpoints.
  2217. The integrand F is expressed in virtual machine code, and takes a
  2218. single real argument to a real result. The argument and result of F are
  2219. required to be floating point numbers as described in *note math::. Any
  2220. expressible function of this type is acceptable, even one defined in
  2221. terms of other integrals, so that a double or triple integral can be
  2222. expressed easily, albeit a costly computation. However, a constant
  2223. overhead in stack space is required for each nested library function
  2224. call, and there is currently no mechanism to prevent segmentation
  2225. faults due to a stack overflow.
  2226. When no tolerance is specified, as with `qng', `qagx', and `qagp',
  2227. the tightest attainable tolerance is chosen by default, currently
  2228. `2e-14', in order find the most accurate result possible. A selection
  2229. of progressively looser tolerances is tried automatically if the
  2230. tightest one is not successful, stopping when either a solution is
  2231. found or ten orders of magnitude are covered.
  2232. If a tolerance is explicitly specified, as with `qng_tol',
  2233. `qagx_tol' or `qagp_tol', only that tolerance is tried.
  2234. 
  2235. File: avram.info, Node: gslint output, Next: gslint exceptions, Prev: gslint input parameters, Up: gslint
  2236. D.7.2 `gslint' output
  2237. ---------------------
  2238. In all cases, if no exception occurs, the result returned is an
  2239. approximation of the integral of F over the interval from A to B or
  2240. from the first item of P to the last.
  2241. Results may differ in numerical properties depending on the
  2242. integration method and the tolerance used.
  2243. * The `qagp'* and `qagx'* functions use an adaptive algorithm, whereas
  2244. the `qng'* functions use a faster non-adaptive algorithm suitable
  2245. only for smooth integrands.
  2246. * Faster and maybe more accurate results are obtained for
  2247. discontinuous or non-differentiable integrands by the `qagp'*
  2248. integration methods if the interior points in P are chosen to
  2249. coincide with the discontinuities or corners.
  2250. * Larger tolerances are conducive to faster but less accurate
  2251. results in most cases.
  2252. 
  2253. File: avram.info, Node: gslint exceptions, Next: Additional gslint notes, Prev: gslint output, Up: gslint
  2254. D.7.3 `gslint' exceptions
  2255. -------------------------
  2256. If an argument of an inappropriate form can be detected (such as an
  2257. empty pair or one without floating point numbers), it causes an error
  2258. message to be returned saying
  2259. <'bad integral specification'>
  2260. Error messages signalled by the integrand F may also be reported, as
  2261. well as any message returned by `gsl_strerror'. A typical cause for a
  2262. `gsl_strerror' message would be an explicitly specified tolerance that
  2263. is too tight. An error message of
  2264. <'slow convergence'>
  2265. is returned in the event of excessively many function evaluations
  2266. (currently 3600 at each tolerance level).
  2267. 
  2268. File: avram.info, Node: Additional gslint notes, Prev: gslint exceptions, Up: gslint
  2269. D.7.4 Additional `gslint' notes
  2270. -------------------------------
  2271. The `qagx'* functions subsume the GSL variants `qags', `qagiu',
  2272. `qagil', and `qagi' for finite, semi-infinite, and infinite intervals,
  2273. which are seleted as appropriate based on the limits of integration A
  2274. and B.
  2275. The `qagp' function reverts to the `qagx' function if there are only
  2276. two points given in P. Fewer than two will cause an error.
  2277. The library interface code relies on the standard `setjmp' utility
  2278. found in the system header file `setjmp.h' to break out of integrals
  2279. that don't converge after excessively many function evaluations.
  2280. Non-termination has been an issue in the past with GSL integration
  2281. routines for very badly behaved integrands, and the API provides no
  2282. documented means for the user supplied integrand function to request a
  2283. halt.
  2284. Although it is meant to be standard, a host without `setjmp' will
  2285. cause `avram' to be configured to abort the application with an error
  2286. message in the event of non-convergence. This behavior is considered
  2287. preferable to the alternative of non-termination. Usually an effective
  2288. workaround in such cases is to specify a sufficiently loose tolerance
  2289. explicitly by using one of the *`_tol' library functions.
  2290. 
  2291. File: avram.info, Node: harminv, Next: kinsol, Prev: gslint, Up: External Libraries
  2292. D.8 `harminv'
  2293. =============
  2294. The `harminv' library decomposes a complex valued function of a discrete
  2295. variable into a sum of decaying sinusoids given a finite sample. It
  2296. uses a method with better accuracy and convergence than Fourier
  2297. analysis or least squares curve fitting. More information is available
  2298. at `http://ab-initio.mit.edu/wiki/index.php/Harminv'.
  2299. * Menu:
  2300. * harminv input parameters::
  2301. * harminv output::
  2302. * harminv exceptions::
  2303. * Additional harminv notes::
  2304. 
  2305. File: avram.info, Node: harminv input parameters, Next: harminv output, Prev: harminv, Up: harminv
  2306. D.8.1 `harminv' input parameters
  2307. --------------------------------
  2308. The virtual machine interface to the `harminv' library provides only a
  2309. single function, callable as
  2310. library('harminv','hsolve')
  2311. The input to this function is an operand of the form
  2312. (signal,(fmin,fmax),nf)
  2313. where
  2314. * `signal' is a list of complex numbers containing samples of the
  2315. function to be decomposed at equal time steps (*note complex:: and
  2316. *note Representation of Numeric and Textual Data::).
  2317. * `fmin' and `fmax' are the band limits expressed in units of
  2318. inverse time steps as floating point numbers (*note math::).
  2319. * `nf' is the number of spectral basis functions expressed as a
  2320. natural (*note Representation of Numeric and Textual Data::).
  2321. If a value of 0 is specified for `nf' a default value of
  2322. min(300, (fmax - fmin) * n * 1.1)
  2323. is used, where `n' is the length of `signal'. The computation time
  2324. increases cubically with `nf'.
  2325. 
  2326. File: avram.info, Node: harminv output, Next: harminv exceptions, Prev: harminv input parameters, Up: harminv
  2327. D.8.2 `harminv' output
  2328. ----------------------
  2329. The result returned by a call to
  2330. library('harminv','hsolve')
  2331. with valid input (*note harminv input parameters::) is a list of
  2332. similar tuples of the form
  2333. <(amplitude,frequency,decay,quality,error)...>
  2334. with all members being real valued except for the amplitudes, which are
  2335. complex. Each tuple describes a function of the form
  2336. f(t) = A * sin (frequency * t + P) * exp (-decay * t)
  2337. such that the summation of these functions approximates the original
  2338. given signal (*note harminv input parameters::). The real amplitude `A'
  2339. and phase `P' are given by the modulus and argument of the complex
  2340. amplitude returned in the result,
  2341. A = library('complex','cabs') amplitude
  2342. P = library('complex','carg') amplitude
  2343. in terms of the complex library functions (*note complex::). The error
  2344. values are measures of the goodness of fit, and the quality factors are
  2345. defined as
  2346. quality = (pi * |frequency| / decay)
  2347. It may be useful in some applications to ignore components with quality
  2348. factors outside of a certain range.
  2349. 
  2350. File: avram.info, Node: harminv exceptions, Next: Additional harminv notes, Prev: harminv output, Up: harminv
  2351. D.8.3 `harminv' exceptions
  2352. --------------------------
  2353. Various exceptional conditions are possible with the `harminv' library
  2354. interface, and one of the following messages could be returned. Each of
  2355. them has the form of a list containing a single character string.
  2356. * `unrecognized harminv function name' is reported in case of a
  2357. function call of the form `library('harminv',f)' where `f' is
  2358. anything other than the character string `'hsolve'', this being
  2359. the only function in the library.
  2360. * `bad harminv function call' is reported if the input parameters
  2361. don't meet the specifications described in *note harminv input
  2362. parameters::, or if `fmin' is greater than `fmax'.
  2363. * `bad vector specification' could be the result of a list of real
  2364. numbers rather than complex numbers being passed as a `signal'.
  2365. Real numbers can be converted to complex numbers using the
  2366. `create' function from the `complex' library (*note complex::).
  2367. * `memory overflow' can occur if `avram' is operating very close to
  2368. the limit of host memory, or perhaps if infeasibly large values
  2369. are passed as `nf'
  2370. * `counter overflow' is similar to a memory overflow
  2371. 
  2372. File: avram.info, Node: Additional harminv notes, Prev: harminv exceptions, Up: harminv
  2373. D.8.4 Additional `harminv' notes
  2374. --------------------------------
  2375. The `harminv' library interface requires the `harminv' and `lapack'
  2376. libraries to be installed on the host system, and also requires
  2377. standard complex number support from the system's C library.
  2378. The author's installation of `avram' has been compiled against the
  2379. Debian `harminv' development library package, which at this writing is
  2380. unmaintained and is missing the necessary header file `harminv-int.h',
  2381. without which compilation of files including `harminv.h' fails. Some
  2382. headers from `harminv.h' have been copied directly into
  2383. `avram-x.x.x/src/harminv.c' under the `avram' source tree to avoid this
  2384. dependence, so that `avram' will compile correctly on a Debian system.
  2385. These may need to be updated if necessary to track the `harminv' source.
  2386. 
  2387. File: avram.info, Node: kinsol, Next: lapack, Prev: harminv, Up: External Libraries
  2388. D.9 `kinsol'
  2389. ============
  2390. The `kinsol' library (`http://www.llnl.gov/CASC/sundials/') contains
  2391. sophisticated routines for non-linear optimization and constrained
  2392. non-linear optimization, some of which are available to virtual code
  2393. applications by way of functions expressed as shown.
  2394. library('kinsol',k)
  2395. The function name `k' is a string of the form `'XY_ZZZZZ''. The field
  2396. ZZZZZ specifies the optimization algorithm, which can be one of `dense',
  2397. `gmres', `bicgs', or `tfqmr', following the names used by the API for
  2398. `kinsol' in C. The field Y determines the way gradients are obtained,
  2399. which is either `j' for a user supplied Jacobian, or `d' for finite
  2400. differences computed by `kinsol'. The remaining field X is either `c'
  2401. for constrained optimization, or `u' for unconstrained. Hence, the
  2402. whole function name can be one of sixteen possible alternatives.
  2403. cd_dense cd_gmres cd_bicgs cd_tfqmr
  2404. ud_dense ud_gmres ud_bicgs ud_tfqmr
  2405. cj_dense cj_gmres cj_bicgs cj_tfqmr
  2406. uj_dense uj_gmres uj_bicgs uj_tfqmr
  2407. More specific information about the optimization algorithms can be
  2408. found in the `kinsol' documentation at the above address. Different
  2409. algorithms may perform better on different problems.
  2410. * Menu:
  2411. * kinsol input parameters::
  2412. * kinsol output::
  2413. * kinsol exceptions::
  2414. * Additional kinsol notes::
  2415. 
  2416. File: avram.info, Node: kinsol input parameters, Next: kinsol output, Prev: kinsol, Up: kinsol
  2417. D.9.1 `kinsol' input parameters
  2418. -------------------------------
  2419. Functions whose names are of the form `Xd_ZZZZZ' take an argument of
  2420. the form `(F,(I,O))', and functions whose names are of the form
  2421. `Xj_ZZZZZ' take an argument of the form `((F,J),(I,O))'. The
  2422. parameters have these interpretations.
  2423. * F is a function to be optimized, expressed in virtual machine
  2424. code. It takes a list of real numbers as input and returns a list
  2425. of real numbers as output. The numbers must be in floating point
  2426. format as described in *note math::.
  2427. * J is a function in virtual machine code that computes the Jacobian
  2428. or partial derivatives of F for a given list of input numbers. The
  2429. exact calling convention for J depends on the optimization
  2430. algorithm selected, as explained below.
  2431. * I is a list of real numbers suitable as an input for F. The exact
  2432. values of the numbers in I are not crucial but the length of I is
  2433. taken as an indication of the required length for any input list
  2434. to F. In the case of constrained optimization problems (i.e.,
  2435. functions with names beginning with `c'), I must consist entirely
  2436. of non-negative numbers.
  2437. * O is a list numbers indicating the "optimal" output from F in the
  2438. sense described below (*note kinsol output::). Its length is taken
  2439. to indicate the usual length of an output returned by F.
  2440. If the optimization problem is being solved by either the `cj_dense'
  2441. or the `uj_dense' method, the Jacobian parameter J is expected to take
  2442. a list V of real numbers the length of I as input and return a list of
  2443. lists of reals as output. The numbers are represented as described in
  2444. *note math::. The outer list in the output from J is required to be the
  2445. length of O, while each inner list is required to be the length of I.
  2446. The output from J is interpreted as a matrix of the form described
  2447. in *note Two dimensional arrays::. The entry in row M and column N is
  2448. the partial derivative (evaluated at V) of the M-th component of the
  2449. output of F with respect to the N-th item of the input list.
  2450. For optimization problems being solved by the methods of `Xj_gmres',
  2451. `Xj_bicgs', or `Xj_tfqmr', (i.e., where X is either `c' or `u') the
  2452. Jacobian function J follows a different convention that is meant to be
  2453. more memory efficient. Given an argument of the form `(M,V)', it
  2454. returns only the M-th row of the matrix described above instead of the
  2455. whole thing. The parameter M is a natural number less than the length
  2456. of O, and V is a list of real numbers the length of I the same as
  2457. above. The number M is encoded as described in *note Representation of
  2458. Numeric and Textual Data::.
  2459. 
  2460. File: avram.info, Node: kinsol output, Next: kinsol exceptions, Prev: kinsol input parameters, Up: kinsol
  2461. D.9.2 `kinsol' output
  2462. ---------------------
  2463. The `kinsol' functions attempt to search the domain of F for a vector V
  2464. the length of I to satisfy `F(V) = O' as closely as possible. In the
  2465. case of constrained optimization, (i.e., functions whose names begin
  2466. with `c'), only non-negative numbers are acceptable in V. The search
  2467. for V will start in the vicinity of I. The value of I will therefore
  2468. determine a unique solution if multiple solutions exist, and will save
  2469. time if it is near a solution.
  2470. In some cases when a solution can't be found due to non-convergence, an
  2471. empty list is returned. Non-convergence is not considered an
  2472. exceptional condition. In all other cases where no exception occurs,
  2473. the output from a `kinsol' function will be the list V of real numbers
  2474. satisfying `F(V) = O' to the best possible tolerance.
  2475. 
  2476. File: avram.info, Node: kinsol exceptions, Next: Additional kinsol notes, Prev: kinsol output, Up: kinsol
  2477. D.9.3 `kinsol' exceptions
  2478. -------------------------
  2479. * Any error messages that may be generated in the course of
  2480. evaluating the functions F and J will propagate to the result
  2481. returned by the `kinsol' library functions.
  2482. * If there is insufficient memory to complete any operation, the
  2483. result is a message of
  2484. <'memory overflow'>
  2485. * If the argument to the library function (i.e., `(F,(I,O))' or
  2486. `((F,J),(I,O))') fails to meet the required specifications in a
  2487. detectable way, the result will be a message of
  2488. <'bad kinsol specification'>
  2489. * Any status returned by any `kinsol' API functions other than
  2490. success or one of several types of non-convergence results in a
  2491. message of
  2492. <'kinsol error'>
  2493. 
  2494. File: avram.info, Node: Additional kinsol notes, Prev: kinsol exceptions, Up: kinsol
  2495. D.9.4 Additional `kinsol' notes
  2496. -------------------------------
  2497. When a user supplied Jacobian function J is specified, the solution is
  2498. likely to be found faster and more accurately. The Jacobian should be
  2499. given if an analytical form for F is known, from which the Jacobian can
  2500. be obtained easily by partial differentiation. If the Jacobian is
  2501. unavailable, a finite difference method implemented internally by
  2502. `kinsol' is used as a substitute and will usually yield acceptable
  2503. results.
  2504. Tolerances are not explicitly specified on the virtual side of the
  2505. interface although the native `kinsol' API requires them. A range of
  2506. tolerances over ten orders of magnitude is automatically tried before
  2507. giving up.
  2508. Similarly to the `glpk' and `lpsolve' library interfaces (*note
  2509. glpk:: and *note lpsolve::), the only expressible constraint through the
  2510. virtual code interface is that all variables are non-negative.
  2511. Arbitrary upper and lower bounds can be simulated by appropriate
  2512. variable substitutions in the formulation of the problem.
  2513. The `kinsol' library natively requires a system function F with
  2514. equally many inputs as outputs, and will search only for the input
  2515. associated with an output vector of all zeros, but the virtual code
  2516. interface relaxes these requirements by allowing a function that
  2517. transforms between lists of unequal lengths, and will search for the
  2518. input of F causing it to match any given "optimal" output O. These
  2519. effects are achieved by padding the shorter of the two vectors
  2520. transparently and subtracting the specified optimum from the result.
  2521. The `kinsol' library can be configured to use single precision,
  2522. double precision, or extended precision arithmetic, but only a double
  2523. precision configuration is compatible with `avram'. This condition is
  2524. checked when `avram' is configured and it will not interface with
  2525. alternative `kinsol' configurations.
  2526. The `kinsol' library has some more advanced features to which this
  2527. interface doesn't do justice, such as preconditioning, scaling,
  2528. solution of systems with band limited Jacobians, and concurrent
  2529. computation.
  2530. 
  2531. File: avram.info, Node: lapack, Next: math, Prev: kinsol, Up: External Libraries
  2532. D.10 `lapack'
  2533. =============
  2534. An arsenal of weapons grade linear algebra functions from the `LAPACK'
  2535. Fortran library is accessible to virtual code applications through
  2536. library calls of the form
  2537. library('lapack',f)
  2538. Each library function `f' invokes a `LAPACK' function of the same
  2539. name, but the calling conventions on the virtual side are an artifact
  2540. of the interface requiring their own documentation.
  2541. Some functions that are part of `LAPACK' are not described here
  2542. (mostly the so called computational and auxiliary routines, and anything
  2543. in single precision), because they are not accessible by the virtual
  2544. code interface.
  2545. * Menu:
  2546. * lapack calling conventions::
  2547. * lapack exceptions::
  2548. * Additional lapack notes::
  2549. 
  2550. File: avram.info, Node: lapack calling conventions, Next: lapack exceptions, Prev: lapack, Up: lapack
  2551. D.10.1 `lapack' calling conventions
  2552. -----------------------------------
  2553. A table describing the inputs and outputs to the `lapack' library
  2554. functions listed by their function names is given in this section. Some
  2555. general points related to most of the functions are mentioned first.
  2556. * References to vectors, matrices, and packed matrices should be
  2557. understood as their list representations explained in *note Type
  2558. Conversions::. Although `LAPACK' internally uses column order
  2559. arrays, the virtual code library interface exhibits a matrix as a
  2560. list of lists with one inner list for each row.
  2561. * Some functions require a symmetric matrix as an input parameter.
  2562. Any input parameter that is required to be a symmetric matrix may
  2563. be specified optionally either in square form or in triangular
  2564. form as described in *note Two dimensional arrays::. If a square
  2565. matrix form is used, symmetry is not checked and the lower
  2566. triangular portion is ignored.
  2567. * Some function names are listed in pairs differing only in the first
  2568. letter. Function names beginning with `d' pertain to vectors or
  2569. matrices of real numbers (*note math::), and function names
  2570. beginning with `z' pertain to complex numbers (*note complex::).
  2571. The specifications of similarly named functions are otherwise
  2572. identical.
  2573. `dgesvx'
  2574. `zgesvx'
  2575. These library functions take a pair `(A,B)' where A is an N by N
  2576. matrix and B is a vector of length N. If A is non-singular, they
  2577. return a vector X such that `A X = B'. Otherwise they return an
  2578. empty list.
  2579. `dgelsd'
  2580. `zgelsd'
  2581. These functions generalize those above by taking a pair `(A,B)'
  2582. where A is an M by N matrix and B is a vector of length M, with M
  2583. greater than N. They return a vector X of length N to minimize the
  2584. magnitude of `B - A X'.
  2585. `dgesdd'
  2586. `zgesdd'
  2587. These functions take a list of M time series (i.e., vectors) each
  2588. of length N and return a list of basis vectors each of length N.
  2589. The basis vectors span the set of time series in the given list
  2590. according to the singular value decomposition (i.e., with the
  2591. basis vectors forming a series in order of decreasing
  2592. significance). The number of basis vectors is at most `MIN(M,N)'
  2593. but could be less if the input time series aren't linearly
  2594. independent. An empty list could be returned due to lack of
  2595. convergence.
  2596. `dgeevx'
  2597. `zgeevx'
  2598. These functions take a non-symmetric square matrix and return a
  2599. pair `(E,V)' where E is a list of eigenvectors and V is a list of
  2600. eigenvalues, both of which will contain only complex numbers.
  2601. (N.B., both functions return complex results even though `dgeevx'
  2602. takes real input.) They could also return `nil' due to a lack of
  2603. convergence.
  2604. `dpptrf'
  2605. `zpptrf'
  2606. These functions take a symmetric square matrix and return one of
  2607. the Cholesky factors. The Cholesky factors are a pair of
  2608. triangular matrices, each equal to the transpose of the other,
  2609. whose product is the original matrix.
  2610. * If the input matrix is specified in lower triangular form,
  2611. the lower triangular Cholesky factor is returned.
  2612. * If the input matrix is specified in square or upper
  2613. triangular form, the upper triangular Cholesky factor is
  2614. returned.
  2615. * In either case, the result is returned in triangular form.
  2616. `dggglm'
  2617. `zggglm'
  2618. The input is a pair of matrices and a vector `((A,B),D)'. The
  2619. output is a pair of vectors `(X,Y)' satisfying `AX + BY = D' for
  2620. which the magnitude of Y is minimal. The dimensions all have to be
  2621. consistent, which means the number of rows in A and B is the
  2622. length of D, the number of columns in A is the length of X, and
  2623. the number of columns in B is the length of Y.
  2624. `dgglse'
  2625. `zgglse'
  2626. The input is of the form `((A,C),(B,D))' where A and B are
  2627. matrices and C and D are vectors. The output is a vector X to
  2628. minimize the magnitude of `AX - C' subject to the constraint that
  2629. `BX = D'. The dimensions have to be consistent, which means A has
  2630. M rows, C has length M, B has P rows, D has length P, both A and B
  2631. have N columns, and the output X has length N. It is also a
  2632. requirement that `P <= N <= M + P'.
  2633. `dsyevr'
  2634. This function takes a symmetric real matrix and returns a pair
  2635. `(E,V)' where E is a list of eigenvectors and V is a list of
  2636. eigenvalues. Both contain only real numbers. This function is
  2637. fast and accurate but not as storage efficient as possible. If
  2638. there is insufficient memory, it automatically invokes `dspev'.
  2639. `dspev'
  2640. This function takes a symmetric real matrix and returns a pair
  2641. `(E,V)' where E is a list of eigenvectors and V is a list of
  2642. eigenvalues. Both contain only real numbers. It uses roughly half
  2643. the memory of `dsyevr' but is not as fast or accurate.
  2644. `zheevr'
  2645. This function takes a complex Hermitian matrix and returns a pair `(E,V)'
  2646. where E is a list of eigenvectors and V is a list of eigenvalues.
  2647. The eigenvectors are complex but the eigenvalues are real.
  2648. * A Hermitian matrix has AIJ equal to the complex conjugate of
  2649. AJI.
  2650. * Although not exactly symmetric, a Hermitian matrix may
  2651. nevertheless be given in either upper or lower triangular
  2652. form.
  2653. * This function is faster but less storage efficient than
  2654. `zhpev', and calls it automatically if it runs out of memory.
  2655. `zhpev'
  2656. This function has the same inputs and approximate outputs as
  2657. `zheevr' but is slower and more memory efficient because it uses
  2658. only packed matrices.
  2659. 
  2660. File: avram.info, Node: lapack exceptions, Next: Additional lapack notes, Prev: lapack calling conventions, Up: lapack
  2661. D.10.2 `lapack' exceptions
  2662. --------------------------
  2663. * Any of these functions can return a message of
  2664. <'memory overflow'>
  2665. if it runs out of memory.
  2666. * If the input parameters don't meet the specification, they can
  2667. also return
  2668. <'bad lapack specification'>
  2669. * Any unexpected behavior from the `LAPACK' Fortran functions or
  2670. irregular status returned by them is reported by the message
  2671. <'lapack error'>
  2672. Getting to the bottom of it may require some debugging of the
  2673. `avram' source code in the file `lapack.c'.
  2674. 
  2675. File: avram.info, Node: Additional lapack notes, Prev: lapack exceptions, Up: lapack
  2676. D.10.3 Additional `lapack' notes
  2677. --------------------------------
  2678. The functions `dgesdd' and `zgesdd' are an effective dimensionality
  2679. reduction technique for a large database of time series. A set of
  2680. basis vectors can be computed once for the database, and then any time
  2681. series in the database can be expressed as a linear combination
  2682. thereof. To the extent that the data embody any redundant information,
  2683. an approximate reconstruction of an individual series from the database
  2684. will require fewer coefficients (maybe far fewer) in terms of the basis
  2685. than original length of the series.
  2686. The library functions `dgelsd' and `zgelsd' are good for finding
  2687. least squares fits to empirical data. If the matrix parameter A is
  2688. interpreted as a list of inputs and the vector parameter B as the list
  2689. of corresponding output data from some unknown linear function of N
  2690. variables F, then X is the list of coefficients whereby F achieves the
  2691. optimum fit to the data in the least squares sense.
  2692. These functions solve a special case of the problem solved by `dggglm'
  2693. and `zggglm' where the parameter B is the identity matrix. For the
  2694. latter functions, the output vector Y can be interpreted as a measure
  2695. of the error, and B can be chosen to express unequal costs for errors
  2696. at different points in the fitted function.
  2697. Cholesky decompositions obtained by `dpptrf' and `zpptrf' are useful
  2698. for generating correlated random numbers. A population of vectors of
  2699. uncorrelated standard normally distributed random numbers can be made
  2700. to exhibit any correlations to order by multiplying all of the vectors
  2701. by the lower Cholesky factor of the desired covariance matrix.
  2702. 
  2703. File: avram.info, Node: math, Next: mtwist, Prev: lapack, Up: External Libraries
  2704. D.11 `math'
  2705. ===========
  2706. The `math' library exports functions that operate on IEEE double
  2707. precision floating point numbers using the host system's C library. The
  2708. numbers are represented natively as contiguous blocks of 8 bytes each,
  2709. and on the virtual side as lists of eight character representations.
  2710. (More explanation is given in *note Type Conversions::.) These
  2711. functions take the form
  2712. library('math',f)
  2713. where `f' is a character string identifying the function in most cases
  2714. by its standard name in the C library.
  2715. * Menu:
  2716. * math library operators::
  2717. * math library predicates::
  2718. * math library conversion functions::
  2719. * math library exceptions::
  2720. * Additional math library notes::
  2721. 
  2722. File: avram.info, Node: math library operators, Next: math library predicates, Prev: math, Up: math
  2723. D.11.1 `math' library operators
  2724. -------------------------------
  2725. The unary operators take a single real number to a real result. They include
  2726. ceil floor round trunc
  2727. sin cos tan sinh cosh tanh
  2728. asin acos atan asinh acosh atanh
  2729. exp log sqrt cbrt expm1 log1p fabs
  2730. The binary operators take a pair of real numbers `(X,Y)' to a single
  2731. real number output. They include
  2732. pow hypot atan2 remainder bus vid add sub mul div
  2733. where the last four correspond to the C language operators `+', `-',
  2734. `*', and `/'. The functions named `bus' and `vid' are like the `sub'
  2735. and `div' functions, respectively, with the order of the operands
  2736. reversed, as explained in *note complex::.
  2737. The meanings of these operators are documented in the GNU `libc'
  2738. reference manual or other C language references. They follow IEEE
  2739. standards including proper handling of `nan' and infinity.
  2740. 
  2741. File: avram.info, Node: math library predicates, Next: math library conversion functions, Prev: math library operators, Up: math
  2742. D.11.2 `math' library predicates
  2743. --------------------------------
  2744. There is one binary predicate, `islessequal', and several unary predicates,
  2745. `isinfinite', `isnan', `isnormal', `isubnormal' and `iszero'.
  2746. The predicate `islessequal' takes a pair of floating point numbers
  2747. `(X,Y)' as an argument, and returns `nil' for a false result and
  2748. `(nil,nil)' for a true result.
  2749. The unary predicates have the obvious interpretations as
  2750. classification functions, and should probably be used in preference to
  2751. comparison with constants in case the representations aren't unique.
  2752. 
  2753. File: avram.info, Node: math library conversion functions, Next: math library exceptions, Prev: math library predicates, Up: math
  2754. D.11.3 `math' library conversion functions
  2755. ------------------------------------------
  2756. The conversion function `strtod' takes a string representing a floating
  2757. point number in C format to its representation. This function is the
  2758. primary means of creating or initializing floating point numbers in
  2759. virtual code. A value of floating point 0.0 is returned if the string
  2760. is not valid, but no exception is raised.
  2761. The conversion `asprintf' is similar to the one by that name in C,
  2762. but requires a pair `(F,X)' as an argument. The left side F is a
  2763. character string containing a C style format conversion for exactly one
  2764. double precision floating point number, such as `'%0.4e'', and the
  2765. parameter X is a floating point number. The result returned will be a
  2766. character string expressing the number in the specified format.
  2767. 
  2768. File: avram.info, Node: math library exceptions, Next: Additional math library notes, Prev: math library conversion functions, Up: math
  2769. D.11.4 `math' library exceptions
  2770. --------------------------------
  2771. The most likely cause of an exception is an attempt to apply a `math'
  2772. library function to `nil' or to an argument that doesn't represent a
  2773. floating point number. In these cases, an error message of `<'missing
  2774. value'>' or `<'invalid value'>' will be the result.
  2775. An error message of `<'invalid asprintf() specifier'>' is reported
  2776. by the `asprintf' function if the format specifier pertains to a
  2777. string, such as `'%s''. This error is specifically trapped because the
  2778. alternative would be a segmentation fault. Otherwise, invalid format
  2779. specifiers are not detected or reported.
  2780. Error messages of `<'invalid text format'>' can be generated by
  2781. conversion functions if any parameters that are meant to be character
  2782. string representations are something else.
  2783. There is always a chance of a `<'memory overflow'>' error if there
  2784. is insufficient memory to allocate a result.
  2785. 
  2786. File: avram.info, Node: Additional math library notes, Prev: math library exceptions, Up: math
  2787. D.11.5 Additional `math' library notes
  2788. --------------------------------------
  2789. Floating point exceptions such as division by zero are not specifically
  2790. reported as exceptions, but invalid computations can be detected by the
  2791. propagation of `nan' into the result, following standard conventions.
  2792. The C function `feclearexcept (FE_ALL_EXCEPT)' is called before every
  2793. floating point operation so that no lingering exception flags can
  2794. affect it.
  2795. There is no library predicate for exact comparison of floating point
  2796. numbers, but none is required because the virtual machine's `compare'
  2797. combinator will work on their representations as it will on any other
  2798. data. The usual caveats apply with regard to comparing floating point
  2799. numbers in the presence of roundoff error.
  2800. 
  2801. File: avram.info, Node: mtwist, Next: minpack, Prev: math, Up: External Libraries
  2802. D.12 `mtwist'
  2803. =============
  2804. The `mtwist' library interfaces to a random number generator based on
  2805. the Mersenne Twistor algorithm. The algorithm has good properties but
  2806. is not meant to be cryptographically secure. The library functions are
  2807. of the form
  2808. library('mtwist',f)
  2809. where `f' is one of the followng character strings.
  2810. bern u_cont u_disc u_path u_enum w_disc w_enum
  2811. Formally they are not mathematical functions because their results
  2812. depend on a pseudo-random number that is not uniquely determined by
  2813. their arguments. The numbers are generated deterministically in a
  2814. sequence starting from a seed derived from the system clock at the time
  2815. `avram' is launched, and each call uses the next number in the
  2816. sequence. In so doing, it simulates a random draw from a uniformly
  2817. distributed population.
  2818. * Menu:
  2819. * mtwist calling conventions::
  2820. * mtwist exceptions::
  2821. * Additional mtwist notes::
  2822. 
  2823. File: avram.info, Node: mtwist calling conventions, Next: mtwist exceptions, Prev: mtwist, Up: mtwist
  2824. D.12.1 `mtwist' calling conventions
  2825. -----------------------------------
  2826. All of the functions in this library simulate a random draw from a
  2827. distribution. There is a choice of distribution statistics depending on
  2828. the function used.
  2829. `bern'
  2830. takes a floating point number P between 0 and 1, encoded as in
  2831. *note math::, and returns a boolean value, either `(nil,nil)' for
  2832. true or `nil' for false. A true value is returned only if a random
  2833. draw from a uniform distribution ranging from 0 to 1 is less than
  2834. P. This function therefore simulates a draw from a Bernoulli
  2835. distribution. A `nil' value of P is treated as 1/2.
  2836. `u_cont'
  2837. takes a floating point number X as an argument, and returns a
  2838. random draw from a continuous uniform distribution ranging from 0
  2839. to X. A `nil' value of X is treated as unity.
  2840. `u_disc'
  2841. simulates a draw from a uniform discrete distribution whose domain
  2842. is the set of natural numbers from 0 to N - 1. The number N is
  2843. given as a parameter to this function, and the retuned value is
  2844. the draw.
  2845. * The returned value will have at most 64 bits regardless of N.
  2846. * Natural numbers are encoded as described in *note
  2847. Representation of Numeric and Textual Data::.
  2848. * If a value of 0 is passed for N, the full 64 bit range is
  2849. used.
  2850. `u_path'
  2851. takes a pair of natural numbers `(N,M)' and returns a randomly
  2852. chosen tree (*note Raw Material::) with 1 leaf and N non-leaves
  2853. each having either a left or a right descendent but not both. The
  2854. number M constrains the result to fall within the first M - 1
  2855. trees of this form enumerated by exhausting all possibilities at
  2856. lower levels before admitting a right descendent at a higher
  2857. level. Within these criteria, all possible results are equally
  2858. probable. Both numbers are masked to 64 bits, but if M is zero, it
  2859. is treated as 2^N.
  2860. `u_enum'
  2861. simulates a random draw from a uniform discrete distribution whose
  2862. domain is enumerated. The argument to the function is a non-empty
  2863. list, and the result is an item selected from the list, with all
  2864. choices being equally probable.
  2865. `w_disc'
  2866. simulates a random draw from a non-uniform, or "weighted" discrete
  2867. distribution whose domain is a set of consecutive natural numbers
  2868. starting from zero. The argument to the function is a list giving
  2869. the probability of each outcome starting from zero as a floating
  2870. point number. Probabilities must be non-negative but needn't be
  2871. normalized.
  2872. `w_enum'
  2873. simulates a random draw from a non-uniform, or "weighted" discrete
  2874. distribution with an arbitrary domain enumerated in the argument.
  2875. The argument is a list of pairs `<(X,P)..>', where X is a possible
  2876. outcome and P is its probability. The result returned is one of
  2877. the values of X from the input list chosen at random according to
  2878. the associated probability. Probabilities must be non-negative but
  2879. needn't be normalized.
  2880. 
  2881. File: avram.info, Node: mtwist exceptions, Next: Additional mtwist notes, Prev: mtwist calling conventions, Up: mtwist
  2882. D.12.2 `mtwist' exceptions
  2883. --------------------------
  2884. * `<'memory overflow'>' can be returned if there is insufficient
  2885. memory to allocate a result.
  2886. * Messages of `<'missing value'>' and `<'invalid value'>' can be
  2887. returned if any floating point argument is `nil' or is not a valid
  2888. floating point number, unless there is a designated default
  2889. interpretation for `nil' as in `bern' and `u_cont'.
  2890. * A message of `<'bad mtwist specification'>' is returned if an
  2891. argument to the `bern' function is not in the range of 0 to 1, or
  2892. if any probability passed to the `w_'* functions is negative.
  2893. * A message of `<'draw from empty list'>' is returned if an argument
  2894. to the *`_enum' functions is `nil' or if an argument to `w_enum'
  2895. contains `nil'.
  2896. 
  2897. File: avram.info, Node: Additional mtwist notes, Prev: mtwist exceptions, Up: mtwist
  2898. D.12.3 Additional `mtwist' notes
  2899. --------------------------------
  2900. Although the `mtwist' library is "external", it requires no special
  2901. configuration on the host because the uniform variate generator in the
  2902. form developed by its original authors is short and elegant enough to
  2903. be packaged easily within the `avram' distribution. All further
  2904. embellishments are home grown despite the advice at the end of *note
  2905. Implementing new library functions::.
  2906. The `u_path' function is intended to allow sampling from a large
  2907. population in logarithmic time when it is stored in a balanced tree. A
  2908. left-heavy tree should be constructed initially with the data items all
  2909. at the same level. Thereafter, a result returned by `u_path' with the
  2910. appropriate dimensions can be used as an index into the tree for fast
  2911. retrieval by the virtual machine's `field' combinator (*note Field::).
  2912. The last three functions, `u_enum', `w_disc', and `w_enum' use an
  2913. inversion method with a binary search. The first draw from a given
  2914. list will take a time asymptotically proportional to the length of the
  2915. list, but subsequent draws from the same list are considerably faster
  2916. due to a persistent cache maintained transparently by `avram'. For
  2917. lists whose length is up to 2^16, the time required for a subsequent
  2918. draw consists mainly of constant overhead with a small logarithmic
  2919. component in the length of the list. For longer lists, the time ramps
  2920. up linearly by a small factor.
  2921. Information allowing fast draws from up to sixteen lists can be
  2922. cached simultaneously. If an application uses more than sixteen, the
  2923. cached data are replaced in first-in first-out order. The size of the
  2924. cache and the maximum list length for logarithmic time access can be
  2925. adjusted easily by redefining constants in `mtwist.c' under the `avram'
  2926. source tree, but will require recompilation.
  2927. 
  2928. File: avram.info, Node: minpack, Next: mpfr, Prev: mtwist, Up: External Libraries
  2929. D.13 `minpack'
  2930. ==============
  2931. The `minpack' library contains functions to solve non-linear optimization
  2932. and least squares problems. The functions can be expressed as
  2933. library('minpack',f)
  2934. where `f' can be one of `'hybrd'', `'hybrj'', `'lmder'', `'lmdif'', or
  2935. `'lmstr'', following the names of the underlying Fortran subroutines.
  2936. * Menu:
  2937. * minpack calling conventions::
  2938. * minpack exceptions::
  2939. * Additional minpack notes::
  2940. 
  2941. File: avram.info, Node: minpack calling conventions, Next: minpack exceptions, Prev: minpack, Up: minpack
  2942. D.13.1 `minpack' calling conventions
  2943. ------------------------------------
  2944. The `minpack' library solves a similar problem to that of the `kinsol'
  2945. library (*note kinsol::), and the two libraries have identical calling
  2946. conventions at the level of the virtual code interface.
  2947. The `hybrd' and `lmdif' functions take input arguments of the form
  2948. `(F,(I,O))', whereas `hybrj', `lmder', and `lmstr' take arguments of
  2949. the form `((F,J),(I,O))'. The interpretations of these parameters are
  2950. explained in *note kinsol input parameters::.
  2951. For the `lmstr' function, the Jacobian function J takes an argument
  2952. `(M,V)' and returns only the M-th row of the Jacobian matrix. For
  2953. `lmder' and `hybrj', the Jacobian function takes only an input vector V
  2954. and returns the whole matrix. These specifications are also explained
  2955. further in relation to the `kinsol' library.
  2956. The output from any minpack function is a vector V satisfying `F(V)
  2957. = O' to the best possible tolerance if a solution is found. A range of
  2958. tolerances over ten orders of magnitude is sampled starting from
  2959. `1e-15'. If no solution is found, an empty list is returned.
  2960. 
  2961. File: avram.info, Node: minpack exceptions, Next: Additional minpack notes, Prev: minpack calling conventions, Up: minpack
  2962. D.13.2 `minpack' exceptions
  2963. ---------------------------
  2964. * A message of `<'memory overflow'>' is possible any time `minpack'
  2965. runs out of memory.
  2966. * A message of `<'bad minpack specification'>' will be returned if
  2967. an input argument recognizably violates the required specification.
  2968. * The `<'minpack error'>' message is returned in the event of any unexpected
  2969. behavior or irregular status from the API.
  2970. * Any error messages reported by the system function F or the
  2971. Jacobian function J are propagated to the result.
  2972. 
  2973. File: avram.info, Node: Additional minpack notes, Prev: minpack exceptions, Up: minpack
  2974. D.13.3 Additional `minpack' notes
  2975. ---------------------------------
  2976. The `lm'* functions are better suited to problems in which the system
  2977. function F has more outputs than inputs, and the `hybr'* functions are
  2978. better suited to the alternative. If either is called when the other is
  2979. more appropriate, the job is handed off to the other automatically.
  2980. The `lmstr' function is more memory efficient than the others
  2981. because it doesn't compute the whole Jacobian matrix at once. Any of
  2982. the `lm'* functions is more memory efficient than the `kinsol'
  2983. equivalent when the output list is sufficiently longer than the input
  2984. list.
  2985. Unlike `kinsol', there is no provision in `minpack' for constrained
  2986. optimization.
  2987. The `minpack' documentation doesn't state whether it's re-entrant,
  2988. but the odds are against it unless it uses no storage outside the user
  2989. provided work areas. If it isn't re-entrant, anomalous effects could
  2990. occur when a virtual code function being optimized calls another
  2991. `minpack' function. A workaround would be to use an equivalent
  2992. `kinsol' function, which is re-entrant by design.
  2993. The `avram' configuration script searches for a C header file `minpack.h'
  2994. on the host system in order to build an interface to this library. This
  2995. file is specific to the Debian `minpack-dev' package and is not part of
  2996. the upstream Fortran source. Configuring `avram' with an interface to
  2997. the `minpack' library on a non-Debian system may require the
  2998. administrator to retrieve the header file manually from the Debian
  2999. archive and place it under `/usr/include' before running the
  3000. configuration script (in addition to installing the `minpack' library
  3001. itself, of course).
  3002. 
  3003. File: avram.info, Node: mpfr, Next: lpsolve, Prev: minpack, Up: External Libraries
  3004. D.14 `mpfr'
  3005. ===========
  3006. The `mpfr' library provides a rich assortment of floating point
  3007. operations on arbitrary precision numbers (`http://www.mpfr.org').
  3008. These numbers are represented in a format that is not binary compatible
  3009. with the standard IEEE floating point number format used by other
  3010. libraries, but they offer superior numerical stability suitable for
  3011. many ill conditioned problems.
  3012. The virtual code interface to the `mpfr' library follows the native
  3013. API to the extent of using the same names for most operations, but
  3014. excludes features pertaining to i/o, mutable storage, and memory
  3015. management.
  3016. The `mpfr' library functions are invoked by an expression of the form
  3017. library('mpfr',f)
  3018. Aside from a few exceptions as noted, `f' is a character string derived
  3019. from the name of the related function from the `mpfr' C library as
  3020. documented at the above address, but without the `mpfr_' prefix.
  3021. The full complement of available functions is documented in the
  3022. remainder of this section.
  3023. * References to natural numbers pertain to the list representation
  3024. described in *note Representation of Numeric and Textual Data::.
  3025. * All functions that perform rounding use a mode of `GMP_RNDN' for rounding
  3026. to nearest, which is not explicitly specified on the virtual side.
  3027. * Menu:
  3028. * mpfr binary operators::
  3029. * mpfr unary operators::
  3030. * mpfr binary operators with a natural operand::
  3031. * mpfr binary predicates::
  3032. * mpfr unary predicates::
  3033. * mpfr constants::
  3034. * mpfr functions with miscellaneous calling conventions::
  3035. * mpfr conversion functions::
  3036. * mpfr exceptions::
  3037. * Additional mpfr notes::
  3038. 
  3039. File: avram.info, Node: mpfr binary operators, Next: mpfr unary operators, Prev: mpfr, Up: mpfr
  3040. D.14.1 `mpfr' binary operators
  3041. ------------------------------
  3042. Functions with these names take a pair of `mpfr' numbers `(X,Y)' and
  3043. return an `mpfr' number as a result.
  3044. * `add'
  3045. * `sub'
  3046. * `mul'
  3047. * `div'
  3048. * `pow'
  3049. * `atan2'
  3050. * `hypot'
  3051. * `min'
  3052. * `max'
  3053. * `vid'
  3054. * `bus'
  3055. Their semantics are similar to those listed in the `mpfr'
  3056. documentation, with some minor qualifications.
  3057. * Unlike the native API, there is no third argument to which the
  3058. result is assigned, because the result is the returned value.
  3059. * The precision of the result is the greater of the two precisions of
  3060. the input numbers X and Y.
  3061. * The `vid' and `bus' functions are added features of the virtual
  3062. code interface, corresponding to division and subtraction with the
  3063. order of the operands reversed, as explained in *note complex::.
  3064. Mathematically it might make more sense for the precision of the result
  3065. to be the lesser of the two input precisions, but this way is more
  3066. convenient for virtual code programs that perform binary operations on
  3067. their input with hard coded constants, because it makes one size fit
  3068. all.
  3069. 
  3070. File: avram.info, Node: mpfr unary operators, Next: mpfr binary operators with a natural operand, Prev: mpfr binary operators, Up: mpfr
  3071. D.14.2 `mpfr' unary operators
  3072. -----------------------------
  3073. Functions with these names take a single `mpfr' number as an argument
  3074. and return a single `mpfr' number as a result.
  3075. sqr sqrt cbrt neg abs log
  3076. log2 log10 exp exp2 exp10 cos
  3077. sin tan acos asin atan cosh
  3078. sinh tanh acosh asinh atanh lngamma
  3079. expm1 eint gamma erf log1p nextbelow
  3080. ceil floor round trunc frac nextabove
  3081. erfc
  3082. The semantics of these functions are similar to those of their
  3083. counterparts in the native API, with these provisions.
  3084. * The precision of the result is the precision of the argument.
  3085. * There is no second argument for assigning the result.
  3086. * The `nextabove' and `nextbelow' functions do not modify their
  3087. arguments in place, but return a freshly allocated result like all
  3088. other functions.
  3089. 
  3090. File: avram.info, Node: mpfr binary operators with a natural operand, Next: mpfr binary predicates, Prev: mpfr unary operators, Up: mpfr
  3091. D.14.3 `mpfr' binary operators with a natural operand
  3092. -----------------------------------------------------
  3093. Functions with these names take an argument of the form `(X,N)', where
  3094. X is an `mpfr' number and N is a natural number.
  3095. * `root'
  3096. * `pow_ui'
  3097. * `mul_2ui'
  3098. * `div_2ui'
  3099. * `grow'
  3100. * `shrink'
  3101. The last two are specific to the virtual code interface, having no
  3102. counterpart in the native API of the `mpfr' library. The `grow'
  3103. function returns a copy of X with its precision increased by N bits,
  3104. and the `shrink' function returns a copy of X with its precision
  3105. reduced by N bits.
  3106. * The precisions are silently capped at the maximum or floored at the minimum
  3107. allowable precisions if necessary.
  3108. * Increasing the precision by the `grow' function does not directly
  3109. cause a more accurate result to be computed, but only pads an
  3110. existing number with zeros.
  3111. * Decreasing the precision by the `shrink' function does not prevent
  3112. valid bits from being discarded.
  3113. The appropriate way to use `grow' is to grow the precision of an
  3114. operand before applying an operator to it, which will cause the result
  3115. to be computed to the full precision. This capability is suitable for
  3116. algorithms that iterate over increasing precisions until a stopping
  3117. criterion is met.
  3118. 
  3119. File: avram.info, Node: mpfr binary predicates, Next: mpfr unary predicates, Prev: mpfr binary operators with a natural operand, Up: mpfr
  3120. D.14.4 `mpfr' binary predicates
  3121. -------------------------------
  3122. These predicates take a pair of `mpfr' numbers `(X,Y)' as arguments and
  3123. perform a logical operation. If the result is true, they return
  3124. `(nil,nil)', and if it's false, they return `nil'.
  3125. * `equal_p'
  3126. * `unequal_abs'
  3127. * `greater_p'
  3128. * `greaterequal_p'
  3129. * `less_p'
  3130. * `lessequal_p'
  3131. * `lessgreater_p'
  3132. The name of the function `unequal_abs', for comparing absolute
  3133. values, has been changed from `mpfr_cmpabs' to avoid confusion with the
  3134. virtual machine's `compare' combinator. The `compare' combinator
  3135. returns a `(nil,nil)' result (i.e., true) if the operands are equal and
  3136. a `nil' result if they're unequal, opposite from `unequal_abs'.
  3137. 
  3138. File: avram.info, Node: mpfr unary predicates, Next: mpfr constants, Prev: mpfr binary predicates, Up: mpfr
  3139. D.14.5 `mpfr' unary predicates
  3140. ------------------------------
  3141. Each of these predicates takes an `mpfr' number as an argument and
  3142. performs a logical operation. If the result is true, it returns
  3143. `(nil,nil)', and otherwise it returns `nil'.
  3144. * `nan_p'
  3145. * `inf_p'
  3146. * `number_p'
  3147. * `zero_p'
  3148. * `integer_p'
  3149. 
  3150. File: avram.info, Node: mpfr constants, Next: mpfr functions with miscellaneous calling conventions, Prev: mpfr unary predicates, Up: mpfr
  3151. D.14.6 `mpfr' constants
  3152. -----------------------
  3153. Each of these functions takes a natural number as an argument
  3154. specifying a precision, and returns a mathematical constant evaluated
  3155. to that precision.
  3156. * `const_log2'
  3157. * `pi'
  3158. * `const_catalan'
  3159. * `inf'
  3160. * `ninf'
  3161. * `nan'
  3162. The name of the constant `pi' has been shortened from
  3163. `mpfr_const_pi'. The functions `inf' and `ninf' return infinity and
  3164. negative infinity, respectively.
  3165. The encoding of `nan', used to represent the results of undefined computations
  3166. such as division by zero, is not unique even for a fixed precision.
  3167. Applications should test for undefined results using `nan_p' rather
  3168. than by comparing a result to a hard coded `nan' (*note mpfr unary
  3169. predicates::).
  3170. 
  3171. File: avram.info, Node: mpfr functions with miscellaneous calling conventions, Next: mpfr conversion functions, Prev: mpfr constants, Up: mpfr
  3172. D.14.7 `mpfr' functions with miscellaneous calling conventions
  3173. --------------------------------------------------------------
  3174. Some functions listed below don't conform to any of the previously
  3175. mentioned calling conventions.
  3176. `eq'
  3177. This is a ternary operator taking a triple `(PREC,(X,Y))', where
  3178. PREC is a natural number and X and Y are `mpfr' numbers. It
  3179. returns a result of `(nil,nil)' (i.e., true) if the numbers agree
  3180. up to the specified precision measured in bits, and returns `nil'
  3181. otherwise.(1)
  3182. `urandomb'
  3183. This function takes a natural number specifying a precision and returns
  3184. a uniformly distributed pseudo-random number of that precision
  3185. between 0 and 1.
  3186. `prec'
  3187. This function takes an `mpfr' number and returns a natural number
  3188. as a result, which is the precision of the argument in bits.
  3189. `sin_cos'
  3190. This function takes an `mpfr' number Z as an argument and returns
  3191. a pair of `mpfr' numbers `(X,Y)' as a result, where X is the sine
  3192. of Z and Y is the cosine. The precisions of the results are the
  3193. same as the precision of the argument.
  3194. ---------- Footnotes ----------
  3195. (1) a potentially useful tool for algorithms concerned with
  3196. numerical approximations despite its inexplicable malignment in the
  3197. `mpfr' documentation
  3198. 
  3199. File: avram.info, Node: mpfr conversion functions, Next: mpfr exceptions, Prev: mpfr functions with miscellaneous calling conventions, Up: mpfr
  3200. D.14.8 `mpfr' conversion functions
  3201. ----------------------------------
  3202. The functions described in this section convert between `mpfr' numbers
  3203. and character strings, naturals, or standard IEEE floating point format
  3204. (in their list representations). Where these functions have similar or
  3205. equivalent counterparts in the `mpfr' library's native API, the names
  3206. have been changed for mnemonic reasons.
  3207. `dbl2mp'
  3208. The input is a standard floating point number as in *note math::.
  3209. The result is an `mpfr' number equal to the input with a fixed
  3210. precision, currently set to 160 bits.
  3211. `mp2dbl'
  3212. The input is an `mpfr' number, and the output is the best possible
  3213. approximation to it by a standard a double precision number.
  3214. `str2mp'
  3215. The input is a pair `(PREC,S)', where PREC is a natural number
  3216. specifying the precision, and S is a string expressing a floating
  3217. point number in C format. The output is an `mpfr' number with the
  3218. specified precision.
  3219. `mp2str'
  3220. The input is an `mpfr' number, and the output is a character
  3221. string expressing the number in exponential decimal notation.
  3222. Sufficiently many decimal digits are included in the string to
  3223. express the full precision.
  3224. `nat2mp'
  3225. The input is a natural number represented as described in *note
  3226. Representation of Numeric and Textual Data::, and the output is an
  3227. `mpfr' number of sufficient precision to express the natural
  3228. number exactly.
  3229. The `mp2str' function enhances the native `mpfr_get_str' function by
  3230. properly formatting the output string rather than only listing the
  3231. digits of the mantissa.
  3232. The `nat2mp' function does not rely on the `mpfr' native integer
  3233. conversion functions, so natural numbers with any number of bits up to
  3234. `MP_PREC_MAX' can be used losslessly. There is currently no conversion
  3235. in the other direction.
  3236. 
  3237. File: avram.info, Node: mpfr exceptions, Next: Additional mpfr notes, Prev: mpfr conversion functions, Up: mpfr
  3238. D.14.9 `mpfr' exceptions
  3239. ------------------------
  3240. * A message of `<'memory overflow'>' is possible any time `mpfr'
  3241. runs out of memory.
  3242. * A message of `<'bad mpfr specification'>' will be returned if an
  3243. input argument recognizably violates the required specification.
  3244. * The `<'mpfr error'>' message is returned in the event of any unexpected
  3245. behavior or irregular status from the API.
  3246. * The message of `<'mpfr overflow'>' can be cause by the `nat2mp'
  3247. function if a natural number has too many bits to be represented
  3248. exactly as an `mpfr' number.
  3249. 
  3250. File: avram.info, Node: Additional mpfr notes, Prev: mpfr exceptions, Up: mpfr
  3251. D.14.10 Additional `mpfr' notes
  3252. -------------------------------
  3253. The `eq' and `urandomb' functions depend not only on the `mpfr' library
  3254. but on the `gmp' library (`http://ftp.gnu.org/gnu/gmp'). It's possible
  3255. for them to be unavailable on a host without `gmp' even if the rest of
  3256. the `mpfr' library is properly configured.
  3257. The file `mpfr.c' in the `avram' source tree exports a couple of
  3258. functions that may be of use to C hackers interested in further
  3259. development of `avram' with `mpfr'. The functions `avm_mpfr_of_list'
  3260. and `avm_list_of_mpfr' convert between the native representation for
  3261. `mpfr' numbers and the caching list representation used by `avram'
  3262. (*note Type Conversions::). This conversion is non-trivial because the
  3263. numbers are not stored contiguously.
  3264. 
  3265. File: avram.info, Node: lpsolve, Next: rmath, Prev: mpfr, Up: External Libraries
  3266. D.15 `lpsolve'
  3267. ==============
  3268. This library interface exports functions to solve linear programming and
  3269. mixed integer programming problems using the `lpsolve' package
  3270. documented at
  3271. `http://lpsolve.sourceforge.net/5.5/'.
  3272. Of the two linear programming solvers currently interfaced with
  3273. `avram', this one is believed to be the more robust.
  3274. * Menu:
  3275. * lpsolve calling conventions::
  3276. * lpsolve return values::
  3277. * lpsolve errors::
  3278. 
  3279. File: avram.info, Node: lpsolve calling conventions, Next: lpsolve return values, Prev: lpsolve, Up: lpsolve
  3280. D.15.1 `lpsolve' calling conventions
  3281. ------------------------------------
  3282. The library is able to solve linear and mixed integer programming
  3283. problems, depending on which function is selected. The function to call
  3284. the linear programming solver is of the form
  3285. * `library('lpsolve','stdform')'
  3286. and the mixed integer programming functions are of the form
  3287. * `library('lpsolve','iform')'
  3288. * `library('lpsolve','bform')'
  3289. * `library('lpsolve','biform')'
  3290. The argument to the `stdform' function represents a triple `(C,(M,Y))',
  3291. which has the same interpretation described in *note glpk input
  3292. parameters::. The arguments to the `iform', `bform', and `biform'
  3293. functions are tuples `(I,(C,(M,Y)))' `(B,(C,(M,Y)))', and
  3294. `((B,I),(C,(M,Y)))', respectively, where C, M, and Y are as above, and
  3295. * B is a list of binary variable column indices
  3296. * I is a list of integer variable column indices
  3297. where column indices pertain to the constraint matrix, and are numbered
  3298. from zero. Specifying some or all variables as integers directs the
  3299. solver to seek only solutions in which those variables have integer
  3300. values, and specifying any as binary directs the solver to seek only
  3301. solutions in which those variables have values of zero or one. The
  3302. IEEE floating point representation is used for all variables regardless
  3303. (*note math::).
  3304. 
  3305. File: avram.info, Node: lpsolve return values, Next: lpsolve errors, Prev: lpsolve calling conventions, Up: lpsolve
  3306. D.15.2 `lpsolve' return values
  3307. ------------------------------
  3308. If a feasible and optimal solution is found, a list of values for the
  3309. variables is returned in the form `<(I,X)...>', where I is a natural
  3310. number and X is a floating point number giving the value of the I-th
  3311. variable numbered from zero. Values of X equal to zero are omitted.
  3312. 
  3313. File: avram.info, Node: lpsolve errors, Prev: lpsolve return values, Up: lpsolve
  3314. D.15.3 `lpsolve' errors
  3315. -----------------------
  3316. If any calling conventions are not followed, an exception is raised and
  3317. a diagnostic message of `bad lpsolve problem specification' is
  3318. reported. If no feasible solution can be found, no exception is raised
  3319. but an empty list is returned.
  3320. 
  3321. File: avram.info, Node: rmath, Next: umf, Prev: lpsolve, Up: External Libraries
  3322. D.16 `rmath'
  3323. ============
  3324. A selection of mathematical and statistical functions from the GNU R
  3325. math library has a virtual code interface of the form
  3326. library('rmath',f)
  3327. where `f' is a character string derived from the name of a function in
  3328. the C language API described in the manual `R-exts.pdf', available at
  3329. `http://www.r-project.org'.
  3330. Every function in the library returns a real result in the form of
  3331. *note math::, but functions differ in the argument types. The arguments
  3332. are tuples of real numbers and booleans that also closely follow the
  3333. native API as explained below.
  3334. * Menu:
  3335. * rmath statistical functions::
  3336. * rmath miscellaneous functions::
  3337. * rmath exceptions::
  3338. 
  3339. File: avram.info, Node: rmath statistical functions, Next: rmath miscellaneous functions, Prev: rmath, Up: rmath
  3340. D.16.1 `rmath' statistical functions
  3341. ------------------------------------
  3342. Functions for evaluating random draws, density, cumulative probability
  3343. and inverse cumulative probability are provided for some of the more
  3344. frequently used probability distributions, which are chi-squared,
  3345. non-central chi-squared, exponential, lognormal, normal, poisson,
  3346. Student's t, and uniform.
  3347. Each distribution is known by an abbreviated name and specified by
  3348. one or two real parameters as listed below. Names of distributions in
  3349. this table form the stem of a library function name. The names of the
  3350. parameters such as MU and SIGMA are not explicitly mentioned when
  3351. invoking the functions, but are listed here for reference. The precise
  3352. definitions of the distribution functions and interpretations of these
  3353. parameters can be found in standard texts on probability and statistics.
  3354. chisq DF
  3355. nchisq DF, LAMBDA
  3356. exp SCALE
  3357. lnorm LOGMEAN, LOGSD
  3358. norm MU, SIGMA
  3359. pois LAMBDA
  3360. t N
  3361. unif A, B
  3362. The virtual code interface follows a naming convention similar to the
  3363. native API, in that function names beginning with `r' represent random
  3364. draws from a distribution, with the argument to the function being the
  3365. parameters specifying the distribution. Functions in this first group
  3366. return a random draw from a distribution described by a single real
  3367. parameter.
  3368. * `rchisq'
  3369. * `rexp'
  3370. * `rpois'
  3371. * `rt'
  3372. These next functions return random draws from distributions specified
  3373. by a pair of parameters, `(X,Y)'.
  3374. * `rnchisq'
  3375. * `rlnorm'
  3376. * `rnorm'
  3377. * `runif'
  3378. Functions whose names begin with `d' evaluate the probability
  3379. density of a distribution at a given point. They require at least two
  3380. real arguments, the first being the point whose probability density is
  3381. sought, and the remaining ones being the parameters that specify the
  3382. distribution. A boolean operand, which is `nil' for false and
  3383. `(nil,nil)' for true, requests the logarithm of the density when true.
  3384. Functions with names in the following group take a triple with two
  3385. real operands and a boolean, `(X,(Y,A))', and return a probabiity
  3386. density.
  3387. * `dchisq'
  3388. * `dexp'
  3389. * `dpois'
  3390. * `dt'
  3391. The next functions pertain to distributions requiring two paramters to
  3392. specify them, so they take a quadruple with three real operands and a
  3393. boolean, `(X,(Y,(Z,A)))'.
  3394. * `dnchisq'
  3395. * `dlnorm'
  3396. * `dnorm'
  3397. * `dunif'
  3398. Functions whose names begin with `p' or `q' obtain cumulative
  3399. probabilities or inverse cumulative probabilities respectively for a
  3400. specified distribution. They require one real operand to identify the
  3401. point whose probability or inverse probability is sought, and other
  3402. real operands to parameterize the distribution, as above. There are
  3403. also two boolean operands. The first is true in order to request a
  3404. probability or inverse probability with respect to the lower tail as
  3405. opposed to the upper, and the other is true to indicate that
  3406. probabilities are to be expressed logarithmically.
  3407. The argument to these functions is a quadruple with two real operands
  3408. and two booleans, `(X,(Y,(A,B)))'.
  3409. * `pchisq', `qchisq'
  3410. * `pexp', `qexp'
  3411. * `ppois', `qpois'
  3412. * `pt', `qt'
  3413. The remaining functions pertain to distributions parameterized by two
  3414. real operands. These take a quintuple with three real operands and two
  3415. booleans, `(X,(Y,(Z,(A,B))))'.
  3416. * `pnchisq', `qnchisq'
  3417. * `plnorm', `qlnorm'
  3418. * `pnorm', `qnorm'
  3419. * `punif', `qunif'
  3420. 
  3421. File: avram.info, Node: rmath miscellaneous functions, Next: rmath exceptions, Prev: rmath statistical functions, Up: rmath
  3422. D.16.2 `rmath' miscellaneous functions
  3423. --------------------------------------
  3424. Some less frequently used real valued mathematical functions are also
  3425. accessible by the `rmath' library interface. The functions with names
  3426. in this group take a single real operand.
  3427. gammafn lgammafn digamma
  3428. trigamma tetragamma pentagamma
  3429. The ones in this group take a pair of real operands `(X,Y)'.
  3430. beta lbeta bessel_j bessel_y
  3431. Those remaining take a triple of real operands `(X,(Y,Z))'.
  3432. bessel_i bessel_k
  3433. An alternative and better documented selection of Bessel functions is
  3434. provided by the `bes' library interface (*note bes::).
  3435. 
  3436. File: avram.info, Node: rmath exceptions, Prev: rmath miscellaneous functions, Up: rmath
  3437. D.16.3 `rmath' exceptions
  3438. -------------------------
  3439. The only exceptional condition specific to the `rmath' library
  3440. interface is associated with the message `<'bad rmath specification'>',
  3441. which means that a tuple given as an argument has the wrong number or
  3442. types of operands.
  3443. 
  3444. File: avram.info, Node: umf, Prev: rmath, Up: External Libraries
  3445. D.17 `umf'
  3446. ==========
  3447. Systems of equations described by sparse matrices (i.e., matrices containing
  3448. mostly zeros) arise in certain practical problems. The usual array
  3449. representation in which zeros are explicitly stored would be
  3450. prohibitive for large matrices occurring in many problems of interest.
  3451. A more sophisticated approach is used by the `umf' library to manage
  3452. memory efficiently, which is documented at
  3453. `http://www.cise.ufl.edu/research/sparse/SuiteSparse/current/SuiteSparse/UMFPACK/Doc/'.
  3454. A virtual code interface to functions for solving sparse systems of
  3455. equations by these methods is afforded by library functions of the form
  3456. library('umf',f)
  3457. where the library function name, `f' is a character string of the form
  3458. `TT_M_RRR'.
  3459. * TT can be either `di' for real matrices, or `zi' for complex.
  3460. * M can be one of `a', `t', or `c' for solving a system given either
  3461. by a matrix, its transpose, or its conjugate transpose,
  3462. respectively, corresponding to mnemonics `A', `Aat' and `At' used
  3463. in the C language API.
  3464. * RRR is either `trp' or `col', to indicate a sparse matrix expressed
  3465. either as a list of triples, or in packed column form, as
  3466. documented below.
  3467. The complete set of function names for this library interface is as
  3468. follows.
  3469. di_a_trp di_a_col zi_a_trp zi_a_col
  3470. di_t_trp di_t_col zi_t_trp zi_t_col
  3471. zi_c_trp zi_c_col
  3472. Not all combinations are represented, because the conjugate transpose
  3473. is relevant only to complex matrices.
  3474. * Menu:
  3475. * umf input parameters::
  3476. * umf output::
  3477. * umf exceptions::
  3478. * Additional umf notes::
  3479. 
  3480. File: avram.info, Node: umf input parameters, Next: umf output, Prev: umf, Up: umf
  3481. D.17.1 `umf' input parameters
  3482. -----------------------------
  3483. For a square matrix A and a column vector B, the `umf' functions find
  3484. the solution X to the matrix equation M X = B, where M is either A, the
  3485. transpose of A, or its conjugate transpose. As noted above, the choice
  3486. is determined by whether the the function name is of the form *`_a_'*,
  3487. *`_t_'*, or *`_c_'* respectively.
  3488. The argument to any of these functions is a pair `(A,B)', where A
  3489. represents the matrix mentioned above and B represents the column
  3490. vector.
  3491. The parameter B is required to be a list of numbers whose length
  3492. matches the number of rows in the matrix. The numbers are either real
  3493. numbers for the `di_'* functions (*note math::), or complex for the
  3494. `zi_'* functions (*note complex::).
  3495. There is a choice of representations for the parameter A, depending
  3496. on whether the function being called is one of the *`_trp' functions or
  3497. one of the *`_col' functions.
  3498. For the *`_trp' functions, A is represented as a non-empty list of
  3499. triples `<((I,J),V)...>', where each item of the list corresponds to a
  3500. non-zero entry in the matrix.
  3501. * The parameters I and J are natural numbers as in *note
  3502. Representation of Numeric and Textual Data::.
  3503. * The value V is a real number for the `di_'*`_trp' functions or a
  3504. complex number for the `zi_'*`_trp' functions.
  3505. * The presence of a triple ((I,J),V) in the list signifies that the
  3506. I,J-th entry in the matrix A (numbered from zero) has a value of V.
  3507. For the *`_col' functions, the representation of A is more
  3508. complicated but has a slight advantage in memory usage. It may also
  3509. have an advantage in speed unless more time is wasted on the virtual
  3510. side transforming a matrix to this representation than it saves.
  3511. In this case, A is represented by a triple of the form `((P,I),V)'.
  3512. The parameters P and I are lists of natural numbers. The parameter V is
  3513. a list of real numbers for the `di_'*`_col' functions and complex
  3514. numbers for the `zi_'*`_col' functions. They have the following
  3515. interpretations.
  3516. * V is the list of non-zero entries in the matrix in column major
  3517. order.
  3518. * I has the same length as V, and each item of I is the row index of
  3519. the corresponding item in V, numbered from zero.
  3520. * P has the length of the number of columns in the matrix, and each
  3521. item identifies the starting position of a column in V and I,
  3522. numbered from zero.
  3523. The first item of P is always zero. Further explanation of this format
  3524. in terms of an array representation can be found in the file
  3525. `UMFPACK_UserGuide.pdf', available from the `umf' library home page at
  3526. `http://www.cise.ufl.edu/research/sparse/SuiteSparse/current/SuiteSparse/'.
  3527. 
  3528. File: avram.info, Node: umf output, Next: umf exceptions, Prev: umf input parameters, Up: umf
  3529. D.17.2 `umf' output
  3530. -------------------
  3531. If no exception occurs, the solution X to the matrix equation M X = B
  3532. noted previously will be returned if one exists.
  3533. The solution is represented as either a list of real numbers as in
  3534. *note math::, or a list of complex numbers as in *note complex::. Real
  3535. numbers are returned by the `di_'* functions, and complex numbers are
  3536. returned by the `zi_'* functions.
  3537. If no solution exists due to a singular matrix, an empty list is
  3538. returned. The lack of a solution isn't treated as an exceptional
  3539. condition.
  3540. 
  3541. File: avram.info, Node: umf exceptions, Next: Additional umf notes, Prev: umf output, Up: umf
  3542. D.17.3 `umf' exceptions
  3543. -----------------------
  3544. If an exceptional condition arises from the use of this library, one of
  3545. the following lists of character strings may be returned as the
  3546. function result.
  3547. * `<'memory overflow'>' means the library function ran out of
  3548. memory, most likely due to a matrix being too large.
  3549. * `<'bad umf specification'>' means an input parameter didn't conform
  3550. to the appropriate format described above (*note umf input
  3551. parameters::)
  3552. * `<'umf error'>' covers any unexpected behavior or abnormal status
  3553. returned by any function from the C language API.
  3554. For the *`_trp' functions. A non-square matrix will cause the second
  3555. exception above. For the *`_col' functions, a non-square matrix will
  3556. cause the third exception or cause an empty result to be returned.
  3557. The exceptions noted at the beginning of this section (*note
  3558. External Libraries::) are also possible.
  3559. 
  3560. File: avram.info, Node: Additional umf notes, Prev: umf exceptions, Up: umf
  3561. D.17.4 Additional `umf' notes
  3562. -----------------------------
  3563. The C language API to `umf' provides very many less frequently used
  3564. features that are not part of the virtual code interface, some of which
  3565. could be added by minor modifications to the file `umf.c' in the
  3566. `avram' source tree.
  3567. A set of `dl_'* and `zl_'* functions orthogonal to those presently
  3568. accessible would enable matrices having billions of rows or columns by
  3569. using long integers, but memory requirements on the virtual code side
  3570. for problems of that scale are probably prohibitive for the foreseeable
  3571. future.
  3572. 
  3573. File: avram.info, Node: Copying, Next: Function Index, Prev: External Libraries, Up: Top
  3574. Appendix E GNU GENERAL PUBLIC LICENCE
  3575. *************************************
  3576. Version 2, June 1991
  3577. Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  3578. 675 Mass Ave, Cambridge, MA 02139, USA
  3579. Everyone is permitted to copy and distribute verbatim copies
  3580. of this license document, but changing it is not allowed.
  3581. * Menu:
  3582. * Preamble::
  3583. * Terms and Conditions::
  3584. * How to Apply::
  3585. 
  3586. File: avram.info, Node: Preamble, Next: Terms and Conditions, Up: Copying
  3587. Preamble
  3588. ========
  3589. The licenses for most software are designed to take away your freedom
  3590. to share and change it. By contrast, the GNU General Public License is
  3591. intended to guarantee your freedom to share and change free
  3592. software--to make sure the software is free for all its users. This
  3593. General Public License applies to most of the Free Software
  3594. Foundation's software and to any other program whose authors commit to
  3595. using it. (Some other Free Software Foundation software is covered by
  3596. the GNU Library General Public License instead.) You can apply it to
  3597. your programs, too.
  3598. When we speak of free software, we are referring to freedom, not
  3599. price. Our General Public Licenses are designed to make sure that you
  3600. have the freedom to distribute copies of free software (and charge for
  3601. this service if you wish), that you receive source code or can get it
  3602. if you want it, that you can change the software or use pieces of it in
  3603. new free programs; and that you know you can do these things.
  3604. To protect your rights, we need to make restrictions that forbid
  3605. anyone to deny you these rights or to ask you to surrender the rights.
  3606. These restrictions translate to certain responsibilities for you if you
  3607. distribute copies of the software, or if you modify it.
  3608. For example, if you distribute copies of such a program, whether
  3609. gratis or for a fee, you must give the recipients all the rights that
  3610. you have. You must make sure that they, too, receive or can get the
  3611. source code. And you must show them these terms so they know their
  3612. rights.
  3613. We protect your rights with two steps: (1) copyright the software,
  3614. and (2) offer you this license which gives you legal permission to copy,
  3615. distribute and/or modify the software.
  3616. Also, for each author's protection and ours, we want to make certain
  3617. that everyone understands that there is no warranty for this free
  3618. software. If the software is modified by someone else and passed on, we
  3619. want its recipients to know that what they have is not the original, so
  3620. that any problems introduced by others will not reflect on the original
  3621. authors' reputations.
  3622. Finally, any free program is threatened constantly by software
  3623. patents. We wish to avoid the danger that redistributors of a free
  3624. program will individually obtain patent licenses, in effect making the
  3625. program proprietary. To prevent this, we have made it clear that any
  3626. patent must be licensed for everyone's free use or not licensed at all.
  3627. The precise terms and conditions for copying, distribution and
  3628. modification follow.
  3629. 
  3630. File: avram.info, Node: Terms and Conditions, Next: How to Apply, Prev: Preamble, Up: Copying
  3631. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  3632. ===============================================================
  3633. 1. This License applies to any program or other work which contains a
  3634. notice placed by the copyright holder saying it may be distributed
  3635. under the terms of this General Public License. The "Program",
  3636. below, refers to any such program or work, and a "work based on
  3637. the Program" means either the Program or any derivative work under
  3638. copyright law: that is to say, a work containing the Program or a
  3639. portion of it, either verbatim or with modifications and/or
  3640. translated into another language. (Hereinafter, translation is
  3641. included without limitation in the term "modification".) Each
  3642. licensee is addressed as "you".
  3643. Activities other than copying, distribution and modification are
  3644. not covered by this License; they are outside its scope. The act
  3645. of running the Program is not restricted, and the output from the
  3646. Program is covered only if its contents constitute a work based on
  3647. the Program (independent of having been made by running the
  3648. Program). Whether that is true depends on what the Program does.
  3649. 2. You may copy and distribute verbatim copies of the Program's
  3650. source code as you receive it, in any medium, provided that you
  3651. conspicuously and appropriately publish on each copy an appropriate
  3652. copyright notice and disclaimer of warranty; keep intact all the
  3653. notices that refer to this License and to the absence of any
  3654. warranty; and give any other recipients of the Program a copy of
  3655. this License along with the Program.
  3656. You may charge a fee for the physical act of transferring a copy,
  3657. and you may at your option offer warranty protection in exchange
  3658. for a fee.
  3659. 3. You may modify your copy or copies of the Program or any portion
  3660. of it, thus forming a work based on the Program, and copy and
  3661. distribute such modifications or work under the terms of Section 1
  3662. above, provided that you also meet all of these conditions:
  3663. a. You must cause the modified files to carry prominent notices
  3664. stating that you changed the files and the date of any change.
  3665. b. You must cause any work that you distribute or publish, that
  3666. in whole or in part contains or is derived from the Program
  3667. or any part thereof, to be licensed as a whole at no charge
  3668. to all third parties under the terms of this License.
  3669. c. If the modified program normally reads commands interactively
  3670. when run, you must cause it, when started running for such
  3671. interactive use in the most ordinary way, to print or display
  3672. an announcement including an appropriate copyright notice and
  3673. a notice that there is no warranty (or else, saying that you
  3674. provide a warranty) and that users may redistribute the
  3675. program under these conditions, and telling the user how to
  3676. view a copy of this License. (Exception: if the Program
  3677. itself is interactive but does not normally print such an
  3678. announcement, your work based on the Program is not required
  3679. to print an announcement.)
  3680. These requirements apply to the modified work as a whole. If
  3681. identifiable sections of that work are not derived from the
  3682. Program, and can be reasonably considered independent and separate
  3683. works in themselves, then this License, and its terms, do not
  3684. apply to those sections when you distribute them as separate
  3685. works. But when you distribute the same sections as part of a
  3686. whole which is a work based on the Program, the distribution of
  3687. the whole must be on the terms of this License, whose permissions
  3688. for other licensees extend to the entire whole, and thus to each
  3689. and every part regardless of who wrote it.
  3690. Thus, it is not the intent of this section to claim rights or
  3691. contest your rights to work written entirely by you; rather, the
  3692. intent is to exercise the right to control the distribution of
  3693. derivative or collective works based on the Program.
  3694. In addition, mere aggregation of another work not based on the
  3695. Program with the Program (or with a work based on the Program) on
  3696. a volume of a storage or distribution medium does not bring the
  3697. other work under the scope of this License.
  3698. 4. You may copy and distribute the Program (or a work based on it,
  3699. under Section 2) in object code or executable form under the terms
  3700. of Sections 1 and 2 above provided that you also do one of the
  3701. following:
  3702. a. Accompany it with the complete corresponding machine-readable
  3703. source code, which must be distributed under the terms of
  3704. Sections 1 and 2 above on a medium customarily used for
  3705. software interchange; or,
  3706. b. Accompany it with a written offer, valid for at least three
  3707. years, to give any third party, for a charge no more than your
  3708. cost of physically performing source distribution, a complete
  3709. machine-readable copy of the corresponding source code, to be
  3710. distributed under the terms of Sections 1 and 2 above on a
  3711. medium customarily used for software interchange; or,
  3712. c. Accompany it with the information you received as to the offer
  3713. to distribute corresponding source code. (This alternative is
  3714. allowed only for noncommercial distribution and only if you
  3715. received the program in object code or executable form with
  3716. such an offer, in accord with Subsection b above.)
  3717. The source code for a work means the preferred form of the work for
  3718. making modifications to it. For an executable work, complete
  3719. source code means all the source code for all modules it contains,
  3720. plus any associated interface definition files, plus the scripts
  3721. used to control compilation and installation of the executable.
  3722. However, as a special exception, the source code distributed need
  3723. not include anything that is normally distributed (in either
  3724. source or binary form) with the major components (compiler,
  3725. kernel, and so on) of the operating system on which the executable
  3726. runs, unless that component itself accompanies the executable.
  3727. If distribution of executable or object code is made by offering
  3728. access to copy from a designated place, then offering equivalent
  3729. access to copy the source code from the same place counts as
  3730. distribution of the source code, even though third parties are not
  3731. compelled to copy the source along with the object code.
  3732. 5. You may not copy, modify, sublicense, or distribute the Program
  3733. except as expressly provided under this License. Any attempt
  3734. otherwise to copy, modify, sublicense or distribute the Program is
  3735. void, and will automatically terminate your rights under this
  3736. License. However, parties who have received copies, or rights,
  3737. from you under this License will not have their licenses
  3738. terminated so long as such parties remain in full compliance.
  3739. 6. You are not required to accept this License, since you have not
  3740. signed it. However, nothing else grants you permission to modify
  3741. or distribute the Program or its derivative works. These actions
  3742. are prohibited by law if you do not accept this License.
  3743. Therefore, by modifying or distributing the Program (or any work
  3744. based on the Program), you indicate your acceptance of this
  3745. License to do so, and all its terms and conditions for copying,
  3746. distributing or modifying the Program or works based on it.
  3747. 7. Each time you redistribute the Program (or any work based on the
  3748. Program), the recipient automatically receives a license from the
  3749. original licensor to copy, distribute or modify the Program
  3750. subject to these terms and conditions. You may not impose any
  3751. further restrictions on the recipients' exercise of the rights
  3752. granted herein. You are not responsible for enforcing compliance
  3753. by third parties to this License.
  3754. 8. If, as a consequence of a court judgment or allegation of patent
  3755. infringement or for any other reason (not limited to patent
  3756. issues), conditions are imposed on you (whether by court order,
  3757. agreement or otherwise) that contradict the conditions of this
  3758. License, they do not excuse you from the conditions of this
  3759. License. If you cannot distribute so as to satisfy simultaneously
  3760. your obligations under this License and any other pertinent
  3761. obligations, then as a consequence you may not distribute the
  3762. Program at all. For example, if a patent license would not permit
  3763. royalty-free redistribution of the Program by all those who
  3764. receive copies directly or indirectly through you, then the only
  3765. way you could satisfy both it and this License would be to refrain
  3766. entirely from distribution of the Program.
  3767. If any portion of this section is held invalid or unenforceable
  3768. under any particular circumstance, the balance of the section is
  3769. intended to apply and the section as a whole is intended to apply
  3770. in other circumstances.
  3771. It is not the purpose of this section to induce you to infringe any
  3772. patents or other property right claims or to contest validity of
  3773. any such claims; this section has the sole purpose of protecting
  3774. the integrity of the free software distribution system, which is
  3775. implemented by public license practices. Many people have made
  3776. generous contributions to the wide range of software distributed
  3777. through that system in reliance on consistent application of that
  3778. system; it is up to the author/donor to decide if he or she is
  3779. willing to distribute software through any other system and a
  3780. licensee cannot impose that choice.
  3781. This section is intended to make thoroughly clear what is believed
  3782. to be a consequence of the rest of this License.
  3783. 9. If the distribution and/or use of the Program is restricted in
  3784. certain countries either by patents or by copyrighted interfaces,
  3785. the original copyright holder who places the Program under this
  3786. License may add an explicit geographical distribution limitation
  3787. excluding those countries, so that distribution is permitted only
  3788. in or among countries not thus excluded. In such case, this
  3789. License incorporates the limitation as if written in the body of
  3790. this License.
  3791. 10. The Free Software Foundation may publish revised and/or new
  3792. versions of the General Public License from time to time. Such
  3793. new versions will be similar in spirit to the present version, but
  3794. may differ in detail to address new problems or concerns.
  3795. Each version is given a distinguishing version number. If the
  3796. Program specifies a version number of this License which applies
  3797. to it and "any later version", you have the option of following
  3798. the terms and conditions either of that version or of any later
  3799. version published by the Free Software Foundation. If the Program
  3800. does not specify a version number of this License, you may choose
  3801. any version ever published by the Free Software Foundation.
  3802. 11. If you wish to incorporate parts of the Program into other free
  3803. programs whose distribution conditions are different, write to the
  3804. author to ask for permission. For software which is copyrighted
  3805. by the Free Software Foundation, write to the Free Software
  3806. Foundation; we sometimes make exceptions for this. Our decision
  3807. will be guided by the two goals of preserving the free status of
  3808. all derivatives of our free software and of promoting the sharing
  3809. and reuse of software generally.
  3810. NO WARRANTY
  3811. 12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  3812. WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  3813. LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  3814. HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  3815. WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  3816. NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  3817. FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
  3818. QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
  3819. PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  3820. SERVICING, REPAIR OR CORRECTION.
  3821. 13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  3822. WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  3823. MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  3824. LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  3825. INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  3826. INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  3827. DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  3828. OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  3829. OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  3830. ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  3831. END OF TERMS AND CONDITIONS
  3832. 
  3833. File: avram.info, Node: How to Apply, Prev: Terms and Conditions, Up: Copying
  3834. How to Apply These Terms to Your New Programs
  3835. =============================================
  3836. If you develop a new program, and you want it to be of the greatest
  3837. possible use to the public, the best way to achieve this is to make it
  3838. free software which everyone can redistribute and change under these
  3839. terms.
  3840. To do so, attach the following notices to the program. It is safest
  3841. to attach them to the start of each source file to most effectively
  3842. convey the exclusion of warranty; and each file should have at least
  3843. the "copyright" line and a pointer to where the full notice is found.
  3844. ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES.
  3845. Copyright (C) 19YY NAME OF AUTHOR
  3846. This program is free software; you can redistribute it and/or
  3847. modify it under the terms of the GNU General Public License
  3848. as published by the Free Software Foundation; either version 2
  3849. of the License, or (at your option) any later version.
  3850. This program is distributed in the hope that it will be useful,
  3851. but WITHOUT ANY WARRANTY; without even the implied warranty of
  3852. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3853. GNU General Public License for more details.
  3854. You should have received a copy of the GNU General Public License
  3855. along with this program; if not, write to the Free Software
  3856. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3857. Also add information on how to contact you by electronic and paper
  3858. mail.
  3859. If the program is interactive, make it output a short notice like
  3860. this when it starts in an interactive mode:
  3861. Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  3862. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  3863. type `show w'. This is free software, and you are welcome
  3864. to redistribute it under certain conditions; type `show c'
  3865. for details.
  3866. The hypothetical commands `show w' and `show c' should show the
  3867. appropriate parts of the General Public License. Of course, the
  3868. commands you use may be called something other than `show w' and `show
  3869. c'; they could even be mouse-clicks or menu items--whatever suits your
  3870. program.
  3871. You should also get your employer (if you work as a programmer) or
  3872. your school, if any, to sign a "copyright disclaimer" for the program,
  3873. if necessary. Here is a sample; alter the names:
  3874. Yoyodyne, Inc., hereby disclaims all copyright
  3875. interest in the program `Gnomovision'
  3876. (which makes passes at compilers) written
  3877. by James Hacker.
  3878. SIGNATURE OF TY COON, 1 April 1989
  3879. Ty Coon, President of Vice
  3880. This General Public License does not permit incorporating your
  3881. program into proprietary programs. If your program is a subroutine
  3882. library, you may consider it more useful to permit linking proprietary
  3883. applications with the library. If this is what you want to do, use the
  3884. GNU Library General Public License instead of this License.
  3885. 
  3886. File: avram.info, Node: Function Index, Next: Concept Index, Prev: Copying, Up: Top
  3887. Function Index
  3888. **************
  3889. �[index�]
  3890. * Menu:
  3891. * *avm_matrix_of_list: Two dimensional arrays.
  3892. (line 61)
  3893. * *avm_matrix_reflection: Related utility functions.
  3894. (line 41)
  3895. * *avm_matrix_transposition: Related utility functions.
  3896. (line 14)
  3897. * *avm_packed_matrix_of_list: Two dimensional arrays.
  3898. (line 194)
  3899. * *avm_row_number_array: Related utility functions.
  3900. (line 60)
  3901. * *avm_standard_unstrung: Characters and Strings.
  3902. (line 92)
  3903. * *avm_unstrung: Characters and Strings.
  3904. (line 89)
  3905. * *avm_value_of_list: Primitive types. (line 14)
  3906. * *avm_vector_of_list: One dimensional arrays.
  3907. (line 19)
  3908. * avm_anticipate: Indirection. (line 36)
  3909. * avm_apply: The Universal Function.
  3910. (line 23)
  3911. * avm_area: Simple Operations. (line 189)
  3912. * avm_binary_comparison: Comparison. (line 63)
  3913. * avm_binary_membership: List Transformations.
  3914. (line 77)
  3915. * avm_byte_transduce: Execution Modes. (line 71)
  3916. * avm_character_code: Characters and Strings.
  3917. (line 48)
  3918. * avm_character_representation: Characters and Strings.
  3919. (line 35)
  3920. * avm_clearjmp: Suicidal exception handling.
  3921. (line 62)
  3922. * avm_comparison: Comparison. (line 25)
  3923. * avm_concatenation: List Transformations.
  3924. (line 41)
  3925. * avm_copied: Simple Operations. (line 40)
  3926. * avm_count_apply: The Universal Function.
  3927. (line 17)
  3928. * avm_count_branches: Indirection. (line 29)
  3929. * avm_count_chrcodes: Characters and Strings.
  3930. (line 186)
  3931. * avm_count_cmdline: Command Line Parsing.
  3932. (line 176)
  3933. * avm_count_compare: Comparison. (line 17)
  3934. * avm_count_decons: Deconstruction Functions.
  3935. (line 15)
  3936. * avm_count_exmodes: Execution Modes. (line 90)
  3937. * avm_count_fnames: File Names. (line 93)
  3938. * avm_count_formin: Formatted Input. (line 132)
  3939. * avm_count_formout: Formatted Output. (line 210)
  3940. * avm_count_instruct: Instruction Stacks. (line 146)
  3941. * avm_count_libfuns: Calling existing library functions.
  3942. (line 60)
  3943. * avm_count_listfuns: List Transformations.
  3944. (line 21)
  3945. * avm_count_lists: Simple Operations. (line 31)
  3946. * avm_count_matcon: Related utility functions.
  3947. (line 89)
  3948. * avm_count_mwrap: Memory leaks. (line 62)
  3949. * avm_count_portals: Lists of Pairs of Ports.
  3950. (line 46)
  3951. * avm_count_ports: Ports and Packets. (line 49)
  3952. * avm_count_profile: Profiling. (line 105)
  3953. * avm_count_rawio: Raw Files. (line 82)
  3954. * avm_date_representation: File Names. (line 43)
  3955. * avm_debug_memory: Memory leaks. (line 31)
  3956. * avm_deconstruction: Deconstruction Functions.
  3957. (line 24)
  3958. * avm_default_command_line: Command Line Parsing.
  3959. (line 14)
  3960. * avm_disable_interaction: Execution Modes. (line 54)
  3961. * avm_dispose: Simple Operations. (line 23)
  3962. * avm_dispose_branch: Indirection. (line 133)
  3963. * avm_dispose_branch_queue: Indirection. (line 122)
  3964. * avm_dispose_rows: Related utility functions.
  3965. (line 77)
  3966. * avm_distribution: List Transformations.
  3967. (line 35)
  3968. * avm_dont_debug_memory: Memory leaks. (line 38)
  3969. * avm_dont_manage_memory: Memory leaks. (line 26)
  3970. * avm_enqueue: Simple Operations. (line 98)
  3971. * avm_enqueue_branch: Indirection. (line 68)
  3972. * avm_entries: Profiling. (line 28)
  3973. * avm_environment: Command Line Parsing.
  3974. (line 126)
  3975. * avm_error: Error Reporting. (line 37)
  3976. * avm_fatal_io_error: Error Reporting. (line 44)
  3977. * avm_free_managed_memory: Memory leaks. (line 97)
  3978. * avm_have_library_call: Calling existing library functions.
  3979. (line 35)
  3980. * avm_initialize_apply: The Universal Function.
  3981. (line 11)
  3982. * avm_initialize_branches: Indirection. (line 23)
  3983. * avm_initialize_chrcodes: Characters and Strings.
  3984. (line 180)
  3985. * avm_initialize_cmdline: Command Line Parsing.
  3986. (line 171)
  3987. * avm_initialize_compare: Comparison. (line 12)
  3988. * avm_initialize_decons: Deconstruction Functions.
  3989. (line 10)
  3990. * avm_initialize_exmodes: Execution Modes. (line 85)
  3991. * avm_initialize_fnames: File Names. (line 88)
  3992. * avm_initialize_formin: Formatted Input. (line 126)
  3993. * avm_initialize_formout: Formatted Output. (line 205)
  3994. * avm_initialize_instruct: Instruction Stacks. (line 141)
  3995. * avm_initialize_libfuns: Calling existing library functions.
  3996. (line 55)
  3997. * avm_initialize_listfuns: List Transformations.
  3998. (line 16)
  3999. * avm_initialize_lists: Simple Operations. (line 17)
  4000. * avm_initialize_matcon: Related utility functions.
  4001. (line 83)
  4002. * avm_initialize_mwrap: Memory leaks. (line 54)
  4003. * avm_initialize_portals: Lists of Pairs of Ports.
  4004. (line 40)
  4005. * avm_initialize_ports: Ports and Packets. (line 45)
  4006. * avm_initialize_profile: Profiling. (line 100)
  4007. * avm_initialize_rawio: Raw Files. (line 77)
  4008. * avm_interact: Execution Modes. (line 12)
  4009. * avm_internal_error: Error Reporting. (line 60)
  4010. * avm_join: Simple Operations. (line 76)
  4011. * avm_length: Simple Operations. (line 179)
  4012. * avm_library_call: Calling existing library functions.
  4013. (line 14)
  4014. * avm_line_map: Execution Modes. (line 80)
  4015. * avm_list_of_matrix: Two dimensional arrays.
  4016. (line 135)
  4017. * avm_list_of_packed_matrix: Two dimensional arrays.
  4018. (line 225)
  4019. * avm_list_of_value: Primitive types. (line 47)
  4020. * avm_list_of_vector: One dimensional arrays.
  4021. (line 48)
  4022. * avm_load: Formatted Input. (line 75)
  4023. * avm_manage_memory: Memory leaks. (line 17)
  4024. * avm_measurement: List Transformations.
  4025. (line 82)
  4026. * avm_membership: List Transformations.
  4027. (line 60)
  4028. * avm_multiscanned: Characters and Strings.
  4029. (line 126)
  4030. * avm_natural: Simple Operations. (line 194)
  4031. * avm_new_portal: Lists of Pairs of Ports.
  4032. (line 25)
  4033. * avm_newport: Ports and Packets. (line 27)
  4034. * avm_non_fatal_io_error: Error Reporting. (line 55)
  4035. * avm_output: Formatted Output. (line 11)
  4036. * avm_output_as_directed: Formatted Output. (line 80)
  4037. * avm_path_name: File Names. (line 55)
  4038. * avm_path_representation: File Names. (line 12)
  4039. * avm_position: Simple Operations. (line 212)
  4040. * avm_preamble_and_contents: Formatted Input. (line 12)
  4041. * avm_print_list: Simple Operations. (line 202)
  4042. * avm_prior_to_version: Version Management. (line 50)
  4043. * avm_program_name: Error Reporting. (line 25)
  4044. * avm_prompt: Characters and Strings.
  4045. (line 143)
  4046. * avm_put_bytes: Formatted Output. (line 191)
  4047. * avm_received_list: Raw Files. (line 10)
  4048. * avm_reclamation_failure: Error Reporting. (line 73)
  4049. * avm_recoverable_anticipate: Indirection. (line 61)
  4050. * avm_recoverable_apply: The Universal Function.
  4051. (line 40)
  4052. * avm_recoverable_area: Recoverable Operations.
  4053. (line 38)
  4054. * avm_recoverable_enqueue: Recoverable Operations.
  4055. (line 25)
  4056. * avm_recoverable_enqueue_branch: Indirection. (line 112)
  4057. * avm_recoverable_interact: Execution Modes. (line 60)
  4058. * avm_recoverable_join: Recoverable Operations.
  4059. (line 15)
  4060. * avm_recoverable_length: Recoverable Operations.
  4061. (line 30)
  4062. * avm_recoverable_natural: Recoverable Operations.
  4063. (line 47)
  4064. * avm_recoverable_prompt: Characters and Strings.
  4065. (line 168)
  4066. * avm_recoverable_standard_strung: Characters and Strings.
  4067. (line 83)
  4068. * avm_recoverable_strung: Characters and Strings.
  4069. (line 80)
  4070. * avm_reschedule: Instruction Stacks. (line 126)
  4071. * avm_retire: Instruction Stacks. (line 104)
  4072. * avm_reversal: List Transformations.
  4073. (line 27)
  4074. * avm_scanned_list: Characters and Strings.
  4075. (line 107)
  4076. * avm_scheduled: Instruction Stacks. (line 89)
  4077. * avm_seal: Lists of Pairs of Ports.
  4078. (line 32)
  4079. * avm_send_list: Raw Files. (line 46)
  4080. * avm_set_program_name: Error Reporting. (line 13)
  4081. * avm_set_version: Version Management. (line 14)
  4082. * avm_setjmp: Suicidal exception handling.
  4083. (line 39)
  4084. * avm_setnonjump: Suicidal exception handling.
  4085. (line 90)
  4086. * avm_sever: Ports and Packets. (line 36)
  4087. * avm_standard_character_code: Characters and Strings.
  4088. (line 50)
  4089. * avm_standard_character_representation: Characters and Strings.
  4090. (line 37)
  4091. * avm_standard_strung: Characters and Strings.
  4092. (line 58)
  4093. * avm_strung: Characters and Strings.
  4094. (line 56)
  4095. * avm_tally: Profiling. (line 67)
  4096. * avm_trace_interaction: Execution Modes. (line 50)
  4097. * avm_transposition: List Transformations.
  4098. (line 49)
  4099. * avm_turn_off_stderr: Inept excess verbiage.
  4100. (line 34)
  4101. * avm_turn_off_stdout: Inept excess verbiage.
  4102. (line 18)
  4103. * avm_turn_on_stderr: Inept excess verbiage.
  4104. (line 40)
  4105. * avm_turn_on_stdout: Inept excess verbiage.
  4106. (line 26)
  4107. * avm_version: Version Management. (line 81)
  4108. * avm_warning: Error Reporting. (line 32)
  4109. 
  4110. File: avram.info, Node: Concept Index, Prev: Function Index, Up: Top
  4111. Concept Index
  4112. *************
  4113. �[index�]
  4114. * Menu:
  4115. * absolute path: Input Data Structure.
  4116. (line 27)
  4117. * adaptive integration: gslint output. (line 13)
  4118. * annotations <1>: Profiling. (line 22)
  4119. * annotations: Note. (line 9)
  4120. * API: Library Reference. (line 17)
  4121. * appending to files: Output From Non-interactive Applications.
  4122. (line 21)
  4123. * apply <1>: Exception Handler Usage.
  4124. (line 46)
  4125. * apply: Variable Freedom. (line 57)
  4126. * argz.h <1>: Command Line Parsing.
  4127. (line 121)
  4128. * argz.h: Configuration Related Errors.
  4129. (line 53)
  4130. * arrays: One dimensional arrays.
  4131. (line 7)
  4132. * ask-to-overwrite command line option: Parameter Mode Options.
  4133. (line 18)
  4134. * asprintf <1>: math library exceptions.
  4135. (line 12)
  4136. * asprintf: math library conversion functions.
  4137. (line 12)
  4138. * assign: Assignment. (line 22)
  4139. * assignment <1>: Error Messages. (line 84)
  4140. * assignment: Assignment. (line 6)
  4141. * asynchronous circuits: Transfer. (line 91)
  4142. * author <1>: Operator Generalization.
  4143. (line 51)
  4144. * author <2>: Transfer. (line 92)
  4145. * author: Internal Errors. (line 23)
  4146. * autoconf: Implementing new library functions.
  4147. (line 49)
  4148. * automake: Implementing new library functions.
  4149. (line 49)
  4150. * avm_current_directory_prefix: File Names. (line 24)
  4151. * avm_packet: Ports and Packets. (line 8)
  4152. * avm_parent_directory_prefix: File Names. (line 24)
  4153. * avm_path_separator: File Names. (line 24)
  4154. * avm_path_separator_character: File Names. (line 24)
  4155. * avm_root_directory_prefix: File Names. (line 24)
  4156. * AVMINPUTS <1>: Environment. (line 6)
  4157. * AVMINPUTS <2>: Configuration Related Errors.
  4158. (line 53)
  4159. * AVMINPUTS: i/o Errors. (line 11)
  4160. * backward compatability <1>: Calling existing library functions.
  4161. (line 22)
  4162. * backward compatability: Characters and Strings.
  4163. (line 29)
  4164. * backward compatibility: Configuration Related Errors.
  4165. (line 35)
  4166. * bad bessel function call: Bessel function errors.
  4167. (line 7)
  4168. * bad character in file name <1>: File Names. (line 74)
  4169. * bad character in file name: File Format Errors. (line 32)
  4170. * bad derivative specification: gsldif exceptions. (line 6)
  4171. * bad integral specification: gslint exceptions. (line 8)
  4172. * bad kinsol specification: kinsol exceptions. (line 17)
  4173. * bad lapack specification: lapack exceptions. (line 13)
  4174. * bad matrix specification: External Libraries. (line 46)
  4175. * bad minpack specification: minpack exceptions. (line 9)
  4176. * bad mpfr specification: mpfr exceptions. (line 9)
  4177. * bad rmath specification: rmath exceptions. (line 8)
  4178. * bad umf specification: umf exceptions. (line 13)
  4179. * bad vector specification: External Libraries. (line 46)
  4180. * bessel functions <1>: rmath miscellaneous functions.
  4181. (line 13)
  4182. * bessel functions: Bessel function calling conventions.
  4183. (line 6)
  4184. * bit strings: Concrete Syntax. (line 15)
  4185. * booleans <1>: Input Data Structure.
  4186. (line 69)
  4187. * booleans: Representation of Numeric and Textual Data.
  4188. (line 33)
  4189. * bu <1>: Exception Handler Usage.
  4190. (line 46)
  4191. * bu <2>: Reduce. (line 66)
  4192. * bu: Refer. (line 11)
  4193. * bug reports: Internal Errors. (line 23)
  4194. * bugs: Bugs. (line 6)
  4195. * byte-transducer command line option <1>: Byte Transducers. (line 6)
  4196. * byte-transducer command line option <2>: Loading All of Standard Input at Once.
  4197. (line 6)
  4198. * byte-transducer command line option: Filter Mode Options. (line 40)
  4199. * C++ <1>: Implementing new library functions.
  4200. (line 118)
  4201. * C++: Library Reference. (line 57)
  4202. * c++filt utility: Implementing new library functions.
  4203. (line 119)
  4204. * can't close <1>: Profiling. (line 84)
  4205. * can't close <2>: Formatted Output. (line 176)
  4206. * can't close: i/o Errors. (line 32)
  4207. * can't emulate version: Configuration Related Errors.
  4208. (line 35)
  4209. * can't read: i/o Errors. (line 11)
  4210. * can't spawn: i/o Errors. (line 27)
  4211. * can't write <1>: Profiling. (line 84)
  4212. * can't write <2>: Formatted Output. (line 66)
  4213. * can't write <3>: Raw Files. (line 68)
  4214. * can't write: i/o Errors. (line 20)
  4215. * cat <1>: Cat. (line 7)
  4216. * cat <2>: Transfer. (line 71)
  4217. * cat: Example Script. (line 13)
  4218. * character codes <1>: Byte Transducers. (line 45)
  4219. * character codes <2>: Representation of Numeric and Textual Data.
  4220. (line 25)
  4221. * character codes: Blocking. (line 26)
  4222. * character encodings: Characters and Strings.
  4223. (line 14)
  4224. * character representations: Character Table. (line 6)
  4225. * character strings <1>: Characters and Strings.
  4226. (line 6)
  4227. * character strings <2>: Error Messages. (line 13)
  4228. * character strings <3>: Standard Output Representation.
  4229. (line 38)
  4230. * character strings: Representation of Numeric and Textual Data.
  4231. (line 19)
  4232. * checksums: File Format. (line 21)
  4233. * chmod: Example Script. (line 24)
  4234. * choice-of-output command line option <1>: Standard Output Representation.
  4235. (line 6)
  4236. * choice-of-output command line option <2>: Standard Input Representation.
  4237. (line 12)
  4238. * choice-of-output command line option: Filter Mode Options. (line 21)
  4239. * Cholesky decomposition <1>: Additional lapack notes.
  4240. (line 28)
  4241. * Cholesky decomposition: lapack calling conventions.
  4242. (line 73)
  4243. * coding standards: Implementing new library functions.
  4244. (line 153)
  4245. * column major order <1>: umf input parameters.
  4246. (line 49)
  4247. * column major order <2>: Related utility functions.
  4248. (line 25)
  4249. * column major order: Two dimensional arrays.
  4250. (line 140)
  4251. * combinators: Recursion. (line 7)
  4252. * command line <1>: Command Line Parsing.
  4253. (line 6)
  4254. * command line <2>: Character Oriented Interaction.
  4255. (line 8)
  4256. * command line <3>: Line Oriented Interaction.
  4257. (line 8)
  4258. * command line <4>: Input for Mapped Applications.
  4259. (line 26)
  4260. * command line <5>: Input Data Structure.
  4261. (line 7)
  4262. * command line: Command Line Syntax. (line 6)
  4263. * compare <1>: Comparison. (line 12)
  4264. * compare: Compare. (line 6)
  4265. * compare combinator <1>: mpfr binary predicates.
  4266. (line 27)
  4267. * compare combinator: Additional math library notes.
  4268. (line 16)
  4269. * complex numbers: complex. (line 6)
  4270. * compose <1>: How avram Thinks. (line 112)
  4271. * compose: Standard Library. (line 10)
  4272. * compression: Weight. (line 20)
  4273. * concatenation <1>: List Transformations.
  4274. (line 41)
  4275. * concatenation <2>: Cat. (line 7)
  4276. * concatenation: Transfer. (line 71)
  4277. * concurrency: Instruction Stacks. (line 23)
  4278. * conditional <1>: How avram Thinks. (line 112)
  4279. * conditional: Standard Library. (line 10)
  4280. * conjugate transpose: umf. (line 26)
  4281. * cons <1>: Operator Generalization.
  4282. (line 6)
  4283. * cons <2>: A New Operator. (line 13)
  4284. * cons: Raw Material. (line 54)
  4285. * constant <1>: How avram Thinks. (line 112)
  4286. * constant: Standard Library. (line 10)
  4287. * constrained non-linear optimization: kinsol. (line 8)
  4288. * constrained optimization: Additional minpack notes.
  4289. (line 17)
  4290. * constraints <1>: Additional kinsol notes.
  4291. (line 20)
  4292. * constraints: Additional glpk notes.
  4293. (line 9)
  4294. * convergence: gslevu. (line 15)
  4295. * copyright: Implementing new library functions.
  4296. (line 151)
  4297. * correlation: Additional lapack notes.
  4298. (line 31)
  4299. * counter <1>: Ports and Packets. (line 8)
  4300. * counter: Simple Operations. (line 179)
  4301. * counter overflow <1>: File Names. (line 74)
  4302. * counter overflow: Overflow Errors. (line 7)
  4303. * couple: Standard Library. (line 10)
  4304. * covariance matrix <1>: Additional lapack notes.
  4305. (line 32)
  4306. * covariance matrix: Interaction combinator.
  4307. (line 21)
  4308. * cumulative probability: rmath statistical functions.
  4309. (line 86)
  4310. * current time: Input Data Structure.
  4311. (line 21)
  4312. * date: Input Data Structure.
  4313. (line 21)
  4314. * deadlock <1>: Execution Modes. (line 46)
  4315. * deadlock <2>: Interaction combinator.
  4316. (line 95)
  4317. * deadlock: Line Oriented Interaction.
  4318. (line 98)
  4319. * Debian <1>: Additional minpack notes.
  4320. (line 31)
  4321. * Debian: Implementing new library functions.
  4322. (line 124)
  4323. * debugging: Exception Handler Usage.
  4324. (line 64)
  4325. * deconstruction <1>: Deconstruction Functions.
  4326. (line 6)
  4327. * deconstruction <2>: Exception Handler Usage.
  4328. (line 17)
  4329. * deconstruction <3>: Deconstruction. (line 6)
  4330. * deconstruction: Bit String Encoding. (line 37)
  4331. * default file extensions: Parameter Mode Options.
  4332. (line 26)
  4333. * default-to-stdin command line option <1>: Example Script. (line 13)
  4334. * default-to-stdin command line option: Parameter Mode Options.
  4335. (line 37)
  4336. * denotational semantics: Semantics. (line 31)
  4337. * diagnostics: Diagnostics. (line 6)
  4338. * dimensionality reduction: Additional lapack notes.
  4339. (line 7)
  4340. * discontiguous field: Comparison. (line 43)
  4341. * distribute: Distribute. (line 7)
  4342. * distributed implementation <1>: Reduce. (line 57)
  4343. * distributed implementation: Bit String Encoding. (line 15)
  4344. * distributions: rmath statistical functions.
  4345. (line 13)
  4346. * eigenvectors: lapack calling conventions.
  4347. (line 64)
  4348. * email: Internal Errors. (line 23)
  4349. * emulation: General Options. (line 9)
  4350. * emulation command line option <1>: Configuration Related Errors.
  4351. (line 35)
  4352. * emulation command line option: General Options. (line 9)
  4353. * environment <1>: Command Line Parsing.
  4354. (line 126)
  4355. * environment <2>: Input Data Structure.
  4356. (line 7)
  4357. * environment <3>: Environment. (line 6)
  4358. * environment <4>: Configuration Related Errors.
  4359. (line 53)
  4360. * environment <5>: i/o Errors. (line 11)
  4361. * environment: Preface. (line 11)
  4362. * eof: Interaction combinator.
  4363. (line 87)
  4364. * equality <1>: Compare. (line 22)
  4365. * equality <2>: Variable Freedom. (line 56)
  4366. * equality: On Equality. (line 6)
  4367. * error messages <1>: Error Reporting. (line 6)
  4368. * error messages <2>: List Transformations.
  4369. (line 8)
  4370. * error messages <3>: Expedient Error Messages.
  4371. (line 6)
  4372. * error messages: Diagnostics. (line 6)
  4373. * exceptions <1>: List Transformations.
  4374. (line 8)
  4375. * exceptions <2>: Computable Error Messages.
  4376. (line 14)
  4377. * exceptions <3>: Exception Handling. (line 6)
  4378. * exceptions <4>: A Minimal Set of Properties.
  4379. (line 58)
  4380. * exceptions: Bugs. (line 6)
  4381. * executable files <1>: Formatted Output. (line 59)
  4382. * executable files: Example Script. (line 23)
  4383. * exp_popen <1>: Line Oriented Interaction.
  4384. (line 32)
  4385. * exp_popen: i/o Errors. (line 27)
  4386. * expect: i/o Errors. (line 27)
  4387. * EXT command line option <1>: Environment. (line 25)
  4388. * EXT command line option: Parameter Mode Options.
  4389. (line 26)
  4390. * extensions <1>: Other Diagnostics and Warnings.
  4391. (line 7)
  4392. * extensions: Parameter Mode Options.
  4393. (line 26)
  4394. * external-libraries: General Options. (line 28)
  4395. * facilitator: Ports and Packets. (line 124)
  4396. * fan: Fan. (line 6)
  4397. * feclearexcept: Additional math library notes.
  4398. (line 10)
  4399. * field <1>: Error Messages. (line 80)
  4400. * field <2>: Assignment. (line 77)
  4401. * field: Field. (line 29)
  4402. * file extensions: Other Diagnostics and Warnings.
  4403. (line 7)
  4404. * file format <1>: Standard Input Representation.
  4405. (line 40)
  4406. * file format: File Format. (line 6)
  4407. * file name extensions <1>: Other Diagnostics and Warnings.
  4408. (line 7)
  4409. * file name extensions: Parameter Mode Options.
  4410. (line 26)
  4411. * file name suffixes <1>: Other Diagnostics and Warnings.
  4412. (line 7)
  4413. * file name suffixes: Parameter Mode Options.
  4414. (line 26)
  4415. * file names <1>: File Names. (line 6)
  4416. * file names <2>: Input Data Structure.
  4417. (line 27)
  4418. * file names: i/o Errors. (line 11)
  4419. * file parameters: Command Line Syntax. (line 13)
  4420. * filter: Filter. (line 6)
  4421. * filter mode <1>: Filter Mode Interface.
  4422. (line 6)
  4423. * filter mode <2>: Security. (line 11)
  4424. * filter mode: Filter Mode. (line 6)
  4425. * flag: Ports and Packets. (line 8)
  4426. * flat: Transpose. (line 17)
  4427. * fold: Reduce. (line 43)
  4428. * force-text-input command line option <1>: Standard Input Representation.
  4429. (line 12)
  4430. * force-text-input command line option: General Options. (line 47)
  4431. * Fortran <1>: lapack. (line 6)
  4432. * Fortran <2>: Implementing new library functions.
  4433. (line 112)
  4434. * Fortran <3>: External Library Maintenance.
  4435. (line 10)
  4436. * Fortran: Two dimensional arrays.
  4437. (line 124)
  4438. * Fourier transforms <1>: harminv. (line 9)
  4439. * Fourier transforms: fftw. (line 6)
  4440. * ftp: Interaction combinator.
  4441. (line 47)
  4442. * functional programming <1>: Exception Handler Usage.
  4443. (line 64)
  4444. * functional programming <2>: List Combinators. (line 6)
  4445. * functional programming <3>: Recursion. (line 7)
  4446. * functional programming <4>: User Manual. (line 26)
  4447. * functional programming: Preface. (line 11)
  4448. * gamma functions <1>: rmath miscellaneous functions.
  4449. (line 7)
  4450. * gamma functions: mpfr unary operators.
  4451. (line 7)
  4452. * generalized least squares <1>: Additional lapack notes.
  4453. (line 22)
  4454. * generalized least squares: lapack calling conventions.
  4455. (line 89)
  4456. * gmp library: Additional mpfr notes.
  4457. (line 7)
  4458. * GNU R: Interaction combinator.
  4459. (line 18)
  4460. * GNU Scientific Library: gsldif output. (line 10)
  4461. * grammar: Syntax. (line 8)
  4462. * guard <1>: Exception Handler Usage.
  4463. (line 46)
  4464. * guard: Computable Error Messages.
  4465. (line 41)
  4466. * harminv: harminv. (line 6)
  4467. * Hartley transforms: fftw. (line 6)
  4468. * head field: Lists. (line 7)
  4469. * header file <1>: Additional minpack notes.
  4470. (line 27)
  4471. * header file: Implementing new library functions.
  4472. (line 12)
  4473. * help: General Options. (line 9)
  4474. * help command line option <1>: Other Diagnostics and Warnings.
  4475. (line 20)
  4476. * help command line option: General Options. (line 9)
  4477. * Hermitian matrix: lapack calling conventions.
  4478. (line 121)
  4479. * hired <1>: Exception Handler Usage.
  4480. (line 46)
  4481. * hired: Variable Freedom. (line 8)
  4482. * home page: General Options. (line 22)
  4483. * I need avram linked with: Configuration Related Errors.
  4484. (line 24)
  4485. * i/o errors: i/o Errors. (line 6)
  4486. * identifiers: How avram Thinks. (line 15)
  4487. * identity <1>: Exception Handler Usage.
  4488. (line 46)
  4489. * identity: Standard Library. (line 10)
  4490. * identity function: Concrete Syntax. (line 7)
  4491. * imperative programming <1>: Exception Handler Usage.
  4492. (line 64)
  4493. * imperative programming <2>: List Combinators. (line 6)
  4494. * imperative programming: Assignment. (line 6)
  4495. * impetus: Ports and Packets. (line 115)
  4496. * improper integrals: Additional gslint notes.
  4497. (line 8)
  4498. * include directives: Implementing new library functions.
  4499. (line 54)
  4500. * infinite series: gslevu. (line 14)
  4501. * infinite streams <1>: Byte Transducers. (line 7)
  4502. * infinite streams <2>: Line Maps. (line 17)
  4503. * infinite streams: Loading All of Standard Input at Once.
  4504. (line 9)
  4505. * infinite sum: gslevu calling conventions.
  4506. (line 13)
  4507. * input files: Command Line Syntax. (line 13)
  4508. * insert <1>: Insert. (line 6)
  4509. * insert: Sort. (line 29)
  4510. * instruction_node: Instruction Stacks. (line 7)
  4511. * interactive applications <1>: Characters and Strings.
  4512. (line 161)
  4513. * interactive applications <2>: Security. (line 32)
  4514. * interactive applications: Parameter Mode Options.
  4515. (line 59)
  4516. * interactive command line option <1>: Output From Interactive Applications.
  4517. (line 6)
  4518. * interactive command line option <2>: Output From Non-interactive Applications.
  4519. (line 6)
  4520. * interactive command line option: Parameter Mode Options.
  4521. (line 59)
  4522. * internal error: Memory leaks. (line 86)
  4523. * internal errors <1>: Bugs. (line 6)
  4524. * internal errors: Internal Errors. (line 6)
  4525. * interpretation: Ports and Packets. (line 115)
  4526. * invalid asprintf specifier: math library exceptions.
  4527. (line 11)
  4528. * invalid assignment: Application Programming Errors.
  4529. (line 27)
  4530. * invalid comparison: Application Programming Errors.
  4531. (line 15)
  4532. * invalid concatenation: Application Programming Errors.
  4533. (line 25)
  4534. * invalid deconstruction: Application Programming Errors.
  4535. (line 17)
  4536. * invalid distribution: Application Programming Errors.
  4537. (line 23)
  4538. * invalid file name: File Names. (line 74)
  4539. * invalid file specification <1>: Formatted Output. (line 176)
  4540. * invalid file specification: File Format Errors. (line 43)
  4541. * invalid membership: Application Programming Errors.
  4542. (line 21)
  4543. * invalid output preamble format <1>: Formatted Output. (line 66)
  4544. * invalid output preamble format: File Format Errors. (line 36)
  4545. * invalid profile identifier <1>: Profiling. (line 84)
  4546. * invalid profile identifier: Application Programming Errors.
  4547. (line 31)
  4548. * invalid raw file format <1>: Formatted Input. (line 113)
  4549. * invalid raw file format <2>: Raw Files. (line 31)
  4550. * invalid raw file format: File Format Errors. (line 48)
  4551. * invalid recursion: Application Programming Errors.
  4552. (line 13)
  4553. * invalid text format <1>: math library exceptions.
  4554. (line 17)
  4555. * invalid text format <2>: Formatted Output. (line 66)
  4556. * invalid text format: File Format Errors. (line 12)
  4557. * invalid transpose: Application Programming Errors.
  4558. (line 19)
  4559. * invalid value <1>: math library exceptions.
  4560. (line 8)
  4561. * invalid value <2>: External Libraries. (line 46)
  4562. * invalid value: Primitive types. (line 41)
  4563. * isolate <1>: Assignment. (line 48)
  4564. * isolate: Variable Freedom. (line 38)
  4565. * iterate <1>: Reduce. (line 66)
  4566. * iterate: Iteration. (line 6)
  4567. * Jacobian <1>: Additional minpack notes.
  4568. (line 12)
  4569. * Jacobian <2>: minpack calling conventions.
  4570. (line 15)
  4571. * Jacobian <3>: Additional kinsol notes.
  4572. (line 6)
  4573. * Jacobian: kinsol input parameters.
  4574. (line 17)
  4575. * jail: General Options. (line 36)
  4576. * Java: Preface. (line 126)
  4577. * lapack error: lapack exceptions. (line 18)
  4578. * least squares <1>: minpack. (line 7)
  4579. * least squares <2>: Additional lapack notes.
  4580. (line 15)
  4581. * least squares <3>: lapack calling conventions.
  4582. (line 89)
  4583. * least squares: harminv. (line 9)
  4584. * left <1>: Error Messages. (line 82)
  4585. * left <2>: Field. (line 6)
  4586. * left: Standard Library. (line 10)
  4587. * Levin u-transform: gslevu. (line 16)
  4588. * libexpect: i/o Errors. (line 27)
  4589. * library interfac source file: Implementing new library functions.
  4590. (line 35)
  4591. * library interface header file: Implementing new library functions.
  4592. (line 12)
  4593. * library modules: Standard Library. (line 7)
  4594. * licensing restrictions: Implementing new library functions.
  4595. (line 143)
  4596. * line breaks <1>: Formatted Output. (line 45)
  4597. * line breaks <2>: Formatted Input. (line 56)
  4598. * line breaks: Character Oriented Interaction.
  4599. (line 30)
  4600. * line-map command line option <1>: Line Maps. (line 6)
  4601. * line-map command line option <2>: Loading All of Standard Input at Once.
  4602. (line 6)
  4603. * line-map command line option: Filter Mode Options. (line 29)
  4604. * linear algebra: lapack. (line 7)
  4605. * linear programming <1>: lpsolve calling conventions.
  4606. (line 7)
  4607. * linear programming <2>: lpsolve. (line 6)
  4608. * linear programming: glpk. (line 7)
  4609. * lists <1>: Lists. (line 7)
  4610. * lists <2>: List Functions. (line 6)
  4611. * lists <3>: List Combinators. (line 6)
  4612. * lists <4>: A Minimal Set of Properties.
  4613. (line 58)
  4614. * lists <5>: Representation of Numeric and Textual Data.
  4615. (line 19)
  4616. * lists: Raw Material. (line 12)
  4617. * LU decomposition: Two dimensional arrays.
  4618. (line 56)
  4619. * map: Map. (line 12)
  4620. * map-to-each-file command line option <1>: Input for Mapped Applications.
  4621. (line 6)
  4622. * map-to-each-file command line option: Parameter Mode Options.
  4623. (line 46)
  4624. * mapcur: Mapcur. (line 6)
  4625. * matrices: Two dimensional arrays.
  4626. (line 8)
  4627. * matrix memory map: Two dimensional arrays.
  4628. (line 172)
  4629. * member <1>: List Transformations.
  4630. (line 60)
  4631. * member: Member. (line 6)
  4632. * memory overflow <1>: File Names. (line 74)
  4633. * memory overflow: Overflow Errors. (line 7)
  4634. * meta <1>: Recur. (line 6)
  4635. * meta: Standard Library. (line 10)
  4636. * minpack error: minpack exceptions. (line 12)
  4637. * missing value <1>: math library exceptions.
  4638. (line 8)
  4639. * missing value <2>: External Libraries. (line 46)
  4640. * missing value: Primitive types. (line 40)
  4641. * mixed integer programming <1>: lpsolve calling conventions.
  4642. (line 12)
  4643. * mixed integer programming: lpsolve. (line 6)
  4644. * mnemonics: Standard Library. (line 30)
  4645. * modes <1>: Filter Mode Interface.
  4646. (line 6)
  4647. * modes <2>: Filter Mode. (line 6)
  4648. * modes: Modes of Operation. (line 8)
  4649. * mpfr error: mpfr exceptions. (line 12)
  4650. * multiple -.EXT options: Other Diagnostics and Warnings.
  4651. (line 7)
  4652. * multiple character encodings: Characters and Strings.
  4653. (line 14)
  4654. * multiple version specifications: Configuration Related Errors.
  4655. (line 41)
  4656. * multivariate normal distrubution: Interaction combinator.
  4657. (line 20)
  4658. * nan <1>: mpfr constants. (line 26)
  4659. * nan: Additional math library notes.
  4660. (line 7)
  4661. * native integer arithmetic <1>: List Transformations.
  4662. (line 87)
  4663. * native integer arithmetic: Weight. (line 30)
  4664. * naturals <1>: Simple Operations. (line 194)
  4665. * naturals <2>: Input Data Structure.
  4666. (line 60)
  4667. * naturals: Representation of Numeric and Textual Data.
  4668. (line 50)
  4669. * nil <1>: Standard Library. (line 10)
  4670. * nil <2>: Representation of Numeric and Textual Data.
  4671. (line 9)
  4672. * nil: Raw Material. (line 50)
  4673. * nm utility: Implementing new library functions.
  4674. (line 118)
  4675. * non-adaptive integration: gslint output. (line 13)
  4676. * non-convergence: kinsol output. (line 14)
  4677. * non-linear optimization <1>: minpack. (line 6)
  4678. * non-linear optimization: kinsol. (line 7)
  4679. * non-local jumps: Suicidal exception handling.
  4680. (line 15)
  4681. * non-standard installation: Example Script. (line 26)
  4682. * not writing file name: Formatted Output. (line 150)
  4683. * note <1>: Profile. (line 22)
  4684. * note: Note. (line 9)
  4685. * null character in file name <1>: File Names. (line 74)
  4686. * null character in file name: File Format Errors. (line 29)
  4687. * numerical differentiation: gsldif. (line 6)
  4688. * numerical integration: gslint. (line 6)
  4689. * operator precedence: Syntax. (line 20)
  4690. * operator properties: A Minimal Set of Properties.
  4691. (line 36)
  4692. * optimization: kinsol. (line 7)
  4693. * overflow <1>: List Transformations.
  4694. (line 8)
  4695. * overflow <2>: Simple Operations. (line 9)
  4696. * overflow <3>: Weight. (line 30)
  4697. * overflow: Overflow Errors. (line 7)
  4698. * packed arrays: Two dimensional arrays.
  4699. (line 158)
  4700. * pairs: Representation of Numeric and Textual Data.
  4701. (line 37)
  4702. * pairwise <1>: Pairwise. (line 6)
  4703. * pairwise: Reduce. (line 66)
  4704. * parameter mode <1>: Parameter Mode Interface.
  4705. (line 6)
  4706. * parameter mode <2>: Filter Mode Interface.
  4707. (line 6)
  4708. * parameter mode <3>: Security. (line 20)
  4709. * parameter mode <4>: Parameter Mode Options.
  4710. (line 6)
  4711. * parameter mode: Parameter Mode. (line 6)
  4712. * parameterized command line option: Parameter Mode Options.
  4713. (line 90)
  4714. * path separators: Command Line Syntax. (line 43)
  4715. * paths <1>: Output From Non-interactive Applications.
  4716. (line 16)
  4717. * paths <2>: Input Data Structure.
  4718. (line 27)
  4719. * paths <3>: Environment. (line 6)
  4720. * paths <4>: Example Script. (line 24)
  4721. * paths: Configuration Related Errors.
  4722. (line 53)
  4723. * pointer equality <1>: Comparison. (line 31)
  4724. * pointer equality: On Equality. (line 39)
  4725. * pointers <1>: Indirection. (line 6)
  4726. * pointers <2>: Comparison. (line 40)
  4727. * pointers <3>: Vacant Address Space.
  4728. (line 55)
  4729. * pointers <4>: On Equality. (line 39)
  4730. * pointers: Preface. (line 126)
  4731. * port: Lists of Pairs of Ports.
  4732. (line 6)
  4733. * port_pair: Lists of Pairs of Ports.
  4734. (line 11)
  4735. * portability <1>: Suicidal exception handling.
  4736. (line 129)
  4737. * portability: Inept excess verbiage.
  4738. (line 60)
  4739. * portal: Lists of Pairs of Ports.
  4740. (line 11)
  4741. * preamble <1>: Formatted Output. (line 7)
  4742. * preamble <2>: Formatted Input. (line 27)
  4743. * preamble <3>: Raw Files. (line 62)
  4744. * preamble <4>: Output From Non-interactive Applications.
  4745. (line 16)
  4746. * preamble <5>: Input Data Structure.
  4747. (line 39)
  4748. * preamble <6>: Standard Output Representation.
  4749. (line 22)
  4750. * preamble <7>: Standard Input Representation.
  4751. (line 47)
  4752. * preamble: Preamble Section. (line 6)
  4753. * precedence: Syntax. (line 20)
  4754. * precision <1>: mpfr binary operators with a natural operand.
  4755. (line 27)
  4756. * precision: mpfr binary operators.
  4757. (line 44)
  4758. * predicates <1>: math library predicates.
  4759. (line 6)
  4760. * predicates: Predicates. (line 6)
  4761. * printing algorithm <1>: Standard Output Representation.
  4762. (line 38)
  4763. * printing algorithm: Bit String Encoding. (line 21)
  4764. * probability distributions: rmath statistical functions.
  4765. (line 13)
  4766. * profile.h: Profiling. (line 6)
  4767. * profile.txt <1>: Profile. (line 6)
  4768. * profile.txt: Files. (line 7)
  4769. * prompts: Line Oriented Interaction.
  4770. (line 51)
  4771. * properties: A Minimal Set of Properties.
  4772. (line 36)
  4773. * queues <1>: Indirection. (line 15)
  4774. * queues <2>: Simple Operations. (line 98)
  4775. * queues: Bit String Encoding. (line 20)
  4776. * quiet command line option: Parameter Mode Options.
  4777. (line 12)
  4778. * random number generators: Implementing new library functions.
  4779. (line 169)
  4780. * random numbers <1>: mpfr functions with miscellaneous calling conventions.
  4781. (line 17)
  4782. * random numbers: mtwist. (line 6)
  4783. * raw-mode command line option: Standard Input Representation.
  4784. (line 8)
  4785. * raw-output command line option <1>: Standard Output Representation.
  4786. (line 6)
  4787. * raw-output command line option: Filter Mode Options. (line 12)
  4788. * re-entrancy: Additional minpack notes.
  4789. (line 20)
  4790. * recur <1>: Error Messages. (line 77)
  4791. * recur: Recur. (line 6)
  4792. * recursion <1>: Comparison. (line 58)
  4793. * recursion <2>: Mapcur. (line 11)
  4794. * recursion <3>: Reduce. (line 62)
  4795. * recursion <4>: Iteration. (line 6)
  4796. * recursion: Recursion. (line 6)
  4797. * reduce: Reduce. (line 6)
  4798. * reductions: Profiling. (line 79)
  4799. * refer: Refer. (line 6)
  4800. * reference count <1>: Simple Operations. (line 71)
  4801. * reference count: Vacant Address Space.
  4802. (line 58)
  4803. * relative path: Input Data Structure.
  4804. (line 27)
  4805. * replace <1>: Replace. (line 6)
  4806. * replace <2>: Error Messages. (line 84)
  4807. * replace: Assignment. (line 42)
  4808. * reverse: Reverse. (line 6)
  4809. * right <1>: Error Messages. (line 82)
  4810. * right <2>: Reduce. (line 66)
  4811. * right <3>: Field. (line 6)
  4812. * right: Standard Library. (line 10)
  4813. * rounding: mpfr. (line 32)
  4814. * row major order: Related utility functions.
  4815. (line 49)
  4816. * run time errors: Diagnostics. (line 6)
  4817. * score: Profiling. (line 14)
  4818. * script: Example Script. (line 6)
  4819. * search paths <1>: Environment. (line 11)
  4820. * search paths: Configuration Related Errors.
  4821. (line 53)
  4822. * search paths not supported <1>: Command Line Parsing.
  4823. (line 117)
  4824. * search paths not supported: Configuration Related Errors.
  4825. (line 53)
  4826. * security <1>: Command Line Parsing.
  4827. (line 167)
  4828. * security <2>: Formatted Output. (line 167)
  4829. * security: Security. (line 6)
  4830. * segmentation fault <1>: math library exceptions.
  4831. (line 14)
  4832. * segmentation fault <2>: gslint input parameters.
  4833. (line 27)
  4834. * segmentation fault <3>: Additional gsldif notes.
  4835. (line 10)
  4836. * segmentation fault <4>: Related utility functions.
  4837. (line 37)
  4838. * segmentation fault <5>: Two dimensional arrays.
  4839. (line 239)
  4840. * segmentation fault <6>: One dimensional arrays.
  4841. (line 59)
  4842. * segmentation fault <7>: Primitive types. (line 63)
  4843. * segmentation fault: Simple Operations. (line 57)
  4844. * semantic function <1>: Error Messages. (line 14)
  4845. * semantic function: Semantics. (line 11)
  4846. * setjmp <1>: Additional gslint notes.
  4847. (line 14)
  4848. * setjmp: Suicidal exception handling.
  4849. (line 23)
  4850. * shell <1>: Output From Interactive Applications.
  4851. (line 9)
  4852. * shell <2>: i/o Errors. (line 27)
  4853. * shell: Command Line Syntax. (line 13)
  4854. * shell script <1>: Environment. (line 17)
  4855. * shell script: Example Script. (line 6)
  4856. * silly: A Simple Lisp Like Language.
  4857. (line 6)
  4858. * silly-me: Error Messages. (line 13)
  4859. * single precision: lapack. (line 17)
  4860. * singular value decomposition: lapack calling conventions.
  4861. (line 51)
  4862. * slow convergence: gslint exceptions. (line 15)
  4863. * sort: Sort. (line 6)
  4864. * sparse matrices: umf. (line 6)
  4865. * sparse matrix <1>: Additional glpk notes.
  4866. (line 6)
  4867. * sparse matrix: glpk input parameters.
  4868. (line 18)
  4869. * spawning processes <1>: Library Reference. (line 39)
  4870. * spawning processes <2>: Character Oriented Interaction.
  4871. (line 13)
  4872. * spawning processes <3>: Line Oriented Interaction.
  4873. (line 26)
  4874. * spawning processes: i/o Errors. (line 27)
  4875. * standard character encoding: Characters and Strings.
  4876. (line 23)
  4877. * standard input <1>: File Names. (line 63)
  4878. * standard input <2>: Output From Non-interactive Applications.
  4879. (line 16)
  4880. * standard input <3>: Line Maps. (line 13)
  4881. * standard input <4>: Standard Input Representation.
  4882. (line 6)
  4883. * standard input <5>: Loading All of Standard Input at Once.
  4884. (line 6)
  4885. * standard input <6>: Filter Mode Interface.
  4886. (line 11)
  4887. * standard input <7>: Security. (line 20)
  4888. * standard input <8>: Parameter Mode Options.
  4889. (line 37)
  4890. * standard input <9>: Filter Mode. (line 27)
  4891. * standard input: User Manual. (line 17)
  4892. * standard library: Refer. (line 44)
  4893. * standard output <1>: Formatted Output. (line 165)
  4894. * standard output <2>: File Names. (line 63)
  4895. * standard output <3>: Simple Operations. (line 204)
  4896. * standard output <4>: Output From Non-interactive Applications.
  4897. (line 16)
  4898. * standard output <5>: Line Maps. (line 14)
  4899. * standard output: Standard Output Representation.
  4900. (line 6)
  4901. * standard prelude: Standard Library. (line 7)
  4902. * state dependence: Implementing new library functions.
  4903. (line 139)
  4904. * state transition function: Transfer. (line 12)
  4905. * statistical distributions: rmath statistical functions.
  4906. (line 13)
  4907. * step command line option <1>: Output From Interactive Applications.
  4908. (line 6)
  4909. * step command line option <2>: Output From Non-interactive Applications.
  4910. (line 6)
  4911. * step command line option: Parameter Mode Options.
  4912. (line 67)
  4913. * storage locations: Assignment. (line 37)
  4914. * strerror <1>: Profiling. (line 96)
  4915. * strerror <2>: Error Reporting. (line 48)
  4916. * strerror <3>: Formatted Output. (line 74)
  4917. * strerror <4>: Raw Files. (line 72)
  4918. * strerror: i/o Errors. (line 7)
  4919. * strings <1>: Error Messages. (line 13)
  4920. * strings: Representation of Numeric and Textual Data.
  4921. (line 19)
  4922. * strtod: math library conversion functions.
  4923. (line 6)
  4924. * symmetric matrices: lapack calling conventions.
  4925. (line 17)
  4926. * symmetric matrix: Two dimensional arrays.
  4927. (line 54)
  4928. * syntax: Syntax. (line 8)
  4929. * system time: Input Data Structure.
  4930. (line 21)
  4931. * tail field: Lists. (line 7)
  4932. * text files <1>: Input Data Structure.
  4933. (line 47)
  4934. * text files <2>: Standard Input Representation.
  4935. (line 47)
  4936. * text files: File Format. (line 17)
  4937. * threads <1>: Instruction Stacks. (line 77)
  4938. * threads: Library Reference. (line 33)
  4939. * time stamp: Input Data Structure.
  4940. (line 21)
  4941. * tolerance <1>: minpack calling conventions.
  4942. (line 22)
  4943. * tolerance <2>: kinsol output. (line 18)
  4944. * tolerance: gslint input parameters.
  4945. (line 11)
  4946. * trace command line option: Parameter Mode Options.
  4947. (line 79)
  4948. * transfer: Transfer. (line 6)
  4949. * transition <1>: Transition. (line 11)
  4950. * transition: Transfer. (line 24)
  4951. * transpose <1>: List Transformations.
  4952. (line 52)
  4953. * transpose <2>: Error Messages. (line 77)
  4954. * transpose: Transpose. (line 12)
  4955. * trees <1>: Indirection. (line 70)
  4956. * trees <2>: Vacant Address Space.
  4957. (line 72)
  4958. * trees <3>: A Hierarchy of Sets. (line 27)
  4959. * trees <4>: Representation of Numeric and Textual Data.
  4960. (line 9)
  4961. * trees <5>: Bit String Encoding. (line 6)
  4962. * trees: Raw Material. (line 109)
  4963. * triangular matrices: lapack calling conventions.
  4964. (line 19)
  4965. * triangular matrix: Two dimensional arrays.
  4966. (line 34)
  4967. * trigonometric functions: math library operators.
  4968. (line 6)
  4969. * Turing equivalence: A Minimal Set of Properties.
  4970. (line 58)
  4971. * type tags: Note. (line 26)
  4972. * types: Representation of Numeric and Textual Data.
  4973. (line 60)
  4974. * ulimit: Overflow Errors. (line 28)
  4975. * umf error: umf exceptions. (line 17)
  4976. * undefined expressions <1>: Operator Generalization.
  4977. (line 50)
  4978. * undefined expressions: On Equality. (line 32)
  4979. * universal function: The Universal Function.
  4980. (line 6)
  4981. * universal quantification <1>: Operator Generalization.
  4982. (line 42)
  4983. * universal quantification <2>: A Hierarchy of Sets. (line 29)
  4984. * universal quantification: On Equality. (line 32)
  4985. * universality <1>: Vacant Address Space.
  4986. (line 45)
  4987. * universality: A Minimal Set of Properties.
  4988. (line 58)
  4989. * Unix <1>: Character Oriented Interaction.
  4990. (line 32)
  4991. * Unix <2>: Input Data Structure.
  4992. (line 21)
  4993. * Unix <3>: Byte Transducers. (line 42)
  4994. * Unix <4>: Example Script. (line 13)
  4995. * Unix <5>: Command Line Syntax. (line 78)
  4996. * Unix: Preface. (line 11)
  4997. * unknown date: File Names. (line 52)
  4998. * unparameterized command line option <1>: Standard Input Representation.
  4999. (line 8)
  5000. * unparameterized command line option: Filter Mode Options. (line 50)
  5001. * unrecognized combinator <1>: Vacant Address Space.
  5002. (line 26)
  5003. * unrecognized combinator: Application Programming Errors.
  5004. (line 29)
  5005. * unrecognized function name: External Libraries. (line 32)
  5006. * unrecognized library: External Libraries. (line 32)
  5007. * unrecognized option: Configuration Related Errors.
  5008. (line 47)
  5009. * unsupported hook <1>: Vacant Address Space.
  5010. (line 26)
  5011. * unsupported hook <2>: Configuration Related Errors.
  5012. (line 15)
  5013. * unsupported hook: Application Programming Errors.
  5014. (line 33)
  5015. * url: General Options. (line 22)
  5016. * value field: Type Conversions. (line 29)
  5017. * variables: Variable Freedom. (line 38)
  5018. * vectors: One dimensional arrays.
  5019. (line 8)
  5020. * verbosity setting: Inept excess verbiage.
  5021. (line 12)
  5022. * version: Version. (line 8)
  5023. * versions <1>: Version Management. (line 6)
  5024. * versions: Configuration Related Errors.
  5025. (line 35)
  5026. * web page: General Options. (line 22)
  5027. * weight: Weight. (line 7)
  5028. * wild cards: Have combinator. (line 62)
  5029. * wish: Example Script. (line 28)
  5030. * writing file name: Formatted Output. (line 150)