Hypergraph Representation of Diagrams in Diagram Editors

Similar documents
In the last lecture, we discussed how valid tokens may be specified by regular expressions.

Fig.25: the Role of LEX

Dr. D.M. Akbar Hussain

Specifying Graph-like Diagrams with DiaGen

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

CSCI 3130: Formal Languages and Automata Theory Lecture 12 The Chinese University of Hong Kong, Fall 2011

2 Computing all Intersections of a Set of Segments Line Segment Intersection

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming

this grammar generates the following language: Because this symbol will also be used in a later step, it receives the

COMP 423 lecture 11 Jan. 28, 2008

An Expressive Hybrid Model for the Composition of Cardinal Directions

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

A dual of the rectangle-segmentation problem for binary matrices

From Dependencies to Evaluation Strategies

Languages. L((a (b)(c))*) = { ε,a,bc,aa,abc,bca,... } εw = wε = w. εabba = abbaε = abba. (a (b)(c)) *

CS143 Handout 07 Summer 2011 June 24 th, 2011 Written Set 1: Lexical Analysis

What are suffix trees?

Definition of Regular Expression

Slides for Data Mining by I. H. Witten and E. Frank

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

Reducing a DFA to a Minimal DFA

Scanner Termination. Multi Character Lookahead. to its physical end. Most parsers require an end of file token. Lex and Jlex automatically create an

The Math Learning Center PO Box 12929, Salem, Oregon Math Learning Center

Before We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1):

Ma/CS 6b Class 1: Graph Recap

Lexical Analysis. Amitabha Sanyal. ( as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

Lexical Analysis: Constructing a Scanner from Regular Expressions

10.5 Graphing Quadratic Functions

Midterm 2 Sample solution

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have

Registering as a HPE Reseller. Quick Reference Guide for new Partners in Asia Pacific

Ma/CS 6b Class 1: Graph Recap

6.2 Volumes of Revolution: The Disk Method

1 Drawing 3D Objects in Adobe Illustrator

MTH 146 Conics Supplement

Registering as an HPE Reseller

Stained Glass Design. Teaching Goals:

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012

4452 Mathematical Modeling Lecture 4: Lagrange Multipliers

OUTPUT DELIVERY SYSTEM

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

CS 430 Spring Mike Lam, Professor. Parsing

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

Lists in Lisp and Scheme

Agilent Mass Hunter Software

George Boole. IT 3123 Hardware and Software Concepts. Switching Algebra. Boolean Functions. Boolean Functions. Truth Tables

12 <= rm <digit> 2 <= rm <no> 2 <= rm <no> <digit> <= rm <no> <= rm <number>

Approximation of Two-Dimensional Rectangle Packing

Compiler Construction D7011E

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

Presentation Martin Randers

LR Parsing, Part 2. Constructing Parse Tables. Need to Automatically Construct LR Parse Tables: Action and GOTO Table

UT1553B BCRT True Dual-port Memory Interface

The Greedy Method. The Greedy Method

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

ON THE DEHN COMPLEX OF VIRTUAL LINKS

ECE 468/573 Midterm 1 September 28, 2012

EECS150 - Digital Design Lecture 23 - High-level Design and Optimization 3, Parallelism and Pipelining

How to Design REST API? Written Date : March 23, 2015

Lexical analysis, scanners. Construction of a scanner

Small Business Networking

CS412/413. Introduction to Compilers Tim Teitelbaum. Lecture 4: Lexical Analyzers 28 Jan 08

Lily Yen and Mogens Hansen

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits

Simrad ES80. Software Release Note Introduction

Lab 1 - Counter. Create a project. Add files to the project. Compile design files. Run simulation. Debug results

Implementing Automata. CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona

Small Business Networking

Mathematics Background

Notes for Graph Theory

INTRODUCTION TO SIMPLICIAL COMPLEXES

CSCE 531, Spring 2017, Midterm Exam Answer Key

F. R. K. Chung y. University ofpennsylvania. Philadelphia, Pennsylvania R. L. Graham. AT&T Labs - Research. March 2,1997.

Typing with Weird Keyboards Notes

An Algorithm for Enumerating All Maximal Tree Patterns Without Duplication Using Succinct Data Structure

Qubit allocation for quantum circuit compilers

Small Business Networking

CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona

CS 241 Week 4 Tutorial Solutions

Pointwise convergence need not behave well with respect to standard properties such as continuity.

Algorithm Design (5) Text Search

Topic 2: Lexing and Flexing

Meaningful Change Detection in Structured Data.

Geometrical tile design for complex neighborhoods

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications.

McAfee Network Security Platform

Small Business Networking

Small Business Networking

box Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example:

Section 10.4 Hyperbolas

documents 1. Introduction

Small Business Networking

Small Business Networking

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFORMATICS 1 COMPUTATION & LOGIC INSTRUCTIONS TO CANDIDATES

II. THE ALGORITHM. A. Depth Map Processing

YOU ARE: AND THIS IS:

Integration of a Scenario Service in a Multimedia Messaging System

Functor (1A) Young Won Lim 10/5/17

Transcription:

Hypergrph Representtion of Digrms in Digrm Editors Mrk Mins Lehrstuhl für Progrmmiersprchen Universität Erlngen-Nürnerg Mrtensstr. 3, 91058 Erlngen, Germny emil: mins@informtik.uni-erlngen.de Astrct When working with digrms in visul environments like grphicl digrm editors, digrms hve to e represented y n internl model. Grphs nd hypergrphs re well-known concepts for such internl models. This pper shows how hypergrphs cn e uniformly used for wide rnge of different digrm types where hyperedges re used to represent digrm components s well s sptil reltions etween components. Using such n internl model requires method for trnslting digrms into their hypergrph model. Such grphicl scnning method is proposed in this pper. The scnner mkes use of specifiction of the digrm lnguge. Since the scnner lso considers how digrm components re emedded into their con, it is pplicle to wide rnge of digrm lnguges nd their hypergrph models. Introduction Digrms re powerful mens to represent complex situtions since they directly support visulizing multidimensionl reltions. The field of visul lnguges is only one exmple of where digrms re in use. Originlly, digrms hve served s visulistion concept only (e.g., connection digrms in electricl engineering) nd hve een produced on pper. Nowdys they re creted on computer using grphicl editor. Furthermore, they re used s grphicl wy to express dt for further processing nd for resoning out dt. When using digrms on computers, the visul representtion of digrms which yields etter perception nd resoning with dt is inpproprite for computers; digrms hve to e represented internlly y forml model which strcts from digrms redundnt visul informtion nd which mkes informtions out the digrm redily ville. Severl concepts hve een used s internl models. Among others, multisets of tokens (Mrriott 1994), ttriuted symols (Bottoni et l. 1995), nd different kind of grphs nd hypergrphs. Among the grphs, typicl exmples re grphs where nodes represent tokens nd edges represent reltions etween tokens (Rekers & Schürr 1996), specil grphs where nodes hve distinct connection points which re then used y edges for representing connections (Zhng & Zhng 1997), nd hypergrphs in our DiGen project where visul tokens (digrm components) re represented y hyperedges nd connections etween them y nodes (Mins & Viehstedt 1995; Mins 1997). (Hyper) Grphs hve the dvntge tht they re forml nd yet visul concept. Therefore, even the internl model is often ut not lwys quite esily perceived y humns. Furthermore, there re powerful mechnisms like grph trnsformtion theory nd the existence of (hyper) grph prsers for syntctic nlysis. The work descried in this pper is continued work on DiGen, frmework together with genertor for creting grphicl editors from forml specifictions. Ech generted editor is specilized for the digrm clss descried y the specifiction. However, this pper does not descrie ll of DiGen s mechnisms like prser nd lyout pproch, ut rther considers prticulr issue: the representtion of digrms y hypergrphs nd how such hypergrphs re creted nd mintined during n editing process. This pper presents new results s compred to erlier descriptions of DiGen (Mins 1997): On the one hnd, the hypergrph model is extended eyond previous versions such tht lrger numer of digrm types cn e modelled y hypergrphs. On the other hnd, this pper presents solution to the question of how to crete such hypergrph when digrm is edited. When using syntx-directed editing,prespecified digrm opertions modify the hypergrph model s the primry dt structure. The digrm is modified ccording to the specifiction how hyperedges re visulized s digrm components. Therefore, digrms ehve like views of their hypergrphs. However, when providing freehnd editing, digrms re modified directly, nd the hypergrph representtion hs to e djusted ccordingly. The ltter requires digrms to e scnned grphiclly in order to crete, delete, nd (re)connect hyperedges. A solution to this prolem is lso presented within this pper. The rest of the pper is orgnized s follows: The next section gives rief overview of DiGen tht forms the environment for this work. DiGen uses hypergrphs for internlly representing digrms. Then, three digrm clsses re expd which re used s demonstrtion exmples in the rest of the pper: Nssi-Shneidermn digrms, Messge Sequence Chrts, nd VEX expressions. The hypergrph model of DiGen with extensions in expressiility is represented in the next section. The remining sections propose

method for creting such hypergrph model for digrm which is edited in digrm editor offering free hnd editing s in DiGen nd riefly discuss relted work. DiGen DiGen s descried in (Mins & Viehstedt 1993; Viehstedt & Mins 1994; Mins & Viehstedt 1995; Mins 1997) consists of n editor frmework nd genertor. A forml specifiction of digrm clss serves s input for the genertor which cretes custom components tht uild together with the frmework grphicl editor customized for the specified digrm clss. Min fetures supported y this pproch re: Digrms re internlly represented y hypergrphs; digrm clss is thus hypergrph lnguge together with mpping from hypergrphs to their visul representtion s digrms. Either con-free or restricted kind of con-sensitive hypergrph grmmr (Mins 1997) is used to descrie the hypergrph lnguge. Nodes nd hyperedges crry ttriutes, nd ech grmmr productions is ugmented y lyout constrints on ttriutes ccessile in the production. A constrintsolver provides utomtic, user-djustle lyout for con-free digrm shres (Mins & Viehstedt 1993; Viehstedt & Mins 1994). The frmework lso provides mechnism to plug in externl lyout modules (e.g., progrmmed mnully) for dvnced lyout which cnnot e otined y constrint stisfction. Digrms cn e edited in syntx-directed wy using trnsformtions on derivtion trees for their con-free shre nd on hypergrphs descried in the specifiction. To hide those detils from the user, interctions of the user nd the editor re descried y certin interction utomt thus offering editing digrms y direct mnipultion. Free-hnd editing is lso supported. The user cn ritrrily dd, delete, move, or modify prts of the digrm s with drwing tool. The underlying hypergrph model is modified ccordingly, hypergrph prser distinguishes correct digrms from incorrect ones y keeping the underlying hypergrph s syntctic met-structure up-to-dte. Free hnd editing with prser support relxes the need to specify full set of trnsformtions on digrms for syntx-directed editing since free hnd editing cn e used for (yet) unspecified digrm opertions. Therefore, this editing mode enhnces usility of editors nd lso mkes rpid prototyping of digrm editors possile ecuse s n extreme cse specifiction of digrm opertions cn e omitted completely. This nd the prsers re descried in (Mins 1997). Digrm clss exmples For showing the concepts of hypergrph representtion of digrms in the following section, we will use three kinds of digrms: Nssi-Shneidermn digrms, Messge Sequence Chrts (MSC), nd VEX expressions. This section riefly descries these digrm clsses. input x while x>1 y x := x/2 x even? n x := 3x-1 Figure 1: A Nssi-Shneidermn digrm. msc simple m0 i1 m1 Figure 2: A Messge Sequence Chrt. Nssi-Shneidermn digrms (NSDs) re used for representing structured progrms (Nssi & Shneidermn 1973). Ech progrm sttement is represented y rectngle contining the sttement. Sequences of sttements re trnslted to stcks of corresponding rectngles. Loops re displyed s rectngles contining the loop control expression s well s the loop ody. Moreover, prticulr grphicl constructs re used for lterntives. Text contined in ox is used to descrie opertions nd conditions. Figure 1 shows n exmple of sequence of two sttements, the second eing while loop. The ody of the while loop consists of n lterntive of two tomic sttements. MSC is lnguge for the description of interction etween entities (ITU 1993). A digrm in MSC descries which messges re interchnged etween process instnces, nd wht internl ctions they perform. Figure 2 shows smple digrm for MSC. VEX (Citrin, Hll, & Zorn 1995) is visul lnguge for expressing λ-expressions: in VEX ech vrile identifier is represented y n empty circle tht is connected y to so-clled root node. A root node is gin n empty circle with one or more s touching it, leding to ll identifiers representing the sme vrile. A root node my either e internlly tngentil to nother circle, it then represents prmeter of λ-strction, or it is not included y ny other circle, it then denotes free vrile. A circle representing λ-strction contins its prmeter circle nd VEX (su) digrm s its ody. An ppliction of two expressions is depicted y two externlly tngentil circles with n rrow t the tngent point. The hed of the rrow lies the rgument circle. Figure 3 shows VEX expressions for (λx:x)y nd λx:xx. In generl ech digrm consists of set of tomic di- i2

x y x input x while x>1 Figure 3: Two VEX expressions for (λx:x)y nd λx:xx. y x even? n grm components which re sptilly relted. The following shows tht NSDs, MSC, nd VEX expressions use different concepts which hypergrphs cn represent in uniform nd strightforwrd wy. For NSDs, components re rectngulr oxes, condition oxes, nd polygons for loop control. MSC provides surrounding oxes, strt nd end oxes, verticl lifes, messge rrows, ction oxes, nd leling s digrm components. For VEX expressions, finlly, we hve circles, s, nd rrows. Sptil reltionships used for composing digrm from its components re very different when compring NSDs s well s MSC with VEX expressions: NSD components re simply comined y stcking them one top nother or plcing them side y side eneth lterntive oxes. Components hve to fit together t their corners. MSCs re minly grph-like structures consisting of lifes with connected segments, ction oxes, nd messge rrows. Components hve to e connected t specific points, too. However, the wys of relting components in VEX expressions is more verstile: circle cn touch others or cn contin n ritrry numer of others, there re s nd rrows connecting circles circumferences, nd rrows cn lso connect res of circles. Another mjor difference to NSDs is the numer of components tht my e directly sptilly relted to single component: for NSDs, ech ox cn e relted to four other oxes t most (to the top, ottom, left, nd right), however in VEX, ech circle cn contin n ritrry numer of circles. The next section shows tht ll these digrm types cn use hypergrphs s internl model in spite of these differences. Hypergrph representtion of digrms Hypergrphs hve proved to e n intuitive mens for internlly representing digrms (Viehstedt & Mins 1994; Mins & Viehstedt 1995; Mins & Shklr 1996; Mins 1997). A hypergrph is generliztion of grph, in which edges re hyperedges, i.e., they cn e connected to ny (fixed) numer of nodes (Berge 1989). Ech hyperedge hs type nd numer of connection points tht determine how mny nodes the hyperedge is connected to. We sy the hyperedge visits these nodes. The fmilir directed grph cn e seen s hypergrph in which ll hyperedges visit exctly two nodes. A specifiction of digrm clss sed on such hypergrph model consists of mpping etween hyperedges nd their digrm counterprts nd description of ll vlid hypergrph models. The ltter is usully specified y some x := x/2 x := 3x-1 while cond Figure 4: Digrm components represented y hyperedges. Hyperedges re shown s gry res connected to nodes tht re represented y lck dots. (hyper)grph grmmr which is discussed in detil in (Mins & Viehstedt 1995; Mins 1997). The specifiction of mppings etween hyperedges nd digrm components is quite ovious: Ech tomic digrm component is simply represented y hyperedge; nodes represent the component s connection res, i.e., the res which cn ctully connect to other components connection res. Figure 4 shows the digrm components of the NSD shown in Figure 1. The gry squres represent the components connection res. Figure 4 lso shows the representtion of ech of these components y single hyperedge visiting n pproprite numer of nodes. The representtion of complete digrm, i.e., the representtion of connections etween hyperedges, however, hs to depend on the kind of sptil reltions. The esiest wy of connecting hyperedges representing relted digrm components is to let them visit the sme nodes if the corresponding digrm components connection res re connected. This representtion cn e used for NSDs: hyperedges visit the sme nodes s soon s connection res overlp (e.g., fter moving components in the grphicl editor). Figure 5 shows the resulting hypergrph for the NSD shown in Figure 1 fter unifying the pproprite nodes of Figure 4. MSCs re similrly represented y hypergrphs: A surrounding ox hs the order, n re for lifes, nd sure for leling s connection res. A messge s connection res re hed nd til of the rrow s well s n re for the leling. The other digrm components hve similr connection res. Specil considertion

nme nme MSC env to messge from contins msc strt life from to from life to from life to end msc nme nme to messge from nme nme msc strt from life to from life to strt ction end end msc Figure 6: Hypergrph model of the NSD depicted in Figure 2. Nodes re drwn s circles, hyperedges s s eing connected to its visited nodes. while re order cond Figure 5: Hypergrph model of the NSD depicted in Figure 1. Nodes re drwn s circles, hyperedges s s eing connected to its visited nodes. is needed for lifes: A nturl representtion would e hyperedge representing the whole life. This hyperedge would need s mny tentcles s there re ctions, incoming, nd outgoing messges plus two dditionl ones for eginning nd end of the. However, deling with hyperedges with vrile numer of tentcles mkes prolems with syntx definition. Therefore, we represent life segments etween ech two events or ctions insted of the whole life. Figure 6 shows the hypergrph representing the MSC shown in Figure 2. Unfortuntely, this esy wy of representing component connections is not sufficient for more generl sptil reltionships etween digrm components. As n exmple, we consider VEX gin. VEX digrms consist of circles, s, nd rrows which re represented y corresponding hyperedges. Actully, plin edges cn e used, hyperedges visiting more thn two nodes re not required for VEX digrms. The edges representing rrows nd s simply connect nodes representing the corresponding end points ( connection re of s nd rrows). In VEX, circle hs Figure 7: Hyperedge representtion of circle. stnds for re, for order. two connection res : its order nd its inner re. Therefore, circles re represented y (directed) edges connecting the two nodes representing these connection res (see Figure 7). VEX s min sptil reltions relte two circles which my e internlly or externlly tngentil, or they relte rrows with circles where rrow hed nd til lie of two circles. The ltter sitution is represented similr to connecting two circles y : the rrow s hyperedge simply connects the circle nodes which represent the circles res. However, sitution where one circle is contined in nother one cnnot e descried y simply visiting the sme re node. It would not e cler which circle is the inner one. Furthermore, if there were third circle contined in the outer one, we would hve to visit the sme re node gin, loosing ll the informtion of how the second nd the third circle re relted (Figure 8). In order not to loose informtion y representing digrm y n internl hypergrph, dditionl hyperedge types touch nd re used. The first one denotes n (undirected) hyperedge connecting the order nodes of tngentil circles, the ltter one denotes directed edge from the re node of circle to the re node of nother circle

Figure 8: Indequte representtion of sptil reltions etween circles. Both digrms hve the sme hypergrph representtion. which contins the first one (cf. Figure 9). We do not need direct representtion of circles eing internlly or externlly tngentil. This is expressed y touch edge etween the order nodes of oth circles nd n edge etween the re nodes if the circles re internlly tngentil nd without such n edge if they re externlly tngentil. In order to mke detection of invlid digrms possile on the level of their internl digrms, we lso need n dditionl intersect edge which connects the order nodes of intersecting circles. The existence of such n edge is n indictor for n invlid VEX digrm. Figure 10 shows the ccording hypergrph representtions for the VEX digrms of Figure 3. As result of this section, the hypergrph model of digrm consists of hyperedges representing digrm components nd nodes representing the components connection res. Sptil reltions etween digrm s components re either modelled y visiting the sme nodes or y inserting dditionl hyperedges directly representing the sptil reltionship. Creting digrm s hypergrph model In digrm editors offering free hnd editing, digrm components re directly mnipulted y the user, i.e., creted, deleted, drgged round etc. The internl hypergrph model hs to e kept up-to-dte. This grphicl scnner s tsk. This section descries method for scnning nd how to specify such scnner for specific digrm clss. As in the previous sections, we use NSDs nd VEX expressions s demonstrtion exmples. Intersecting connection res The input of the scnning process is set of tomic digrm components ech with specific set of connection res. These re used for connections, i.e., sptil reltions etween digrm components. For ech component type (e.g., circle in VEX), there re different connection re types with different shpes (e.g., the order nd the inner re of circles in VEX). Connection res got connected if they intersect in specific wy. Given two connection res A Figure 9: Representtion of sptil reltions using hyperedges explicitly representing sptil reltions. nd B, siclly three different kinds of intersection re possile (the cse where A nd B do not intersect is omitted, i.e., A\ B 6= /0 holds for ll three cses): A B or B A (Type C for contining) A 6 B nd B 6 A nd A \ B is not seprted into disconnected pieces (Type S for single intersection) A 6 B nd B 6 A nd A\B is seprted into disconnected pieces (Type M for multiple intersection) In VEX, the differences etween the intersection types re essentil: If one circle contins nother one, we hve type C for the connection res of the circles res. Two circles touching hve n S intersection of the connection res of the circles orders. Finlly, two circles intersecting (which is syntctic error in VEX expression) cn e detected y n M intersection of these connection res. A first ide of how to crete the hypergrph model from the set of digrm components together with their connection res is s follows: For ech digrm component together with its connection res, we hve hyperedge which visits set of nodes, one node for ech connection re. Now check ech intersection etween ny pir of connection res. Depending on the types of connection res nd the type of intersection, unify the corresponding nodes (i.e., the former two distinct nodes ecome single one), connect them with n pproprite dditionl hyperedge (like n edge), or do nothing (e.g., if the circle re contins nother circle s inner re). This method is effective for simple connection schemes s for NSDs. However, it is not sufficient for more complex sptil reltions s with VEX: Consider functionl ppliction of expressions which re represented y two touching

x y rrow touch touch touch rrow touch x touch Figure 11: Hypergrph representtion of the right VEX digrm of Figure 3 s in Figure 10, ut with highlighted sugrph. touch rrow Figure 10: Hypergrph representtion of the VEX digrms of Figure 3. (Hyper)Edges for digrm components hve gry lel, sptil reltionship edges hve white one. Gry s show which VEX circle is represented y which hyperedge. digrm components with connection res find intersecting connection res intersection grph for connection res select intersection edges for hypergrph model circles with n rrow t the tngent point. E.g., Figure 11 shows the hypergrph model of the right VEX digrm of Figure 3. The gry prt of the hypergrph demonstrtes the prolem which cnnot e creted y the scnning method descried ove: Ech of the inner circles contins connection re of the circle which is expressed y unifying the rrows nodes with the circles re nodes. However, the outer circle contins the rrow s connection res, too. This would result in unifiction of the re nodes of theses three circles which is not desired. Oviously, the scnning method s prolem is not to check ny con. A similr prolem rises in VEX expressions with mny nested circles. The method descried ove would crete lrge numer of edges. Actully, the result would e the trnsitive closure of the set of ctully required edges. A two-step scnning method An ovious solution to the prolems descried ove is to consider nesting level: if there is n intersection with the connection res of some circle, ll circles contining this one re left out from further considertions. In the following, we present more generl solution which llows for specifiction of exctly this ehvior. For correct scnning method, we do not crete the hypergrph directly s in the previous method. Insted, we first crete n intermedite grph which is then used for creting hypergrph model Figure 12: The two-step scnning method the hypergrph, see Figure 12. The intermedite grph simply consists of ll connection res s nodes nd ll detected intersections s explicit edges leled with the intersection type. 1 This intersection grph mkes it possile to consider con efore unifying nodes or dding hyperedges to the hypergrph. The scnning method now works s follows: Crete the intersection grph y dding ll connection res of the digrm s nodes. For ech pir of intersecting connection res, drw n edge etween those nodes. Use the intersection type s the edge s lel. When this grph is completed, check ech edge in the intersection grph. Depending on its lel nd its con, unify the corresponding hypergrph nodes, connect them with n pproprite dditionl hyperedge, or do nothing. The remining tsk is how to specify the ction modifying the hypergrph depending on edge lel nd edge con. 1 C-edges re directed from the contining to the contined node; S-ndM-edges re undirected.

As for the previous method, we cn mke use of the intersection type (i.e., the intersection edge s lel) nd the types of the intersecting connection res for determining the right ction. However, the ction is prohiited if the intersection edge hs certin con. In the following, this con is represented s grph. More formlly, the scnning specifiction is function F : T I T! Action G where T is the set of connection re types, I = fc;s;mg the set of intersection types, Action the set of ctions for hypergrph modifictions, nd G is the set of con grphs. For ech pir t 1 ;t 2 2 T of connection re types nd for ech intersection type i 2 I, (A;G)=F(t 1 ;i;t 2 )consists of n ction A =? representing the null opertion or n λ-expression λx:λy:ction(x;y). ction is n ction referring to two hypergrph nodes x nd y. Possile ctions re Unify the nodes x nd y or Drw n edge from node x to node y. Finlly, G is either n empty grph or grph of connection res whose edges re leled with intersection lels nd with two of its nodes eing leled with α 1 nd α 2,resp. With this function F, the scnning phse following fter the cretion of the intersection grph is s follows: For ech edge e of the intersection grph, determine the lel i of edge e, source node c 1, nd trget node c 2 which re connection res hving some types t 1 nd t 2, resp. Compute (A;G)= F(t 1 ;i;t 2 ). If A=?, do nothing. Else try to mtch G with the intersection grph such tht G s nodes α 1 nd α 2 hve to mtch c 1 nd c 2, resp. If such mtch does exist nd G is not the empty grph, do nothing. Else determine the hypergrph nodes n 1 nd n 2 representing c 1 nd c 2,resp.,in the hypergrph model nd use A(n 1 ;n 2 ) in order to modify the hypergrph model. For VEX, connection re types re T = fre;order;pointg representing circle s inner re, its order, nd the s nd rrows end points. F hs non-null opertions for six pirs in T 1 T 2. For revity, we show only the specifiction for the cse which hs cused prolems in the previous scnning method, i.e., n rrow s end point is contined in circle: F(point;C;re)=(λx:λy:unify(x;y);G) where unify(x;y) mens Unify nodes x nd y nd G= α 2 α 1 re C re C point Grph G detects the sitution where the rrow ends in nested circle. Therefore, the rrow will get connected to the inner circle only, solving the prolem of the first scnning method. Complexity issues In order to get n ide of the scnning method s speed, we will now estimte its complexity. The first phse of the scnning method checks for ech intersection of connection res. When doing preprocessing y serching for intersecting rectngles which serve s ounding oxes for the connection res, this phse hs complexity O(nlogn + k) where n is the numer of connection res nd k the numer of (ounding ox) intersections since well know Plne-sweep-lgorithm cn e used (Mehlhorn 1984). The worst cse of the second phse is to mtch grphs for ech intersection edge. If e is the mximum numer of edges in con grphs, the worst cse of grph mtching is O(k e ). Therefore, the worst cse complexity of the scnning procedure is O(nlogn+k e+1 ).However, the intersection grph is normlly sprse which reduces complexity of grph mtching lot. Relted work Grphs re frequently used s n internl model for representing digrms in visul environment. When creting the internl model from the visul representtion, some kind of grphicl scnning is necessry. Exmples of relted concepts re the visul progrmming environment for implementing visul lnguges VLCC y Costgliol et l. (Costgliol et l. 1997) nd the proposed visul environment y Rekers nd Schürr (Rekers & Schürr 1996). VLCC is distinguishes etween connection-sed nd geometric-sed digrms. For connection-sed ones, the user specifying the visul lnguge cn define connection points for ech visul token, i.e., tomic digrm component. When using the generted editor, the user cn connect such connection points y s. No scnning is necessry. For geometric-sed digrms, tokens hve to fit together in specified wy. This is lso specil cse of the more generl cse discussed in this pper. The pproch y Rekers nd Schürr ctully uses two kinds of grphs s internl representtions of digrms: the sptil reltionship grph (SRG) strcts from the physicl digrm lyout nd represents higher level sptil reltions. Additionlly, n strct syntx grph (ASG) is kept up-todte with the SRG representing the digrm s logicl structure. For free-hnd editing, they propose to use scnner for extrcting low level sptil reltions from the digrm. However, they do not descrie in detil how such scnner would work. Insted they clim tht s long s they do not use low level grphics editor their sptil reltionship grph cn e kept up to dte y the user interfce. Furthermore, this work is relted to 9-intersection, comprehensive model for inry topologicl reltions mong point-, -, nd re-ojects (Egenhofer & Frnzos 1991; Egenhofer & Herring 1991). However, the prolem of determining nd representing sptil reltionships in the con of digrm editors s in this pper is more restricted: We ssume tht digrms which re edited in specilized digrm editors do not use ritrry sptil reltionships mong ny digrm components, ut tht ech component hs specific connection res of certin types. We consider only those sptil reltionships tht cn e detected y checking overlpping connection res of certin types which hppens when digrm components re moved on the editor s cnvs. Conclusions nd future work In this pper we hve reconsidered modelling digrms y hypergrphs s it is done y digrm editors in DiGen (Mi-

ns & Viehstedt 1995; Mins 1997). In digrm editor, the internl (hypergrph) model is then further processed for syntx checking, semntic evlution, etc., ut this ws outside the scope of this pper. The pper hs discussed different wys of how to model digrms nd how to otin digrms y connecting nd comining their components. When using such model in digrm editor which supports free hnd editing, grphicl scnner is needed which cretes the hypergrph model of the digrm currently edited. Such scnning method hs een presented in the pper. The scnning method mkes use of specifiction of the digrm clss which descries how reltions etween digrm components hve to e modelled y edges in the hypergrph depending on the digrm components cons. This pproch mkes hypergrphs flexile modeling concept suitle for modelling lrge numer of different digrm clsses. So fr, the scnner does not work incrementlly, i.e., the whole hypergrph model is (re)creted from scrtch even if only smll digrm prts re modified. Current work on this prolem tries to otin such n incrementl scnner. Other work dels with the hypergrph model itself. So fr, hyperedges re only llowed to visit fixed numer of nodes depending on the hyperedge type. However, there re digrms where visiting n ritrry numer of nodes mkes sense, e.g., lifes in Messge Sequence Chrts s descried in this pper. The nturl model is hyperedge representing the whole time. However, this hyperedge hs to visit ll the nodes which model the points of time. References Berge, C. 1989. Hypergrphs. Amsterdm: North- Hollnd. Bottoni, P.; Costile, M.; Levildi, S.; nd Mussio, P. 1995. Formlising visul lnguges. In VL 95 (1995), 45 52. Citrin, W.; Hll, R.; nd Zorn, B. 1995. Progrmming with visul expressions. In VL 95 (1995), 294 301. Costgliol, G.; Luci, A. D.; Orefice, S.; nd Tortor, G. 1997. A frmework of syntctic models for the implementtion of visul lnguges. In VL 97 (1997), 58 65. Egenhofer, M., nd Frnzos, R. 1991. Point-set topologicl sptil reltions. Interntionl Journl of Geogrphic Informtion Systems 5(2):161 174. Egenhofer, M., nd Herring, J. 1991. Ctegorizing inry topologicl reltionships etween regions, s, nd points in geogrphic dtses. Technicl report, Deprtment of Surveying Engineering, University of Mine. ITU-T, Genev. 1993. Recommendtion Z.120: Messge Sequence Chrt (MSC). See lso: http://www.win.tue.nl/win/cs/fm/sjouke/msc.html. Mrriott, K. 1994. Constrint multiset grmmrs. In VL 94 (1994), 118 125. Mehlhorn, K. 1984. Dt Structures nd Algorithms 3 Multi-dimensionl Serching nd Computtionl Geometry. Berlin: Springer-Verlg. Mins, M., nd Shklr, L. 1996. A high-level visul lnguge for generting we structures. In VL 96 (1996), 248f. Mins, M., nd Viehstedt, G. 1993. Specifiction of digrm editors providing lyout djustment with miniml chnge. In VL 93 (1993), 324 329. Mins, M., nd Viehstedt, G. 1995. DiGen: A genertor for digrm editors providing direct mnipultion nd execution of digrms. In VL 95 (1995), 203 210. Mins, M. 1997. Digrm editing with hypergrph prser support. In VL 97 (1997), 230 237. Nssi, I., nd Shneidermn, B. 1973. Flowchrt techniques for structured progrmming. SIGPLAN Notices 8(8):12 26. Rekers, J., nd Schürr, A. 1996. A grph sed frmework for the implementtion of visul environments. In VL 96 (1996), 148 155. 1997. 1997 Workshop on Theory of Visul Lnguges (TVL 97), Cpri, Itly. Viehstedt, G., nd Mins, M. 1994. Interction in relly grphicl user interfces. In VL 94 (1994), 270 277. 1993. 1993 IEEE Symp. on Visul Lnguges, Bergen, Norwy, IEEE Computer Society Press. 1994. 1994 IEEE Symp. on Visul Lnguges, St. Louis, Missouri, IEEE Computer Society Press. 1995. 1995 IEEE Symp. on Visul Lnguges, Drmstdt, Germny, IEEE Computer Society Press. 1996. 1996 IEEE Symp. on Visul Lnguges (VL 96), Boulder, Colordo, IEEE Computer Society Press. 1997. 1997 IEEE Symp. on Visul Lnguges (VL 97), Cpri, Itly, IEEE Computer Society Press. Zhng, D.-Q., nd Zhng, K. 1997. Reserved grph grmmr: A specifiction tool for digrmmtic VPLs. In VL 97 (1997), 288 295.