ebook img

Drawing Programs. Schematic Functional Programming PDF

397 Pages·2010·8.553 MB·english
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Drawing Programs. Schematic Functional Programming

· Tom Addis Jan Addis Drawing Programs: The Theory and Practice of Schematic Functional Programming 1 3 TomAddis JanAddis UniversityofPortsmouth ClaritySupport SchoolofComputing SouthseaPO49QU PortsmouthP013HE UnitedKingdom UnitedKingdom ISBN978-1-84882-617-5 e-ISBN978-1-84882-618-2 DOI10.1007/978-1-84882-618-2 SpringerLondonDordrechtHeidelbergNewYork BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary LibraryofCongressControlNumber:2009927007 ©Springer-VerlagLondonLimited2010 Preface Drawing programs is a personal response to some very practical problems. To explain this I need to go back in time to when my greatest toy was the Mechano set;amechanicalconstructionkitwithinstructionsonhowtobuildyourowntoys.I soonfoundthatalthoughthekitwasboundlessinonesenseitwasalsoverylimited. I spent many hours trying to do things that were well beyond the intention of the kitdesigner.MuchlaterIfoundelectronicswherecircuitsprovidedmewithamuch widerscopeformodelbuildingbutitstilltookalongtimetomakedevices.Itwas notuntilprogrammingwasintroducedduringmytimeatUniversitythatthisreally flexibletoolwasmadeavailable.Nomorebleedingfingersfromtheironworkand no more burnt ties from soldering irons. Modelling was going to be easy and fun. However,therewassnag.Ihadanaturalinabilitytospelloreventoconstructcoher- ent written sentences. It is true that I had evolved many strategies to successfully overcomethisproblembutthestrategiesonlyworkedwithinalimitedframework. Theproblemwithprogramsisthattheyarewrittenandinvolvetheaccurateuseof characters.Mostofmytimewasspentinpursuingtyposandverylittletimeonthe programming.Sometimesitwasnecessarytoasksomeonetolookformeandusu- ally they could identify the problem within seconds; natural ability is a wonderful thing. FunctionalprogrammingintheformofLISPcamealongandthepowerofthis language for expressing formal systems in an elegant way was very exciting. It wasonemoveawayfromhavingtoworryabouttheactualphysicalcomputerwith all its storage management problems and one step closer to a language designed specifically for modelling. It was like stepping into an automatic car after years of struggling with manual gears. Even though practical computer languages had moved a long way from machine code it was still only a change from the crash gearboxtosynchromesh.Thecomputerstructurewasstillinthebackgroundinthat everythingwasforcedintotheframeworkofdataandprocessesthusreflectingthe fundamentaldualdistinctionwithinthemachineitself.Theproblemwithfunctional programmingwasthatitwasconstrainedbyitsownformalframeworkandstopped short of being able to extend itself. LISP overcame this problem, to some extent, by slipping back into the computer framework by introducing special ‘program’ typefunctions.Italsoovercame another limitationbyallowing thelanguage tobe extended beyond the original formal functional description. In some cases it was stillveryclumsyandfrommypointofviewstillrequiredbeingwritten. As an engineer, electronic circuits had been no problem to read, to find errors ortoremember.Ifonlyprogrammingcouldbemadethateasy.Itwasthisdriveto createatoolthatwouldsidestepissuesofspellingandyetstillprovideaprofessional toolfordevelopingmodelsandotherkindsofprograms.ThisledustocreateClarity, or rather, led Jan to develop the Clarity environment for me. Also, while we were at it, we could also eliminate some of the restrictions found in current text-based languages. Clarity has been introduced quite slowly in this book simply because it seems tobeslightlyatoddswiththenormalwindowsapproach.Thisisnottoosurprising since it was developed well before windows had become generally available and itwasalsodrivenbydifferentrequirements.Thetheoryrelatedtodesigningmod- elshasbeenincludedrightfromthebeginningbutforpracticalpurposesitcanbe skipped. The justification for Clarity given in Chapter 1 is in response to criticism of thediagrammaticapproachtoprogramming.Theseotherdiagrammaticapproaches have usually been stimulated by a desire to make programming available to non- programmers. This is not the purpose behind Clarity. Clarity has been driven by a need to provide a sophisticated tool for programmers that would rather work with diagramsthanwithtext.Projectsaregivenattheendofeachchapter.Thesefollow thestyleoftheMechanoinstructionbookinthateverystepisdescribed.Thepur- poseofdoingitthiswayistoshowhowdrawingprogramsshouldbedoneandto giveanillustrationofgoodtechniques. Clarity has been developed over the last 23 years for a wide range of different projects.ItevolvedoutofanIKBSproject(CARDS)in1986–1990withtheGen- eralElectricCompany,theUniversityofReadingandtheImperialCancerResearch FundtobuildaspecialhardwaredevicethatwouldallowthoseinvolvedwithDNA research to create models of DNA behaviour. For this a modelling language was needed. Originally the researchers had used Prolog. The next SERC/ESRC/MRC projectin1991–1996waswiththeUniversitiesofBath,withProfessorDavidGood- ing,andtheUniversityofReadingwithus,toconstructamodelofscientificdiscov- eryfromthehistoryofscience.Thisworkisstillgoingon.Anotherprojectstarted in1996andfundedbyShipAnalytics(nowMPRI,partoftheL3consortium)was anexpertsystemusedasateacherreplacementforMarinerstrainingonashipsim- ulation for gas and oil management. Work on the automatic assessment of these studentsisalsoalmostcomplete.Otherworkinvolvingmodellingofthenegotiation process(BillingeandAddis2008)attheUniversityofPortsmouthhascomeupwith somesurprisingresultsrequiringustoreconsiderthemotivationbehindreasonsfor conversation. WehavealsotakenonsomereallygoodpostgraduatestudentsfromtheTechni- calUniversityofDelft,TheNetherlands.ThesehavebeenprovidedbyDr,DrsLeon Rothkrantzalmosteveryyearbetween1996and2006toworkonvariousprojects. Many of these projects have helped to start new research directions such as those describedinChapter10.Inparticular,DrBart-FlorisVisscherwasoneofthevisit- ing students who led a team thatused Claritytoconstruct aplanning systemfor a multi-leggedrobot(PortechLtd).Hewasanoutstandingstudent.Hecamebackto PortsmouthtodoresearchwithmeandhisThesis(2005)‘ExploringComplexityin SoftwareSystems:Fromanirrationalmodelofsoftwareevolutiontoatheoryofpsy- chologicalcomplexityandcognitivelimitationsbasedonempiricalevidence’went wellbeyondmyownworkstartedin1977.Itwasthrillingstuff.Healsodesigned theembellishedClarityicononthefrontcover. There have been many others that have helped us develop the Clarity Environ- ment. Simon Gray (Sharp Edge Systems Ltd) was invaluable at the system level while we working with Apple Macintosh computers and he was always a source of new ideas. Dr. Carol Small introduced us to the functional database language (Poulovassilis 1988) during the CARDS project and wrote the core interpreter for theSunUNIXsystembasedonFieldandHarrisonswork(1988).JohnChewter,an undergraduate student at the University of Portsmouth, showed considerable pro- grammingaptitudebyconstructingtheFaithtoClarityinterpreterforhisfinalyear project in 1995. It has been surprisingly useful. Ray Gillett (Director, MPRI, UK) hasprovideduswithasetofexcellentpracticalindustrialprojectssince1998.These projects have not only tested the system to its limits but many of the techniques developedforthebeliefsystem(modelofscience)havefoundanaturalhome.We thankhimforhispatienceinallowingustodevelopthesysteminourownway. TheClarityschemahasallowedustoworkcloselywithmanytechnicallycom- petent people. This close working with a fast implementation leads directly to the models needed. Any system that is useful requires to be continually mod- ified to keep pace with technology and changing perspectives. For this reason we are giving away Clarity in all its forms with example databases and source code. At the time of publishing these will be found at the publisher’s web site http://www.springer.com/978-1-84882-617-5, the University of Portsmouth web site http://userweb.port.ac.uk/_addist/978-1-84882-617-5.zip andaspecialClarity communitywebsite http://www.clarity-support.com Southsea,March2009 TomAddis References 1. BillingeD.andAddisT.,(2008)‘SeekingAllies:ModellinghowListnersChoosetheirMusical Friends’, Special issue of Foundations of Science, Vol 13, No1, March, pp 53–66, ISSN 1233–1821. 2. FieldA.J.andHarrisonP.G.,(1998)‘FunctionalProgramming’pubAddis-WesleyLtd,ISBN 0-201-19249-7. 3. PoulovassilisA.,(1988),‘FDL.AnIntegrationofthefunctionaldatabaseModelandtheFunc- tionalComputerModel’,BNCOD6,CUP,Cambridge,pp215–236. Contents 1 WhySchematicFunctionalProgramming? . . . . . . . . . . . . . 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 TheCollapseofVisualLanguages[→Page12] . . . . . . . . . . . . 3 EngineeringDrawings[→Page12]. . . . . . . . . . . . . . . . . . . 4 EngineeringDrawingsUsedforProgramming[→Page12] . . . . . 6 DifferentTypesofClarity . . . . . . . . . . . . . . . . . . . . . . . . 11 ABriefHistory[→Page12] . . . . . . . . . . . . . . . . . . . . . 11 ∗GettingGoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 ALittleBitAboutFunctions[→Page17] . . . . . . . . . . . . . . . 15 ∗“HelloWorld” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Exercise1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 AnExampleSchematic . . . . . . . . . . . . . . . . . . . . . . . . . 18 AFirstAttemptataSchematic . . . . . . . . . . . . . . . . . . . . . 19 Exercise1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 ChangingaFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 SavingaProgram/Database . . . . . . . . . . . . . . . . . . . . . . . 26 LoadingaProgram/Database . . . . . . . . . . . . . . . . . . . . . . 27 Project:CreatingaSimpleClarityProgramDICE . . . . . . . . . . . 28 Dice:GeneratingaRandomNumber . . . . . . . . . . . . . . . . . 28 Exercises1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Questions1.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 2 MakingChanges . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 ProblemsofSoftwareDesign[→Page42] . . . . . . . . . . . . . . . 35 ATypicalExample . . . . . . . . . . . . . . . . . . . . . . . . . . 36 TheEngineeringDimensionsofDesign . . . . . . . . . . . . . . . 36 SomeDefinitionsforPracticalResults . . . . . . . . . . . . . . . . 38 ChoiceandRandomSelection . . . . . . . . . . . . . . . . . . . . 40 ∗OverYourShoulder . . . . . . . . . . . . . . . . . . . . . . . . . . 42 ListManipulation[→Page44] . . . . . . . . . . . . . . . . . . . . . 43 ∗Improving‘Awake’ . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 ALittleBitMoreAboutFunctions[→Page51] . . . . . . . . . . . . 48 Built-InLibraryandFunctionTypes[→Page51] . . . . . . . . . . . 49 Exercise2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Questions2.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 ∗GreatFunctionsHaveLittleFunctions . . . . . . . . . . . . . . . . . 51 MoreSchemaEditingFeatures . . . . . . . . . . . . . . . . . . . . . 54 Exercise2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Memory,WindowsandYou . . . . . . . . . . . . . . . . . . . . . . . 58 Exercise2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Questions2.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Project:ASimpleInteractiveProgram . . . . . . . . . . . . . . . . . 62 Guess:FindingYourNumberwithLeastQuestions . . . . . . . . . 62 Exercise2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Questions2.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 3 InPursuitofElegance . . . . . . . . . . . . . . . . . . . . . . . . . 73 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 InferringInternalExperience[→Page81] . . . . . . . . . . . . . . . 74 APhilosophicalViewofComputing[→Page81] . . . . . . . . . . . 75 DualSemantics[→Page81] . . . . . . . . . . . . . . . . . . . . . . 78 MoreonFunctions[→Page81] . . . . . . . . . . . . . . . . . . . . 80 ∗CreatingComponents . . . . . . . . . . . . . . . . . . . . . . . . . 81 Constructors:ThePackagingofData . . . . . . . . . . . . . . . . . . 86 LookingThroughtheFunctionWindow. . . . . . . . . . . . . . . . . 89 Exercises3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Questions3.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 TheNotionofCasting . . . . . . . . . . . . . . . . . . . . . . . . . . 95 AStructureProcessDiagram (SPD) . . . . . . . . . . . . . . . . . . 95 Exercise3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Questions3.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Project:PlayingaSimpleGame . . . . . . . . . . . . . . . . . . . . . 102 Paper:OutGuesstheComputer. . . . . . . . . . . . . . . . . . . . 102 Exercise3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Questions3.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 4 MindMapsTMandMechanisms . . . . . . . . . . . . . . . . . . . . 111 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Junctions,ColourandOrganisation . . . . . . . . . . . . . . . . . . . 112 Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 ListProcessingandConstructors . . . . . . . . . . . . . . . . . . . . 118 DealingwithInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 FunctionsasGlobalVariables . . . . . . . . . . . . . . . . . . . . . . 123 Excercises4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Questions4.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 DetailsofPattern-Matching[→Page140] . . . . . . . . . . . . . . . 125 DealingwithConditionals(Ifs)[→Page140]. . . . . . . . . . . . . . 126 TheEngineeringCoherencesofDesign[→Page140] . . . . . . . . . 127 Functionalvs.ImperativeProgramming[→Page140] . . . . . . . . . 128 CreatingaSchematicLanguage[→Page140] . . . . . . . . . . . . . 129 TheProblemsofaFunctionalLanguage . . . . . . . . . . . . . . . 129 SolvingtheProblems . . . . . . . . . . . . . . . . . . . . . . . . . 130 DoingWithout‘Ifs’[→Page140] . . . . . . . . . . . . . . . . . . 132 Exploring‘Real’Programs[→Page140] . . . . . . . . . . . . . . . . 135 TheApproach,ResultsandInterpretation . . . . . . . . . . . . . . 135 DiscussiononResults . . . . . . . . . . . . . . . . . . . . . . . . . . 138 ConsequencesoftheExperiments . . . . . . . . . . . . . . . . . . . . 138 *PROJECT:AMinimalistProgram . . . . . . . . . . . . . . . . . . . 140 Digits:DoingWithouttheBuilt-InLibrary . . . . . . . . . . . . . 140 Exercises4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Questions4.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 5 FunctionalThinking . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 LoopsandRecursion. . . . . . . . . . . . . . . . . . . . . . . . . . . 150 TailRecursionandAuxiliaryFunctions . . . . . . . . . . . . . . . . . 154 Exercise5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Questions5.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 FunctionsasMappings[→Page160]. . . . . . . . . . . . . . . . . . 157 ∗ProgrammingbyNumbers . . . . . . . . . . . . . . . . . . . . . . . 160 Exercises5.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Questions5.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 Project:UsingPatternMatching . . . . . . . . . . . . . . . . . . . . . 166 Snake1:SnakesandLadders . . . . . . . . . . . . . . . . . . . . . 166 Snake2:SnakesandLadders . . . . . . . . . . . . . . . . . . . . . 177 Exercise5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 6 ThinkingPractically . . . . . . . . . . . . . . . . . . . . . . . . . . 185 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 ConditionalControl . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 Higher-OrderFunctions . . . . . . . . . . . . . . . . . . . . . . . . . 191 Non-recursiveApproachtoLoops . . . . . . . . . . . . . . . . . . . . 194 CreatingTwoUsefulFunctions . . . . . . . . . . . . . . . . . . . . . 196 Non-recursiveApproachtoIteration . . . . . . . . . . . . . . . . . . 199 ‘Lambda’:ControllingtheParameterAssignment . . . . . . . . . . 200 EditingoutSub-functionstoaNewFunctionWindow . . . . . . . . 202 TheAnnotationWindow . . . . . . . . . . . . . . . . . . . . . . . . . 202 Exercises6.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 Questions6.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 Project:ASimpleLearningStrategy . . . . . . . . . . . . . . . . . . 205 Oxo:TheGamePlayerThatLearns . . . . . . . . . . . . . . . . . 205 7 SideEffectProgrammingandSchematicDesign . . . . . . . . . . 223 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 FunctionsasData . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 FunctionsasRelations . . . . . . . . . . . . . . . . . . . . . . . . 226 StagesofSystemDesign. . . . . . . . . . . . . . . . . . . . . . . . . 227 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 EvaluationControl . . . . . . . . . . . . . . . . . . . . . . . . . . 233 BenignandMalignantSideEffects . . . . . . . . . . . . . . . . . 234 SchematicDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 AnEmergentDesignTechnique . . . . . . . . . . . . . . . . . . . 235 ArtificialIntelligence . . . . . . . . . . . . . . . . . . . . . . . . . 236 TheGeneralProblemSolver . . . . . . . . . . . . . . . . . . . . . 237 GraphSearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 The‘And/Or’Graph . . . . . . . . . . . . . . . . . . . . . . . . . . 239 EmergentAnalysisStage . . . . . . . . . . . . . . . . . . . . . . . 240 ConstructionStage . . . . . . . . . . . . . . . . . . . . . . . . . . 246 InSummary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Exercises7.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Questions7.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Project:LearningfromDefeat . . . . . . . . . . . . . . . . . . . . . . 254 Oxo2:TheGamePlayerThatLearns:AContinuation . . . . . . . . 254 Oxo3:TheGamePlayerThatLearns:AnotherImprovement . . . . 259 Oxo4:TheGamePlayerThatDoesEvenBetter . . . . . . . . . . . 262 Oxo5:HinderingtheOpponent . . . . . . . . . . . . . . . . . . . . 264 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 8 AdultThings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 GraphicsOperations . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 gr_operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 btn_operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 NarrativeWindow(nar_) . . . . . . . . . . . . . . . . . . . . . . . . 271 AutomaticJunctionInsertionforDependencyNetworks . . . . . . . . 272 ConvertingFaithCode toClarityDiagrams . . . . . . . . . . . . . . 274 FileOperations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 ListsandTables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 TreesandNetworks . . . . . . . . . . . . . . . . . . . . . . . . . . 279 CastingandCodeGeneration . . . . . . . . . . . . . . . . . . . . . . 281 BayesianDecisionFunctions . . . . . . . . . . . . . . . . . . . . . . 282 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 TheBayesianTheoryofClassification[→Page285] . . . . . . . . 283 *TheBayesianFunctionsinOperation . . . . . . . . . . . . . . . . 285 MatrixOperationsandLinearSimultaneousEquations . . . . . . . . . 287 SetOperations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 Project:UsingFaithwithClarity . . . . . . . . . . . . . . . . . . . . 289 Loans:ALoansCalculationProgram . . . . . . . . . . . . . . . . 289 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 9 Higher-OrderProgrammingandLowerLevelActivity . . . . . . . 301 SpecialFunctionClasses. . . . . . . . . . . . . . . . . . . . . . . . . 301 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 FunctionandConstructorHandling . . . . . . . . . . . . . . . . . . 302 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 Client/ServerFacilities. . . . . . . . . . . . . . . . . . . . . . . . . . 309 OverviewofNetworkandMachineOrganisation . . . . . . . . . . 309 ManualNetworking . . . . . . . . . . . . . . . . . . . . . . . . . . 310 NetworkingThroughUserFunctions . . . . . . . . . . . . . . . . . 313 AddingUsers’OwnCode:ExtendingtheLibrary . . . . . . . . . . . 315 ASimpleApproach . . . . . . . . . . . . . . . . . . . . . . . . . . 315 WritingApplicationExtensions:(DLLs) . . . . . . . . . . . . . . . 316 CreatinganInterfacetoClarity . . . . . . . . . . . . . . . . . . . . 319 SomeAdditionalFeatures . . . . . . . . . . . . . . . . . . . . . . . . 322 ImportingandExportingDatabases. . . . . . . . . . . . . . . . . . 322 StackingWindows . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Re-numberingandNamingFunctionComponents . . . . . . . . . 323 TheClaritySourceCode. . . . . . . . . . . . . . . . . . . . . . . . . 324 TheCFilesandHeaderFiles . . . . . . . . . . . . . . . . . . . . . 326 Project:ProblemSolving . . . . . . . . . . . . . . . . . . . . . . . . 327 Sudoku:SearchingforAnswers . . . . . . . . . . . . . . . . . . . 327 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 10 ProgrammingwithUncertainty:Theories,ModelsandPrograms . 343 ModelsandPrograms[→Page349]. . . . . . . . . . . . . . . . . . . 343 TheRoleofaModel . . . . . . . . . . . . . . . . . . . . . . . . . 345 ∗SolvingSudoku . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 AnIntroductiontoGameTheory[→Page364] . . . . . . . . . . . . 351 TheProblemofthe‘Best’Choice . . . . . . . . . . . . . . . . . . 351 TheOldShellGame. . . . . . . . . . . . . . . . . . . . . . . . . . 352 PrinciplesofMaximising . . . . . . . . . . . . . . . . . . . . . . . 353 ProbabilisticStrategies . . . . . . . . . . . . . . . . . . . . . . . . 353 ChoosingActions(orCalculatingaHeuristic) . . . . . . . . . . . . . 355 MaximumSecurityLevel(MSL) . . . . . . . . . . . . . . . . . . . 355 GeneralisedMSLforActions . . . . . . . . . . . . . . . . . . . . . 356 MultipleSimultaneousEquationsMatrix . . . . . . . . . . . . . . . 356 ImplementingMSL . . . . . . . . . . . . . . . . . . . . . . . . . . 357

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.