*1.2. Content and Structure of the Paper*

Section 2 recapitulates some basic concepts and corresponding notational conventions. We include a short discussion concerning foundations and outline how the tuple notation is used in this paper to represent (partial) finite maps.

In Section 3, we present a universal mechanism to define first-order statements and their semantics in arbitrary categories. We show that any choice of the seven parameters we are going to introduce (see Figure 1) gives us a corresponding Institution of Statements at hand. The concept of institution [2,31] is a very simple one and lives on the same abstraction level as categories and functors. We utilize institutions as a very convenient guideline to present logical formalisms in a uniform and well-organized way. The satisfaction condition is the only more complicated thing and simply tells us that we designed syntax and semantics compatible in the way that the translation of sentences corresponds exactly to model extensions (see [32–34]). Thus, validating the satisfaction condition is a kind of sanity check for the design of our formalism. At the beginning of the section, we introduce the five running examples we have chosen to illustrate and validate our definitions and constructions.

At the present stage, Institutions of Statements do not incorporate operations since we have not found yet a way to define operations in arbitrary categories. To close, nevertheless, the circle to the ideas and motivations discussed in the Introduction Section 1.1.1, we recapitulate in Section 4 the traditional concepts of operations on sets and many-sorted equations. We show that the procedure we developed in Section 3 to construct Institutions of Statements enables us also to construct corresponding Institutions of Equational Statements. Substitutions play a central role in Universal Algebra, and this section may also provide some hints and guidelines for the future development of a more abstract and general account of substitutions in Logics of Statements.

Any institution gives us a corresponding category of presentations and an extension of the model functor of the institution to the category of presentations at hand [2,31]. In Section 5, we outline this construction for Institutions of Statements and Institutions of Equations, respectively. To distinguish presentations for Institutions of Statements (Equations) from presentations in general, we will use the term sketch for these specific presentations. The general theory of institutions [2,31] also provides us with a standard notion of morphism between sketches (presentations). Those morphisms are of minor importance in this paper. We introduce and investigate, in addition, sketch arrows and sketch implications as well as the relationships between these three concepts. As a pendant to elementary diagrams in traditional first-order logic, we define sketch encodings of semantic structures and will give a kind of positive answer to Question 4 (p. 39): Is there any justification to ignore completely the concept of semantic structure (model)?

To describe the syntactic structure of software models and, more generally, the structure of sketch encodings of semantic structures, we introduce and study in Section 6 arbitrary first-order sketch conditions and sketch constraints, thereby unifying and generalizing the different concepts of graph conditions and graph constraints in the area of Graph Transformations. We outline that we can, analogous to the hierarchy of generalized sketches in [15], also establish a conceptual hierarchy of sketches and sketch constraints. Moreover, we present some vital observations, insights, concepts and ideas to establish a basis for the future development of deduction calculi for Institutions of Statements.

We conclude the paper with a discussion of the results, findings and shortcomings of the paper and highlight future research directions.

The only categorical concepts we actually use in this paper are category, functor, product, functor category and slice category, and a basic understanding of these concepts is recommended. Looking up the definition of institutions may not be necessary but helpful.

#### **2. Notations and Preliminaries**

C*Obj* denotes the collection of objects of a category C and C*Mor* the collection of morphisms of C, respectively. C(*a*, *b*) is the collection of all morphisms from object *a* to object

*b* in C. We use the diagrammatic notation *f* ; *g* : *a* → *c* for the composition of morphisms *f* : *a* → *b* and *g* : *b* → *c* in C. C D states that category C is a subcategory of category D. A category C is *small* if the collection C*Mor*, and thus also the collection C*Obj*, is a set. Cat is the category of all small categories. Set denotes the category of all sets and all (total) maps, while Par is the category of all sets and partial maps. We consider Set as a subcategory of Par. Cat, Set and Par are not small!

A (directed multi) graph *G* = (*GV*, *GE*,*scG*, *tgG*) is given by a collection *GV* of vertices, a collection *GE* of edges and maps *sc<sup>G</sup>* : *GE* <sup>→</sup> *GV*, *tg<sup>G</sup>* : *GE* <sup>→</sup> *GV* assigning to each edge its source and target vertex, respectively. *gr*(C) denotes the underlying graph of a category C, i.e., we have *gr*(C)*<sup>V</sup>* := C*Obj* and *gr*(C)*<sup>E</sup>* := C*Mor*. A graph *G* is small if *GV* and *GE* are sets. A homomorphism *ϕ* : *G* → *H* between two graphs is given by a pair of maps *<sup>ϕ</sup><sup>V</sup>* : *GV* <sup>→</sup> *HV*, *<sup>ϕ</sup><sup>E</sup>* : *GE* <sup>→</sup> *HE* such that *scG*; *<sup>ϕ</sup><sup>V</sup>* <sup>=</sup> *<sup>ϕ</sup>E*;*sc<sup>H</sup>* and *tgG*; *<sup>ϕ</sup><sup>V</sup>* <sup>=</sup> *<sup>ϕ</sup>E*; *tgH*. Graph is the category of all small graphs and all graph homomorphims between them.

The category comprising as well finite and small graphs as the underlying graphs of categories like Cat, Set, Par and Graph, for example, is denoted by GRAPH, while SET is the category containing all the corresponding collections of vertices and edges, respectively. Correspondingly, we denote the category with all small categories and categories like Cat, Set, Par and Graph as objects by CAT.

**Remark 1** (Foundations)**.** *We rely on Tarski–Grothendieck set theory, which is based on the concept of Grothendieck universes. That is, we allow ourselves to work, in principal, with open hierarchies of sets, graphs and categories, respectively. In contrast, many expositions of set theory and category theory, respectively, rely on a strict two level approach. We cite from [35], page 5:*

*Is* CAT *a category in itself? Our answer here is to treat* CAT *as a regulative idea; which is an inevitable way of thinking about categories and functors, but not a strictly legitimate entity. (Compare the self, the universe, and God in Kant "Kritik der Reinen Vernunft".)*

*Here, we work with a three-level hierarchy. That is, we also consider* SET*,* GRAPH *and* CAT *as legitimate entities but take the level above as a "regulative level".*

*In view of* CAT *the category* Cat *appears in two different roles: First,* Cat *is an object in* CAT*. Second,* Cat *is a subcategory of* CAT*. We consider the inclusion functor* Cat CAT *as an anonymous* coercion functor *which embeds any object* C *in* Cat *into the bigger context of* CAT *where we can even consider functors between* C *and* Cat*, for example. (We use the term coercion analogous to programming languages where coercion describes the implicit conversion of a value into another equivalent value of a different data type). If necessary, we will indicate in what role a small category* C *appears in a certain situation in* CAT*, namely as an object in* Cat ∈ CAT*Obj (the default case) or as an element in* CAT*Obj, respectively.*

*Analogously, we assume corresponding anonymous coercion functors* Set SET *and* Graph GRAPH*, respectively. Note that the isomorphisms between small categories* C *and the corresponding objects in* CAT *as well as the anonymous coercion functors are not living in* CAT*! They are located on our third regulative level. Finally, we assume also implicit coercion from the categories* SET*,* GRAPH *and* CAT*, respectively, to the regulative level.*

*In other words, we comply with the following principles: (1) Any item on a certain level of the hierarchy can be used at any level above but it can not be used at any level below the level where it has been declared or constructed. (2) Located on a certain level of the hierarchy, we can see, declare and construct items on this level and on all levels below. (3) We are, however, not allowed to push an item to a lower level! Instead, we have to declare or construct a "new" item on the lower level and establish an isomorphism between the given item and the new item. The lowest level, where the isomorphism could be established, is the level of the given item but sometimes we will be only able to establish the isomorphism on an even higher level.*

To achieve Objective 3 (p. 6), we have to pay a small price. In addition to the conventional interpretation of an *n*-tuple (*a*1, ... , *an*) as a "list of values of length *n*", we will also work with a more unconventional interpretation. We interpret an *n*-tuple **a** = (*a*1, ... , *an*) with *n* ≥ 1 and *a*1, ... , *an* ∈ *A* as a convenient shorthand notation for an "indexed array" of

length *n*, i.e., for a set of assignments {1 → *a*1, ... , *n* → *an*} representing a map **a** : [*n*] → *A* with [*n*] := {1, ... , *n*} and **a**(*i*) = *ai*. That is, the numbers in [*n*] indicate the corresponding *position* in the tuple. The empty tuple () represents, in such a way, the only map from [0] := ∅ into *A*.

Given an [*n*]-indexed family *A*1, ... , *An*, *n* ≥ 1 of sets, i.e., a map *A* : [*n*] → Set*Obj*, we denote the set of all maps **<sup>a</sup>** : [*n*] → *<sup>i</sup>*∈[*n*] *Ai* with **<sup>a</sup>**(*i*) <sup>∈</sup> *Ai* for all *<sup>i</sup>* <sup>∈</sup> [*n*] by *<sup>A</sup>*<sup>1</sup> <sup>⊗</sup> ... <sup>⊗</sup> *An*, *<sup>i</sup>*∈[*n*] *Ai* or simply *<sup>A</sup>*, respectively. Relying on the assumption that [*n*] is (implicitly) equipped with the total irreflexive order 1 < 2 < ... < *n*, we can still use the traditional tuple notation to represent those maps, as discussed in the last paragraph. The traditional Cartesian product *<sup>A</sup>*<sup>1</sup> × ... × *An* and *<sup>A</sup>* are isomorphic and both give us a categorical product of the family *A*1, ... , *An* of objects in Set at hand. If necessary, we will use the term traditional tuple to indicate the traditional interpretation of a tuple as a simple "list of values".

To describe, for example, the concept of a row in Relational Databases (see Section 3.1.5), we also take the step from indexed arrays to "associative arrays".

Instead of the standard sets [*n*] of indexes, we consider arbitrary finite sets *I* of indexes (identifiers, names) with *n* elements. For an *I*-indexed set *A* = (*A*(*i*) | *i* ∈ *I*), i.e., a map *<sup>A</sup>* : *<sup>I</sup>* → Set*Obj*, we denote by *<sup>i</sup>*∈*<sup>I</sup> <sup>A</sup>*(*i*), or simply *<sup>A</sup>*, the set of all maps **<sup>a</sup>** : *<sup>I</sup>* <sup>→</sup> *<sup>i</sup>*∈*<sup>I</sup> <sup>A</sup>*(*i*) with **a**(*i*) ∈ *A*(*i*) for all *i* ∈ *I*. *A* is a categorical product of the *I*-indexed family *A* of objects in Set where for any *i* ∈ *I* the corresponding *projection map π<sup>i</sup>* : *<sup>A</sup>* → *<sup>A</sup>*(*i*) is simply defined by *<sup>π</sup>i*(**a**) := **<sup>a</sup>**(*i*) for all **<sup>a</sup>** ∈ *<sup>A</sup>*.

Each element **a** in *A* can be represented by a corresponding *associative array*, i.e., by the set {*i* → **a**(*i*) | *i* ∈ *I*} of assignments. To be able, however, to utilize the tuple notation to represent the elements in *A*, we have to equip the set *I*, explicitly, with a fixed (!) total order *i*<sup>1</sup> < *i*<sup>2</sup> < ... < *in*. Under this assumption, we can then represent each **a** in *A* by the tuple (*a*1,..., *an*) with *aj* = **a**(*ij*) for all 1 ≤ *j* ≤ *n*.

In practice, it is often more convenient to work with interpretation categories instead of functor categories. An interpretation of a graph *G* in a category C is a graph homomorphism *ϕ* from *G* to *gr*(C) denoted by *ϕ* : *G* → C. A natural transformation *μ* : *ϕ* ⇒ *ψ* between two interpretations *ϕ* : *G* → C and *ψ* : *G* → C is a family *μ<sup>v</sup>* : *ϕV*(*v*) → *ψV*(*v*), *v* ∈ *GV* of morphism in C such that *ϕE*(*f*); *μ<sup>u</sup>* = *μv*; *ψE*(*f*) for all edges *f* : *v* → *u* in *G*. All interpretations of *G* in C and all natural transformations between them constitute the interpretation category [*G* → C] with composition–the vertical composition of natural transformations. (In [10], interpretations *ϕ* : *G* → C are called "models of *G* in C", and the notation **Mod**(*G*, C) is used instead of [*G* → C]. For our purposes, the more neutral and general term "interpretation" is more convenient, and we do not want to overload the term "model" too heavily). For convenience and uniformity reasons, we will often consider a set *A* as a graph without edges and use the interpretation category [*A* → C] to represent all maps from *A* into C*Obj*. Moreover, we will also use the more compact notations C*<sup>G</sup>* and C*<sup>A</sup>* instead of [*G* → C] or [*A* → C], respectively.
