Skip to main content
Log in

Speedith: A Reasoner for Spider Diagrams

  • Published:
Journal of Logic, Language and Information Aims and scope Submit manuscript

Abstract

In this paper, we introduce Speedith which is an interactive diagrammatic theorem prover for the well-known language of spider diagrams. Speedith provides a way to input spider diagrams, transform them via the diagrammatic inference rules, and prove diagrammatic theorems. Speedith’s inference rules are sound and complete, extending previous research by including all the classical logic connectives. In addition to being a stand-alone proof system, Speedith is also designed as a program that plugs into existing general purpose theorem provers. This allows for other systems to access diagrammatic reasoning via Speedith, as well as a formal verification of diagrammatic proof steps within standard sentential proof assistants. We describe the general structure of Speedith, the diagrammatic language, the automatic mechanism that draws the diagrams when inference rules are applied on them, and how formal diagrammatic proofs are constructed.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Fig. 27
Fig. 28
Fig. 29
Fig. 30

Similar content being viewed by others

Notes

  1. The use of diagrams as evidence, or as a tool for constructing proofs, predates modern efforts of formalisation of logic. An early example of the use of diagrams in proofs is Euclid’s Elements. In the past, diagrams were used in the context of geometry, or geometrical representations of concepts from algebra, number theory, analysis, topology and category theory.

  2. We first introduced Speedith in Urbas et al. (2012). This paper gives a comprehensive account of Speedith, its design and theoretical properties, and also its further developments regarding the selection of inference rules, hand-drawing interface and pluggable infrastructure.

  3. The system in Howse et al. (2005) is a proper fragment of that implemented in Speedith and was proved complete in the absence of \(\longrightarrow \), \(\longleftrightarrow \) and \(\lnot \). We enlarge the set of inference rules to obtain completeness in this syntactically richer logic.

  4. Note that we use labels on spider feet in order to be able to refer to specific spiders. However, as can be observed from the definition of spiders above, these labels do not form part of the syntax of spider diagrams. They are a convenience, and can be arbitrarily and freshly chosen every time an inference rule is applied on a diagram. This means that, for example, two drawn spider diagrams that are identical apart from the spider labels have the same syntax.

  5. A spider with an empty habitat is a contradiction, as it would imply that there exists an element that does not belong to any set.

  6. So, each zone \(( in , out )\) in Z ensures that \( in \cup out =L\).

  7. Introducing a contour in abstract syntax is straightforward. However, drawing an additional contour may be more complex, for example, it may not be drawable as a single circle. We use iCircle algorithm for laying out spider diagrams—for details, see Sect. 4.4.2.

  8. In Speedith, \(\bot \) is equivalently represented by \(\lnot \top \).

  9. Note that we assume an empty disjunction is \(\perp \).

  10. This rule has been added in Urbas et al. (2012) and is not part of the original specification of spider diagrams in Howse et al. (2005).

  11. Regions in two unitary spider diagrams that represent the same set are called corresponding regions. Corresponding regions can be identified syntactically and are therefore suitable as a proof-theoretic tool for defining inference rules. This was first seen in Howse et al. (2002), where that work is generalized in “Appendix 1” so that corresponding regions can be used for the formalization of inference rules.

  12. iCircles was originally created by Stapleton et al. (2012) to draw Euler diagrams (spider diagrams without any spiders in them). Flower then extended iCircles to include the visualisation of spiders, so iCircles supports the visualisation of unitary spider diagrams only, but not compound spider diagrams.

  13. An empty unitary spider diagram is the tuple \(d = (\emptyset , \{(\emptyset , \emptyset )\}, \emptyset , \emptyset , \emptyset )\).

  14. Hand-drawn input support for spider diagrams similar to SpiderDrawer is currently being developed by Wang et al. (2011) within the SketchSet tool. But unlike SpiderDrawer and Speedith, SketchSet is platform dependent and requires proprietary Windows libraries. Since this would seriously limit Speedith’s reach to users, we instead developed SpiderDrawer.

  15. https://code.google.com/p/tessaract-ocr/.

  16. Embedding SpiderDrawer’s canvas directly within Speedith’s proof panel (rather than using it as a separate pop-up window) is work that we plan for the future.

References

  • Bachmair, L., Ganzinger, H., & Waldmann, U. (1992). Set constraints are the monadic class

  • Bashford-Chuchla, C.T. (2014). Pen input interface for a diagrammatic theorem prover. Mphil dissertation, University of Cambridge Computer Laboratory, Cambridge, UK

  • Chang, S. H., Blagojevic, R., & Plimmer, B. (2012). Rata.gesture: A gesture recognizer developed using data mining. Artificial Ingelligence for Engineering Design, Analysis and Manufacturing, 26(3), 351–366.

    Article  Google Scholar 

  • Damm, C., Hansen, K., & Thomsen, M. (2000) Tool support for cooperative object-oriented design: Gesture based modelling on an electronic whiteboard. In SIGCHI conference on human factors in computing systems, pp. 518–525. ACM, New York.

  • Dau, F. (2007). Constants and functions in peirce’s existential graphs. In ICCS, LNCS, Vol. 4604, pp. 429–442. Springer, Berlin.

  • De Chiara, R., Hammar, M., & Scarano, V. (2005). A system for virtual directories using euler diagrams. Electronic Notes in Theoretical Computer Science, 134, 33–53.

    Article  Google Scholar 

  • Flower, J., Masthoff, J., & Stapleton, G. (2004). Generating readable proofs: A heuristic approach to theorem proving with spider diagrams. In A. Blackwell, K. Marriott, A. Shimojima (Eds.), Diagrammatic representation and inference. Lecture notes in computer science (Vol. 2980, pp. 166–181). New York, Springer. doi:10.1007/978-3-540-25931-2_17.

  • Gordon, M. J., Milner, A. J., & Wadsworth, C. P. (1979). Edinburgh LCF: A mechanised logic of computation. Lecture Notes in Computer Science (Vol. 78). New York: Springer. doi:10.1007/3-540-09724-4.

  • Hammer, E. (1995). Logic and visual information. CSLI.

  • Hammond, T., & Davis, R. (2002) Tahuti: A geometrical sketch recognition system for UML class diagrams. In AAAI spring symposium on sketch understanding.

  • Howse, J., Stapleton, G., Flower, J., & Taylor, J. (2002) Corresponding regions in Euler diagrams. In Diagrams. lecture notes in computer science, Vol. 2317, pp. 76–90. New York: Springer.

  • Howse, J., Stapleton, G., & Taylor, J. (2005). Spider diagrams. Journal of Computation and Mathematics, 8, 145–194.

    Google Scholar 

  • Jamnik, M., Bundy, A., & Green, I. (1999). On automating diagrammatic proofs of arithmetic arguments. Journal of Logic, Language and Information, 8(3), 297–321.

    Article  Google Scholar 

  • Jiang, Y., Tian, F., Zhang, X. L., Dai, G., & Wang, H. (2011). Understanding, manipulating and searching hand-drawn concept maps. ACM Transactions on Intelligent Systems and Technology, 3(11), 21.

    Google Scholar 

  • Kent, S. (1997). Constraint diagrams: Visualizing invariants in object oriented modelling. In OOPSLA, SIGPLAN, Vol. 32, pp. 327–341. New York: ACM.

  • Keslter, H., Muller, A., Kraus, J., Buchholz, M., Gress, T., Kane, D., et al. (2008). Vennmaster: Area-proportional Euler diagrams for functional go analysis of microarrays. BMC Bioinformatics, 9(67).

  • Kortenkamp, U., & Richter-Gebert, J. (2004). Using automatic theorem proving to improve the usability of geometry software. In Procedings of the mathematical user-interfaces workshop, pp. 1–12.

  • Plimmer, B., & Freeman, I. (2007) A toolkit approach to sketched diagram recognition. In HCI, pp. 205–213. British Computer Society

  • Plimmer, B., Purchase, H., & Yang, H. (2010). SketchNode: Intelligent sketching support and formal diagramming. In OZCHI 2010, pp. 136–143. ACM.

  • Shin, S. J. (2009). The logical status of diagrams. Cambridge: Cambridge University Press.

    Google Scholar 

  • Smith, R. (2007). An overview of the Tesseract OCR engine. In Proceedings of the ninth international conference on document analysis and recognition (ICDAR ’07), pp. 629–633. IEEE Computer Society.

  • Stapleton, G., Flower, J., Rodgers, P., & Howse, J. (2012). Automatically drawing Euler diagrams with circles. Journal of Visual Languages and Computing, 23(3), 163–193.

    Article  Google Scholar 

  • Stapleton, G., Howse, J., Taylor, J., & Thompson, S. (2004). The expressiveness of spider diagrams. Journal of Logic and Computation, 14(6), 857–880.

    Article  Google Scholar 

  • Stapleton, G., & Masthoff, J. (2007). Incorporating negation into visual logics: A case study using Euler diagrams. In Visual languages and computing 2007, pp. 187–194. Knowledge Systems Institute.

  • Stapleton, G., Masthoff, J., Flower, J., Fish, A., & Southern, J. (2007). Automated theorem proving in Euler diagram systems. Journal of Automated Reasoning, 39(4), 431–470.

    Article  Google Scholar 

  • Stapleton, G., Plimmer, B., Delaney, A. & Rodgers, P. (2014). Combining sketching and traditional diagram editing tools. ACM Transactions on Intelligent Systems and Technology.

  • Stapleton, G., Taylor, J., Howse, J., & Thompson, S. (2009). The expressiveness of spider diagrams augmented with constants. Journal of Visual Languages and Computing, 20, 30–49.

    Article  Google Scholar 

  • Swoboda, N., & Allwein, G. (2005). Heterogeneous reasoning with Euler/Venn diagrams containing named constants and FOL. In Proceedings of Euler diagrams 2004. ENTCS, Vol. 134. Elsevier.

  • Takemura, R. (2013). Proof theory for reasoning with Euler diagrams: A logic translation and normalization. Studia Logica, 101(1), 157–191.

    Article  Google Scholar 

  • Tarski, A. (1944). The semantic conception of truth: And the foundations of semantics. Philosophy and Phenomenological Research, 4(3), 341–376.

    Article  Google Scholar 

  • Urbas, M., & Jamnik, M. (2012). Diabelli: A heterogeneous proof system. In Proceedings of the international joint conference on automated reasoning. Lecture notes in computer science, Vol. 7364, pp. 559–566. New York: Springer.

  • Urbas, M., & Jamnik, M. (2014). A framework for heterogeneous reasoning in formal and informal domains. In T. Dwyer, H. Purchase, & A. Delaney (Eds.), Diagrams. Lecture notes in computer science, Vol. 8578, pp. 277–292. New York: Springer.

  • Urbas, M., Jamnik, M., Stapleton, G., & Flower, J. (2012). Speedith: A diagrammatic reasoner for spider diagrams. In Diagrams. Lecture notes in computer science, Vol. 7352, pp. 163–177. New York: Springer.

  • Wang, M., Plimmer, B., Schmieder, P., Stapleton, G., Rodgers, P., & Delaney, A. (2011). SketchSet: Creating Euler diagrams using pen or mouse. In IEEE symposium on visual languages and human-centric computing, Vol. 6898, pp. 75–82. IEEE Computer Society.

  • Wang, M., Plimmer, B., Schmieder, P., Stapleton, G., Rodgers, P., & Delaney, A. (2011). SketchSet: Creating Euler diagrams using pen or mouse. In IEEE symposium on visual languages and computing, pp. 75–82. IEEE.

  • Winterstein, D., Bundy, A., & Gurr, C. (2004). Dr. Doodle: A diagrammatic theorem prover. In Proceedings of the international joint conference on automated reasoning. Lecture notes in artificial intelligence, Vol. 3097, pp. 331–335.

Download references

Acknowledgments

We thank Jean Flower for her help with iCircles extension, and Charlie Bashford-Chuchla for his implementation of SpiderDrawer as part of his MPhil project in the University of Cambridge Computer Laboratory.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mateja Jamnik.

Appendices

Appendix 1: Corresponding Regions

This section sets out the theory required to compare syntactically different regions at a semantic level. So-called corresponding regions are not necessarily syntactically identical, but they do represent the same set under any interpretation. Similar notions of corresponding sub-regions and super-regions will also be defined in this section. To identify corresponding regions, we need access to the missing zones and the empty zones in a unitary diagram, d. To simplify notation, we generalise the notion of an empty zone from earlier in the paper (recall, the set VEZ contains the zones which are shaded in d yet contain no spider feet). We define the set of empty zones to be MZ(d) together with VEZ:

Definition 13

Let d be a unitary diagram. The empty zones of d are elements of the set

$$\begin{aligned} EZ (d)= MZ (d)\cup \left\{ ( in , out )\in ShZ (d): \forall s\in S(d) ( in , out )\not \in \eta _d(s)\right\} . \end{aligned}$$

Lemma 1

Let d be a unitary diagram and let \(I=(U,\varPhi )\) be a model for d. Then the empty zones represent the empty set, that is

$$\begin{aligned} \forall z\in EZ (d) \zeta _{I}(z)=\emptyset . \end{aligned}$$
Fig. 31
figure 31

Using empty zones to make deductions

We use the concept of empty zones when defining inference rules: if we have two unitary diagrams taken in conjunction, and a zone, z, is empty in one of them, then we can use that information to determine how we apply inference rules on the other diagram, for example. To illustrate, in Fig. 31, in \(d_2\) the zone \((\{B\},\{A,C\})\) is empty so we can add shading to this zone in \(d_1\), as shown in \(d_1^{\prime }\).

The notion of corresponding regions was introduced in Howse et al. (2002) for Euler diagrams, where a syntactic definition was provided that established when two regions represented the same set. Here, we give a definition of corresponding regions that is effective for unitary spider diagrams taken in conjunction: we prove that our definition captures when two regions, one from \(d_1\) and the other from \(d_2\), necessarily represent the same set in all models for \(d_1\wedge d_2\). We also define the notion of a corresponding sub-region and a corresponding super-region, relating to subset and superset respectively.

To illustrate, \(r_1=\{(\{A,D\},\{B\}),(\{A\},\{B,D\})\}\) and \(r_2=\{(\{A,C\},\{B\}),(\{A\}\), \(\{B,C\})\}\) both represent the same set and are corresponding; informally, they both represent the set \(A{\setminus } B\). In this example, we can be confident that \(r_1\) and \(r_2\) represent the same set in any interpretation:

$$\begin{aligned} \chi _I\left( r_1\right)= & {} \zeta _{I}((\{A,D\},\{B\}))\cup \zeta _{I}((\{A\},\{B,D\}))\\= & {} \zeta _{I}(\{A,D,C\},\{B\}))\cup \zeta _{I}((\{A,C\},\{B,D\}))\cup \zeta _{I}((\{A,D\},\{B,C\})) \\&\cup \zeta _{I}((\{A\},\{B,D,C\}))\\= & {} \zeta _{I}((\{A,C\},\{B\}))\cup \zeta _{I}((\{A\},\{B,C\})) \\= & {} \chi _I\left( r_2\right) . \end{aligned}$$
Fig. 32
figure 32

Corresponding regions

Given \(d_1\) and \(d_2\) as in Fig. 32, the region

$$\begin{aligned} r_3=\left\{ (\{A,D\},\{B\}),(\{A\},\{B,D\}), (\{B\},\{A,D\})\right\} \end{aligned}$$

also represents the same set as \(r_2\) (and \(r_1\)) in any model for \(d_1\wedge d_2\), since the zone \((\{B\},\{A,D\})\) represents the empty set:

$$\begin{aligned} \chi _I\left( r_3\right)= & {} \zeta _{I}((\{A,D\},\{B\}))\cup \zeta _{I}((\{A\},\{B,D\}))\cup \zeta _{I}((\{B\},\{A,D\}))\\= & {} \zeta _{I}((\{A,D\},\{B\}))\cup \zeta _{I}((\{A\},\{B,D\}))\\= & {} \chi _I\left( r_2\right) . \end{aligned}$$

The region \(r_3\) corresponds to \(r_2\). In order to syntactically identify whether two regions, r and \(r^{\prime }\), are corresponding, we need to transform them, altering the zones by adding labels. The transformation is based on the observation that given any zone, \(( in , out )\), and a label, l, not used in the zone,

$$\begin{aligned} \zeta _{I}(( in , out ))=\zeta _{I}(( in \cup \{l\}, out ))\cup \zeta _{I}(( in , out \cup \{l\})). \end{aligned}$$

The zone \(( in , out )\) can, thus, be transformed into the two zones \(( in \cup \{l\}, out )\) and \(( in , out \cup \{l\})\). We use this insight to define the notion of an expansion of a region, which given some set of labels iteratively ‘splits’ zones in this manner. In what follows, we denote the set of labels used in a region, r, by L(r), so

$$\begin{aligned} L(r)=\bigcup \limits _{( in , out )\in r} ( in \cup out ). \end{aligned}$$

Definition 14

Let r be a region such that all of the zones, \(( in , out )\), in r ensure that \( in \cup out =L(r)\). Let \(L^{\prime }\) be a finite set of labels such that \(L(r)\subseteq L^{\prime }\). An expansion of r given \(L^{\prime }\), denoted \( exp (r,L^{\prime })\), is the region defined as follows:

  1. 1.

    If \(L^{\prime }=L(r)\) then \( exp (r,L^{\prime })=r\).

  2. 2.

    If \(|L^{\prime }{\setminus } L(r)|=1\) then

    $$\begin{aligned} exp \left( r,L^{\prime }\right)= & {} \left\{ ( in \cup \left( L^{\prime }{\setminus } L(r)\right) , out ):( in , out )\in r\right\} \\&\cup \left\{ ( in , out \cup \left( L^{\prime }{\setminus } L(r))\right) :( in , out )\in r\right\} . \end{aligned}$$
  3. 3.

    If \(|L^{\prime }{\setminus } L(r)|> 1\) then

    $$\begin{aligned} exp \left( r,L^{\prime }\right) = exp \left( r^{\prime },L^{\prime }\right) \end{aligned}$$

    where

    $$\begin{aligned} r^{\prime }= exp \left( r,L^{\prime \prime }\right) \end{aligned}$$

    and \(L^{\prime \prime }=L(r)\cup \{\lambda \}\) for some label \(\lambda \in L^{\prime }{\setminus } L(r)\).

For example, given \(r=\{(\{A\},\{B\}),(\{B\},\{A\})\}\) and \(L^{\prime }=\{A,B,C,D\}\), we have

$$\begin{aligned} exp \left( r,L^{\prime }\right)= & {} exp \left( exp \left( r,\{A,B,C\}\right) ,L^{\prime }\right) \\= & {} exp \left( \{(\{A,C\},\{B\}),(\{A\},\{B,C\}),(\{B,C\},\{A\}),(\{B\},\{A,C\})\},L^{\prime }\right) \\= & {} \left\{ (\{A,C,D\},\{B\}),(\{A,C\},\{B,D\}),(\{A,D\},\{B,C\}),(\{A\},\{B,C,D\}),\right. \\&\left. (\{B,C,D\},\{A\}),(\{B,C\},\{A,D\}),(\{B,D\},\{A,C\}),(\{B\},\{A,C,D\})\right. \}.\\ \end{aligned}$$

The order in which the labels are introduced during the expansion does not matter. Moreover, we do not change the represented set:

Lemma 2

Let r be a region such that all of the zones, \(( in , out )\), in r ensure that \( in \cup out =L(r)\). Let \(L^{\prime }\) be a set of labels such that \(L(r)\subseteq L^{\prime }\). In any interpretation, \(I=(U,\varPhi )\),

$$\begin{aligned} \chi _I\left( r\right) =\chi _I\left( exp \left( r,L^{\prime }\right) \right) . \end{aligned}$$

Proof

(Sketch) The proof proceeds by induction on the cardinality of \(L^{\prime }{\setminus } L(r)\).

Definition 15

Let \(d_1\) and \(d_2\) be unitary diagrams. Let \(r_1\) and \(r_2\) be regions in \(Z(d_1)\cup MZ(d_1)\) and \(Z(d_2)\cup MZ(d_2)\) respectively. Then \(r_1\) and \(r_2\) are corresponding, denoted \(r_1\equiv _c r_2\), provided that

$$\begin{aligned}&exp (r_1,L)\cup exp \left( EZ (d_1),L\right) \cup exp ( EZ (d_2),L) \nonumber \\&\quad = exp (r_2,L)\cup exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L) \end{aligned}$$

where \(L=L(d_1)\cup L(d_2)\). Furthermore, \(r_1\) is a corresponding sub-region of \(r_2\), denoted \(r_1\subseteq _c r_2\), provided that

$$\begin{aligned}&exp (r_1,L)\cup exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L) \nonumber \\&\quad = \subseteq exp (r_2,L)\cup exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L). \end{aligned}$$

If \(r_1\) is a corresponding sub-region of \(r_2\) then \(r_2\) is a corresponding super-region of \(r_1\), denoted \(r_2\supseteq _c r_1\).

In Fig. 32, we have \(r_4\subseteq _c r_5\) where \(r_4=\{(\{A\},\{B,D\})\}\) and \(r_5=\{(\{A\},\{B,C\})\), \((\{A,C\},\{B\})\), \((\{A,B,C\},\emptyset )\}\). Intuitively, \(r_4\) represents the set \(A{\setminus } (B\cup D)\) and \(r_5\) represents A, and we see that in any model, \(I=(U,\varPhi )\), for \(d_1\wedge d_2\) that \(\chi _I\left( r_4\right) \subseteq \chi _I\left( r_5\right) \). The following theorem establishes that our syntactic correspondence relations respect the semantics as intended:

Theorem 3

Let \(d_1\) and \(d_2\) be unitary diagrams and let \(r_1\) and \(r_2\) be regions in \(Z(d_1)\cup MZ(d_1)\) and \(Z(d_2)\cup MZ(d_2)\) respectively.

  1. 1.

    If \(r_1\equiv _c r_2\) then for all models \(I=(U,\varPhi )\) for \(d_1\wedge d_2\), \(\chi _I\left( r_1\right) =\chi _I\left( r_2\right) \).

  2. 2.

    If \(r_1\subseteq _c r_2\) then for all models \(I=(U,\varPhi )\) for \(d_1\wedge d_2\), \(\chi _I\left( r_1\right) \subseteq \chi _I\left( r_2\right) \).

  3. 3.

    If \(r_1\supseteq _c r_2\) then for all models \(I=(U,\varPhi )\) for \(d_1\wedge d_2\), \(\chi _I\left( r_1\right) \supseteq \chi _I\left( r_2\right) \).

Proof

Suppose that \(r_1\equiv _c r_2\). Then, by definition,

$$\begin{aligned}&exp (r_1,L)\cup exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L) \nonumber \\&= exp (r_2,L)\cup exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L) \end{aligned}$$

where \(L=L(d_1)\cup L(d_2)\). By Lemma 2, given any interpretation, \(I=(U,\varPhi )\), we know that:

  1. 1.

    \(\chi _I\left( r_i\right) =\chi _I\left( exp (r_i,L)\right) \), and

  2. 2.

    \(\chi _I\left( EZ(d_i)\right) =\chi _I\left( exp ( EZ (d_i),L)\right) \)

for each \(i\in \{1,2\}\). Therefore, in any model for \(d_i\), \(\chi _I\left( exp ( EZ (d_i),L)\right) =\emptyset \) since \(\chi _I\left( EZ(d_i)\right) =\emptyset \) by Lemma 1. Thus, in any model for \(d_1\wedge d_2\),

$$\begin{aligned} \chi _I\left( r_1\right)= & {} \chi _I\left( exp(r_1,L)\right) \\= & {} \chi _I\left( exp (r_1,L)\right) \cup \chi _I\left( exp ( EZ (d_1),L)\right) \cup \chi _I\left( exp ( EZ (d_2),L)\right) \\= & {} \chi _I\left( exp (r_1,L)\cup exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L)\right) \\= & {} \chi _I\left( exp (r_2,L)\cup exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L)\right) \quad \qquad (*) \\= & {} \chi _I\left( r_2\right) \end{aligned}$$

as required. The remainder of the proof is similar, noting that the line \((*)\) is, instead, a subset (superset) relation in the case of \(\subseteq _c\) (resp. \(\supseteq _c\)).

Appendix 2: Formalised Inference Rules and Proofs of Soundness

First, we observe that all of the rules inherited from Howse et al. (2005) and, trivially, all of the rules for logical connectives are sound.

Theorem 4

The inference rules for the logical connectives are all sound, as are AddFeet, IntroContour, EraseSpider, EraseContour, IntroShadedZone, RemoveShading, SplitSpider, EcludedMiddle, and Combining.

Here we include formalisations and soundness proofs for the diagrammatic inference rules that are new [i.e., those not included in Howse et al. (2005)]: NegationElimination, CopyContours, CopyShading and CopySpider. These rules are all equivalences, so we must show that their application preserves semantics. In what follows, we need to use the function \(\Sigma _{d,U}\) that maps spiders to elements. Given an interpretation, \(I=(U,\varPhi )\), and a unitary diagram d, \(\Sigma _{d,U}\) maps the spiders of d to the elements of U. Frequently, we will be considering a single interpretation and the spiders of more than one diagram. As such, rather than writing \(\Sigma _{d,U}\), we more simply write \(\Sigma _{d}\). We now formalise and prove the soundness of NegationElimination.

1.1 Negation Elimination

Let \(d_n\) be a unitary diagram with exactly n spiders, no missing zones (so \(d_n\) is in Venn-form) where all spiders have single feet, and there is at most one zone, \(z_n\), that contains spiders or shading. Let \(d_i\), for \(0\le i<n\), be the unitary diagram where \(z_n\) contains exactly i spiders and shading. More precisely, \(d_i\) has components that are defined as follows:

  1. 1.

    the contour labels are \(L(d_i)=L(d_n)\),

  2. 2.

    the zones are \(Z(d_i)=Z(d_n)\),

  3. 3.

    the shaded zones are \(ShZ(d_i)=\{z_n\}\),

  4. 4.

    the spiders are \(S(d_i)=\{s_j:1\le j\le i\}\), and

  5. 5.

    the habitat of each spider, \(s_j\in S(d_i)\), is \(\eta _{d_i}(s_j)=\{z_n\}\).

Let \(d_{n+1}\) be a unitary diagram where \(z_{n}\) contains \(n+1\) spiders and no shading, that is:

  1. 1.

    the contour labels are \(L(d_{n+1})=L(d_n)\),

  2. 2.

    the zones are \(Z(d_{n+1})=Z(d_n)\),

  3. 3.

    the shaded zones are \(ShZ(d_{n+1})=\{z_n\}\),

  4. 4.

    the spiders are \(S(d_{n+1})=\{s_j:1\le j\le n+1\}\), and

  5. 5.

    the habitat of each spider, \(s_j\in S(d_{n+1})\), is \(\eta _{d_{n+1}}(s_j)=\{z_n\}\).

The NegationElimination rule can be applied in the following way to \(\lnot d_1\):

  1. 1.

    if no zone in \(d_n\) contains spiders or shading then \(\lnot d_n\) is logically equivalent to \(\perp \),

  2. 2.

    if \(z_n\) contains spiders but no shading in \(d_n\) then \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\),

  3. 3.

    otherwise \(z_n\) contains spiders and shading in \(d_n\) and we have that \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\vee d_{n+1}\).

Theorem 5

NegationElimination is sound.

Proof

Given \(d_n\) as in the formalisation of the NegationElimination inference rule, we must show that

  1. 1.

    if no zone in \(d_n\) contains spiders or shading then \(\lnot d_n\) is logically equivalent to \(\perp \),

  2. 2.

    if \(z_n\) contains spiders but no shading in \(d_n\) then \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\),

  3. 3.

    otherwise \(z_n\) contains spiders and shading in \(d_n\) and we have that \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\vee d_{n+1}\).

Let \(I=(U,\varPhi )\) be an interpretation. We consider the three cases in turn.

  1. 1.

    Case 1: if no zone in \(d_n\) contains spiders or shading then \(\lnot d_n\) is logically equivalent to \(\perp \). We first show that \(d_n\) is modelled by I. Trivially, as \(d_n\) has no missing zones, \(\chi _I\left( Z(d_n)\right) =U\). As there are no spiders, we also see that there exists a function, \(\varSigma _{d_n}:S(d_n)\rightarrow U\), such that

    1. (a)

      \(\forall s\in S(d_n) (\varSigma _{d_n}\left( s\right) \in \chi _I({\eta _{d_n}(s)}))\), and

    2. (b)

      \(\forall z\in ShZ (d_n)(\zeta _{I}(z)\subseteq im(\varSigma _{d_n}))\),

    where \(im(\varSigma _{d_n})\) is the image of the function \(\varSigma _{d_n}\) (i.e., the set of elements in U to which \(\varSigma _{d_n}\) maps spiders). As there are no shaded zones in \(d_n\), it is trivial that for all shaded zones in \(d_n\), \(\zeta _{I}(z) \subseteq im(\varSigma _{d_n})\). Hence I models \(d_n\). As I was arbitrary, it follows that every interpretation models \(d_n\). Therefore, \(\lnot d_n\) has no models and is logically equivalent to \(\perp \), as required.

  2. 2.

    Case 2: if \(z_n\) contains spiders but no shading in \(d_n\) then \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\). Suppose that I models \(\lnot d_n\). We show I models \(\bigvee \nolimits _{1\le i <n}d_i\). Now, given I models \(\lnot d_n\), I does not model \(d_n\). The only way I can fail to model \(d_n\), since there is no shading and there are no missing zones, is if there are insufficient elements in \(\zeta _{I}(z_n)\) to which the spiders can map injectively. From this it follows that \(|\zeta _{I}(z_n)|<n\). Therefore, \(|\zeta _{I}(z_n)|=i\) for some \(i<n\).We show I models \(d_i\). Since \(d_i\) has no missing zones, again we see that \(\chi _I\left( Z(d_n)\right) =U\). Choose the i elements in U that are in \(\zeta _{I}(z_n)\), say \(u_1,\ldots ,u_i\), and further define \(\varSigma _{d_i}\left( s_j\right) =u_j\). Then, by construction, \(\varSigma _{d_i}\) is injective and maps spiders to elements in their habitat (recall, there are no other spiders in \(d_i\)). Furthermore, there is only one shaded zone, namely \(z_n\), in \(d_i\) and we know \(\zeta _{I}(z_n)=\{u_1,\ldots ,u_i\}\). Therefore,

    $$\begin{aligned} \zeta _{I}(z_n)\subseteq \{u_1,\ldots ,u_i\}, \end{aligned}$$

    as required. Hence, I models \(d_i\) and, consequently, I models \(\bigvee \nolimits _{1\le i <n}d_i\).For the converse, suppose that I models \(\bigvee \nolimits _{1\le i <n}d_i\). Then I models one of the disjuncts, say \(d_j\). We show that I does not model \(d_n\). Since I models \(d_j\), there is a spider map, \(\varSigma _{d_j}\), which ensures that \(\zeta _{I}(z_n)\subseteq \{u_1,\ldots ,u_j\}\), where \(u_1,\ldots ,u_j\) are the elements mapped to by the j spiders in \(z_n\) in \(d_j\). From this, it follows that \(\zeta _{I}(z_n)<n\), since \(j<n\). Therefore, as there are n spiders in \(z_n\) in \(d_n\), there cannot exist an injective mapping of spiders in \(d_n\), namely \(\varSigma _{d_n}\), which ensures that all spiders represents elements in \(\zeta _{I}(z_n)\). Hence I cannot model \(d_n\). Therefore I models \(\lnot d_n\). Thus, we see that \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\), as required.

  3. 3.

    Case 3: \(z_n\) contains spiders and shading in \(d_n\) and we have that \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\vee d_{n+1}\).Suppose that I models \(\lnot d_n\). We show I models \(\bigvee \nolimits _{1\le i <n}d_i\vee d_{n+1}\). Now, given I models \(\lnot d_n\), I does not model \(d_n\). The only way I can fail to be a model for \(d_n\) is if there are not exactly n elements in \(\zeta _{I}(z_n)\). From this it follows that \(|\zeta _{I}(z_n)|<n\) or \(|\zeta _{I}(z_n)|>n\). Therefore, \(|\zeta _{I}(z_n)|=i\) for some \(i<n\) or \(i>n\). In the former case, we have I models \(d_i\) for some \(i<n\), as in Case 2. When \(i>n\), choose \(n+1\) elements, say \(u_1,\ldots ,u_{n+1}\), in \(\zeta _{I}(z_n)\), define \(\varSigma _{d_{n+1}}\) by \(\varSigma \left( s_j\right) =u_j\) and one can readily proceed to show I models \(d_{n+1}\) in much the same way, noting the details are more straightforward since \(z_n\) is not shaded in \(d_{n+1}\). Therefore I models \(\bigvee \nolimits _{1\le i <n}d_i\vee d_{n+1}\).For the converse, suppose I models \(\bigvee \nolimits _{1\le i <n}d_i\vee d_{n+1}\). Then I models \(d_i\) for some \(1\le i<n\) or I models \(d_{n+1}\). If I models such a \(d_i\) then to show I models \(\lnot d_n\) the proof proceeds similarly to case 2. If I models \(d_{n+1}\) then it can readily be shown that there are at least \(n+1\) elements, say \(u_1,\ldots ,u_n,u_{n+1}\), in \(\zeta _{I}(z_n)\). But then I does not model \(d_n\), since \(d_n\) requires \(|\zeta _{I}(z_n)|=n\). Therefore, I models \(\lnot d_n\). Thus, we see that \(\lnot d_n\) is logically equivalent to \(\bigvee \nolimits _{1\le i <n}d_i\vee d_{n+1}\), as required.

Hence NegationElimination is sound.

Recall that the CopyContours inference rule applies to \(d_1\wedge d_2\), copying a contour \(l_2\) from \(d_2\) into \(d_1\), yielding \(d_1^{\prime }\wedge d_2\). In order to formalise CopyContours, we need to specify syntactically how the addition of the new contour, \(l_2\), impacts on the existing zones in \(d_1\). Zones can either be completely inside, completely outside or split by the new contour, for which we require three parameters. These parameters will be defined using \(Z_{i}(l_2,d_2)\), \(Z_{o}(l_2,d_2)\), and \(Z_{s}(l_2,d_2)\) which we will shortly define. Zones that are in \(Z_{i}(l_2,d_2)\) will necessarily represent subsets of \(\varPhi (l_2)\) in models for \(d_1\wedge d_2\); these zones will be inside \(l_2\) in \(d_1^{\prime }\). Similarly, zones that are in \(Z_{o}(l_2,d_2)\) will necessarily represent sets disjoint from \(\varPhi (l_2)\) and will be outside \(l_2\). If zones are neither necessarily subsets of nor disjoint from \(\varPhi (l_2)\) then they will be split into two new zones by \(l_2\), one inside and the other outside \(l_2\).

To give further insight into the definition below, we observe that in any model for \(d_2\), the following hold:

  1. 1.

    \(\varPhi (l_2)=\chi _I\left( \{( in _2, out _2)\in Z(d_2):l_2\in in _2\}\right) ,\) and

  2. 2.

    \(\varPhi (l_2)\cap \chi _I\left( \{( in _2, out _2)\in Z(d_2):l_2\in out _2\}\right) =\emptyset .\)

Definition 16

Let \(d_1\) and \(d_2\) be unitary diagrams and let \(l_2\) be in \(L(d_2){\setminus } L(d_1)\). We define three subsets of \(Z(d_1){\setminus } EZ(d_1)\), namely \(Z_{ i }(l_2,d_2)\), \(Z_{ o }(l_2,d_2)\), and \(Z_{ s }(l_2,d_2)\), according to the following rules: let \(( in _1, out _1)\in Z(d_1){\setminus } EZ(d_1)\) such that \(\{( in _1, out _1)\}\not \subseteq _c EZ(d_2)\), then

  1. 1.

    \(( in _1, out _1)\in Z_{i}(l_2,d_2)\) provided

    $$\begin{aligned} \{( in _1, out _1)\}\subseteq _c \{( in _2, out _2)\in Z(d_2):l_2\in in _2\}, \end{aligned}$$
  2. 2.

    \(( in _1, out _1)\in Z_{o}(l_2,d_2)\) provided

    $$\begin{aligned} \{( in _1, out _1)\}\subseteq _c \{( in _2, out _2)\in Z(d_2):l_2\in out _2\}, \end{aligned}$$
  3. 3.

    \(( in _1, out _1)\in Z_{s}(l_2,d_2)\) provided

    $$\begin{aligned}( in _1, out _1)\not \in Z_{i}\cup Z_{o}.\end{aligned}$$

We now establish some properties of the sets \(Z_{ i }(l_2,d_2)\), \(Z_{ o }(l_2,d_2)\), and \(Z_{ s }(l_2,d_2)\).

Lemma 3

Let \(d_1\) and \(d_2\) be unitary diagrams and let \(l_2\) be in \(L(d_2){\setminus } L(d_1)\). Then

  1. 1.

    \(Z_{ i }(l_2,d_2)\), \(Z_{ o }(l_2,d_2)\), and \(Z_{ s }(l_2,d_2)\) are pairwise disjoint, and

  2. 2.

    \(Z(d_1){\setminus } (Z_{ i }(l_2,d_2)\cup Z_{ o }(l_2,d_2)\cup Z_{ s }(l_2,d_2)\cup EZ (d_1))\equiv _c EZ (d_2)\).

Proof

First we show that \(Z_{ i }(l_2,d_2)\), \(Z_{ o }(l_2,d_2)\), and \(Z_{ s }(l_2,d_2)\) are pairwise disjoint. Trivially, \(Z_{ s }(l_2,d_2)\) is disjoint from both \(Z_{ i }(l_2,d_2)\) and \(Z_{ o }(l_2,d_2)\). Let \(( in _1, out _1)\) be a zone in \(Z_{ i }(l_2,d_2)\). We must show that \(( in _1, out _1)\) is not in \(Z_{ o }(l_2,d_2)\). Since \(( in _1, out _1)\) is a zone in \(Z_{ i }(l_2,d_2)\) we know that

$$\begin{aligned} \{( in _1, out _1)\}\subseteq _c \left\{ ( in _2, out _2)\in Z(d_2):l_2\in in _2\right\} . \end{aligned}$$

By the definition of \(\subseteq _c\),

where \(L=L(d_1)\cup L(d_2)\). If \(( in _1, out _1)\) was in \(Z_{ o }(l_2,d_2)\) then we would also have

We show that there is a zone in the LHS of (1) and (2), namely

$$\begin{aligned} exp\left( \left\{ \left( in _1, out _1\right) ,L\right\} \right) \cup exp \left( EZ (d_1),L\right) \cup exp \left( EZ (d_2),L\right) \end{aligned}$$

that is not in the RHS of (2), namely

$$\begin{aligned} exp\left( \left\{ \left( in _2, out _2\right) \in Z(d_2):l_2\in out _2\right\} ,L\right) \cup exp \left( EZ (d_1),L\right) \cup exp \left( EZ (d_2),L\right) \end{aligned}$$

Since \(( in _1, out _1)\) is in \(Z_{i}\), we know that

$$\begin{aligned} \left( in _1, out _1\right) \not \subseteq _c EZ (d_2) \end{aligned}$$

This implies, by the definition of \(\subseteq _c\), that

$$\begin{aligned}&exp\left( \left\{ \left( in _1, out _1\right) ,L\right\} \right) \cup exp \left( EZ (d_1),L\right) \cup exp \left( EZ (d_2),L\right) \not \subseteq exp \left( EZ (d_1),L\right) \nonumber \\&\quad \cup exp \left( EZ (d_2),L\right) . \end{aligned}$$

Choose a zone, \(( in , out )\), such that

$$\begin{aligned} ( in , out )\in exp\left( \left\{ \left( in _1, out _1\right) ,L\right\} \right) {\setminus } \left( exp ( EZ (d_1),L)\cup exp ( EZ (d_2),L)\right) . \end{aligned}$$

If \(l_2\not \in out \) then \(( in , out )\) is not in the RHS of (2) but it is in the LHS of (1) and we are done. Alternatively, \(l_2\in out \), in which case \(l_2\not \in in \). But then \(( in , out )\) is not in the RHS of (1) but it is in the LHS of (1), which is a contradiction. Hence, the LHS of (1) is not a subset of the RHS of (2), as required. Therefore, \(( in _1, out _1)\) is not in \(Z_{ o }(l_2,d_2)\). Thus, the sets \(Z_{ i }(l_2,d_2)\) and \(Z_{ o }(l_2,d_2)\) are also disjoint, completing the first part of the proof.

For the last part of the proof we need to establish that

$$\begin{aligned} Z(d_1){\setminus } \left( Z_{ i }(l_2,d_2)\cup Z_{ o }(l_2,d_2)\cup Z_{ s }(l_2,d_2)\cup EZ (d_1)\right) \,\equiv _c\, EZ (d_2). \end{aligned}$$

Let \(( in _1, out _1)\) be a zone such that

$$\begin{aligned} \left( in _1, out _1\right) \in Z(d_1){\setminus } \left( Z_{ i }(l_2,d_2)\cup Z_{ o }(l_2,d_2)\cup Z_{ s }(l_2,d_2)\cup EZ (d_1)\right) . \end{aligned}$$

Trivially, since \(( in _1, out _1)\) is not in any one of \(Z_{ i }(l_2,d_2)\), \(Z_{ o }(l_2,d_2)\) \(Z_{ s }(l_2,d_2)\), we see that

$$\begin{aligned} \left\{ \left( in _1, out _1\right) \right\} \subseteq _c EZ (d_2). \end{aligned}$$

From this the result immediately follows.

We now formalise the CopyContours inference rule.

1.2 Copy Contours

Let \(d_1\) and \(d_2\) be unitary diagrams and let \(l_2\) be in \(L(d_2){\setminus } L(d_1)\). Let \(Z_{ IN }\), \(Z_{ OUT }\) and \(Z_{ SPLIT }\) be a three-way partition of \(Z(d_1)\) such that

  1. 1.

    \(Z_{i}(l_2,d_2)\subseteq Z_{IN}\),

  2. 2.

    \(Z_{o}(l_2,d_2)\subseteq Z_{OUT}\), and

  3. 3.

    \(Z_{s}(l_2,d_2)\subseteq Z_{SPLIT}\).

Let \(d_1^{\prime }\) be the diagram whose components are defined as follows:

  1. 1.

    the contour labels are \(L(d_1^{\prime })=L(d_1)\cup \{l_2\}\),

  2. 2.

    the zones are

    $$\begin{aligned} Z(d_1^{\prime })= & {} \left\{ \left( in \cup \{l_2\}, out \right) :( in , out )\in Z_{IN}\cup Z_{SPLIT}\right\} \\&\cup \left\{ \left( in , out \cup \{l_2\}\right) :( in , out )\in Z_{OUT}\cup Z_{SPLIT}\right\} , \end{aligned}$$
  3. 3.

    the shaded zones are

    $$\begin{aligned} Z\left( d_1^{\prime }\right)= & {} \left\{ ( in \cup \{l_2\}, out ):( in , out )\in \left( Z_{IN}\cup Z_{SPLIT}\right) \cap ShZ (d_1)\right\} \\&\cup \left\{ \left( in , out \cup \{l_2\}\right) :\left( in , out \right) \in \left( Z_{OUT}\cup Z_{SPLIT}\right) \cap ShZ (d_1)\right\} , \end{aligned}$$
  4. 4.

    the spiders are \(S(d_1^{\prime })=S(d_1)\), and

  5. 5.

    the habitat of each spider, \(s^{\prime }\in S(d_1^{\prime })\), is

    $$\begin{aligned} \eta _{d_1^{\prime }}\left( s^{\prime }\right)= & {} \left\{ \left( in \cup \{l_2\}, out \right) :( in , out )\in \left( Z_{IN}\cup Z_{SPLIT}\right) \cap \eta _{d_1}(s)\right\} \\&\cup \left\{ \left( in , out \cup \{l_2\}\right) :( in , out )\in \left( Z_{OUT}\cup Z_{SPLIT}\right) \cap \eta _{d_1}(s)\right\} . \end{aligned}$$

The CopyContours rule can be applied to show \(d_1\wedge d_2\) is logically equivalent to \(d_1^{\prime }\wedge d_2\).

Theorem 6

CopyContours is sound.

Proof

Let \(d_1\), \(d_2\) and \(d_1^{\prime }\) be spider diagrams, let \(l_2\) be a contour label and let \(Z_{ IN }\), \(Z_{ OUT }\) and \(Z_{ SPLIT }\) be a three way partition of \(Z(d_1)\) as in the definition of the CopyContours inference rule. We must show that \(d_1\wedge d_2\equiv d_1^{\prime }\wedge d_2\). Let \(I=(U,\varPhi )\) be an interpretation and suppose that I models \(d_1^{\prime }\wedge d_2\). Trivially, \(d_1^{\prime }\vDash d_1\), by Theorem 4, since \(d_1\) can be obtained from \(d_1^{\prime }\) by applying the EraseContour inference rule (deleting the contour labelled \(l_2\) from \(d_1^{\prime }\)). Therefore, \(d_1^{\prime }\wedge d_2 \vDash d_1\wedge d_2\).

For the converse, suppose that I models \(d_1\wedge d_2\). We must first show that \(\chi _I({Z(d_1^{\prime })})=U\). Trivially, \(\chi _I({Z(d_1^{\prime })})\subseteq U\). Let \(e\in U\). We show that there exists a zone, \(( in _1^{\prime }, out _1^{\prime })\in Z(d_1^{\prime })\), such that \(e\in \zeta _{I}( in _1^{\prime }, out _1^{\prime })\). We know that

$$\begin{aligned} e\in \zeta _{I}(( in _1, out _1)) \end{aligned}$$

for some zone \(( in _1, out _1)\in Z(d_1)\), since \(\chi _I\left( Z(d_1)\right) = U\). There are three cases to consider, relating to the three-way partition, \(Z_{ IN }\), \(Z_{ OUT }\) and \(Z_{ SPLIT }\), of \(Z(d_1)\).

  1. 1.

    Case 1: \(( in _1, out _1)\in Z_{ IN }\). We show that \(e\in \zeta _{I}( in _1\cup \{l_2\}, out _1)\). Since \(( in _1, out _1)\in Z_{ IN }\), we know, by Lemma 3, that either \(( in _1, out _1)\in Z_{i}\) or \(( in _1, out _1)\in EZ(d_1)\), or \(( in _1, out _1)\subseteq _c EZ(d_2)\). In the latter two subcases, \(\zeta _{I}( in _1, out _1)=\emptyset \), by Lemma 1 and so does not contain e. Thus, it can only be that \(( in _1, out _1)\in Z_{i}\). We, therefore, know that

    $$\begin{aligned} \left\{ ( in _1, out _1)\right\} \subseteq _c \left\{ ( in _2, out _2)\in Z(d_2):l_2\in in _2\right\} \end{aligned}$$

    by the definition of \(Z_{i}\). This implies that

    $$\begin{aligned} e\in \zeta _{I}( in _1, out _1)\subseteq \chi _I\left( \left\{ ( in _2, out _2)\in Z(d_2):l_2\in in _2\right\} \right) \quad \qquad (1) \end{aligned}$$

    by Theorem 3. Since all zones, \(( in _2^{\prime }, out _2^{\prime })\), in \(\{( in _2, out _2)\in Z(d_2):l_2\in in _2\}\) have the property that \(l_2\in in _2^{\prime }\) it follows that

    $$\begin{aligned} \chi _I\left( \left\{ ( in _2, out _2)\in Z(d_2):l_2\in in _2\right\} \right) \subseteq \varPhi (l_2). \end{aligned}$$

    By (1), we deduce that

    $$\begin{aligned} e\in \zeta _{I}(( in _1, out _1))\subseteq \varPhi (l_2). \end{aligned}$$

    Therefore

    $$\begin{aligned} e\in \zeta _{I}(( in _1, out _1))\cap \varPhi (l_2)\subseteq \varPhi (l_2) \end{aligned}$$

    and we know that

    $$\begin{aligned} \zeta _{I}(( in _1, out _1))\cap \varPhi (l_2)=\zeta _{I}(( in _1\cup \{l_2\}, out _1)). \end{aligned}$$

    Hence

    $$\begin{aligned} e\in \zeta _{I}(( in _1\cup \{l_2\}, out _1)). \end{aligned}$$

    By the definition of \(d_1^{\prime }\), the zone \(( in _1\cup \{l_2\}, out _1)\) is in \(Z(d_1^{\prime })\).

  2. 2.

    Case 2: \(( in _1, out _1)\in Z_{ OUT }\). We show that \(e\in ( in _1, out _1\cup \{l_2\})\). This case is similar to Case 1, noting that all zones, \(( in _2^{\prime }, out _2^{\prime })\), in \(\{( in _2, out _2)\in Z(d_2):l_2\in out _2\}\) have the property that \(l_2\in out _2^{\prime }\). From this, it follows that

    $$\begin{aligned} \chi _I\left( \{( in _2, out _2)\in Z(d_2):l_2\in out _2\}\right) \subseteq U{\setminus } \varPhi (l_2). \end{aligned}$$
  3. 3.

    Case 3: \(( in _1, out _1)\in Z_{ SPILT }\). Trivially,

    $$\begin{aligned} e\in \zeta _{I}(( in _1\cup \{l_2\}, out _1))\cup \zeta _{I}(( in _1, out _1\cup \{l_2\})) \end{aligned}$$

    and both the zones \(( in _1\cup \{l_2\}, out _1)\) and \(( in _1, out _1)\cup \{l_2\})\) are in \(Z(d_1^{\prime })\) and we are done.

Hence for every element, e, in U there exists a zone, \(( in _1^{\prime }, out _1^{\prime })\) in \(Z(d_1^{\prime })\) such that \(e\in \zeta _{I}(( in _1^{\prime }, out _1^{\prime }))\). Thus \(\chi _I\left( Z(d_1)\right) =U\), as required. That is, between them the zones of \(d_1^{\prime }\) represent the universal set.

We must now show that the condition for I to model \(d_1^{\prime }\) relating to spiders holds. For \(d_1\) there exists a function, \(\varSigma _{d_1}:S(d_1)\rightarrow U\), such that

  1. 1.

    \(\forall s\in S(d_1) (\varSigma _{d_1}\left( s\right) \in \chi _I\left( \eta _{d_1}(s)\right) )\), and

  2. 2.

    \(\forall z\in ShZ (d_1)(\zeta _{I}(z_n)\subseteq im(\varSigma _{d_1}))\).

Choose such a \(\varSigma _{d_1}\). We must show that a similar \(\varSigma _{d_1^{\prime }}:S(d_1^{\prime })\rightarrow U\) exists for \(d_1^{\prime }\). We define \(\varSigma _{d_1^{\prime }}=\varSigma _{d_1}\).

We now show that \(\varSigma _{d_1^{\prime }}\) ensures that the spiders map to elements in the sets represented by their habitats. Let \(s^{\prime }\) be a spider in \(S(d_1^{\prime })\). Then, by the definition of \(d_1^{\prime }\),

$$\begin{aligned} \eta _{d_1^{\prime }}(s^{\prime })= & {} \left\{ ( in \cup \{l_2\}, out ):( in , out )\in \left( Z_{IN}\cup Z_{SPLIT}\right) \cap \eta _{d_1}(s)\right\} \\&\cup \left\{ \left( in , out \cup \{l_2\}\right) :( in , out )\in \left( Z_{OUT}\cup Z_{SPLIT}\right) \cap \eta _{d_1}(s)\right\} . \end{aligned}$$

We know that \(\varSigma _{d_1}\left( s\right) \in \chi _I({\eta _{d_1}(s)})\). Choose the zone \(( in _1, out _1)\in \eta _{d_1}(s)\) such that

$$\begin{aligned} \varSigma _{d_1}\left( s\right) \in \zeta _{I}(( in _1, out _1)). \end{aligned}$$

Then \(( in _1, out _1)\not \in EZ (d_1)\) and \(( in _1, out _1)\not \subseteq _c EZ (d_2)\). This implies that either \(( in _1, out _1)\in Z_i\), \(( in _1, out _1)\in Z_o\), or \(( in _1, out _1)\in Z_s\). Similarly to previous parts of the proof, we make the following three deductions.

  1. 1.

    If \(( in _1, out _1)\in Z_i\) then

    $$\begin{aligned} \varSigma _{d_1}\left( s\right) \in \zeta _{I}(( in _1, out _1))=\zeta _{I}(( in _1\cup \{l_2\}, out _1)). \end{aligned}$$

    The zone \(( in _1\cup \{l_2\}, out _1)\) is in \(\eta _{d_1^{\prime }}(s)\) and, since \(\varSigma _{d_1}\left( s\right) =\varSigma _{d_1^{\prime }}\left( s\right) \), we have

    $$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s\right) \in \zeta _{I}(( in _1\cup \{l_2\}, out _1)). \end{aligned}$$
  2. 2.

    If \(( in _1, out _1)\in Z_o\) then

    $$\begin{aligned} \varSigma _{d_1}\left( s\right) \in \zeta _{I}(( in _1, out _1))=\zeta _{I}(( in _1, out _1\cup \{l_2\})). \end{aligned}$$

    The zone \(( in _1, out _1\cup \{l_2\})\) is in \(\eta _{d_1^{\prime }}(s)\) and, since \(\varSigma _{d_1}\left( s\right) =\varSigma _{d_1^{\prime }}\left( s\right) \), we have

    $$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s\right) \in \zeta _{I}(( in _1, out _1\cup \{l_2\})). \end{aligned}$$
  3. 3.

    If \(( in _1, out _1)\in Z_s\) then

    $$\begin{aligned} \varSigma _{d_1}\left( s\right) \in \zeta _{I}(( in _1, out _1))=\zeta _{I}(( in _1\cup \{l_2\}, out _1))\cup \zeta _{I}(( in _1, out _1\cup \{l_2\})). \end{aligned}$$

    The zones \(( in _1\cup \{l_2\}, out _1)\) and \(( in _1, out _1\cup \{l_2\})\) are both in \(\eta _{d_1^{\prime }}(s)\) and, since \(\varSigma _{d_1}\left( s\right) =\varSigma _{d_1^{\prime }}\left( s\right) \), we have

    $$\begin{aligned}\varSigma _{d_1^{\prime }}\left( s\right) \in \zeta _{I}(( in _1\cup \{l_2\}, out _1))\cup \zeta _{I}(( in _1, out _1\cup \{l_2\})). \end{aligned}$$

In all three cases, we have shown that \(\varSigma _{d_1^{\prime }}\left( s\right) \in \chi _I({\eta _{d_1^{\prime }}(s))}\), as required. That is, each spider in \(d_1^{\prime }\) represents an element in the set represented by its habitat in \(d_1^{\prime }\).

Finally, we consider the shaded zones. Let z be a shaded zone in \(d_1^{\prime }\), in which case

$$\begin{aligned} z\in & {} \left\{ ( in \cup \{l_2\}, out ):( in , out )\in (Z_{IN}\cup Z_{SPLIT})\cap ShZ (d_1)\right\} \\&\cup \left\{ ( in , out \cup \{l_2\}):( in , out )\in (Z_{OUT}\cup Z_{SPLIT})\cap ShZ (d_1)\right\} . \end{aligned}$$

Therefore, given that \(z=( in \cup \{l_2\}, out )\) or \(( in , out \cup \{l_2\}\}\) for some zone \(( in , out )\in ShZ (d_1)\), we know that

$$\begin{aligned} \zeta _{I}(z)\subseteq im(\varSigma _{d_1})=im\left( \varSigma _{d_1^{\prime }}\right) \end{aligned}$$

since

$$\begin{aligned} \zeta _{I}(z)\subseteq \zeta _{I}(( in , out )) \subseteq im(\varSigma _{d_1}). \end{aligned}$$

Therefore, for all shaded zones, z, in \(d_1^{\prime }\), \(\zeta _{I}(z) \subseteq im(\varSigma _{d_1^{\prime }})\) as required. That is, each shaded zone in \(d_1^{\prime }\) represents a set containing only elements represented by spiders. Hence I is a model for \(d_1^{\prime }\). Since, by assumption, I models \(d_2\) it follows that I models \(d_1^{\prime }\wedge d_2\). Thus, \(d_1\wedge d_2\vDash d_1^{\prime }\wedge d_2\). Hence \(d_1\wedge d_2\equiv d_1^{\prime }\wedge d_2\), that is, copyContour is sound.

We now formalise CopyShading and prove that it is sound. To formalise the rule, we need to identify spiders whose habitats have certain properties, given a diagram \(d_1\wedge d_2\). In particular, these spiders are in \(d_1\) and have a foot in a particular region, say \(r_1\). Moreover, all zones of the habitat outside of \(r_1\) represent empty sets, which can be deduced from \(d_2\).

Definition 17

Let \(d_1\) and \(d_2\) be unitary diagrams. We define

$$\begin{aligned} S(r_1,d_1,d_2)=\left\{ s\in S(d_1):\eta _{d_1}(s)\cap r_1\ne \emptyset \wedge \eta _{d_1}(s){\setminus } r_1\subseteq _c EZ (d_2)\right\} . \end{aligned}$$

1.3 Copy Shading

Let \(d_1\) and \(d_2\) be unitary diagrams with regions, \(r_1\) and \(r_2\) respectively, such that:

  1. 1.

    \(r_1\equiv _c r_2\),

  2. 2.

    \(r_1\) contains at least one non-shaded zone in \(d_1\), that is \(r_1{\setminus } ShZ (d_1)\ne \emptyset \),

  3. 3.

    \(r_2\) is entirely shaded in \(d_2\), that is, \(r_2\subseteq ShZ (d_2)\),

  4. 4.

    in \(d_1\), each spider, s, whose habitat includes a zone of \(r_1\), that is, \(\eta _{d_1}(s)\cap r_1\ne \emptyset \), is also in \(S(r_1,d_1,d_2)\),

  5. 5.

    in \(d_2\), each spider, s, whose habitat includes a zone of \(r_2\), that is, \(\eta _{d_2}(s)\cap r_2\ne \emptyset \), is also in \(S(r_2,d_2,d_1)\), and

  6. 6.

    there is a bijection, \(\sigma :S(r_1,d_1,d_2)\rightarrow S(r_2,d_2,d_1)\) such that for each spider, s, \(\eta _{d_1}(s)\equiv _c \eta _{d_2}(\sigma (s))\).

Let \(d_1^{\prime }\) be the diagram whose components are defined as follows:

  1. 1.

    the contour labels are \(L(d_1^{\prime })=L(d_1)\),

  2. 2.

    the zones are \(Z(d_1^{\prime })=Z(d_1)\),

  3. 3.

    the shaded zones are \( ShZ (d_1^{\prime })= ShZ (d_1)\cup r_1\),

  4. 4.

    the spiders are \(S(d_1^{\prime })=S(d_1)\),

  5. 5.

    the habitat of each spider, s, in \(S(d_1^{\prime })\) is \(\eta _{d_1^{\prime }}(s)=\eta _{d_1}(s)\).

The CopyShading rule can be applied to show \(d_1\wedge d_2\) is logically equivalent to \(d_1^{\prime }\wedge d_2\).

Theorem 7

CopyShading is sound.

Proof

Let \(d_1\), \(d_2\) and \(d_1^{\prime }\) be spider diagrams and let \(r_1\) and \(r_2\) be regions as in the definition of the CopyShading inference rule. We must show that \(d_1\wedge d_2\equiv d_1^{\prime }\wedge d_2^{\prime }\). Let \(I=(U,\varPhi )\) be an interpretation and suppose that I models \(d_1^{\prime }\wedge d_2\). Trivially, \(d_1^{\prime }\vDash d_1\), by Theorem 4, since \(d_1\) can be obtained from \(d_1^{\prime }\) by applying the RemoveShading inference rule (deleting the shading from the region \(r_1{\setminus } ShZ (d_1)\)). Therefore, \(d_1^{\prime }\wedge d_2 \vDash d_1\wedge d_2\).

For the converse, suppose that I models \(d_1\wedge d_2\). First, since \(Z(d_1^{\prime })=Z(d_1)\) and since I models \(d_1\), we immediately see that \(\chi _I({Z(d_1^{\prime })})=U,\) because \(\chi _I({Z(d_1)})=U\), as required. That is, between them the zones of \(d_1^{\prime }\) represent the universal set.

We must now show that the condition for I to model \(d_1^{\prime }\) relating to spiders holds. For \(d_1\) there exists a function, \(\varSigma _{d_1}:S(d_1)\rightarrow U\), such that

  1. 1.

    \(\forall s\in S(d_1) (\varSigma _{d_1}\left( s\right) \in \chi _I({\eta _{d_1}(s))})\), and

  2. 2.

    \(\forall z\in ShZ (d_1)(\zeta _{I}(z)\subseteq im(\varSigma _{d_1}))\).

Choose such a \(\varSigma _{d_1}\). Similarly, choose such a \(\varSigma _{d_2}\) for \(d_2\). We must show that a similar \(\varSigma _{d_1^{\prime }}:S(d_1^{\prime })\rightarrow U\) exists for \(d_1^{\prime }\). We define \(\varSigma _{d_1}:S(d_1^{\prime })\rightarrow U\) by

$$\begin{aligned}\varSigma _{d_1^{\prime }}\left( s\right) =\left\{ \begin{array}{ll} \varSigma _{d_1}\left( s\right) &{}\quad \hbox {if}\;s\in S(d_1){\setminus } S(r_1,d_1,d_2) \\ \varSigma _{d_2}\left( \sigma (s)\right) &{}\quad \hbox {otherwise.} \\ \end{array}\right. \end{aligned}$$

Our first obligation is to show that \(\varSigma _{d_1^{\prime }}\) is injective. Clearly, \(\varSigma _{d_1^{\prime }}|_{S(d_1){\setminus } S(r_1,d_1,d_2)}\) and \(\varSigma _{d_1^{\prime }}|_{S(r_1,d_1,d_2)}\) are both injective, since \(\varSigma _{d_1}\) and \(\varSigma _{d_2}\), respectively, are injective. Let \(s_1\in S(d_1){\setminus } S(r_1,d_1,d_2)\) and let \(s_2\in S(r_1,d_1,d_2)\) and suppose that \(\varSigma _{d_1^{\prime }}\left( s_1\right) =\varSigma _{d_1^{\prime }}\left( s_2\right) \). Since

$$\begin{aligned} {d_1^{\prime }}{s_1}=\varSigma _{d_1}\left( s_1\right) \in \chi _I\left( \eta _{d_1}(s_1)\right) =\chi _I\left( \eta _{d_1^{\prime }}(s_1)\right) \qquad \left( \text { because } \eta _{d_1}(s_1)=\eta _{d_1^{\prime }}(s_1)\right) \end{aligned}$$

and

$$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s_2\right)= & {} \varSigma _{d_2}\left( \sigma (s_2)\right) )\in \chi _I\left( \eta _{d_2}(\sigma (s_2))\right) = \chi _I\left( \eta _{d_1^{\prime }}(s_2)\right) \quad \qquad \nonumber \\&\times \left( because \eta _{d_2}(\sigma (s_2))\equiv _c\eta _{d_1^{\prime }}(s_2)\right) , \end{aligned}$$

we know that

$$\begin{aligned} \chi _I\left( \eta _{d_1^{\prime }}(s_1)\right) \cap \chi _I\left( \eta _{d_1^{\prime }}(s_2)\right) \ne \emptyset . \end{aligned}$$

Since distinct zones in any unitary diagram represent disjoint sets, it follows that

$$\begin{aligned} \eta _{d_1^{\prime }}(s_1)\cap \eta _{d_1^{\prime }}(s_2)\ne \emptyset , \end{aligned}$$

that is, the spiders \(s_1\) and \(s_2\) have a common zone, z say, in their habitats in \(d_1^{\prime }\). Moreover, \(s_2\in S(r_1,d_1,d_2)\) implies \(\chi _I({\eta _{d_1}(s_2){\setminus } r_1})=\emptyset \), by Lemma 2 which, in turn, implies that \(z\in r_1\). Therefore, since \(z\in \eta _{d_1^{\prime }}(s_1)=\eta _{d_1}(s_1)\), we see that \(s_1\) is a spider in \(d_1\) whose habitat includes a zone \(r_1\). Hence \(s_1\in S(r_1,d_1,d_2)\), contradicting our assumption that \(s_1\in S(d_1){\setminus } S(r_1,d_1,d_2)\). Hence \(\varSigma _{d_1^{\prime }}\left( s_1\right) \ne \varSigma _{d_1^{\prime }}\left( s_2\right) \), so \(\varSigma _{d_1^{\prime }}\) is injective.

We now show that \(\varSigma _{d_1^{\prime }}\) ensures that the spiders map to elements in the sets represented by their habitats. Let s be a spider in \(S(d_1^{\prime })\). Then, by the definition of \(d_1^{\prime }\), \(\eta _{d_1^{\prime }}(s)=\eta _{d}(s)\). If \(s\in S(d_1){\setminus } S(r_1,d_1,d_2)\) then \(\varSigma _{d_1^{\prime }}\left( s\right) =\varSigma _{d_1}\left( s\right) \in \chi _I\left( \eta _{d}(s)\right) =\chi _I({\eta _{d_1^{\prime }}(s)})\), as required. Otherwise, \(s\in S(r_1,d_1,d_2)\). In this case,

$$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s\right) =\varSigma _{d_2}\left( \sigma (s)\right) \in \chi _I\left( \eta _{d_2}\left( \sigma (s)\right) \right) . \end{aligned}$$

Since \(\eta _{d_2}(\sigma (s))\equiv _c \eta _{d_1}(s)=\eta _{d_1^{\prime }}(s)\), by Theorem 3 we deduce

$$\begin{aligned} \chi _I\left( \eta _{d_2}(\sigma (s))\right) = \chi _I\left( \eta _{d_1}(s)\right) =\chi _I\left( \eta _{d_1^{\prime }}(s)\right) . \end{aligned}$$

Hence

$$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s\right) \in \chi _I\left( \eta _{d_1^{\prime }}(s)\right) , \end{aligned}$$

as required. That is, each spider in \(d_1^{\prime }\) represents an element in the set represented by its habitat in \(d_1^{\prime }\).

Finally, we consider the shaded zones. Let z be a shaded zone in \(d_1^{\prime }\). There are two cases: \(z\in ShZ (d_1^{\prime }){\setminus } r_1\) and \(z\in ShZ (d_1^{\prime })\cap r_1\). If \(z\in ShZ (d_1^{\prime }){\setminus } r_1\) then \(z\in ShZ (d_1)\), so

$$\begin{aligned}\zeta _{I}(z)\subseteq im(\varSigma _{d_1})\quad \qquad (1) \end{aligned}$$

Let \(e\in \zeta _{I}(z)\). We show that e is represented by a spider in \(S(d_1)\) that is not in \(S(r_1,d_1,d_2)\). Choose the spider, s, in \(S(d_1)\) such that \(\varSigma _{d_1}\left( s\right) =e\) [such a spider exists by (1)]. Then \(\varSigma _{d_1}\left( s\right) \in \chi _I\left( \eta _{d_1}(s)\right) \) which implies that \(z\in \eta _{d_1}(s)\). Since \(z\not \in r_1\), there is a zone in the habitat of s that is not in \(r_1\). This implies that \(s\not \in S(r_1,d_1,d_2)\) because all of the spiders whose habitats includes a zone of \(r_1\) represent elements in \(\chi _I\left( r_1\right) \) (from the fact that for all \(s^{\prime }\in S(r_1,d_1,d_2)\), \(\chi _I\left( \eta _{d_1}(s){\setminus } r_1\right) =\emptyset \) in models for \(d_1\wedge d_2\)). Since e was an arbitrary element in \(\zeta _{I}(z)\) it follows that

$$\begin{aligned} \zeta _{I}(z)\subseteq im(\varSigma _{d_1}){\setminus } \left\{ \varSigma _{d_1}\left( s_1\right) :s_1\in S\left( r_1,d_1,d_2\right) \right\} \subseteq im\left( \varSigma _{d_1^{\prime }}\right) \end{aligned}$$

as required.

For the second case, \(z\in ShZ (d_1^{\prime })\cap r_1\). We show that \(\zeta _{I}(z)\subseteq im(\varSigma _{d_1^{\prime }})\cap im(\varSigma _{d_2})\). Let \(e\in \zeta _{I}(z)\). We show that e is represented by a spider in \(S(d_2)\) that is also in \(S(r_2,d_2,d_1)\). Choose the spider, s, in \(S(d_2)\) such that \(\varSigma _{d_2}\left( s\right) =e\); such a spider exists because \(\zeta _{I}(z)\subseteq \chi _I\left( r_1\right) = \chi _I\left( r_2\right) \subseteq im(\varSigma _{d_2})\), by Theorem 3, since \(r_1\equiv _c r_2\). In particular, we see that

$$\begin{aligned} \varSigma _{d_2}\left( s\right) \in \chi _I\left( r_2\right) . \end{aligned}$$

Furthermore, we know that

$$\begin{aligned} \varSigma _{d_2}\left( s\right) \in \chi _I\left( \eta _{d_2}(s)\right) \end{aligned}$$

implying that \(\chi _I\left( r_2\right) \cap \chi _I({\eta _{d_2}(s)})\ne \emptyset \). Since distinct zones in a unitary diagram represent disjoint sets, we deduce that \(r_2\cap \eta _{d_2}(s)\ne \emptyset \). That is, the habitat of s in \(d_2\) includes a zone of \(r_2\). Therefore, \(s\in S(r_2,d_2,d_1)\), as required. From this, since e was an arbitrary element in \(\zeta _{I}(z)\), it follows that

$$\begin{aligned} \zeta _{I}(z)\subseteq \{\varSigma _{d_2}\left( s_2\right) ):s_2\in S(r_2,d_2,d_1)\} \qquad (2) \end{aligned}$$

Since \(\sigma :S(r_1,d_2,d_1)\rightarrow S(r_2,d_2,d_1)\) is a bijection and, for all spiders, \(s\in S(r_1,d_2,d_1)\), \(\varSigma _{d_1^{\prime }}\left( s\right) =\varSigma _{d_2}\left( \sigma (s)\right) \) we then see that

$$\begin{aligned} \left\{ \varSigma _{d_2}\left( s_2\right) :s_2\in S\left( r_2,d_2,d_1\right) \right\} =im\left( \varSigma _{d_1^{\prime }}\right) \cap im(\varSigma _{d_2}). \end{aligned}$$

Hence, by (2), \(\zeta _{I}(z)\subseteq im(\varSigma _{d_1^{\prime }})\). Therefore, for all shaded zones, z, in \(d_1^{\prime }\), \(\zeta _{I}(z) \subseteq im(\varSigma _{d_1^{\prime }})\) as required. That is, each shaded zone in \(d_1^{\prime }\) represents a set containing only elements represented by spiders. Hence I is a model for \(d_1^{\prime }\). Since, by assumption, I models \(d_2\) it follows that I models \(d_1^{\prime }\wedge d_2\). Thus, \(d_1\wedge d_2\vDash d_1^{\prime }\wedge d_2\). Hence \(d_1\wedge d_2\equiv d_1^{\prime }\wedge d_2\), that is, CopyShading is sound.

Lastly, we formalise the CopySpider inference rule and establish its soundness.

1.4 Copy a Spider

Let \(d_1\) and \(d_2\) be unitary diagrams with regions \(r_1\) and \(r_2\) respectively, such that:

  1. 1.

    \(r_1\equiv _c r_2\),

  2. 2.

    \(r_1\) contains no shaded zones in \(d_1\), that is, \(r_1\cap ShZ (d_1)=\emptyset \),

  3. 3.

    in \(d_1\), each spider, s, whose habitat includes a zone of \(r_1\), that is, \(\eta _{d_1}(s)\cap r_1\ne \emptyset \), is also in \(S(r_1,d_1,d_2)\),

  4. 4.

    there exists an injective, but not surjective, function \(\sigma :S(r_1,d_1,d_2)\rightarrow S(r_2,d_2,d_1)\) such that

    1. 5.

      for each spider s, \(\eta _{d_1}(s)\equiv _c \eta _{d_2}(\sigma (s))\), and

    2. 6.

      there exists a spider, \(s_2\), that is in \(S(r_2,d_2,d_1)\) but is not mapped to by \(\sigma \), such that \(\eta _{d_2}(s_2)\subseteq _c r_1\).

Let \(s_1\) be a fresh spider. Let \(d_1^{\prime }\) be the diagram whose components are defined as follows:

  1. 1.

    the contour labels are \(L(d_1^{\prime })=L(d_1)\),

  2. 2.

    the zones are \(Z(d_1^{\prime })=Z(d_1)\),

  3. 3.

    the shaded zones are \( ShZ (d_1^{\prime })= ShZ (d_1)\),

  4. 4.

    the spiders are \(S(d_1^{\prime })=S(d_1)\cup \{s_1\}\),

  5. 5.

    the habitat of each spider, \(s^{\prime }\), in \(S(d_1^{\prime })\) is

    $$\begin{aligned} \eta _{d_1^{\prime }}\left( s^{\prime }\right) =\left\{ \begin{array}{ll} \eta _{d_1}\left( s^{\prime }\right) &{}\quad \hbox {if}\; s^{\prime }\in S(d_1) \\ r_1 &{}\quad \hbox {otherwise}. \\ \end{array}\right. \end{aligned}$$

    The CopySpider rule can be applied to show \(d_1\wedge d_2\) is logically equivalent to \(d_1^{\prime }\wedge d_2\).

Theorem 8

CopySpider is sound.

Proof

Let \(d_1\), \(d_2\) and \(d_1^{\prime }\) be spider diagrams, and let \(r_1\) and \(r_2\) be regions, and let \(s_1\) be a spider as in the definition of the CopySpider inference rule. We must show that \(d_1\wedge d_2\equiv d_1^{\prime }\wedge d_2^{\prime }\). Let \(I=(U,\varPhi )\) be an interpretation and suppose that I models \(d_1'\wedge d_2\). Trivially, \(d_1^{\prime }\vDash d_1\), by Theorem 4, since \(d_1\) can be obtained from \(d_1^{\prime }\) by applying the EraseSpider inference rule (deleting the spider \(s_1\), since its habitat is \(r_1\) and this region contains no shaded zones). Therefore, \(d_1^{\prime }\wedge d_2 \vDash d_1\wedge d_2\).

For the converse, suppose that I models \(d_1\wedge d_2\). First, since \(Z(d_1^{\prime })=Z(d_1)\) and since I models \(d_1\), we immediately see that \(\chi _I({Z(d_1^{\prime })})=U,\) because \(\chi _I\left( Z(d_1)\right) =U\), as required. That is, between them the zones of \(d_1^{\prime }\) represent the universal set.

We must now show that the condition for I to model \(d_1^{\prime }\) relating to spiders holds. For \(d_1\) there exists a function, \(\varSigma _{d_1}:S(d_1)\rightarrow U\), such that

  1. 1.

    \(\forall s\in S(d_1) (\varSigma _{d_1}\left( s\right) \in \chi _I\left( \eta _{d_1}(s)\right) )\), and

  2. 2.

    \(\forall z\in ShZ (d_1)(\zeta _{I}(z)\subseteq im(\varSigma _{d_1}))\).

Choose such a \(\varSigma _{d_1}\). Similarly, choose such a \(\varSigma _{d_2}\) for \(d_2\). We must show that a similar \(\varSigma _{d_1^{\prime }}:S(d_1^{\prime })\rightarrow U\) exists for \(d_1^{\prime }\). Now, since \(\sigma :S(r_1,d_1,d_2)\rightarrow S(r_2,d_2,d_1)\) ensures that there exists a spider, \(s_2\), that is in \(S(r_2,d_2,d_1)\) but is not mapped to by \(\sigma \) where \(\eta _{d_2}(s_2)\subseteq _c r_1\), we extend \(\sigma \) to \(\sigma :S(r_1,d_1',d_2)\rightarrow S(r_2,d_2,d_1')\) by defining \(\sigma (s_1)=s_2\) (noting that \(S(r_1,d_1^{\prime },d_2)=S(r_1,d_1^{\prime },d_2)\cup \{s_1\}\)). We define \(\varSigma _{d_1^{\prime }}:S(d_1^{\prime })\rightarrow U\) by

$$\begin{aligned}\varSigma _{d_1^{\prime }}\left( s\right) =\left\{ \begin{array}{ll} \varSigma _{d_1}\left( s\right) &{}\quad \hbox {if}\; s\in S(d_1){\setminus } S(r_1,d_1,d_2) \\ \varSigma _{d_2}\left( \sigma (s)\right) &{}\quad \hbox {otherwise.} \\ \end{array}\right. \end{aligned}$$

Our first obligation is to show that \(\varSigma _{d_1^{\prime }}\) is injective. Clearly, \(\varSigma _{d_1^{\prime }}|_{S(d_1){\setminus } S(r_1,d_1,d_2)}\) and \(\varSigma _{d_1^{\prime }}|_{S(r_1,d_1,d_2)\cup \{s_1\}}\) are both injective, since \(\varSigma _{d_1}\) and \(\varSigma _{d_2}\), respectively, are injective. Let \(s_1^{\prime }\in S(d_1){\setminus } S(r_1,d_1,d_2)\) and let \(s_2^{\prime }\in S(r_1,d_1,d_1)\cup \{s_1\}=S(r_1,d_1^{\prime },d_2)\) and suppose that \(\varSigma _{d_1^{\prime }}({s_1^{\prime }})=\varSigma _{d_1^{\prime }}({s_2^{\prime }})\). Since

$$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s_1^{\prime }\right) \in \chi _I\left( \eta _{d_1}\left( s_1^{\prime }\right) \right) =\chi _I\left( \eta _{d_1^{\prime }}\left( s_1^{\prime }\right) \right) \quad \qquad {\left( \hbox {because}\,\eta _{d_1}\left( s_1^{\prime }\right) =\eta _{d_1^{\prime }}\left( s_1^{\prime }\right) \right) } \end{aligned}$$

and

$$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s_2^{\prime }\right)= & {} \varSigma _{d_2}\left( s_2^{\prime }\right) \in \chi _I\left( \eta _{d_2}\left( \sigma \left( s_2^{\prime }\right) \right) \right) \subseteq \chi _I\left( \eta _{d_1^{\prime }}\left( s_2^{\prime }\right) \right) \quad \qquad \\&\times \left( \text {because } \eta _{d_2}\left( \sigma \left( s_2^{\prime }\right) \right) \subseteq _c\eta _{d_1^{\prime }}\left( s_2^{\prime }\right) \right) \end{aligned}$$

we know that

$$\begin{aligned} \chi _I\left( \eta _{d_1^{\prime }}\left( s_1^{\prime }\right) \right) \cap \chi _I\left( \eta _{d_1^{\prime }}\left( s_2^{\prime }\right) \right) \ne \emptyset . \end{aligned}$$

Since distinct zones in any unitary diagram represent disjoint sets, it follows that

$$\begin{aligned} \eta _{d_1^{\prime }}\left( s_1^{\prime }\right) )\cap \eta _{d_1^{\prime }}\left( s_2^{\prime }\right) \ne \emptyset , \end{aligned}$$

that is, the spiders \(s_1^{\prime }\) and \(s_2^{\prime }\) have a common zone, z say, in their habitats in \(d_1^{\prime }\) that represents a non-empty set. By definition, the only zones of \(\eta _{d_1^{\prime }}(s_2^{\prime })\) that represent non-empty sets are in \(r_1\). But then \(s_1^{\prime }\) would be a spider in \(d_1\) that includes a zone, z, of \(r_1\) but is not in \(S(r_1,d_2)\), which is a contradiction. Hence \(\varSigma _{d_1^{\prime }}({s_1^{\prime }})\ne \varSigma _{d_1^{\prime }}({s_2^{\prime }})\), so \(\varSigma _{d_1^{\prime }}\) is injective.

We now show that \(\varSigma _{d_1^{\prime }}\) ensures that the spiders map to elements in the sets represented by their habitats. Let \(s^{\prime }\) be a spider in \(S(d_1^{\prime })\). Then, by the definition of \(d_1^{\prime }\), \(\eta _{d_1^{\prime }}(s^{\prime })=\eta _{d}(s^{\prime })\) or, when \(s^{\prime }=s_1\), \(\eta _{d_1^{\prime }}(s^{\prime })=r_1\) [in this latter case, \(s^{\prime }\in S(r_1,d_1^{\prime },d_2)\)]. If \(s^{\prime }\in S(d_1){\setminus } S(r_1,d_1,d_2)\) then \(\varSigma _{d_1^{\prime }}(s^{\prime })=\varSigma _{d_1^{\prime }}(s^{\prime })\in \chi _I({\eta _{d_1}(s^{\prime }))}=\chi _I({\eta _{d_1^{\prime }}(s^{\prime })})\), as required. Otherwise, \(s^{\prime }\in S(r_1,d_1,d_2)\cup \{s_1\}=S(r_1,d_1^{\prime },d_2)\). In this case,

$$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s^{\prime }\right) =\varSigma _{d_2}\left( s^{\prime }\right) \in \chi _I\left( \eta _{d_2}\left( \sigma \left( s^{\prime }\right) \right) \right) . \end{aligned}$$

Since, when \(s^{\prime }\ne s_1\), \(\eta _{d_2}(\sigma (s^{\prime }))\equiv _c \eta _{d_1}(s^{\prime })=\eta _{d_1^{\prime }}(s^{\prime })\) and, when \(s^{\prime }=s_1\), \(\eta _{d_2}(\sigma (s^{\prime }))\subseteq _c r_1=\eta _{d_1^{\prime }}(s^{\prime })\), by Theorem 3 we deduce

$$\begin{aligned} \chi _I\left( \eta _{d_2}\left( \sigma \left( s^{\prime }\right) \right) \right) \subseteq \chi _I\left( \eta _{d_1^{\prime }}\left( s^{\prime }\right) \right) . \end{aligned}$$

Hence

$$\begin{aligned} \varSigma _{d_1^{\prime }}\left( s^{\prime }\right) \in \chi _I\left( \eta _{d_1^{\prime }}(s)\right) , \end{aligned}$$

as required. That is, each spider in \(d_1^{\prime }\) represents an element in the set represented by its habitat in \(d_1^{\prime }\).

Finally, we consider the shaded zones. Let z be a shaded zone in \(d_1^{\prime }\), in which case z is shaded in \(d_1\). Let \(e\in \zeta _{I}(z)\). We show that there is a spider, s, in \(d_1^{\prime }\) that maps to e. Now, since z is shaded, \(z\not \in r_1\), by the definition of the inference rule. Then no spider in \(d_1\) whose habitat includes a zone of \(r_1\) maps to e. This is because any spider, \(s^{\prime }\), whose habitat includes a zone of \(r_1\), is in \(S(r_1,d_1,d_2)\) and, thus, all zones in \(\eta _{d_1}(s){\setminus } r_1\) represent empty sets. Therefore, any spider that maps to e cannot include zones of \(r_1\) in its habitat. Since z is shaded, there exists a spider s that maps to e. Therefore, s is not in \(S(r_1,d_1,d_2)\), so \(\varSigma _{d_1^{\prime }}\left( s\right) =\varSigma _{d_1}\left( s\right) \). Since e is an arbitrary element in \(\zeta _{I}(z)\) we deduce that \(\zeta _{I}(z)\subseteq im(\varSigma _{d_1^{\prime }})\). That is, each shaded zone in \(d_1^{\prime }\) represents a set containing only elements represented by spiders. Hence I is a model for \(d_1^{\prime }\). Since, by assumption, I models \(d_2\) it follows that I models \(d_1^{\prime }\wedge d_2\). Thus, \(d_1\wedge d_2\vDash d_1^{\prime }\wedge d_2\). Hence \(d_1\wedge d_2\equiv d_1^{\prime }\wedge d_2\), so CopySpider is sound.

Appendix 3: Proof of Completeness

We now establish that the spider diagram logic, extended to include implication, bi-implication and negation, is complete. To achieve completeness, we added new logical rules for these connectives along with NegationElimination; the other new rules we introduced for constructing more readable proofs and whose soundness we just proved in “Appendix 2” are not necessary for completeness. To prove completeness, we extend the proof given for spider diagrams in Howse et al. (2005), which relies on the absence of \(\longrightarrow \), \(\longleftrightarrow \) and \(\lnot \). If we can establish that every spider diagram is syntactically equivalent to a diagram with no occurrences of \(\longrightarrow \), \(\longleftrightarrow \) and \(\lnot \) then we have established completeness for the extended spider diagram system implemented in Speedith.

It is trivial to eliminate \(\longrightarrow \) and \(\longleftrightarrow \) using standard logical inference rules. We now show how to eliminate negation. If we have a negated unitary diagram where all spiders have single feet then it is possible to eliminate the negation using three rules: IntroShadedZone, Combining and NegationElimination. The NegationElimination inference rule can only be applied to diagrams with information about at most one zone. Thus, it is useful to define this property:

Definition 18

Let d be a unitary diagram where all spiders have a single foot. Then d is in zone-minimal form if it has no missing zones and all zones except, perhaps a single zone, do not contain any spiders or shading.

Lemma 4

Let d be a unitary diagram with zone set \(Z=\{z_1,\ldots ,z_n\}\) such that all spiders have single feet. Then d is syntactically equivalent to

$$\begin{aligned} \bigwedge \limits _{1\le i\le n}d_i \end{aligned}$$

where \(d_i\) is zone-minimal and has

  1. 1.

    zone set Z, together with any missing zones,

  2. 2.

    the same number of spiders in \(z_i\) as in d,

  3. 3.

    shading in \(z_i\), provided \(z_i\) was shaded in d,

  4. 4.

    no other spiders or shading.

Proof

We start by adding all missing zones to d, using IntroShadedZone. Noting that the Combining rule is an equivalence, it can be applied to turn d into \(\bigwedge \nolimits _{1\le i\le n}d_i\), as follows. First, turn d into \(d_1\wedge d^{\prime }\), where \(d^{\prime }\) is a copy of d except that it contains no spiders or shading in \(z_1\). Repeat this process, iterating through all of the zones, to give \(\bigwedge \nolimits _{1\le i\le n}d_i\). Thus, d is syntactically equivalent to \(\bigwedge \nolimits _{1\le i\le n}d_i\).

Theorem 9

Let d be a spider diagram. Then there exists a syntactically equivalent spider diagram, \(d^{\prime }\), where \(d^{\prime }\) does not contain any of \(\longrightarrow \), \(\longleftrightarrow \), and \(\lnot \).

Proof

We begin by using the logical inference rules to eliminate \(\longrightarrow \), \(\longleftrightarrow \). Next, apply SplitSpider until all spiders have single feet. Then replace each non-\(\perp \) unitary part of the resulting diagram with \(\bigwedge \nolimits _{1\le i\le n}d_i\) as in Lemma 4. To eliminate negation, the next step is to push all negation symbols to the leaves, using standard logical inference rules. Since all non-\(\perp \) unitary parts are zone-minimal and all spiders have single feet, the NegationElimination rule can be applied to eliminate all negation symbols. The resulting diagram does not contain any of \(\longrightarrow \), \(\longleftrightarrow \), and \(\lnot \). Since all rules used are equivalences, this completes the proof.

Since all diagrams can be reduced to syntactically equivalent diagrams without using any of \(\longrightarrow \), \(\longleftrightarrow \), and \(\lnot \), we can then use the completeness theorem from Howse et al. (2005) to establish completeness for this extended system.

Theorem 10

(Completeness) Let \(d_1\) and \(d_2\) be spider diagrams such that \(d_1\vDash d_2\). Then \(d_1\vdash d_2\).

Proof

Suppose that \(d_1\vDash d_2\). By Theorem 9, there exists \(d_1^{\prime }\) and \(d_2^{\prime }\) that are syntactically equivalent to \(d_1\) and \(d_2\) respectively, where \(d_1^{\prime }\) and \(d_2^{\prime }\) do not contain any of \(\longrightarrow \), \(\longleftrightarrow \), and \(\lnot \). Since the spider diagram logic in Howse et al. (2005) did not include \(\longrightarrow \), \(\longleftrightarrow \), and \(\lnot \) and is complete, we have established completeness for our extended spider diagram logic.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Urbas, M., Jamnik, M. & Stapleton, G. Speedith: A Reasoner for Spider Diagrams. J of Log Lang and Inf 24, 487–540 (2015). https://doi.org/10.1007/s10849-015-9229-0

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10849-015-9229-0

Keywords

Navigation