A Normal Form for Spider Diagrams of Order - CiteSeerX

10
A Normal Form for Spider Diagrams of Order Aidan Delaney, Gem Stapleton, John Taylor University of Brighton, Brighton, BN2 4GJ, United Kingdom Simon Thompson School of Computing, University of Kent, CT2 7NF, United Kingdom Abstract We develop a reasoning system for an Euler diagram based visual logic, called spider diagrams of order. We de- fine a normal form for spider diagrams of order and provide an algorithm, based on the reasoning system, for producing diagrams in our normal form. Normal forms for visual log- ics have been shown to assist in proving completeness of associated reasoning systems. We wish to use the reasoning system to allow future direct comparison of spider diagrams of order and linear temporal logic. 1 Introduction Shin’s rebirth of Peirce’s and β systems for reason- ing [14] has produced a variety of Euler diagram based visual logics, for example [6, 4, 16, 17]. Euler diagram based visual logics allow reasoning about sets, their ele- ments and their relationships. Associated with visual log- ics are reasoning systems that embody equivalence between diagrams [2, 9, 18]. Spider Diagrams of Order (SDoO) and Second-Order Spider Diagrams [3] differ from the main body of work on Euler diagram based logics as elements of their token syntax were designed to be as expressive as star- free regular languages and regular languages respectively. Weakly expressive language classes, such as regular lan- guages and star-free regular languages, are used to for- malise real-world temporal specifications [5, 11]. Due to the real-world application there has been recent interest in incorporating temporal semantics in these diagrammatic logics [1, 13]. In this paper we address the problem of adding temporal semantics to Euler diagrams by adding a syntax and semantics for specifying order of the elements. Furthermore, we develop the first reasoning system for an Euler diagram based logic that includes an order relation. In demonstrating our reasoning system for spider diagrams of order we produce both a normal form and an algorithm to produce the normal form. Our algorithm also contributes to (a) (b) Figure 1: An Euler and a spider diagram. the recent interest in normal forms for Euler diagram based logics [8]. In section 2 we define the syntax and semantics of spi- der diagrams of order. In section 3 we present each of our reasoning rules. Thereafter, in section 4 we present our normalisation algorithm by example. An implemen- tation of our algorithm is available under an open-source license at https://github.com/AidanDelaney/ SpiderReasoning. 2 Spider Diagrams of Order The Euler diagram in Fig. 1(a) contains three labelled contours and six zones. A zone is defined to be a pair, (in, out), of disjoint subsets of the set of contour labels. The set in contains the labels of the contours that the zone is inside whereas out contains the labels of the contours that the zone is outside. The set of all zones is denoted Z .A re- gion is a set of zones. As an example, there exists a zone inside the contour P but outside both contours Q and R de- noted ({P }, {Q, R}). The zone inside the bounding box and outside all contours can be described by being inside ; and outside {P, Q, R}. We note that there is no zone in the diagram corresponding to ({P, Q}, {R}) i.e. there is no zone inside contours labelled P and Q but outside the con- tour labelled R. Euler diagrams may be conjoined using the symbol ^, disjoined using the symbol _ or negated using the symbol ¬. 300

Transcript of A Normal Form for Spider Diagrams of Order - CiteSeerX

A Normal Form for Spider Diagrams of Order

Aidan Delaney, Gem Stapleton, John TaylorUniversity of Brighton, Brighton, BN2 4GJ, United Kingdom

Simon ThompsonSchool of Computing, University of Kent, CT2 7NF, United Kingdom

Abstract

We develop a reasoning system for an Euler diagrambased visual logic, called spider diagrams of order. We de-fine a normal form for spider diagrams of order and providean algorithm, based on the reasoning system, for producingdiagrams in our normal form. Normal forms for visual log-ics have been shown to assist in proving completeness ofassociated reasoning systems. We wish to use the reasoningsystem to allow future direct comparison of spider diagramsof order and linear temporal logic.

1 Introduction

Shin’s rebirth of Peirce’s ↵ and � systems for reason-ing [14] has produced a variety of Euler diagram basedvisual logics, for example [6, 4, 16, 17]. Euler diagrambased visual logics allow reasoning about sets, their ele-ments and their relationships. Associated with visual log-ics are reasoning systems that embody equivalence betweendiagrams [2, 9, 18]. Spider Diagrams of Order (SDoO)and Second-Order Spider Diagrams [3] differ from the mainbody of work on Euler diagram based logics as elements oftheir token syntax were designed to be as expressive as star-free regular languages and regular languages respectively.

Weakly expressive language classes, such as regular lan-guages and star-free regular languages, are used to for-malise real-world temporal specifications [5, 11]. Due tothe real-world application there has been recent interestin incorporating temporal semantics in these diagrammaticlogics [1, 13]. In this paper we address the problem ofadding temporal semantics to Euler diagrams by adding asyntax and semantics for specifying order of the elements.Furthermore, we develop the first reasoning system for anEuler diagram based logic that includes an order relation. Indemonstrating our reasoning system for spider diagrams oforder we produce both a normal form and an algorithm toproduce the normal form. Our algorithm also contributes to

(a)

���

(b)

Figure 1: An Euler and a spider diagram.

the recent interest in normal forms for Euler diagram basedlogics [8].

In section 2 we define the syntax and semantics of spi-der diagrams of order. In section 3 we present each ofour reasoning rules. Thereafter, in section 4 we presentour normalisation algorithm by example. An implemen-tation of our algorithm is available under an open-sourcelicense at https://github.com/AidanDelaney/SpiderReasoning.

2 Spider Diagrams of Order

The Euler diagram in Fig. 1(a) contains three labelledcontours and six zones. A zone is defined to be a pair,(in, out), of disjoint subsets of the set of contour labels.The set in contains the labels of the contours that the zoneis inside whereas out contains the labels of the contours thatthe zone is outside. The set of all zones is denoted Z . A re-gion is a set of zones. As an example, there exists a zoneinside the contour P but outside both contours Q and R de-noted ({P}, {Q,R}). The zone inside the bounding boxand outside all contours can be described by being inside; and outside {P,Q,R}. We note that there is no zone inthe diagram corresponding to ({P,Q}, {R}) i.e. there is nozone inside contours labelled P and Q but outside the con-tour labelled R. Euler diagrams may be conjoined using thesymbol ^, disjoined using the symbol _ or negated usingthe symbol ¬.

300

A Spider Diagram of Order is an Euler diagram con-taining one or more graphs. The vertices of a graph arelabelled with ‘•’ or an integer. A graph is restricted suchthat it is acyclic and may not have more than one vertex ofa given label in a given zone. To maintain consistency withthe literature we call graphs of this form spiders and terma vertex within a graph to be a spider foot. The diagramin Fig 1(b) contains two spiders, one spider consisting ofthree feet labelled ‘1’, ‘1’ and ‘•’ the other spider containstwo feet labelled ‘1’ and ‘2’. In the following definition,as throughout the paper, we use [ to mean set union, \ tomean set intersection and A� B denotes the set differencebetween A and B.

Definition 1 A spider foot is an element of the set (Z+ [{•})⇥ Z and the set of all feet is denoted F . A spider foot(k, z) 2 F where k 2 Z+ [ {•} has rank k. The rank ofa spider foot induces a relation < on the feet, defined by(k1, z1) < (k2, z2) if both k1, k2 2 Z+ and k1 < k2 holdor k1 = • or k2 = •.

Whilst it may seems strange that < as just defined is not astrict ordering (because • is both less than and greater thanall other feet) this choice of < simplifies many definitions.

Definition 2 A spider, s, is a non-empty set of feet togetherwith a positive natural number, that is s 2 Z+⇥(PF�{;}),and the set of all spiders is denoted S . The set p is the foot

set of spider s = (n, p). The habitat of a spider s = (n, p)is the region ⌘(s) = {z : (k, z) 2 p}.

Formally, the set of all contour labels is denoted C.

Definition 3 A unitary spider diagram of order, d, is aquadruple hC,Z, ShZ, SIi where:

C = C(d) ✓ C is a finite set of contour labels,

Z = Z(d) ✓ {(in, C � in) : in ✓ C} is a set of zones,

ShZ = ShZ(d) ✓ Z(d) is a set of shaded zones,

SI = SI(d) ( S is a finite set, called the spider iden-

tifiers, such that for all spiders (n1, p1), (n2, p2) inSI(d) if p1 = p2 then n1 = n2.

The set of spiders in d is defined to be

S(d) = {(i, p) : (n, p) 2 SI(d) ^ 1 i n}.

The symbol ? is also a unitary spider diagram. We defineC(?) = Z(?) = ShZ(?) = SI(?) = ;.

Spider diagrams of order may also be combined using theBoolean operations ^,_ and ¬. In addition we allow thebinary connective C. A spider diagram of order that con-tains one of the ^,_,¬ or C connectives is a compound

diagram. Furthermore, a spider diagram of order contain-ing either no spiders or containing spiders consting of onlysingle feet is an ↵-diagram. A zone can be considered tobe missing from a spider diagram as presented in [9].

Definition 4 Given an Euler diagram, d, a zone (in, out) issaid to be missing if it is in the set {(in, C(d)� in) : in ✓C(d)} � Z(d) with the set of such zones denoted MZ(d).If d has no missing zones then d is in Venn form.

Spider diagrams of order have a model based semantics.

Definition 5 An interpretation is a triple (U,�, ) whereU is a universal set and : C ! PU is a function that as-signs a subset of U to each contour label and � is a stricttotal order on U . The function can be extended to inter-pret zones and sets of regions as follows:

1. each zone, (in, out) 2 Z , represents the set

(z) =\

c2in

(c) \\

c2out

(U � (c)) and

2. each region, r 2 PZ , represents the set which is theunion of the sets represented by r’s constituent zones,that is

(r) =[

z2r

(z).

Definition 6 Let I = (U,�, ) be an interpretation andlet d (6=?) be a unitary spider diagram. Then I is a model

for d, denoted I |= d, if and only if the following conditionshold.

1. The missing zones condition All of the missing zonesrepresent the empty set, that is,

Sz2MZ(d)

(z) = ;.

2. The spider mapping condition There exists an in-jective function, ' : S(d) ! U and a functionf : S(d) ! F , called a valid pair, such that the fol-lowing conditions hold:

(a) The selected foot condition Each spider s mustmap, under f , to a spider foot in its foot set:

8(n, p) 2 S(d) f(n, p) 2 p.

(b) The spiders’ location condition All spiders rep-resent elements in the sets represented by thezone in which the selected foot, under f , isplaced:

8s 2 S(d) (f(s) = (k, z)) '(s) 2 (z)).

(c) The shading condition Shaded regions representa subset of elements denoted by spiders:

8z 2 ShZ(d) (z) ✓ im(').

301

(d) The order condition The ordering informationprovided by the selected spider feet agrees withthat provided by the strict order relation.That is,

8s1, s2 2 S(d) ('(s1) � '(s2)) f(s1) < f(s2)).

If d =? then no interpretation is a model for d.

The conjunction of conditions 1 and 2 above is the seman-tics predicate for spider diagrams of order. The semanticsof the connectives ^,_ and ¬ extend in the obvious manner,however the semantics of C requires some explanation.

The C operation allows the specification of an order be-tween unitary diagrams. In order to define the semantics ofcompound spider diagrams of order involving C we presentthe definition of ordered sum of interpretations [7].

Definition 7 The ordered sum of two interpretations m1 =(U1,�1, 1) and m2 = (U2,�2, 2), denoted m1 + m2,where U1 and U2 are disjoint, is the interpretation m =(U,�, ) such that

• U = U1 [ U2,

• �=�1 [ �2 [ {(a, b) : a 2 U1 ^ b 2 U2},

• (c) = 1(c) [ 2(c) for all c 2 C.

Given an interpretation, I , and a diagram, D1CD2, I mod-els D1 C D2 if there exist models m1 and m2 for D1 andD2 respectively and I = m1 + m2. We now define whentwo diagrams are semantically equivalent.

Definition 8 Let D1 and D2 be spider diagrams of order.If the model set for D1 is exactly that of D2 then D1 andD2 are semantically equivalent, denoted D1 ⌘✏ D2.

Having defined the syntax and semantics of spider diagramsof order, we now define the rules of our sound reasoningsystem.

3 Reasoning Rules

We introduce seven reasoning rules for spider diagramsof order. These rules are subsequently used to produce dia-grams in normal form; providing the basis of our reasoningsystem. The rules are:

1. introduction of a contour label,

2. introduction of a missing zone,

3. splitting spiders,

4. separate rank and bounds,

5. factor lowest spiders,

6. drop spider-foot rank, and

7. rule of replacement.

The rules of replacement, introduction of a contour label,introduction of a missing zone and splitting spiders ruleare generalised from [18], whereas the other three rules arecompletely new. For each rule we present a statement of therule, a formal definition of the rule and an example of theuse of the rule. All of the reasoning rules presented in thissection produce semantically equivalent diagrams. There-fore, each of the rules defines its own inverse and if D2 isthe consequence of applying a rule to D1 then D1 is theconsequence of applying the inverse of the rule to D2.

The following rule describes how to introduce a missingcontour into a diagram producing a semantically equivalentdiagram.

Rule 1 (Introduction of a Contour Label) Let d be a uni-tary spider diagram of order and let d0 be a unitary spiderdiagram of order obtained from d by introduction of a con-tour label as follows.

• The new contour has a label that is not present in d.

• The contour introduced in d

0 splits each zone z of dinto two zones z1 and z2 and both z1 and z2 are shadedwhere z is shaded.

• Each unordered foot of a spider in zone z of d is re-placed in d

0 by a pair of unordered spider feet in z1

and z2.

• Each ordered spider foot in zone z is similarly replacedin d

0 by a pair of ranked feet of the same rank in z1 andz2.

Then d may be replaced by d

0 and vice-versa.

Example 1 Let d be the diagram in Fig. 2(a). Let d0 be thediagram in Fig. 2(b) where each zone in d has been split bythe introduced contour R in d

0. Each spider foot of d hasbeen replaced by a pair of spider feet in d

0 such that one footof the pair is the original foot and the other foot is extendedinto new zone created by the partition of the original zonecontaining the original foot.

Formal Description of Rule 1 Let d be a unitary spiderdiagram of order such that d 6= ?. Let l 2 C � C(d) and

302

� �

(a)

� �� �

(b)

Figure 2: The introduction of a contour label rule

let d0 be the diagram where

C(d0) = C(d) [ {l},Z(d0) = {(in [ {l}, out) : (in, out) 2 Z(d)} [

{(in, out [ {l}) : (in, out) 2 Z(d)},ShZ(d0) = {(in [ {l}, out) : (in, out) 2 ShZ(d)} [

{(in, out [ {l}) : (in, out) 2 ShZ(d)},SI(d0) = {(n, p0) : 9(n, p) 2 SI(d) ^ p

0 =

{(k, (in [ {l}, out)) : (k, (in, out)) 2 p}[{(k, (in, out [ {l})) : (k, (in, out)) 2 p}}.

Then d may be replaced by d

0 and vice-versa.

The add contour rule is sound as the resultant diagram issemantically equivalent to the original, as we now state.

Theorem 1 Let d be a unitary spider diagram of order suchthat d 6= ?. Let l 2 C�C(d). Let d0 be a spider diagram oforder such that l is introduced to d resulting in d

0 by rule 1,introduction of a contour. Then d ⌘✏ d

0.

Given an arbitrary diagram D and the introduction of acontour label rule we may introduce all contours in C pro-ducing a diagram containing all contours. The introductionof a missing zone rule, when coupled with the introductionof a contour label rule, allows us to produce diagrams inVenn-form containing all contours.

Rule 2 (Introduction of a Missing Zone) Let d be a uni-tary spider diagram of order with missing zone z and let d0be a copy of d where z is added to d

0 and z is shaded. Thend can be replaced by d

0 and vice-versa.

Example 2 Let d be the unitary diagram in Fig. 3(a). Thezone z = ({P,Q}, {}) is missing from d. Let d0 be the dia-gram in Fig. 3(b). The zone z has been added as a shadedzone to d

0.

Formal Description of Rule 2 Let d ( 6= ?) be a unitaryspider diagram of order. Let z 2 MZ(d). Then d

0 is a

(a) (b)

Figure 3: The introduction of a missing zone rule.

unitary spider diagram of order where

C(d0) = C(d),

Z(d0) = Z(d) [ {z},ShZ(d0) = ShZ(d) [ {z},SI(d0) = SI(d).

Then d can be replaced by d

0 and vice-versa.

The following establishes the soundness of the introduc-tion of a missing zone rule.

Theorem 2 Let d ( 6= ?) be a unitary spider diagram oforder. Let z 2 MZ(d). Let d0 be the diagram obtained byapplying rule 2 introduction of a missing zone to d. Thend ⌘✏ d

0.

The splitting spiders rule allows us to represent the dis-junctive information held within a unitary diagram as a dis-junction of unitary diagrams. By repeated application wegenerate a disjunction of ↵-diagrams.

Rule 3 (Splitting spiders) Let d ( 6= ?) be a unitary spiderdiagram of order containing a spider s with foot set p where|p| > 1. Let d1 and d2 be copies of d and let {p1, p2} bea partition of p. Then s is replaced in d1 with s1 where thefoot set of s1 is p1. Similarly, s is replaced in d2 with s2

where the foot set of s2 is p2. Then d can be replaced by thediagram d1 _ d2 and vice-versa.

Example 3 Let d1 be the diagram in Fig. 4(a). A single ap-plication of the splitting spiders rule may result in the dia-gram d2 _ d3 in Fig. 4(b). A further application of the split-ting spiders rule to d3 produces a disjunction of ↵-spiderdiagrams of order.

In order to formally describe the split spiders rule werequire the following definition which allows us to removeof spiders from, and add spiders to, a unitary diagram.

Definition 9 Let d be a unitary spider diagram of order. Letp be a foot set such that {z : (k, z) 2 p} ✓ Z(d). Let d0be a unitary spider diagram of order that contains the sameset of contours, set of zones and set of shaded zones as d.

303

� � �

(a)

��

� �

(b)

Figure 4: The splitting spiders rule.

We may remove a spider with foot set p from d, denotedS(d) p to give d0 such that, d0 is identical to d except that:

S(d0) = S(d)� {(n, p) : (n, p) 2 SI(d)}.

Alternatively, we may add a spider with foot set p to d, de-noted S(d)�p to give d0 such that, d0 is identical to d exceptthat:

S(d0) = S(d) [{(n+ 1, p) : (n, p) 2 SI(d)} [ {(1, p)}.

Formal Description of Rule 3 Let d be a spider diagramof order containing a spider s = (n, p) with |p| > 1 andlet {p1, p2} be a partition of p. Let d1 and d2 be unitarydiagrams such that:

• d1 = (d p)� p1, and

• d2 = (d p)� p2.

Then d can be replaced by the diagram d1 _ d2 and viceversa.

Theorem 3 Let d be a unitary spider diagram of order andlet d1 _ d2 be the result of the application of rule 3 splittingspiders to d. Then d ⌘✏ d1 _ d2.

When given an arbitrary diagram D, we may use the in-troduction of a contour label, introduction of a missing zoneand splitting spiders rules, to produce a diagram D

whereeach unitary component is in Venn-form, contains all con-tours in C and is an ↵-diagram. We now introduce a seriesof three rules which, when given D

produce a diagram thatcontains no ranked feet. The first of our three rules isolatesthe order information from the bounds information providedby unranked spiders and shading.

Rule 4 (Separate rank and bounds) Let d be a unitary↵-spider diagram of order. The diagram d can be decom-posed into the conjunction of d1 and d2 where d1 containsthe ordered spider feet from d and no shading. Further-more, d2 contains an unranked spider foot for each spiderfoot in d and each shaded zone in d is also shaded in d2.Then d can be replaced by diagram d1 ^ d2 and vice-versa.

��

(a)

��

(b)

Figure 5: The separate rank and bounds rule.

Example 4 Let d be the diagram in Fig. 5(a). A singleapplication of rule 4 separate rank and bounds producesd

↵� ^ d

↵• in Fig. 5(b). The ordered spider feet are sepa-rated from the bounds information as the diagram d1 con-tains only the order information, provided by ordered spiderfeet in d. The diagram d2 contains the bounds informationprovided by both the shading and spiders in d. For each ofthe spiders in d there exists an unranked spider in d2 withthe same habitat.

Formal Description of Rule 4 Let d ( 6= ?) be a unitary↵-diagram of order in Venn-form containing all contoursin C. Let d1 and d2 be diagrams such that

C(d1) = C(d2) = C(d),

Z(d1) = Z(d2) = Z(d),

ShZ(d1) = ;,ShZ(d2) = ShZ(d),

and

SI(d1) = {(n, {(k, z)}) : (n, {(k, z)}) 2 SI(d)^ k 6= •},

SI(d2) = {(n, {(•, z)}) : n > 0^n =X

(m,{(k,z)})2SI(d)

m}.

Then d can be replaced by d1 ^ d2 and vice-versa.

Our proof of the soundness of rule 4 proceeds by firstpresenting a series of lemmas. Each lemma corresponds toa step demonstrated in Fig. 6. The diagram d is semanti-cally equivalent to the diagram d ^ d2 by lemma 1 below.Lemma 2 will show that d ^ d2 is equivalent to d3 ^ d2 i.e.we may drop shading from d without changing the meaningof the diagram d ^ d2. Finally, lemma 3 will show that

d3 ^ d2 ⌘✏ d4 ^ d2 ⌘✏ d5 ^ d2

i.e. we may remove all unranked spiders from d3, one ata time, without changing the meaning of the diagram. Wenow show that the first step in this process holds.

304

��

��

��

��

��

Figure 6: The separating the rank and bounds rule.

Lemma 1 Let d be a unitary ↵-diagram of order in Venn-form containing all contours in C. Let d2 be a diagramwhere

C(d2) = C(d)

Z(d2) = C(d)

ShZ(d2) = ShZ(d)

and

SI(d2) = {(n, {(•, z)}) : n > 0^n =X

(m,{(k,z)})2SI(d)

m}.

Then d ⌘✏ d ^ d2.

Returning to Fig. 6, lemma 1 shows that d is semanticallyequivalent to d ^ d2. We now show that d ^ d2 is semanti-cally equivalent to d3 ^ d2. Here, d3 is obtained from d byremoving the shading.

Lemma 2 Let d^ d2 where d 6= ? and d2 6= ? be a spiderdiagram of order where d is a unitary ↵-diagram of orderin Venn form containing all contours in C and where

C(d2) = C(d)

Z(d2) = C(d)

ShZ(d2) = ShZ(d)

and

SI(d2) = {(n, {(•, z)}) : n > 0^n =X

(m,{(k,z)})2SI(d)

m}.

Let d3 be a copy of d where ShZ(d3) = {}. Then d^d2 ⌘✏d3 ^ d2.

We now show that where rank information has been sep-arated from bounds information we can remove unrankedspiders. This is illustrated in Fig. 6, where d3 ^ d2 becomesd4 ^ d2, by removing an unranked spider.

Lemma 3 Let d3 ^ d2 be a spider diagram of order where

• d3 is a unitary ↵-spider diagram of order in Venn formcontaining all contours from C and ShZ(d3) = {},

• d2 is a unitary ↵-spider diagram of order in Venn formcontaining all contours from C containing only un-ranked spider feet, and

• there exists a habitat preserving injective function⇡ : S(d3)! S(d2).

Let d4 be a copy of d3 where one of the unranked spiderss = (n, {(•, z)}) in d4 is removed i.e. S(d4) = S(d3) {(•, z)}. Then d3 ^ d2 ⌘✏ d4 ^ d2.

Having demonstrated that we can remove a single un-ranked spider, we can repeatedly remove such spiders fromdiagrams like d3 in Fig. 6 until no unranked spiders remain.We use this observation in the proof of the next theorem.

Theorem 4 Let d be a unitary ↵-diagram of order whered1 ^ d2 is the result of applying rule 4 separate rank andbounds rule to d. Then d ⌘✏ d1 ^ d2.

Given a diagram d that contains only rank information(such a diagram is generated by an application of separaterank and bounds) the factor lowest spiders rule allows usto factor the different ranks out into a product of diagrams,where each unitary component of the product contains spi-ders of the same rank. We will subsequently show thatranked spider feet may be substituted by unranked spiderfeet given a unitary diagram containing only spiders of thesame rank.

Rule 5 (Factor lowest spiders) Let d be a unitary ↵-diagram containing only spiders whose feet are ranked andcontaining no shaded zones. Then d may be replaced byd

k

C d

0 where d

k

contains those spider feet of lowest rankin d and d

0 contains all other spider feet.

Example 5 Let d↵� be the diagram in Fig. 7(a) and d

1�C

d

2�

be the diagram in Fig. 7(b). We factor d

↵� into d

1�

and d

2�

where d

1�

contains all the lowest ranked spiderfeet from d

↵� i.e. those spider feet labelled  . The diagramd

1�C d

2�⌘✏ d

↵� .

305

��

(a)

��

(b)

Figure 7: The factor lowest spiders rule

�� ��

(a) (b)

Figure 8: The drop spider foot rank rule.

Formal Description of Rule 5 Let d be a unitary ↵-diagram containing only spiders whose feet are ranked andcontaining no shaded zones. Considering the ranked spiderfeet in d, let k be the lowest rank of these feet. Let d

k

andd

0 be diagrams such that

C(dk

) = C(d0) = C(d)Z(d

k

) = Z(d0) = Z(d)ShZ(d

k

) = ShZ(d0) = ShZ(d) = {}

and

SI(dk

) = {(n, (k, z)) : (n, (k, z)) 2 SI(d)}SI(d0) = SI(d)� SI(d

k

).

Then d may be replaced by d

k

C d

0 and vice versa.

Theorem 5 Let d ( 6= ?) be a unitary ↵-diagram contain-ing only spiders whose feet are ranked and containing noshaded zones. Let d ⌘✏ d

k

C d

0 be the result of applyingrule 5 factor lowest spiders to d. Then d ⌘✏ d

k

C d

0.

Rule 6 (drop spider-foot rank) Let d be a unitary ↵-diagram such that each foot of each spider in d is of rankk 2 Z+. Then d may be replaced by a diagram d

0 whered

0 is a copy of d and each foot of each spider foot in d

0 isunranked.

Example 6 Let d be the diagram in Fig. 8(a) is a spiderdiagram of order in which all spiders contain the same rankspider feet. Then d may be replaced by d

0 in Fig. 8(b).

Formal Description of Rule 6 Let d be a unitary ↵-diagram and k 2 Z+ where

(n, {(j, z)})) 2 SI(d)) j = k.

The diagram d may be replaced by d

0 where

C(d0) = C(d),

Z(d0) = Z(d),

ShZ(d0) = ShZ(d),

and

SI(d0) = {(n, {(•, z)}) : (n, {(k, z)}) 2 SI(d)}.

Theorem 6 Let d ( 6= ?) be a unitary ↵-diagram where allspiders contain only feet of rank k. Let d0 be the diagramproduced by application of rule 6 to d. Then d ⌘✏ d

0.

Our final rule, the rule of replacement, allows us to re-place any spider diagram of order which is a sub-diagram ina compound expression with a semantically equivalent dia-gram. The purpose of this rule is to allow a sub-diagram ina compound expression to be replaced by the result of ap-plication of a reasoning rules to that sub-diagram. We firstdefine a sub-diagram. We observe that the syntax of a spi-der diagram of order is defined by the following grammarin Backus-Naur form:

diagram ::= hunitary diagrami|conjunction|disjunction|negation|product;

conjunction ::= diagram ^ diagram;

disjunction ::= diagram _ diagram;

negation ::= ¬diagram;

product ::= diagramC diagram;

Given any spider diagram of order we may now constructits abstract syntax tree. Each tree contains unitary spiderdiagrams of order at leaf nodes and compound operators atnon-leaf nodes.

The set of all abstract syntax trees is T and the set of allspider diagrams of order is�.

Theorem 7 Let D be a spider diagram of order. There ex-ists a unique abstract syntax tree t and bijective function� : �! T such that �(D) = t.

Let D be a well-formed spider diagram of order with ab-stract syntax tree t where t contains a non-leaf node r. Thetree t

r

with root node r is a sub-tree of t. Furthermore,�

�1(tr

) is a sub-diagram of D.Not only do we need to define what a sub-tree is, but

we also need to know when two diagrams are syntacticallyequivalent. The following two definitions define syntacticequivalence

306

(a)

(b)

Figure 9: The rule of replacement.

Definition 10 (Adapted from [12] and [15]) Let D1 andD2 be spider diagrams of order. Then D1 � D2 if andonly if D1 can be transformed into D2 by applying one ofthe reasoning rules given in this section. We say that D2

is obtainable from D1, denoted D1 ` D2, if and only ifthere is a sequence of diagrams hD1

, D

2, . . . , D

mi suchthat D

1 = D1, Dm = D2 and D

k�1 � D

k for each1 k m.

Definition 11 (Adapted from [12] and [15]) Let D1 andD2 be spider diagrams of order. If D1 ` D2 and D2 `D1 then D1 and D2 are syntactically equivalent denoted,D1 ⌘` D2.

We may now define the rule of replacement.

Rule 7 (Rule of Replacement) Let D and D

0 be spider di-agrams of order. Let D

r

be a sub-diagram of D, where D

r

is syntactically equivalent to D

0. Then an instance of Dr

inD may be replaced by D

0.

Example 7 In the diagram d1 _ d2 in Fig. 9(a) we applya rule to d1 such that d1 ` d

x

_ d

y

(specifically, the splitspiders rule). Then we may replace d1 by d

x

_ d

y

as seenin Fig. 9(b).

Formal Description of Rule 7 Let D1 and D

0 be spiderdiagrams of order where D

r

is a sub-diagram of D1. IfD

r

⌘` D

0 then any occurrence of the subtree �(Dr

) in�(D1) may be replaced by �(D0) to produce D2. Then D1

can be replaced by D2 and vice-versa.

The soundness of the rule of replacement is given in thefollowing theorem:

Theorem 8 Let D1 and D2 be spider diagrams of orderwhere D2 is obtained from D1 by application of rule 7 ruleof replacement. Then D1 is semantically equivalent to D2.

Each of our seven reasoning rules is sound. However,our reasoning system is incomplete. Previous approachesto showing completeness of spider diagram based reason-ing systems do not readily generalise to spider diagrams oforder. As a first step in developing a complete reasoningsystem we produce a normal form for spider diagrams of or-der. In the next section we provide an algorithm that, givenan arbitrary spider diagram of order, produces a spider dia-gram of order in our normal form.

4 An Algorithm to Produce Diagrams in Nor-mal Form

In this section we define a normal form for spider di-agrams of order. Our normal form allows the diagram ?.Furthermore, compound diagrams are formed from unitary↵-spider diagrams in Venn-form containing all contours inC and no ranked spiders. Compound expressions in normalform allow ^,_ and C as connectives and ¬ as the unaryoperator. From the 7 reasoning rules, presented in the pre-vious section, we show that any spider diagram of order issemantically equivalent to a diagram in our normal form.Specifically, we define a sequence of applications of rea-soning rules for producing a diagram in normal form givenan arbitrary spider diagram of order.

Definition 12 Let D be a spider diagram of order. It is thecase that D is in normal form if the following conditionshold:

• No unitary component of D contains ranked spiderfeet.

• Each unitary component of D is an ↵-diagram andcontains all contours in C, or is ?.

• There are no zones missing from any unitary compo-nent ( 6= ?) of D.

• The binary connectives ^, _ and C and the unitaryconnective ¬ are the allowed connectives in D.

Given a spider diagram of order as input, the algorithmproduces a spider diagram of order in normal form as out-put. The algorithm is outlined as follows, where applica-tions of rule 7, the rule of replacement, are implicitly as-sumed:

• Let D be the input diagram.

• Apply rule 1 to each unitary diagram in D, producingDC , until all contours in C are present in the result DC .

• Apply rule 2 to each unitary diagram in DC , producingDZ , until there are no missing zones in the result DZ .

307

• Apply rule 3 to each unitary diagram in DZ until thereare no spiders with multiple feet in the result D

.

• Apply rule 4 to each unitary diagram in D

, producingD

↵� .

• Apply rule 5 to each unitary diagram in D

↵� until ev-ery unitary diagram either contains no spider feet orspider feet of all the same rank.

• Apply rule 6 to each unitary diagram in D

0� , produc-

ing D•, the final result.

We now present an example of a unitary spider diagram,its corresponding normal form diagram and an illustrationof the algorithm to generate the required normal form.

Example 8 Let d1 be the unitary spider diagram of or-der in Fig. 10(a) and let C = {P,Q,R}. The dia-gram d1 contains the contours P and Q and the zones({}, {P,Q}), ({P}, {Q}) and ({Q}, {P}). It is not in Vennform as the zone ({P,Q}, {}) is missing. Furthermore, thecontour R is not present in d1 and the diagram contains aspider with more than one foot. Our strategy is to first addall the missing contours to d1. The addition of R to d givesthe diagram in Fig. 10(b). We then add all the zones that aremissing from 10(b) forming 10(c). The addition of the zones({P,Q}, {R}) and ({P,Q,R}, {}) to the diagram can beseen in Fig. 10(c). The diagram in Fig. 10(c) is in Venn formand contains no missing zones. It is semantically equivalentto d1. From this diagram in Venn form containing all con-tours in C we repeatedly employ a split spiders reasoningrule to produce a disjunction of ↵-diagrams. The diagramin Fig. 10(d) is a disjunction of ↵-diagrams where each uni-tary component contains all contours in C. It is semanticallyequivalent to d1.

Let d7 (an arbitrary choice) be the unitary componentof the diagram in Fig. 10(d) as annotated in the figure. Wenow show that d7 and, by extension, any unitary ↵-diagrammay be transformed, by application of reasoning rules, intoa diagram in our normal form. We first separate order andshading resulting in diagram d12^d13 in Fig. 11(a). There-after, we factor lowest spiders from d12 and replace d12 withd

012^d0012 in Fig. 11(b). Finally, the precondition for the drop

spider foot order rule is satisfied we drop the ordered footfrom d

012 resulting in d14 in Fig. 11(a). Applying the drop

spider foot order rule to d

0012 and replacing the result into

(d14 C d

0012) ^ d13 yields the diagram (d14 C d15) ^ d13 in

normal form in Fig. 11(d).

5 Conclusion

We have presented a reasoning system and normal formfor spider diagrams of order. Spider diagrams of order are

� �

(a)

� �� �

(b)

� �� �

(c)

��

��

� � �� � �

��

(d)

Figure 10: Applying reasoning rules resulting in a disjunc-tion of ↵-diagrams.

an interesting recent advance in Euler-diagram based visuallogics as they incorporate an order relation into their seman-tics. Furthermore, it is known that spider diagrams of orderare as expressive as star-free regular languages and that star-free regular languages are as expressive as linear temporallogic. In the future, we wish to use the normal form, devel-oped in this paper, to directly compare spider diagrams oforder and linear temporal logic.

We view our algorithm for obtaining normal form to bethe first step towards providing a completeness result forspider diagrams of order. This is because the complete-ness proofs for existing spider diagram logics, such as [9],as well as their extension called constraint diagrams [10],rely on obtaining diagrams with the property that all spi-ders have single feet [2]. This property is delivered by ournormal form. Once in this normal form, the completenessproofs use other rules to establish syntactic entailment. Asit stands, the spider diagram of order logic does not havesufficient rules to establish completeness. Finding a com-plete set of rules is an interesting prospect for future workbecause it will provide insight into how to gain complete-ness when an order operator is present, contributing to ourunderstanding of diagrammatic logics in general.

308

� ��

(a)

���

(b)

��

(c)

(d)

Figure 11: Applying reasoning rules resulting in a diagramin normal form.

References

[1] P. Bottoni and A. Fish. Policy enforcement and verificationwith timed modeling spider diagrams. In IEEE Symposiumon Visual Languages and Human-Centric Computing, pages27–34, 2013.

[2] J. Burton, G. Stapleton, and J. Howse. Completeness proofstrategies for euler diagram logics. In International Confer-ence on the Theory and Application of Diagrams, 2012.

[3] P. Chapman, G. Stapleton, and A. Delaney. On the expres-siveness of second-order spider diagrams. Journal of VisualLanguages & Computing, 24(5):327 – 349, 2013.

[4] L. Choudhury and M. K. Chakraborty. On extending Venndiagrams by augmenting names of individuals. In Inter-national Conference on the Theory and Application of Di-agrams, volume 2980 of LNAI, pages 142–146. Springer-Verlag, March 2004.

[5] J. Cohen, D. Perrin, and J.-E. Pin. On the expressive powerof temporal logic. Computer System Science, 46:271–294,1993.

[6] H. Dunn-Davies and R. Cunningham. Propostional state-charts for agent interaction protocols. In Proceedings of Eu-ler Diagrams 2004, Brighton, UK, volume 134 of ENTCS,pages 55–75, 2005.

[7] H.-D. Ebbinghaus and J. Flum. Finite Model Theory.Springer, 2 edition, 1991.

[8] A. Fish and J. Taylor. Equivalences in euler-based diagramsystems through normal forms. London Mathematical Soci-ety, 2014. to appear.

[9] J. Howse, G. Stapleton, and J. Taylor. Spider diagrams.LMS Journal of Computation and Mathematics, 8:145–194,2005.

[10] S. Kent. Constraint diagrams: Visualizing invariants in ob-ject oriented modelling. In International Conference on Ob-ject Oriented Programming, Systems, Languages and Appli-cations, pages 327–341. ACM Press, October 1997.

[11] M. Leucker and C. Snchez. Regular linear temporal logic.In C. Jones, Z. Liu, and J. Woodcock, editors, TheoreticalAspects of Computing ICTAC 2007, volume 4711 of LectureNotes in Computer Science, pages 291–305. Springer, 2007.

[12] F. Molina. Reasoning with extended Venn-Peirce diagram-matic systems. PhD thesis, University of Brighton, 2001.

[13] B. Nagy and S. Valyi. Visual reasoning by generalizedinterval-values and interval temporal logic. In P. T. Cox,A. Fish, and J. Howse, editors, VLL, volume 274 of CEURWorkshop Proceedings, pages 13–26. CEUR-WS.org, 2007.

[14] S.-J. Shin. The Logical Status of Diagrams. CambridgeUniversity Press, 1994.

[15] G. Stapleton. Reasoning with Constraint Diagrams. PhDthesis, University of Brighton, August 2004.

[16] G. Stapleton and A. Delaney. Evaluating and generalizingconstraint diagrams. Journal of Visual Languages and Com-putation, 19:499–521, August 2008.

[17] G. Stapleton, J. Howse, P. Chapman, A. Delaney, J. Burton,and I. Oliver. Formalizing concept diagrams. In 19th In-ternational Conference on Distributed Multimedia Systems,pages 182 – 187. Knowledge Systems Institute, 2013.

[18] G. Stapleton, J. Howse, and J. Taylor. A decidable constraintdiagram reasoning system. Journal of Logic and Computa-tion, 15(6):975–1008, December 2005.

309