Some Remarks on
Programming Existential Graphs
one can make exact experiments upon uniform diagrams; and when one does so, one must keep a bright outlook for unintended and unexpected changes thereby brought about in the relations of different significant parts of the diagram to one another. Such operations upon diagrams, whether external or imaginary, take the place of the experiments upon real things that are performed in chemical and physical research . . . experiments upon diagrams are questions put to the nature of the relations concerned. (4.530)
Thus Peirce in the 1906 Prolegomena to an Apology for Pragmaticism. From this point of view, the diagrams we use in mathematical reasoning are far more than means to expose and illustrate our thought; they become part of the field of reasoning itself. And computer technology offers us a way of extending that field dramatically and dynamically.
It is with this in mind that I enter into a study of the Beta System of Existential Graphs employing contemporary programming tools. My work is being conducted within Microsoft Visual Studio NET 2003, specifically, in Visual Basic; however, there is no reason why it could not be done in other programming systems of similar power. I will comment on details of the work as we progress.
My work also makes use of XML technology for file and other purposes, including using SVG for visual renderings of the Graphs.
This work fits very well the Object Oriented nature of contemporary programming. An Existential Graph is an object—actually, a propositional object, a proposition—it has properties and operations which may be represented within a programming Class. Within Visual Studio, the Application developed is a Windows Forms Application, and each Existential Graph will be a Windows Forms Control. The basic such Object is a Class called ProtoGraph; this is an Abstract Class which is inherited by all Existential Graphs. Under ProtoGraph are two descendent Abstract Classes, ContainerGraph and AtomicGraph. The Graphs which may be instantiated are descendents of these, as in the following diagram
ProtoGraph 

ContainerGraph 

AtomicGraph 

SheetOfAssertion 
Cut 
ConjunctiveEG 

Spot 
Dot 



Table 1 
Actually, there is one further Class descended from ProtoGraph; this is Van, which is a “ghostly” temporary ProtoGraph which is used as a “vehicle” in the sizing and movement of Graphs, and enters in no permanent way in the economy of graph construction.
ContainerGraphs, as you might imagine, can contain other EG as subcontrols; this models the nesting of Peirce’s Graphs (and the propositions of which they are representations). The AtomicGraphs can only end branches in the nestingtree. The nonabstract classes (with the exception of ConjunctiveEG) reflect the functions and properties of graphical objects introduced by Peirce. Peirce has no explicit graph paralleling ConjunctiveEG, but he does employ the concept, since a group of Graphs standing on the same area may be dealt with as itself a Graph. The ConjunctiveEG permits Reiterations and other operations involving a set of Graphs. This is less important in Alpha, where any such operation can be handled piecemeal; in Beta, however, the situation is complicated especially by the existence of another element, the Ligature, which, as we shall see, makes if necessary to treat certain sets of Graphs as a unit.
As with Peirce, the SheetOfAssertion is the basic field of operations, the “surface” upon which all graphs are “scribed.” I present the SheetOfAssertion currently in two manners; one is in a setup which supports operations corresponding to the Beta Rules of Transformation as laid out by Peirce (and thus permits derivation of Graphs corresponding to valid schemas of Quantification Theory with Identity). The other mode of use of the SheetOfAssertion permits unrestricted operations upon Graphs, and so is employed in experimentation as well as in composing graphs for insertion (on “oddly enclosed” or “Verso” areas of the firstmentioned restricted manner of constructing Graphs. Figures 1 and 2 are examples of Forms employing these modes of presentation.

Figure 1: BetaDerivation Format 
Note that Figure 1 contains two distinct areas separated by a vertical line. This is an adaptation of Peirce’s notion of the Sheet of Assertion (SA). The terminology which he developed over his years of working with Existential Graphs speaks of the SA as having two sides, a “Recto” and a “Verso,” as here in the 1906 Prolegomena to an Apology for Pragmaticism:
Should the Graphist desire to negative a Graph, he must scribe it on the verso, and then, before delivery to the Interpreter, must make an incision, called a Cut, through the Sheet all the way round the Graphinstance to be denied, and must then turn over the excised piece, so as to expose its rougher surface carrying the negatived Graphinstance. This reversal of the piece is to be conceived to be an inseparable part of the operation of making a Cut (4.556).
I note that the text labels in the upperleft of the SheetOfAssertion Windows in Figures 1 and 2 are for diagnostic purposes, and may be turned on or off by the user. Also, features of the Forms containing the Graphs (such as Menus, Toolbars, etc.) are subject to change.

Figure 2: Unrestricted Format 
The Right side of the Graph in Figure 1 is the Recto of the SA; the left side represents the Verso; note that the basic access to the Verso that Peirce mentions is via the “Cut,” which, as our first Table indicates, is also the name of one of our graphical objects. These objects have a Boolean Property called “IsRecto”; the areas of Figure 1 in question are both of type SheetOfAssertion, with the right one having IsRecto = True, and the left having IsRecto = False (and so being a Verso). As it turns out, a Verso SA on these graphs may be used to set out Hypotheses which may be used in the construction of arguments from hypotheses. The SheetOfAssertion on the left is the more inclusive, containing the other SheetOfAssertion (and, ancestrally, all graphs which may be scribed on either SheetOfAssertion).
The “Scratchpad” SA of Figure 2 is a Recto surface. The IsRecto Property of the other Graphs in Table 1 depends on their placement. A Cut takes the reverse of the IsRecto of the Graph containing it, as suggested by Peirce in the above quote (The other descendents of ProtoGraph—ConjunctiveEG, Spot, and Dot—will take the IsRecto value of the Graph immediately containing them). I note that in earlier work on EG, Peirce often spoke of oddness or evenness of enclosure (by Cuts); an oddly enclosed area is what we are calling a Verso, while an area enclosed by an even number (including zero) of Cuts is a Recto—an additional Verso case for us is the case in which the Verso of the Sheet of Assertion is shown. When the Existential Graphs is taken as a Logic, each of the ProtoGraphs is a statement. A Spot is, as we have noted, an AtomicGraph and corresponds to the Predicate of Quantification Theory. As such it will commonly be associated with a text String, commonly a letter of the alphabet (which in our system is called the VariableName of the Spot). It will have zero or more “Places,” which in ordinary Logic may be thought of as blanks to be filled by variables for individuals in our Universe of Discourse. In EG, Peirce referred to the places of a Spot as “Hooks,” by which the quantified variables of the system would attach to the Spot. Thus the Spot for
“__ is Red”
would have 1 Hook, and that for
“__ loves __”
would have 2.
Here we quickly mention two further Objects of the System of Existential Graphs which will be represented in code (each by a Class, in fact) and discussed at greater length later on. One is the justintroduced Hook, which is not by itself an Existential Graph but which occurs as part of Spots (as just noted) as well as of Dots. The other object is the Ligature; Ligatures are also discussed by Peirce:
A collection composed of any line of identity together with all others that are connected with it directly or through still others is termed a ligature. Thus ligatures often cross cuts, and, in that case, are not graphs (4.407).
The “Line of Identity” is thought of as a set of contiguous Dots. As noted, a Dot is a Graph, a statement essentially that something exists. The contiguity of the parts of a Line of Identity is a claim that the same something is represented by all its points. Objects in the class of Dots include what Peirce called dots as well as their graphical extensions into Lines of Identity; although “Dot” formally is the name of this Class of objects, less formally we may think of “Dot” and “Line of Identity” as synonymous. Most commonly, these objects appear as lines of some shape and orientation. And some Color. A key unifying identifier for Dots in our system is color. Interestingly, this constitutes a tie back to the original manuscripts of Peirce which is essentially lost in most reproductions of his graphs through the years that have intervened; Peirce made considerable use of color in his manuscript work (see here for example), and this is not restricted to the “Tinctured Existential Graphs” of the 1906 Prolegomena.