Next Article in Journal
A Comparative Study of Several Classical, Discrete Differential and Isogeometric Methods for Solving Poisson’s Equation on the Disk
Previous Article in Journal
Classical Probability and Quantum Outcomes

Axioms 2014, 3(2), 260-279; https://doi.org/10.3390/axioms3020260

Article
Modalities for an Allegorical Conceptual Data Model
Department of Computer Science, Faculty of Physics and Applied Informatics,University of Łódź ul. Pomorska nr 149/153, 90-236 Łódź, Poland
*
Author to whom correspondence should be addressed.
Received: 27 February 2014; in revised form: 12 May 2014 / Accepted: 13 May 2014 / Published: 29 May 2014

Abstract

:
Allegories are enriched categories generalizing a category of sets and binary relations. In this paper, we extend a new, recently-introduced conceptual data model based on allegories by adding support for modal operators and developing a modal interpretation of the model in any allegory satisfying certain additional (but natural) axioms. The possibility of using different allegories allows us to transparently use alternative logical frameworks, such as fuzzy relations. Mathematically, our work demonstrates how to enrich with modal operators and to give a many world semantics to an abstract algebraic logic framework. We also give some examples of applications of the modal extension.
Keywords:
allegories; data modeling; modal logic
Classification:
MSC 18B10; 03B45; 18D20; 03B52; 68P15; 03B70

1. Introduction

Allegories, introduced by Freyd and Scedrov [1], are enriched categories modeled upon the category of sets and binary relations, R , in such a way that allows for other realizations of allegorical axioms than R , while still preserving many of the useful R properties. This is similar to the way in which toposes generalize the category, S et , of sets. For a logician, allegories can be seen as the generalizations (with some axioms relaxed) of the relation algebra [2]. Because of the deep relationship between relational databases and relational algebra and also a lively research program of using category theory for conceptual modeling (see e.g., [3,4,5,6,7,8,9,10]), it is surprising that allegories were hardly ever used for database modeling. The use of allegories for this purpose was suggested in [9], and recently, the new allegorical data model was introduced by the authors in [11]; barring that, the authors were unable to secure more references.
In the majority of works applying category theory to conceptual database modeling, the arrows in a category are interpreted as functional dependencies. While this approach was successfully used, e.g., in tackling the view update problem ([12,13]) and in the treatment of incomplete data ([14]), the advantage of using the allegories instead of plain categories is that they furnish interpreting the arrows as arbitrary binary relationships (including non-functional ones), and makes the use of auxiliary constructs, like spans or power sets, unnecessary.
Conceptual database modeling is an important part of the database design process, assisting in creating better database schema and applications and also isolating the designer from the technical details of a particular database technology, which might be relational, object-oriented, XML, etc. One of the rationales for using category theory (and allegories, in particular) for conceptual modeling instead of plain first-order logic or relational algebra is that it allows one to abstract away also some ontological and logical commitments [11]: the data model formulated in terms of an allegory can be interpreted both in the allegory of (sharp) relations, but also in some allegory of fuzzy relations; thus, the database designer can, to some extent, free herself from the dependence on the particular choice of logic.
A desired feature of the conceptual model is the possibility of extending the model to increase its expressivity, when such a need arises. An example of such an extension is adding the modalities and many world interpretations, useful e.g., in the context of temporal or distributed databases. A main contribution of this paper is adding support for modal operators to the allegorical conceptual data model described in [11]. Here, we add the many world semantics to the model using only the language of allegories. This means that we are doing it independently of a concrete allegory; we can do it, e.g., for both sharp and fuzzy relations.
For both the allegorical model to be useful and the introduction of many worlds semantics to be possible requires more structure than provided by the plain allegories. A structure we work with here and which we conjecture to be minimal is that of a complete distributive allegory with all relational products (which are just products in the subcategory of maps). Our sentences are equalities between type safe terms formed using language of these categories. In particular, when our model is interpreted in R , this language is sufficient to express any first-order sentence (cf. [2]). The specification of the model resembles the algebraic sketch (see, e.g., [15]), but is a lot more expressive; in fact, limits and colimits in the subcategory of maps (arrows that are like total functions) are definable within our formalism (see [1]).
The many worlds semantics of the allegorical conceptual model is introduced as the family of interpretations of the model in a family of allegories (each corresponding to the “world”), as well as a special allegory providing a kind of common interpretation and within which one can define the modal operators using only the allegorical operators, together with the structure connecting “worlds” with one another and the common interpretation.
The structure of this paper is as follows. In Section 2, we recall some basic facts about category theory and allegories, as well as the definition (slight extension) of the allegorical conceptual model from [11]. In Section 3, we develop our modal extension and its semantics, and finally, in Section 4, we give some examples of modal specifications and queries.

2. Preliminaries

We recall some basic categorical definitions in order to fix the clean, but somewhat idiosyncratic, notation we use. The bulk of this preliminaries is taken, first by introductory material on allegories, which are not widely known and for which [1] is the basic textbook, and, then, by modified definitions of an allegorical conceptual data model from [11].
The reader might be disturbed by our consequent use of the term “set” where “class” might be more appropriate. We do it consciously, in order not to clutter the presentation with the set-theoretical considerations. The reader should also remember that while we use the · ; · operator to compose arrows in diagrammatic order, we also denote by f g the composition in the assignment order (i.e., ( f g ) ( x ) : = f ( g ( x ) ) ), of any two actual maps (that is, procedures that assign values to values) whenever those maps are not used as arrows in a category.

2.1. Categories and Graphs

A graph, G , consists of a set of vertices, Obj [ G ] , a set of arrows, Arr [ G ] , and a pair of maps ( · ) , ( · ) : Arr [ G ] Obj [ G ] called source and target, respectively. We denote by Arr G ( A , B ) the set of arrows with source A and target B, where A , B Obj [ G ] . A graph morphism F : G H from a graph, G , to a graph, H , is a pair of maps:
F o : Obj [ G ] Obj [ H ] , F a : Arr [ G ] Arr [ H ]
such that F a ( f ) = F o ( f ) , F a ( f ) = F o ( f ) , for all f Arr [ G ] . A composition of graph morphisms is defined componentwise, i.e., F G : = ( F o G o , F a G a ) .
A category, C , is a graph with associative arrow composition f ; g Arr C ( f , g ) , defined whenever f = g (note the diagrammatic order), and identity map id : Obj [ C ] Arr [ C ] such that id ( f ) ; f = f ; id ( f ) = f for all f Arr [ C ] . We write id A : = id ( A ) . When using single letter arrow names, we will often omit the semicolon composition operator abbreviating f g : = f ; g . A graph morphism F : C D between categories is called a functor when it maps identity arrows to identity arrows and respects composition, i.e., F a ( id A ) = id F o ( A ) and F a ( f ; g ) = F a ( f ) ; F a ( g ) .

2.2. Allegories

An allegory [1] A is a category enriched with intersection and reciprocation operators, respectively, for all A , B Obj [ A ] :
· · : Arr A ( A , B ) × Arr A ( A , B ) Arr A ( A , B ) ( · ) : Arr A ( A , B ) Arr A ( B , A )
We require these operators to satisfy the following conditions: Intersections make each hom-set a meet semi-lattice (see, e.g., [16]), where we denote the associated partial order by ⊑, i.e., R S : R S = R , for all R , S Arr A ( R , R ) . In addition, · · and ( · ) are to satisfy:
R = R , ( R S ) = S R , ( R S ) = R S R ( S T ) R S R T , R S T ( R T S ) S
for all R , S , T Arr [ A ] such that the above formulas are well-defined.
Allegories generalize the allegory, R , of sets (objects) and binary relations (arrows). Because of this, we may refer to arrows in any allegory as “relations”. In R , we write a R b iff ( a , b ) R . The identity in R is id : A { ( a , a ) | a A } ; intersection is the set intersection, i.e., R S : = R S ; reciprocation is defined by a R b : b R a ; and the composition of relations R , S Arr [ R ] such that R = S is defined by:
a ( R S ) c : b R . a R b b S c
We distinguish the following classes of arrows in allegory:
  • If id R R R , then R is called total.
  • If R R id R , then R is called functional.
  • If R is functional and total, it is called a map. A set of all maps in an allegory, A , is denoted by: Map [ A ] .
  • If R R id R , then R is called injective.
  • If id R R R , then R is called surjective.
A family { r i } i Map [ A ] with a common source, A, is called jointly monic if: i r i r i id A . For any maps h , h Map [ A ] with target A, if h ; r i = h ; r i for all i, then h = h .
For any A , B Obj [ A ] , we denote by A , B and A , B the top and bottom elements of Arr A ( A , B ) , respectively, if they exist. In R , we have A B : = A × B , A B : = Ø A B .
Suppose that the top element A B Arr A ( A , B ) exists. An object, C, together with maps π A , π B Map [ A ] (called projections on components), where the arrow π X Arr A ( C , X ) , X = A , B , is called a relational product iff:
π A ; π A π B ; π B = id C , π A ; π B = A B
Relational products are products in Map [ A ] , and they are unique up to an isomorphism. On the other hand, a product in Map [ A ] is not necessarily a relational product (see, e.g., [17]). Let f , g Map [ A ] be such that f = g , f = A , g = B . Then, the unique map, h Map [ A ] , such that f = h ; π A , g = h ; π B can be expressed explicitly as:
h = ( f ; π A ) ( g ; π B )
In an allegory, A , there might be a canonical choice of a relational product of each A , B Obj [ A ] . In such a case, we denote the canonical product object by A B and the projections by π A A B and π B A B . In R , the canonical relational product is the usual Cartesian product.
A distributive allegory is an allegory, A , in which for all hom-sets, Arr A ( A , B ) , there exists a bottom element, A B Arr A ( A , B ) , and a binary operation:
· · : Arr A ( A , B ) × Arr A ( A , B ) Arr A ( A , B )
which together with · · makes Arr A ( A , B ) a distributive lattice with · · as the infimum and · · as the supremum. In addition, we require that · · and A B satisfy:
R R B = R B , R ( S T ) = R S R T
for all R , S , T Arr [ A ] such the above formulae are type-correct. One proves easily that:
( A B ) = B A , ( R S ) = R S
A locally complete distributive allegory is a distributive allegory in which each of the hom-sets is a complete lattice, and moreover, the following infinite distributive laws hold:
R i S i = i ( R S i ) , R ; i S i = i ( R ; S i )
for any arrow R and a family { S i } i such that the above formulas make sense. As a consequence, each of the hom-sets in a complete distributive allegory, A , is a locale (a complete lattice in which finite meets distribute over any joins) or, equivalently, a complete Heyting algebra. More precisely, the above distributivity condition implies the existence of a binary hom-set operator, →, called implication, defined uniquely by the property:
R S T S ( R T )
for all R, S and T in the same hom-set. The implication can be expressed explicitly by the formula:
R T = S | S R T S
We denote for brevity ¬ R : = ( R R R ) . A hom-set, Arr A ( A , B ) , is a Boolean algebra if and only if one of the equivalent conditions below hold for all R Arr A ( A , B ) :
¬ ¬ R = R , ¬ R R = A B
If this is the case, then R S : = ¬ R S . It is immediate that R is a locally complete distributive allegory with the union defined as a set union, i.e., R S : = R S , and in which every hom-set is a Boolean algebra where a ( ¬ R ) b : ¬ a R b .
It is worth noting that a locally complete distributive allegory is a division allegory [1], that is, a distributive allegory with a partial binary operation · / · (called a right division), defined if and only if both arguments have the same targets, and satisfying for all arrows R, S and T:
R / S = R , R / S = S , T R / S T S R
In a distributive allegory which is locally complete, the (unique) operation satisfying the above axioms is given by R / S : = T | T S R T . In the present paper, we do not utilize this operation, but it would be easy to extend the language of the conceptual model considered here with the right division operator, in order to increase its expressivity.
The allegorical conceptual data model introduced in [11] requires that the allegories in which the model is interpreted contain canonical relational products of all pairs of objects and top and bottom elements in all hom-sets. Here, because the modal structure imposed on the model in this paper requires the locally complete distributive allegories anyway for the definitions to make sense, we enrich the language of specification to include unions and implications and, thus, require from the allegories in which models are interpreted to be distributive. For an easy reference, we call such allegories PTBDI (product, top, bottom distributive and containing implications) allegories. In particular, R is a locally complete PTBDI allegory.

2.3. Allegorical Conceptual Data Model

Before we can recall the definition of the model, we need first the following two auxiliary notions:
Definition 1. 
An extended set of objects Obj E [ G ] of a graph G is defined as a groupoid (i.e., a set with a binary operation ([18], Chapter V)) with operationgenerated by Obj [ G ] , i.e., if A , B , C Obj [ G ] , then A B , A A , ( A B ) C Obj E [ G ] , etc.
Definition 2. 
Let G be a graph. A set, T G , of allegorical terms associated to (cf. [11]) G is defined as the smallest set of expressions such that:
  • R T G for all R Arr [ G ] ,
  • id A , A B , A B , π A A B , π B A B T G for all objects A , B Obj E [ G ] ,
  • if t T G , then ( t ) T G ,
  • if t 1 , t 2 T G are such that t 1 = t 2 , then ( t 1 ) ; ( t 2 ) T G ,
  • if t 1 , t 2 T G are such that t 1 = t 2 and t 1 = t 2 , then ( t 1 ) ( t 2 ) T G , ( t 1 ) ( t 2 ) T G and ( t 1 ) ( t 2 ) T G .
We omit unnecessary parentheses when writing elements of T G . In the above conditions, we used the functions ( · ) , ( · ) : T G Obj E [ G ] defined in an obvious way using induction on the structure of terms as the extension of source and target functions, i.e., A B = B , t = t , t 1 ; t 2 = t 2 , t 1 t 2 = t 1 , π A A B = A B and so on, for any terms t, t 1 , t 2 .
We are now ready to formulate the definition of our conceptual model.
Definition 3. 
An allegorical conceptual data model, ( G , E ) , consists of a finite graph, G , and a finite set, E , of equations of the form t 1 t 2 , where t 1 , t 2 T G .
We write the equations of the form t 1 t 2 t 1 as t 1 t 2 . Equations allow us to specify constraints and dependencies between data elements.
Example 1. 
A conceptual model ( G , E ) loosely based on an example HR database of Oracle is depicted in Figure 1 (graph G ) and Figure 2 (equations E ). Equation (a) states that the arrows in the list are (total) maps; Equation (b) states that maps street , street-no , code , city and country are jointly monic (that is an Address is uniquely determined by the values of these attributes). Equation (c) makes ‘‘ ’’ a linear order and under transitive (it is meant as a transitive closure of the chain of commands) and irreflexive relation. The first two equations in Equation (d) specify that manages is an injective map (i.e., each department has a manager, and no manager manages two different departments). Then, the last of equations in (d) link relations manages and under by specifying that either an employee is a manager of the department he/she works in or he/she is under the departmental manager. Finally, Equation (e) limits the wages by enforcing that an employee doing a certain job type may not earn less than the minimal wage nor more than the maximal wage associated with the given job type.
The model is intended to be interpreted in some PTBDI allegory. Each interpretation corresponds to some actual realization and state of the database. The choice of allegory determines the kind of database; different interpretations in the same allegory may be interpreted as different states of the same database. Interpretation of the allegorical conceptual model in R is the typical choice. In order to formulate the precise definition of interpretation, we first need the following simple observation:
Figure 1. An example of an allegorical conceptual model graph.
Figure 1. An example of an allegorical conceptual model graph.
Axioms 03 00260 g001
Figure 2. Equations specifying the properties of relations from Figure 1.
Figure 2. Equations specifying the properties of relations from Figure 1.
Axioms 03 00260 g002
Lemma 4. 
Let G be a graph, and let A be a PTBDI allegory. Let F : G A be a graph morphism. Then, F o can be extended to a map F ^ o : Obj E [ G ] Obj [ A ] using induction on the ⊗-groupoid structure of Obj E [ G ] ; that is, by defining F ^ o ( A B ) = F ^ o ( A ) F ^ o ( B ) for all A , B Obj E [ G ] . Similarly, F a can be extended to a map F ^ a : T G Arr [ A ] using induction on the structure of terms in T G ; that is, by defining F ^ a ( id A ) = id F o ( A ) , F ^ a ( t 1 ; t 2 ) = F ^ a ( t 1 ) ; F ^ a ( t 2 ) , and so on.
The following remark clarifies the above lemma. Suppose that: Axioms 03 00260 i001 is a subgraph contained in a graph G , and that F : G A is a graph morphism from G into a PTBDI allegory, A , such that F a ( T ) F a ( R ) ; F a ( S ) . Consequently, by the above definition of the extension F ^ a : T G Arr [ A ] of F a , we have F ^ a ( R ; S ) : = F a ( R ) ; F a ( S ) F ^ a ( T ) , where F ^ a ( T ) : = F a ( T ) . Note that even if T is intended to be interpreted as a composition of R and S, this intention cannot be communicated through the structure of the graph, G , and hence, it does not introduce any inconsistency in the extension of F a . On the other hand, the intended identification of T with the composition of R and S can be declared through equations. In particular, if ( R ; S T ) E , then F cannot be an interpretation of ( G , E ) , as defined below.
Definition 5. 
Let ( G , E ) be an allegorical conceptual data model, and let A be a PTBDI allegory. A graph morphism H : G A is called an interpretation of ( G , E ) in A if H ^ a ( t 1 ) = H ^ a ( t 2 ) for all equations ( t 1 t 2 ) E . A set of all interpretations of ( G , E ) is denoted by Ipt [ G , E ] , and the set of all interpretations in an allegory A is denoted by Ipt A [ G , E ] .
Reasoning about data is furnished by the following semantic definition of a derived equality:
Definition 6. 
Let ( G , E ) be an allegorical conceptual model. We write ( G , E ) F t 1 t 2 , where F is an interpretation of ( G , E ) if F ^ a ( t 1 ) = F ^ a ( t 2 ) . We write ( G , E ) t 1 t 2 (the equality t 1 t 2 holds in ( G , E ) ) if ( G , E ) F t 1 t 2 for any interpretation F of ( G , E ) .

3. Modal Terms and Modal Interpretations

Recall that a modal similarity type ( S ̲ , ρ ) consists of a set, S ̲ , of symbols and a map ρ : S ̲ N called an arity. A frame ( M , R ) with modal similarity type ( S ̲ , ρ ) is a set, M , together with a family R : = { R S M ρ ( S ) + 1 | S S ̲ } of relations.
Let G be a graph, and let ( S ̲ , ρ ) be a modal similarity type. We extend the set, T G , of allegorical terms associated with G to a set, T G S ̲ , ρ , of modal allegorical terms of modal similarity type ( S ̲ , ρ ) by introducing new term constructors called modal operators: for each S S ̲ , such that ρ ( S ) 1 , and each term t 1 , , t ρ ( S ) T G S ̲ , ρ such that t 1 = t 2 = = t ρ ( S ) and t 1 = t 2 = = t ρ ( S ) also terms Δ S ( t 1 , , t ρ ( S ) ) , S ( t 1 , , t ρ ( S ) ) T G S ̲ , ρ . We also declare:
Δ S ( t 1 , , t ρ ( S ) ) = t 1 = S ( t 1 , , t ρ ( S ) ) Δ S ( t 1 , , t ρ ( S ) ) = t 1 = S ( t 1 , , t ρ ( S ) )
(i.e., modal operators associate arrows with arrows from the same hom-set) so that the terms with modal operators can be used as subterms. Arity zero modal operators (that is, modal constants) require special treatment. For all S S ̲ such that ρ ( S ) = 0 , and all pairs of objects A , B Obj [ G ] , we declare Δ S A B to be a term in T G S ̲ , ρ with Δ S A B = A and Δ S A B = B .
Definition 7. 
Let ( M , R ) be a frame of similarity type ( S ̲ , ρ ) ; let A be a locally complete PTBDI allegory, and let ( G , E ) be an allegorical conceptual data model. A modal interpretation ( Φ , Υ , ı ) of ( G , E ) in A with frame ( M , R ) consists of a family of interpretations { Φ m } m M Ipt A [ G , E ] , a map Υ : Obj E [ G ] Obj [ A ] and a map ı : M × Obj E [ G ] Arr [ A ] , where we denote ı A m : = ı ( m , A ) , satisfying, for all A , B Obj E [ G ] and m M :
ı A m ; ( ı A m ) = id ı A m , ( ı A m ) ; ı A m id ı A m , ı A m = Φ ^ o m ( A ) , ı A m = Υ ( A )
Υ ( A B ) = Υ ( A ) Υ ( B )
ı A B m = Φ ^ a m ( π A A B ) ; ı A m ; π Υ ( A ) Υ ( A ) Υ ( B ) Φ ^ a m ( π B A B ) ; ı B m ; π Υ ( B ) Υ ( A ) Υ ( B )
We denote by ModInt A M , R [ G , E ] the set of all modal interpretations of ( G , E ) in A with frame ( M , R ) .
The last of the equalities (10) specifies ı A B m to be a unique map which makes a diagram in Figure 3 commute (cf. Equation (4)). In fact, Formula (10c) could be taken as a definition of ı A B m , because it guarantees by itself that ı A B m is an injective map. Indeed, ı A B m as defined by Equation (10c) is a map because Φ ^ a m ( π A A B ) ; ı A m and Φ ^ a m ( π B A B ) ; ı B m are maps and π Υ ( A ) Υ ( A ) Υ ( B ) , π Υ ( B ) Υ ( A ) Υ ( B ) are projections for a relational product. It remains to prove that ı A B m ; ( ı A B m ) id Φ ^ o m ( A ) Φ ^ o m ( B ) :
ı A B m ; ( ı A B m ) { Composition and reciprocation are monotonic } Φ ^ a m ( π A A B ) ; ı A m ; π Υ ( A ) Υ ( A ) Υ ( B ) ; Φ ^ a m ( π A A B ) ; ı A m ; π Υ ( A ) Υ ( A ) Υ ( B ) = { Properties of ( · ) } Φ ^ a m ( π A A B ) ; ı A m ; π Υ ( A ) Υ ( A ) Υ ( B ) ; π Υ ( A ) Υ ( A ) Υ ( B ) ; ı A m ; Φ ^ a m ( π A A B ) { π Υ ( A ) Υ ( A ) Υ ( B ) is functional and ‘‘ ; ’’ is monotonic } Φ ^ a m ( π A A B ) ; ı A m ; ı A m ; Φ ^ a m ( π A A B ) = { Because ı A m is an injective map } Φ ^ a m ( π A A B ) ; Φ ^ a m ( π A A B )
Similarly, exchanging A and B, we prove the inequality
ı A B m ; ( ı A B m ) Φ ^ a m ( π B A B ) ; Φ ^ a m ( π B A B )
Hence,
ı A B m ; ( ı A B m ) { because is infimum } Φ ^ a m ( π A A B ) ; Φ ^ a m ( π A A B ) Φ ^ a m ( π B A B ) ; Φ ^ a m ( π B A B ) = { Φ ^ a m ( π A A B ) and Φ ^ a m ( π B A B ) are jointly monic } id Φ ^ o m ( A ) Φ ^ o m ( B )
as desired.
Observe that a modal interpretation ( Φ , Υ , ı ) defines a family of maps { Γ m : T G A } m M given explicitly by:
Γ a m ( t ) = ı t m ; Φ ^ a m ( t ) ; ı t m , t T G
Alternatively, Γ m is determined by the commutativity of the following family of diagrams (for all t T G ):
Axioms 03 00260 i002
Figure 3. The construction of injection for a relational product (note that Φ ^ a m ( π A A B ) = π Φ ^ o m ( A ) Φ ^ o m ( A ) Φ ^ o m ( B ) and Φ ^ a m ( π B A B ) = π Φ ^ o m ( B ) Φ ^ o m ( A ) Φ ^ o m ( B ) ).
Figure 3. The construction of injection for a relational product (note that Φ ^ a m ( π A A B ) = π Φ ^ o m ( A ) Φ ^ o m ( A ) Φ ^ o m ( B ) and Φ ^ a m ( π B A B ) = π Φ ^ o m ( B ) Φ ^ o m ( A ) Φ ^ o m ( B ) ).
Axioms 03 00260 g003
Lemma 8. 
Γ m satisfies the following properties:
(1) 
For all t 1 , t 2 T G , such that t 1 = t 2 and t 1 = t 2 , if Γ m ( t 1 ) = Γ m ( t 2 ) , then Φ ^ a m ( t 1 ) = Φ ^ a m ( t 2 ) .
(2) 
For all t 1 , t 2 T G , such that t 1 = t 2 and t 1 = t 2 , we have Γ m ( t 1 t 2 ) = Γ m ( t 1 ) Γ m ( t 2 ) and Γ m ( t 1 t 2 ) = Γ m ( t 1 ) Γ m ( t 2 ) .
(3) 
For all t 1 , t 2 T G such that t 1 = t 2 , we have Γ m ( t 1 ; t 2 ) = Γ m ( t 1 ) ; Γ m ( t 2 ) .
(4) 
For all A , B Obj E [ G ] , the following properties hold:
Γ m ( id A ) id Υ ( A ) , Γ m ( A B ) = Υ ( A ) Υ ( B ) , Γ m ( A B ) Υ ( A ) Υ ( B ) Γ m ( π A A B ) π Υ ( A ) Υ ( A ) Υ ( B ) , Γ m ( π B A B ) π Υ ( B ) Υ ( A ) Υ ( B )
Proof. 
ad. 1: Suppose that Γ m ( t 1 ) = Γ m ( t 2 ) . Then:
Φ ^ a m ( t 1 ) = ı t 1 m ; ı t 1 m ; Φ ^ a m ( t 1 ) ; ı t 1 m ; ı t 1 m = ı t 1 m ; Γ m ( t 1 ) ; ı t 1 m = ı t 2 m ; Γ m ( t 2 ) ; ı t 2 m = Φ ^ a m ( t 2 )
ad. 2: Γ m ( t 1 t 2 ) = Γ m ( t 1 ) Γ m ( t 2 ) follows immediately from the distributivity of composition over union. The composition does not distribute over the intersection. However, it is well known (see, e.g., [1]) that in any allegory R ( S T ) = R S R T and ( S T ) R = S R T R if R is functional, that is, if R R id R . Hence, the result follows from the injectivity of ı t 1 m and ı t 1 m , which implies the functionality of ı t 1 m and ı t 1 m .
ad. 3:
Γ m ( t 1 ) ; Γ m ( t 2 ) = ı t 1 m ; Φ ^ a m ( t 1 ) ; ı t 1 m ; ı t 2 m ; Φ ^ a m ( t 2 ) ; ı t 2 m = ı t 1 m ; Φ ^ a m ( t 1 ) ; Φ ^ a m ( t 2 ) ; ı t 2 m = ı t 1 m ; Φ ^ a m ( t 1 ; t 2 ) ; ı t 2 m = Γ m ( t 1 ; t 2 )
ad. 4: Γ m ( id A ) = ı A m ; id Φ ^ o m ( A ) ; ı A m = ı A m ; ı A m id Υ ( A ) , as ı A m is functional. The first of Equations (5) implies that Γ m ( A B ) = Υ ( A ) Υ ( B ) . Inequality Γ m ( A B ) Υ ( A ) Υ ( B ) holds trivially. Then, (cf. Figure 3):
Γ m ( π A A B ) = ı A B m ; Φ ^ a m ( π A A B ) ; ı A m = π Υ ( A ) Υ ( A ) Υ ( B ) ; ı A m ; Φ ^ a m ( π A A B ) π Υ ( B ) Υ ( A ) Υ ( B ) ; ı B m ; Φ ^ a m ( π B A B ) ; Φ ^ a m ( π A A B ) ; ı A m π Υ ( A ) Υ ( A ) Υ ( B ) ; ı A m ; Φ ^ a m ( π A A B ) ; Φ ^ a m ( π A A B ) ; ı A m π Υ ( A ) Υ ( A ) Υ ( B ) ; ı A m ; ı A m π Υ ( A ) Υ ( A ) Υ ( B )
Note that Γ m does not in general preserve identities, tops, bottoms and relational product projections, and thus, it is not an interpretation. The objects Υ ( A ) , for A Obj E [ G ] should be considered a representation of “total domains”—the collections of all possible values (whatever that means in a general allegory). On the other hand, Φ m is an interpretation of the conceptual model of the database in the concrete world (say a moment of time), and in particular objects Φ o m ( A ) represent actual values stored in the database in the world m.
Note also that Γ m does not preserve implications in general. This is obvious, as, in particular, in R , the complement ¬ Γ m ( t ) : = Γ m ( t ) Υ ( t ) Υ ( t ) in the arrow-set Arr A ( Υ ( t ) , Υ ( t ) ) is much larger than the embedding Γ m ( ¬ t ) in Arr A ( Υ ( t ) , Υ ( t ) ) of the complement of Φ ^ a m ( t ) in Arr A ( Φ ^ o m ( t ) , Φ ^ o m ( t ) ) . However, Lemma 10 alleviates that a bit. First, we need the following general result, interesting on its own.
Lemma 9. 
Let ı 1 and ı 2 be injective maps in some allegory, A , and suppose that the meet semilattice of arrows Arr A ( ı 1 , ı 2 ) contains the top element, ı 1 , ı 2 . Let R Arr A ( ı 1 , ı 2 ) . Consider the following statements (see the diagram below for illustration):
(1) 
R = ı 1 ; R ; ı 2 for some R Arr A ( ı 1 , ı 2 ) .
(2) 
R = ı 1 ; ı 1 ; R and R = R ; ı 2 ; ı 2 ,
(3) 
R ı 1 ; ı 1 , ı 2 ; ı 2 .
Statement (1) implies Statements (2) and (3), and Statement (3) implies Statements (1) and (2).
Axioms 03 00260 i003
Proof. 
If R = ı 1 ; R ; ı 2 , then, because R ı 1 , ı 2 and the composition is monotonic, we must also have R = ı 1 ; R ; ı 2 ı 1 ; ı 1 , ı 2 ; ı 2 . Furthermore, ı 1 ; ı 1 ; R = ı 1 ; ı 1 ; ı 1 ; R ; ı 2 = ı 1 ; R ; ı 2 = R as ı 1 ; ı 1 = id ı 1 and, similarly, R = R ; ı 2 ; ı 2 . This finishes the proof of the first set of implications.
Assume now that R ı 1 ; ı 1 , ı 2 ; ı 2 . We will prove first that ı 1 ; ı 1 ; R = R . Because ı 1 is functional, i.e., ı 1 ; ı 1 id ı 1 , and composition is monotonic, we have ı 1 ; ı 1 ; R id ı 1 ; R = R . Similarly, R ; ı 2 ; ı 2 R . In order to prove the other inequalities, we first define for any arrow, T, the domain of T:
Dom ( T ) : = id T T T
Recall ([1]) that Dom has the following properties:
Dom ( T S ) Dom ( T ) , where S = T
T S Dom ( T ) Dom ( S )
H . H id T ( T H ; T ) ( Dom ( T ) H )
It follows from Formula (13c) that R ı 1 ; ı 1 ; R if and only if Dom ( R ) ı 1 ; ı 1 . By assumption, however, R ı 1 ; ı 1 , ı 2 ; ı 2 , and so, by the transitivity of the order relation and the monotonicity of Dom (Equation (13b)), it is enough to prove that Dom ( ı 1 ; ı 1 , ı 2 ; ı 2 ) ı 1 ; ı 1 . However, by Equation (13a), we have:
Dom ( ı 1 ; ı 1 , ı 2 ; ı 2 ) Dom ( ı 1 ) = id ı 1 ı 1 ; ( ı 1 ) = id ı 1 ı 1 ; ı 1 = ı 1 ; ı 1
In order to prove that R R ; ı 2 ; ı 2 , first note that because reciprocation is monotonic and ı 1 , ı 2 = ı 2 , ı 1 , if R ı 1 ; ı 1 , ı 2 ; ı 2 , then R ı 2 ; ı 2 , ı 1 ; ı 1 , and hence, by the just proven result, R ı 2 ; ı 2 ; R . Taking the reciprocation of both sides of this inequality yields R R ; ı 2 ; ı 2 as desired.
Now, we are ready to prove the last implication. Assuming R ı 1 ; ı 1 , ı 2 ; ı 2 , itfollows from the just proven result that ı 1 ; ( ı 1 ; R ; ı 2 ) ; ı 2 = ( ı 1 ; ı 1 ; R ) ; ı 2 ; ı 2 = R ; ı 2 ; ı 2 = ı 2 ; ı 2 . Hence, defining R : = ı 1 ; R ; ı 2 Arr A ( ı 1 , ı 2 ) yields R = ı 1 ; R ; ı 2 , as desired. ☐
Lemma 10. 
For all t 1 , t 2 T G such that t 1 = t 2 and t 1 = t 2 , we have:
Γ m ( t 1 t 1 ) Γ m ( t 1 ) Γ m ( t 2 ) = Γ m ( t 1 t 2 )
Proof. 
Using explicit Formula (8) for an implication in a locally complete distributive allegory, and the distributivity law (6), we have:
Γ m ( t 1 t 1 ) Γ m ( t 1 ) Γ m ( t 2 ) = Γ m ( t 1 t 1 ) R Arr A ( Υ ( t 1 ) , Υ ( t 1 ) ) R Γ m ( t 1 ) Γ m ( t 2 ) R = R Arr A ( Υ ( t 1 ) , Υ ( t 1 ) ) Γ m ( t 1 t 1 ) R Γ m ( t 1 ) Γ m ( t 2 ) Γ m ( t 1 t 1 ) R
In the second equality, in order to change the ⨆ subscript, we made use of the fact that Γ m ( t 1 ) Γ m ( t 1 t 1 ) . Note that by Lemma 9 Γ m ( t 1 t 1 ) R = ı t 1 m ; R ; ı t 1 m for some R Arr A ( Φ o m ( t 1 ) , Φ o m ( t 1 ) ) . It follows immediately, because extending the set of which the supremum is taken increases the supremum value that:
( * ) R Arr A ( Φ ^ o m ( t 1 ) , Φ ^ o m ( t 1 ) ) ı t 1 m ; R ; ı t 1 m Γ m ( t 1 ) Γ m ( t 2 ) ı t 1 m ; R ; ı t 1 m
Then, because the injectivity of ı t 1 m and ı t 1 m implies that ı t 1 m ; R ; ı t 1 m Γ m ( t 1 ) Γ m ( t 2 ) if and only if R Φ ^ a m ( t 1 ) Φ ^ a m ( t 2 ) , we have that:
( ** ) = R Arr A ( Φ ^ o m ( t 1 ) , Φ ^ o m ( t 1 ) ) R Φ ^ a m ( t 1 ) Φ ^ a m ( t 2 ) ı t 1 m ; R ; ı t 1 m = ı t 1 m ; ( R Arr A ( Φ ^ o m ( t 1 ) , Φ ^ o m ( t 1 ) ) R Φ ^ a m ( t 1 ) Φ ^ a m ( t 2 ) R ) ; ı t 1 m = ı t 1 m ; ( Φ ^ a m ( t 1 ) Φ ^ a m ( t 2 ) ) ; ı t 1 m = ı t 1 m ; Φ ^ a m ( t 1 t 2 ) ; ı t 1 m = Γ m ( t 1 t 2 )
It remains to prove that:
Γ m ( t 1 t 1 ) Γ m ( t 1 ) Γ m ( t 2 ) Γ m ( t 1 t 2 )
The above inequality is equivalent to the conjunction of Γ m ( t 1 t 1 ) Γ m ( t 1 t 2 ) (which holds by the monotonicity of Γ m ) and Γ m ( t 1 ) Γ m ( t 2 ) Γ m ( t 1 t 2 ) . Using explicit Formula (8) for implication and the fact that decreasing the set for which the supremum is taken decreases the supremum value, we have:
Γ m ( t 1 ) Γ m ( t 2 ) = R Arr A ( Υ ( t 1 ) , Υ ( t 1 ) ) R Γ m ( t 1 ) Γ m ( t 2 ) R R Arr A ( Φ ^ o m ( t 1 ) , Φ ^ o m ( t 1 ) ) ı t 1 m ; R ; ı t 1 m Γ m ( t 1 ) Γ m ( t 2 ) ı t 1 m ; R ; ı t 1 m
The last expression is identical to (**), which is equal (as shown above) to Γ m ( t 1 t 2 ) .  ☐
The following immediate corollary to Lemma 10 shows that for certain safe expressions, Γ m preserves implications:
Corollary 11. 
For all t 1 , t 2 , t 3 T G with the same source and target and all m M , we have:
Γ m ( t 1 ) Γ m ( t 2 t 3 ) = Γ m ( t 1 ) Γ m ( t 2 ) Γ m ( t 3 )
We are now ready to define the interpretation of the modal formulas T G ( S ̲ , ρ ) in the allegory A using the interpretation ( Φ , Υ , ı ) .
Definition 12. 
Let ( M , R ) be a frame of similarity type ( S ̲ , ρ ) ; let A be a locally complete PTBDI allegory, and let ( G , E ) be an allegorical conceptual data model. A modal interpretation ( Φ , Υ , ı ) of ( G , E ) in A with frame ( M , R ) defines for all m M a map Ξ ( Φ , Υ , ı ) m : T G ( S ̲ , ρ ) Arr [ A ] defined by induction on the structure of terms in T G S ̲ , ρ as follows (we omit the subscript whenever ( Φ , Υ , ı ) is clear from the context):
  • If t Arr [ G ] or
    t A , B Obj E [ G ] { A B , A B , π A A B , π B A B , id A }
    then Ξ m ( t ) : = Γ m ( t ) .
  • Ξ m ( t 1 ; t 2 ) = Ξ m ( t 1 ) ; Ξ m ( t 2 ) , Ξ m ( t 1 t 2 ) = Ξ m ( t 1 ) Ξ m ( t 2 ) , Ξ m ( t 1 t 2 ) = Ξ m ( t 1 ) Ξ m ( t 2 ) , Ξ m ( t 1 t 2 ) = Ξ m ( t 1 ) Ξ m ( t 2 ) , Ξ m ( t ) = Ξ m ( t ) .
  • If S S ̲ is such that ρ ( S ) = 0 and A , B Obj E [ G ] , then:
    Ξ m ( Δ S A B ) = Υ ( A ) Υ ( B ) if m R S Υ ( A ) Υ ( B ) if m R S
  • If S S ̲ is such that ρ ( S ) > 0 and t 1 , , t ρ ( S ) T G S ̲ , ρ are such that t 1 = t 2 = = t ρ ( S ) and t 1 = t 2 = = t ρ ( S ) , then:
    Ξ m Δ S ( t 1 , , t ρ ( S ) ) = m 1 , , m ρ ( S ) M s.t. R S ( m , m 1 , , m ρ ( S ) ) 1 i ρ ( S ) Ξ m i ( t i ) Ξ m S ( t 1 , , t ρ ( S ) ) = m 1 , , m ρ ( S ) M s.t. R S ( m , m 1 , , m ρ ( S ) ) 1 i ρ ( S ) Ξ m i ( t i )
Remark 1. 
Note that Ξ m preserves neither top elements, relational projections and identities nor implications (because Γ m does not preserve them either). Note, however, that by definition, Ξ m ( t ) = Υ ( t ) and Ξ m ( t ) = Υ ( t ) for all t T G ( S ̲ , ρ ) .
Example 2. 
Here, we construct an allegorical counterpart of the basic modal logic. Let ( M , R ) be a frame of similarity type ( { S } , S 1 ) . Let ( G , E ) be an allegorical conceptual data model and consider a modal interpretation ( Φ , Υ , ı ) ModInt R M , R [ G , E ] . We denote customarily R : = Δ S ( t ) and R : = S ( t ) for all t T G S , S 1 . Let a Υ ( t ) , b Υ ( t ) . Then:
a Ξ m ( t ) b m M . R S ( m , m ) a Ξ m ( t ) b a Ξ m ( t ) b m M . R S ( m , m ) a Ξ m ( t ) b
Note that the above formulas are the same as in the definition of satisfaction of modal operators in the (first-order) basic modal logic (see, e.g., [19,20]).
Example 3. 
In this example, we will consider modal interpretations in the allegory R [ L ] where L is a locale, of locale-valued relations (see, e.g., [1]). In R [ L ] , objects are sets, and for any A , B Obj [ R [ L ] ] , the hom-set Arr R [ L ] ( A , B ) consists of maps R : A × B L . Locale-valued relations are usually interpreted as fuzzy relations, where the value, R ( a , b ) , gives the degree to which the relation, R, between a and b actually holds. Composition for R , S Arr [ R [ L ] ] such that R = S , is given by:
( R S ) ( a , c ) : = b R R ( a , b ) S ( b , c )
For all A Obj [ R [ L ] ] , the identity morphisms are given explicitly by id A ( a , b ) : = if a = b and id A ( a , b ) : = if a b . The intersection, union and reciprocation operators are defined in R [ L ] by ( R S ) ( a , b ) : = R ( a , b ) S ( a , b ) , ( R S ) ( a , b ) : = R ( a , b ) S ( a , b ) , R ( a , b ) : = R ( b , a ) .
Let us now consider the formulas defining modal interpretation in the same setting as in Example 2, but with R [ L ] instead of R . Then:
Ξ m ( t ) ( a , b ) = m M s.t. R S ( m , m ) Ξ m ( t ) ( a , b ) Ξ m ( t ) ( a , b ) = m M s.t. R S ( m , m ) Ξ m ( t ) ( a , b )
Sometimes, the modal operators associated directly to the frame relations are not enough. For instance (see Example 4), the counterpart of until and since operators from temporal logic cannot be expressed using the formalism described so far. Therefore, we allow one to extend the set of terms, T G , to the set, T G Ω , using an arbitrary set of constructors corresponding to the set of operators, Ω, instead of using only the constructors tied in a canonical way to frame relations and attaching to those operators arbitrary (though defined using frame relations) semantics.
Example 4. 
Let ( M , { } ) be a frame of similarity type ( { S } , S 1 ) , such thatis a linear order. Let ( G , E ) be an allegorical conceptual data model. We extend T G to T G { S , U } by adding two new term constructors: For all terms t 1 , t 2 T G { S , U } such that t 1 = t 2 and t 1 = t 2 , also U ( t 1 , t 2 ) T G { S , U } ( t 1 until t 2 ) and S ( t 1 , t 2 ) T G { S , U } ( t 1 since t 2 ).
Let ( Φ , Υ , ı ) ModInt A ( M , R ) [ G , E ] , and let m M . Then, the semantics of S and U is given by:
Ξ m ( U ( t 1 , t 2 ) ) = m | m m Ξ m ( t 2 ) m | m m < m Ξ m ( t 1 ) Ξ m ( S ( t 1 , t 2 ) ) = m | m m Ξ m ( t 2 ) m | m < m m Ξ m ( t 1 )
where we denote m < m m m m m . In particular, if A = R , then for all a Υ ( t 1 ) and b Υ ( t 1 ) , those definitions boil down to the classical definition of the since and until temporal modalities:
a Ξ m ( U ( t 1 , t 2 ) ) b = m | m m . a Ξ m ( t 2 ) b m | m m < m . Ξ m ( t 1 ) a Ξ n ( S ( t 1 , t 2 ) ) b = m | m m . a Ξ m ( t 2 ) b m | m < m m . Ξ m ( t 1 )
Formal equalities between terms from T G S ̲ , ρ can be used to specify the dependencies between data from different “worlds”, where the “world” can mean, depending on the application, a time moment or perhaps a database server instance. Here is the precise definition.
Definition 13. 
Let t 1 , t 2 T G ( S ̲ , ρ ) ; let ( M , R ) be a frame of similarity type ( S ̲ , ρ ) , and let the modal interpretation ( Φ , Υ , ı ) ModInt A ( M , R ) [ G , E ) ] . We say that a formal equality t 1 t 2 is satisfied in modal interpretation ( Φ , Υ , ı ) at m M if Ξ ( Φ , Υ , ı ) m ( t 1 ) = Ξ ( Φ , Υ , ı ) m ( t 2 ) , which we denote by ( Φ , Υ , ı ) m t 1 t 2 . We say that a formal equality t 1 t 2 is satisfied in modal interpretation ( Φ , Υ , ı ) , which we denote by ( Φ , Υ , ı ) t 1 t 2 if ( Φ , Υ , ı ) m t 1 t 2 for all m M .

4. Applications to Database Modeling

In this section, we consider how our formalism can be used to express business rules and queries in the context of temporal and distributed databases. In all the examples, we use the allegorical conceptual model depicted in Figure 1 and Figure 2.

4.1. Temporal Databases

Here, we work with frame ( T , R ) of similarity type { O , ρ } , where we denote O : = { ‘‘ ’’ , ‘‘ ’’ , ‘‘ < ’’ , ‘‘ > ’’ } , ρ ( ‘‘ ’’ ) = ρ ( ‘‘ ’’ ) = ρ ( ‘‘ < ’’ ) = ρ ( ‘‘ > ’’ ) = 1 . We abbreviate : = R ‘‘ ’’ and similarly for the other symbols. We assume that ≤ is a linear order on T and that <, > and ≥ are dependent on ≤ in the usual way. We interpret the set of worlds, T , as the time axis, with ≤ being the linear time ordering.
Example 5. 
Consider the following business rule concerning the allegorical conceptual model ( G , E ) depicted in Figure 1 and Figure 2: “A manager of a department must have worked in the department in the past and not as its manager”. For simplicity let us ignore the fact that this rule is impossible to realize for the new departments. We claim that this rule can be expressed as the following formal equality between terms in T G ( O , ρ ) :
manages Δ ‘‘ > ’’ works-in ¬ manages
where we denoted for brevity ¬ manages : = ( manages Employees Departmets ) . Indeed, let the modal interpretation ( Φ , Υ , ı ) ModInt R ( T , R ) [ G , E ] , and let m T . Then:
( Φ , Υ , ı ) m manages Δ ‘‘ > ’’ works-in ¬ manages
is equivalent to the statement, that for all elements e Υ ( Employees ) and d Υ ( Departments ) :
e Ξ m ( manages ) d m < m . e Ξ m ( works-in ) d ¬ e Ξ m ( manages ) d
which is a direct first-order rendering of the desired business rule, where we read a Ξ m ( R ) b , as a is in relation b at the time m.
Note that in Equation (15), the negation was used in a “safe” way in accordance with Corollary 11.
Example 6. 
Suppose that we want to create a temporal query (that is, a term in T G ( O , ρ ) ), the evaluation of which at some moment m T will return those employees, whose pay will not decrease in the future. One may use such a term as a part of a formal equality stating some business rule or as a query in a temporal database. We claim that the query can be expressed as follows:
earns ; Δ ‘‘ < ’’ ‘‘ ’’ ; earns id Employees
Note the unfortunate clash of symbols here: in the above formula, we have the arrow ‘‘ ’’ from the graph, G , and the relation symbol, ‘‘ < ’’ O . Any modal interpretation is bound to represent Term (16) as a coreflexive (that is contained in the identity) arrow. Coreflexive arrows are natural allegorical representations of subobjects (subsets) (see, e.g., [1]). In R , if R is coreflexive, then by definition R = R and for all e , e R , we have e R e e = e . One can associate with R the subset { e R | e R e } R . Conversely, with a subset V U , one can associate a coreflexive relation R V id U defined by e R e e = e e V .
The correctness of the solution (16) of our problem depends on the following reasonable assumption: the object Salaries should be understood not as a collection of salaries really earned by someone, but rather as a (generalized) numerical domain (e.g., NUMBER(6,2)). Accordingly, its interpretation (as well as the interpretation of the linear order, ‘‘ ’’ ) should be constant, that is, we consider only those modal interpretations ( Φ , Υ , ı ) of ( G , E ) in which for all m T , we have:
Φ ^ o m ( Salaries ) = Υ ( Salaries ) , ı Salaries m = id Υ ( Salaries ) , Φ ^ a m ( ‘‘ ’’ ) =
As in the previous example, we consider the query to satisfy the desired semantics if the modal interpretation in R turns out to be the translation into the first-order logic of the problem statement. Therefore, let us consider any ( Φ , Υ , ı ) ModInt R ( T , R ) [ G , E ] satisfying Conditions (17). Let T denote Term (16). In this setting, e Ξ m ( T ) e can be equivalently written using Definition 12 as:
m > m . s , s Υ ( Salaries ) . e Ξ m ( earns ) s s s e Ξ m ( earns ) s e = e

4.2. Replicated Databases

Here, we consider applications of modal interpretations of allegorical conceptual data models to specifying properties of replicated databases. One of the frames a replicated database can be associated with is the frame ( DB , { } ) of similarity type D : = ( { ‘‘ ’’ } , { ‘‘ ’’ 1 } ) . Here, DB is the set of database servers, and d d means that d pushes data into d . To avoid problems with circular pushes and consistency, we assume that the graph of ⇝ is acyclic and that that there exists a unique master, that is a database, d DB , such that there exists no d DB , such that d d . Applications can read any database, but only the master is directly modified. What remains is the specification of details of change propagation.
Example 7. 
We want to specify the following rule: deletions from the relation works-in are propagated within the updating transaction. However insertions are propagated after the end of the transaction. The solution can be easily seen to be as follows:
works-in ‘‘ ’’ ( works-in )
Consider now the frame ( T × DB , R { } ) of similarity type { O { ‘‘ ’’ } , ρ } , where ρ | O = ρ and ρ ( ‘‘ ’’ ) = 1 . Here, T , R O and ρ are like in SubSection 4.1, and ⇝ and DB are like above, except that both R and ⇝ are extended in a natural way as relations on Cartesian product T × DB , e.g., ( ( m , d ) < ( m , d ) ) : ( m < m ) and ( ( m , d ) ( m , d ) ) : ( d d ) .
Example 8. 
Here, we continue Example 7. Note that one cannot express the requirement that the inserts will be eventually propagated without temporal modalities, that is using the frame that was used in the previous example. One can do it, however, using the frame described above, combining the replicated database frame with the temporal frame from the previous subsection. The reader will easily verify that the appropriate equation is as follows:
works-in ‘‘ < ’’ ( Δ ‘‘ ’’ ( works-in ) )

5. Conclusions

We have presented a modal extension of a new allegorical conceptual data model, which interprets modal operators within an appropriate allegory. Our formalism can be seen as a generalization via the relational algebra of a limited form of a first-order modal logic with variable domains (see, e.g., [19]). We have given a few examples of applications of the modal extensions of our allegorical conceptual data model to specifying properties of temporal or distributed databases. We hope that those examples justify our conviction about the usefulness and expressiveness of our approach. More examples are needed, however, where the data should be naturally interpreted in allegories other than R or R [ L ] for some locale, L.
It will be also interesting to compare our approach with that of [21], where it is shown how to enrich an arbitrary institution [22] with modalities and many worlds semantics. To make this comparison possible, we are currently working on the institutional formulation of our allegorical data model.

Acknowledgments

We would like to thank the reviewers for their helpful suggestions.

Author Contributions

Bartosz Zieliński provided the main idea. Paweł Maślanka and and Ścibor Sobieski helped to develop it. All contributed to writing and editing.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Freyd, P.; Scedrov, A. Categories, Allegories; North-Holland Mathematical Library; Elsevier Science: New York, NY, USA, 1990. [Google Scholar]
  2. Tarski, A.; Givant, S. A Formalization of Set Theory Without Variables; Number t. 41 in A Formalization of Set Theory without Variables; American Mathematical Society: Providence, RI, USA, 1987. [Google Scholar]
  3. Lippe, E.; Hofstede, A. A Category Theory Approach to Conceptual Data Modeling; University of Nijmegen, Computing Science Institute: Tartu, Estonia, 1994. [Google Scholar]
  4. Piessens, F.; Steegmans, E. Selective attribute elimination for categorical data specifications. In Algebraic Methodology and Software Technology; Johnson, M., Ed.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1997; Volume 1349, pp. 424–436. [Google Scholar]
  5. Rosebrugh, R.; Wood, R.J. Relational databases and indexed categories. In Proceedings of the International Category Theory Meeting, CMS Conference Proceedings, Montreal, QC, Canada, 23–30 June 1991; American Mathematical Society: Providence, RI, USA, 1992; Volume 13, pp. 391–407. [Google Scholar]
  6. Johnson, M.; Rosebrugh, R. Sketch data models, relational schema and data specifications. Electron. Notes Theor. Comput. Sci. 2002, 61, 51–63. [Google Scholar] [CrossRef]
  7. Diskin, Z.; Kadish, B. Algebraic Graph-Oriented = Category Theory Based—Manifesto of Categorizing Database Theory; Technical Report for Laboratory for Database Design; Frame Inform Systems: Riga, Latvia, 1995. [Google Scholar]
  8. Diskin, Z. Formalizing graphical schemas for conceptual modeling: Sketch-based Logic vs. heuristic pictures. In Proceedings of the 10th International Congress of Logic, Methodology and Philosophy of Science, Florence, Italy, 9–25 August 1995; pp. 40–41.
  9. Diskin, Z. Generalised Sketches as an Algebraic Graph-Based Framework for Semantic Modeling and Database Design; University of Latvia: Riga, Latvia, 1997. [Google Scholar]
  10. Spivak, D.I. Simplicial Databases. CoRR 2009, abs/0904.2012. [Google Scholar]
  11. Zielinski, B.; Maslanka, P.; Sobieski, S. Allegories for database modeling. In Model and Data Engineering; Cuzzocrea, A., Maabout, S., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2013; Volume 8216, pp. 278–289. [Google Scholar]
  12. Johnson, M.; Rosebrugh, R. Fibrations and universal view updatability. Theor. Comput. Sci. 2007, 388, 109–129. [Google Scholar] [CrossRef]
  13. Johnson, M.; Rosebrugh, R.; Wood, R.J. Lenses, fibrations and universal translations. Math. Struct. Comput. Sci. 2012, 22, 25–42. [Google Scholar] [CrossRef]
  14. Johnson, M.; Kasangian, S. A relational model of incomplete data without nulls. In Proceedings of the Sixteenth Symposium on Computing: The Australasian Theory (CATS ’10), Brisbane, Australia, 18–21 January 2010; Australian Computer Society, Inc.: Darlinghurst, Australia, 2010; Volume 109, pp. 89–94. [Google Scholar]
  15. Barr, M.; Wells, C. Category Theory for Computing Science; Prentice-Hall International Series in Computer Science; Prentice Hall: Upper Saddle River, NJ, USA, 1995. [Google Scholar]
  16. Davey, B.; Priestley, H. Introduction to Lattices and Order; Cambridge Mathematical Text Books; Cambridge University Press: Cambridge, UK, 2002. [Google Scholar]
  17. Winter, M. Products in categories of relations. J. Log. Algebr. Program. 2008, 76, 145–159, Relations and Kleene Algebras in Computer Science. [Google Scholar] [CrossRef]
  18. Rosenfeld, A. An Introduction to Algebraic Structures; Holden-Day: San Francisco, CA, USA, 1968. [Google Scholar]
  19. Blackburn, P.; van Benthem, J.; Wolter, F. Handbook of Modal Logic; Studies in Logic and Practical Reasoning; Elsevier Science: New York, NY, USA, 2006. [Google Scholar]
  20. Blackburn, P.; de Rijke, M.; Venema, Y. Modal Logic; Cambridge Tracts in Theoretical Computer Science; Cambridge University Press: Cambridge, UK, 2002. [Google Scholar]
  21. Diaconescu, R.; Stefaneas, P. Ultraproducts and possible worlds semantics in institutions. Theor. Comput. Sci. 2007, 379, 210–230. [Google Scholar] [CrossRef]
  22. Goguen, J.; Burstall, R. Introducing institutions. In Logics of Programs; Clarke, E., Kozen, D., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1984; Volume 164, pp. 221–256. [Google Scholar]
Back to TopTop