WARNING: This text has been OCRd from the original paper and so will contain many typographical errors. It should be useful for searching, however. [Ash, August 2002]. Abstract ..... ,Y Modelling a Canal System using Definitive Principles Meurig Beynon Mike Joy Department of Computer Science University of Warwick Coventr\ CV4 7AL email: {wmb,ms i }@dcs.warwick.ac.uk This paper investigates the applicati~m of new pn)gramming principles to the development of a computer-based Geographical Intonnalion System (GIS). Our aim is to develop aJId demonstrate a method of modelling a geographic region tim! involves creating environments in which a user can emulam different modes of real-world observation and interaction. Introduction The development of effective GISs is a major challenge in knowledge representation. There is little doubt that new approaches to data representation and processing will be required. Relevant issues have been addressed in part by a model-based approach tO programming ("definitive~ programming") that represents system state by sets of deft nitions~. This paper assesses the prospects for applying these techniques to GIS design. The computer model to be constructed using our approach is not as restricted as a conventional computer program - the user can interact with it in many different ways, including many that are not preconceived in the model-building process. Such a model can be adapted to serve specific functions that would normally require several different special-purpose programs. It can also deal with empirical information that is encountered whilst the model is in use, rather than known in advance. In these respects, it is quite different in character from a conventional map, in which all the information is preprocessed and statically presented, and it is up to the user to interpret the data to suit a particular purpose. The paper has two main sections: the first reviews fundamental problems in GIS design and development in relation to definitive programming. The second explains and illustrates how we propose to apply our methods in developing a GIS for the canal system in the West Midlands. tthroughout this paper, the term definition is used in a technic,'d sense, ,and definitive to mean definition-bLsed. 1 Programming Principles for GIS Development 1.1 Fundamental Issues for Geographical Information Systems The design and development of GISs raises s~me fundamental issues: • we don't km~w ~hat l,ohlem a GIS may he u.sed to .~olve Gec~graphical data carl be pr~cessed in many ways. A map-user may be planning a scenic route, identifying the hwati~m ~f an aerial photo,graph. ~r investigating getflogical hist~wv. The data required f~n- these applicatitms is diverse and cann~t easily be prec~mcei,,ed. • complex ~ral~hical ima,,,es are &i~cult to modit3. A GIS differs fr~ml a c~mventi~mal database in that the external presentation is generally graphical and ic~mic. ]'he size ,~f get,graphical data bases demands em~rmous c~m~putation when change is required. Referencine c{unponents of an image that is t~ be m~dilied is typically difficult. It is hard t~ Ir~aintain the integrity of ima,,es in chan,,e ~-, , ~ - • ~,ral;hical presentation I~resumes ~'om'entionsfi)r interlwetatirm Interpreting a conventional map is a c~mplex process. The map reader has t~ associate graphical symbols with geographical features in a manner that must frst to be learnt, and typically has to be reinforced by experience. Consider e.g. recognising symbols that are drawn out of scale, distinguishing rivers from roads, or interpreting contours. The difficulties of interpretation put further constraints on modifiability. • a GIS models analogue data. exact geometric locations arc, significant It is hard to capture the concept of "X marks the spot" in a discrete computer-b',sed model. Every geographical location is a point of reference with which values and attributes may be .a change the state. The effects nf an actium must be c~msistent with experimental knmvledge. The next section explains the relevance ~f definitive pr~gramming principles t~ the basic GIS issues introduced above, anti our reas~ms f~r ~ptilnism about their successful application in the hmger term. Definitive Programming and GIS issues we don't know what problem a GIS may be used to solve Many approaches to computer system development focus on theflmction the system has to serve. This favours the design of an encapsulated system, where the user-interface is preconceived for a particular mode of use. The user cannot adapt such systems to serve new functions. Definitive programming uses a development method based on modelling the appli-cation-domain - an approach that creates software systems more readily adapted to new roles. Unlike other model-oriented methods, such as JSD [14] or object-oriented design [ 12], it focuses on identifying and faithfully representing the agents and observations in the application-domain. This focus leads to a much greater degree of flexibility; a particular choice of mode and nature of observation is consistent with models serving many different functions. • complex graphical images are difficult to modify Definitive programming principles were first applied to interactive graphics by Wyvill [15]. They are well-suited to CAD [3], scientific visualisation [5] and animation [6]. They rely upon constructing an internal representation of a graphical image in which all the significant features can be independently referenced whether or not they are easy to distinguish visually. This representation records dependencies between the components of a graphical image in a way that allows an image to be selectively and consistently updated. graphical presentation presumes conventions for interpretation Our internal representation of a graphical display attaches variables to the pictur~ elements that correspond to observations. The dependencies between the values of~ these variables represent relationships between real-world observations in much the same way that the defining formulae of cells of a spreadsheet reflect an external interpretation. As explained in [5], this enables the user - through experiment - to relate an abstractly defined geometric symbol to its intended interpretation. 9 * a GIS models analogue data: exact geometric locations are significant Any representation of a geographical region is incomplete and approximate. This limitation cannot be overcome in a static document, such as a map. It can be addressed in principle in an interactive environment, provided that the user can adapt the representation as new infi~rmatic~n is obtained. Definitive principles are well-adapted tt~ deal with incc~mplete infornlation. They operate in such awav that there is m~ distinction between design anti use ~f the information model except in respect of interpretati~m 16,1. For instance, a user can introduce new attributes or features interactively. The problem of exact m~delline t)f analogue data has no solutit~n within the c~mtext t~f the fi~rmal representation system itself'5 There is nevertheless a role ft~r refininu a geometric representation where useful infiwmation can be derived by interpt~lat~n from existing data. The applicati~n ~f definitive principles t~ modelling anah,gue data in this manner has been demt,nstrated in [2]. • da[(l C]I(III~,eS I(IIINDI?I/V, (IS I'o(IdS ~II'U/~ld[f or .~,eo/ok~icd/el'~'ll/S 0('('ltt" In the conventional process ~f producing a map. there has been a clear separatism between surveying and map specificatitm. In principle, techm~logical advances can reduce or even eliminate the need for such separation. In the future, by linking sophisticated surveying devices, such as geosatellites, to a computer-based GIS we can hope to record many geographical changes as they occur. For this purpose, programming principles that establish an intimate connection between external observations of the world and a computer model are a prerequisite. Applying Definitive Programming Principles to a GIS: a Case Study This section describes an initial study, inw:~lving some problem analysis and prototyping, aimed at assessing issues of feasibility and identifying the technical challenges to be solved. / \ L.,.~# Wo!vor~ Stoutbr i~ ~ " B 1 tm ingham < I0 ka'n , Year ~s IR60 Figure 1.1 Figure 1.2 Our chosen case-study is the development of a GIS for the BCN ("Birmingham Canal Navigations") network [8, 13, 11]. This canal system was developed after the Industrial Revolution of the 18th century to provide a transport infrastructure for what was at that time one of the principal manufacturing regions in the UK. In its heyday, the network served ;'n area of about 500 square kilometres and consisted of nearly 300 kilomen'es of navigable waterway, of which 200 are still in use today. The BCN was built to handle narrowboats (dimensions no longer than 2. lm wide by 18m long), and could not compete with the railways for commercial traffic in the 19th century. Today, the canals are mainly used by pleasure craft, and the towpaths as useful green arteries for walkers and cyclists. Our GIS is to be designed to represent both omtemporary and hist~rical data. Figure 1.1 depicts the BCN network as it was in 1860. Figure 1.2 shows the contemporary state of the canal system in the Sandwell district" classed secti~ms t~f canal are indicated by dashed lines. As these figures illustrate, the canal system is sufficiently c~m~plicated fi~r the representatitm problem tc~ be ram-trivial. 2.1 Analysing the Application The first step towards designing our system is tt~ identify the agents with an interest in the canal system, and the observati~ms t~f the canal system they make. We distinguish three types ~] agent, each with a different mmive f~x knmving abc~ut the canal s\'stem • the canal e,tlmsiast, wht, studies the canal system abstractly. • the canal user, who travels about the system. • the canal authority ~ffficial. who polices the system. The roles of these agents inw~ke many kinds ~f ~bservati~m ~f the system. Recording these entails modelling a large and diverse wdume ~f data: • relevant map data, to include significant present-day and historical canal features, such as locks, tunnels, boatyards and junctions, as well as nearby landmarks, such as historic buildings, public houses, and centres of population, • information about the current status of the canal system, as is needed for route planning: e.g. restrictions due to maintenance or temporary closure of sections, approximate journey times, toll and licence requirements, • registration information concerning each canal boat, to include name, authorised owner, place of permanent mooring, dimensions, licences issued and current location. In applying definitive programming principles, we are led to consider how these observations are organised into states, and how these states are affected by actions on the part of agents in the system. In effect, we view the canal system and the agents that affect and interact with it as a concurrent system. In comparison with other contexts in which we have addressed concurrent systems modelling, the canal system is intrinsically relatively static. On different time-scales, canal boats move about the system, licences are issued, sections of canal are closed for maintenance, canals come and go. On the other hand, the nature of the real-world interaction and interfaces that the agents establish in performing their roles is exceptionally volatile. The dynamic aspects of the model relate primarily to the variety and subtlety of the views of the agents, who are forever re-organising the data for different patterns of use. The fundamental principle we wish to exploit in developing a GIS is that of creating~a computer model of the canal system with which we can interact in ways that faithfully reflect real-world observation and action. In using the GIS, the human agents in the canal system need to be able to reconstruct within the computer model faithful images of the states and privileges they observe in the real system, whilst the GIS manager ) J Figure 2.1 has to be able to emulate the effect of other transforming agents. To this end, we use definitive scripts to model real-world states. In these scripts, the values of variables represent current observations, and redefinitions of variables represent possible actions. Faithfulness to observation in such models derives from the fact that a change in the value t~f a variable automatically propagates changes t~ the values ~f all dependent variables (us in a spreadsheet). 2.2 Definitive Scripts and the Modelling Process Many kinds ~f state-changing uctivit\, have tL~ be modelled in t~ur GIS. In tiffs secti~m. ~e consider some ~f the ways in which "definitive scripts can in principle be applied. At the present stage ~f deveh~pi{~ent ~f our system, these can be illustrated bv n]odifvin,2 ~u a.u,.2,-menting the definititms currently in tt~e m~del interactivelv,, but this (temands interacti(~n with the m~del at a rather h~v-ievel ~f abstracti~,n. The pr~spects for m~we uppr~priate meth~ds ~f representine, deveh~pin,-, and manaeine scripts are discussed in secti~,n "~ beh~w. Example 1: lnfiwming the Canal Enthusiast The history of the canal system is well-dt~cumented 17]. The status of the canal system at any point in its 211() year history can be inferred from the dates when individual sections were in t~peration. This information is represented in our GIS so that the display is automatically updated ~m "redefining the current year" (cf Figures 1.2 anti 2.2). Example 2: Assisting the Canal User There are many ways in which a definitive script can be used to generate maps customised for a particular canal user or journey. Figure 2.1 depicts a map that might be generated for a journey from Horseleyfields to Old Turn Junction: The definitive script used to specify the map is given below. In the script, from and t:o are the points representing the endpoints of the journey. The map is centred on the midpoint, as given by the variable centre. The map is square, with skle twice the distance between the endpoints. The shortest path between the endpoints is represented as a sequence of canal segments: the width of these segments is redefined so as to highlight the optimal route. Figure 2.2 Had we been making the journey in 1800, we would have followed a different route, as depicted in Figure 2.2. To derive Figure 2.2 from Figure 2.1 it is only necessary to make a single redefinition: > year is 1800; \\ , .... ~, Figure 2.3 On reaching Bradeshall Junction we could generate a higher-resolution map of the remainder of the route, as in Figure 2.3. Again, Figure 2.3 can be derived by a single redefinition: > from is location("Bradeshall Junction"); Many sections of canal are subject to periodic restrictions, anti all are closed for maintenance at various times. Definitive scripts provide a mechanism by which we can take acccmnt ~f current infi~rmation ~m navieability in j-urney planning. Closures scheduled in advance can be recorded and registered tm the display by the same meth~d that is used m distm<-,ulsh active frc~m defunct canal branches in Figure 1.2. An unexpected temp~rary ch,sure can be rec.rded when it occurs. Example 3: An interface fiw a Canal Auth.rity agent The duty ~f a lenethsman is tt~ check that a N~at B in a eiven reei~m R is licensed'under the'Zlppr~priate autht~ritv. A suitable definiti~n can express the condition under which B is in breach ~f regulations: legal˘ B) = imregi~,n(R. B ) aml m ~t licellsed˘ B. auth~ ,rio˘ R J) A complementary definition can relate the b~at locaticm to the regi~m: in.a'egion( R. B) = is-in-sect(sect-no, h ~c( B ) ) and i.~-im R. .sect mo ) To display this information, the position .f an ic.n t~ represent the boat B can be defined as a function of the location of B. and an attribute of the icon. such as its colour, defined to reflect the value of legal(B): A lengthsman patrolling a stretch of canal might enter the location of a boat B by keying in its identification code and pointing at a map on the screen. The effect of such an action would be to define lot(B), and to display a suitably coloured ict,aa on the map. Note that the information displayed "'ould still be valid after movement of the boat, acquisition of a licence or a change of responsible authority. Example 2 illustrates an important distinction between information that can be inferred entirely from "knowing the time" and information that cannot possibly be preconceived when setting up the model. By applying definitive principles, both types of knowledge can be represented in a convenient and flexible manner. Definitive scripts have advantages in common with constraints and logical specification where maintaining consistency between data items is concerned. Unlike these specification techniques, a definitive script represents particular states of knowledge that can be readily modified to reflect new observations. For instance, the historical data about canal locations is potentially inaccurate, and subject to revision in the light of archaeological findings - where such inaccuracies are identified, they can be interactively resolved through redefinition. 2.3 Technical Challenges to be met The virtues of definitive programming are not adequately represented by the illustrative ˘ examples above. The most significant advantage of a definitive approach is that we ~+ can readily program interactions that were not preconceived when setting up the model. This is possible because the model implicit in the system is already rich enough to simplify the programming task. Whether the naive user of a GIS could be trained to apply definitive princip!es is a controversial issue, but it is arguably no more difficult to construct a definiti-'e script than to conceive the data relationship it captures. Our practical experience proves that even novice programmers can adapt existing scripts that perform a recognisably similar function, just as engineers exploit catalogues of mechanical linkages. More fundamental challenges for user-interface design are illustrated by contrasting Examples 1 and 2 above. Information about the temporary closure of canal sections is accessible and topical only in respect of recent past, present or future time. We represent this by introducing a notion of current time into the GIS, measured by days and weeks rather than years. Contemplating the canal system in the historical time perspective is conceptually distinct from a day-to-day view. Both views can be supp~rted by specifying an appropriate set of definitions, but there is an essential need for management as well as mere representamm of alternative views. Developing a suitable user-interface inw~lves representim, an enorm~us number ~f modes ~f t~bservati~m and privileges t~ intervene. Relevant issues include: t~bserving a sin-ele object at difterent levels of abstracti~m, dealing with references t~ ~,bservati~ms and rec~rdine histories of ~bservation. Different views are not necessarily c~inpatible with a sinele environment - a boat cannot travel on a canal that is under construction. It seems pr~;-bable that geometric representati~ms, perhaps resembling Harel's statecharts [91, will be necessary to convey the subtle ways in which who and where an agent is determines what it can see and do. The data intensive nature of the applicati~m p~ses ~ther pr~blems not previously encountered in applying definitive programinmg principles to reactive systems [2, 4]. In interfacing with an existing geographical database, we have to overcome the limitations of a conventional graphical database, where the organisation of data is haphazard anti the form and identity of objects is inadequately represented. Our experience so far shows the advantages of a definitive approach to incremental deveh~pment of a model, where data can be introduced as it is acquired, and geometric inconsistencies resolved as they are detected. The complexity of geographical images poses technical problems in efficiently updating the display. When a value is changed, our interpreter selectively updates dependent variables, but this may involve much more computation than is required to make the display consistent. For instance, redefining the year in the canal model potentially affects the display status of every section of the canal, but only tho~e sections currently being displayed need to be updated immediately. This points to a r, czd for mechanisms of lazy evaluation [ 1 O] where maintaining up-to-date values of visible data takes priority. Conclusions > Definitive programming has great potential as the basis for GIS development. There are difficult challenges to be addressed, but the long-term benefits will repay investment in developing concepts and tools. Successful application of definitive principles would transform the processes of data capture and incremental system design, simplify the process of integrating map data with animated sequences, both graphics and video, and enhance the potential for special-purpose programming and customisation of the interface to a particular task. The major technical issues to be addressed are: understanding and formally describing the levels of reference required, avoiding the syntactic convolutions that these generate in our present framework, and ultimately making the package accessible to the ordinary user. ?~ I11 121 131 141 IS1 161 17] I81 [11] References W.M. Beynon, Definitive Prim'il)lesJbr Interactive Graphics, NATO ASI Series F, Vol 40, Springer-Verlag 1988, pp. 10X3-1()97, 1988. W.M. Beymm, I. Bridge and Y.P. Yung, A~,ent-orientedmodelling.fbra Vehic'le Cruise Controller, in Prec. Eng. Sys. Design and Analysis. AS ME PD-47-4:159-165, 1992. W.M. Beynon anti A.J. Cartwright, ,4 Definitive Pro,wammin,,, Al)l)roac'h to the Implementation of CAD Software in Intelligent CAD Systems II: Implementation Issues, Springer-Verlag, pp. 456-46~. 19X9. W.M. Beynon, M.T. N~rris, R.A. Orr anti M.D. Slatle, Dqfinitive Sl)ecific'ari(mfor Concurrent Systems. in Pr~c. UKIT'~)(!, lEE C~mference Publicati~ms 316. pp. 52-57, 199(). W.M. Beymm, Y.P. Yung, A.J. C'artx~,right anti PJ. H~rgan, S