Manuscript Offprint
arXiv:2611.06208Executable Specifications in Transition Algebra
DANIEL GÄINÄ, Kyushu University, Japan
ADRIÁN RIESCO, Universidad Complutense de Madrid, Spain
IONUT TUTU, Simion Stoilow Institute of Mathematics of the Romanian Academy, Romania
Transition Algebra can be viewed as an extension of many-sorted first-order logic by borrowing essential features from dynamic logic. This leads us to new, more expressive sentences that include transitions labelled with actions, which are built from terms using union, composition, and iteration operators. We define a suitable notion of Horn clause, develop a system of proof rules for reasoning about clauses, and subsequently show that the proof system is sound and complete. We then introduce a rewriting relation based on Horn clauses, capturing transitions along established paths expressed as actions. This rewriting relation is naturally extended to a narrowing procedure for solving queries, thereby laying foundation for logic programming in Transition Algebra. As usual, soundness for both rewriting and narrowing is straightforward, whereas completeness requires additional conditions. Finally, we provide a prototype tool that demonstrates the practical aspects and shows the effectiveness of the proposed method.
CCS Concepts: • Theory of computation → Logic and verification; Equational logic and rewriting; Constraint and logic programming; Finite Model Theory.
Additional Key Words and Phrases: Transition algebra, Horn clause, rewriting, narrowing, calculi, tool support
1 Introduction
Motivation. As software systems become more complex and safety-critical, ensuring their correctness becomes not only desirable but essential. Subtle defects in such systems can lead to significant economic losses, security vulnerabilities, or even threats to human life, making rigorous verification a fundamental concern [8]. Traditional testing techniques, while valuable, are often insufficient to guarantee correctness across all possible scenarios [15]. Consequently, there is a growing need for specification languages that are sufficiently expressive to capture intricate system behaviours, yet executable so that models can be validated, simulated, and analyzed efficiently. Such languages bridge the gap between formal reasoning and practical validation, enabling early detection of inconsistencies and providing scalable mechanisms to assess system correctness. In this regard, a novel denotational semantics called Transition Algebra (TA) [27] was introduced for algebraic specification languages that are executable through rewriting. This semantics is defined by extending first-order logic with constructs inspired by dynamic logic [26], thereby enabling a more expressive and structured framework for describing state transitions. Within the new framework, TA supports actions, which are composed from binary relations using standard relational operators: union (∪), composition (⊆), and iteration (*). Moreover, the algebraic structure of TA can be easily extended further to include additional action operators (e.g., tests, converse, or parallel composition). To simplify the presentation and highlight the core ideas of the proposed method, this initial formulation focuses only on the original three relational operators. Another notable feature of TA is that it offers a rigorous foundation, in logical terms, for a core fragment of the Maude strategy language [16]. Maude [4] is a specification language that implements Rewriting Logic [34], and also a state-of-the-art and highly efficient tool for equational reasoning and term rewriting. The strategy language significantly enhances its expressive power by enabling fine-grained control over the application of transition rules—that is, the rules that govern how terms, representing system states, change through rewriting. By modelling strategies as algebraic constructs, TA offers a natural and uniform
Authors' Contact Information: Daniel Găină, daniel@imi.kyushu-u.ac.jp, Kyushu University, Fukuoka, Japan; Adrián Riesco, ariesco@fdi.ucm.es, Universidad Complutense de Madrid, Madrid, Spain; Ionut Tutu, ittutu@gmail.com, Simion Stoilow Institute of Mathematics of the Romanian Academy, Bucharest, Romania.
Gäinä, Riesco and Tutu
2
framework for reasoning about strategic control in rewriting systems. It is worth noting that iteration (*) significantly increases the expressive power of TA at the expense of other good properties such as compactness. For example, [28] establishes a categoricity property for TA, roughly showing that theories formulated in TA can control the cardinality of any of their models, including those of singular cardinality. This result holds under the Generalized Continuum Hypothesis and assuming the nonexistence of inaccessible cardinals.
Institutional approach. The formulation of TA adheres to the principles of institution theory [23], a general and abstract model-theoretic framework that formalizes the notion of a logical system through four key components: signatures, sentences, models, and a satisfaction relation between models and sentences. A cornerstone of this framework is the satisfaction condition, a fundamental requirement for supporting modularity and composability in logical systems. The satisfaction condition ensures that the truth of sentences is preserved under translations induced by signature morphisms—structure-preserving mappings between signatures that coherently translate syntax and reduce semantics. Much of the theoretical foundation of modern specification languages has been developed within the institutional framework [12, 13, 43], grounded in the principle that formal specification should be based on a well-defined underlying institution. Two prominent examples of specification languages that were explicitly designed following the institutional approach are CafeOBJ [14], developed in Japan, and CASL [1], developed in Europe. Both languages are built upon logical systems that have been rigorously formulated as institutions, ensuring strong support for modularity, compositionality, and interoperability between different logics. A notable exception to this institution-based design philosophy is the Maude system [4]. As mentioned above, Maude is based on Rewriting Logic [34], a framework which does not have, in full, an institutional formalization. As a result, the development of Maude has taken, in some respects, a different path from that of mainstream institution-theoretic approaches—particularly in areas such as modularization and logical heterogeneity [7].
Quantification. In [27], each signature is equipped with a separate set of plain, unstructured transition labels, which are interpreted in models as atomic transition relations. In contrast, the present work adopts a more minimalistic approach: the signatures are ordinary algebraic signatures, and we use terms both to denote elements in models and to form atomic transition labels. Concretely, given a term and a model defined over a signature , the interpretation is an element of the carrier of , as in standard algebraic semantics. In addition to this, for every sort in , we associate with a binary transition relation on the carrier set ; that is, . This dual semantic role of terms—as both elements and binary relations—enables a flexible treatment of transitions within the model-theoretic framework. This approach has a powerful consequence: it allows us to quantify over atomic transitions using ordinary first-order variables. This feature proves particularly useful in applications such as the formal specification of process calculi like Milner's Calculus of Communicating Systems (CCS) [38, 39], where the ability to abstract over transitions is essential. Effectively, this mechanism serves as a method of encoding second-order quantification (over transition relations) using first-order quantifiers. By avoiding the complexity of a second-order logic, we retain a simpler logical foundation while still enabling expressive reasoning about behaviours and interactions in concurrent systems.
Entailments. In the present work, we focus on defining a fragment of TA with good computational properties, making specifications written in this logical framework executable via rewriting and narrowing. To that end, we introduce a notion of Horn clause tailored to TA, which appears in two distinct forms: (a) equational, if , and (b) transitional, if , where and are terms with variables from , is also a term with variables from representing a transition label, and is a set of conditions consisting of equations and transitions along actions.
Importantly, for transitional clauses, the head needs to be atomic, meaning that is not constructed from any other actions using operators such as union, composition, or iteration. This differs from the approach taken by systems such as Maude and CafeOBJ. The latter does not take into account labelled transitions, whereas the former admits them, but does not support explicit references to labels in conditions. In contrast, in TA, the use of labelled atomic transitions is unconstrained, as they can occur anywhere in clauses. Moreover, the framework allows the conditions in to include actions that are arbitrarily complex and not necessarily atomic. That is a key feature of our approach, allowing more expressive and flexible specifications. We define a system of proof rules for reasoning about clauses in TA, and we establish that the resulting entailment system is both sound and complete. Notably, our completeness proof does not rely on the use of a cut rule. This means that properties of systems specified by clauses in TA can be proved without requiring the discovery of intermediate results—a process often referred to as lemma discovery in the formal-methods community. However, permitting arbitrary actions in the conditions of clauses introduces a distinctive challenge: to establish the validity of a clause, it may be necessary to reason beyond the space of clauses themselves. This requirement compels us to go beyond traditional clause-based reasoning techniques, leading to both theoretical insights and practical consequences for the design of executable specification languages. As a result, the completeness theorem established in this work departs significantly from those found in earlier approaches (e.g., [6, 19, 20]) where clause conditions are restricted to simpler forms, typically limited to equations or plain relations.
Rewriting. The rewrite rules we employ in TA are derived from general Horn clauses by imposing restrictions on the occurrences of variables in order to ensure that the rules are executable—that is, to ensure that rules can be applied in rewriting and narrowing steps. We distinguish between two kinds of rewrite rules: (a) equational rewrite rules of the form if , where the set of variables in the right-hand side is restricted by the condition , and (b) transitional rewrite rules of the form if , with a similar restriction: . In both cases, the hypothesis is a finite set of equations and transitions, which act as side conditions that must be satisfied for the rule to be applied. These conditions, while not themselves rewrite rules, may include complex compositions of actions and thus require their own operational semantics. To manage this, we proceed in two stages.
First, we define a rewriting relation on sets of conditions. To that end, it is more convenient to regard those sets of conditions as goals that are meant to be proved by rewriting, where proving a goal amounts to rewriting it to the empty set (meaning that all the conditions get discharged). This preliminary definition is intentionally broad: to prove we may need to apply other rewrite rules, which may be conditional; unlike term rewriting, for goal rewriting we do not check the conditions of rules straight away; instead, we add them to so that they are checked at some point during rewriting. Moreover, we do not commit to a specific mechanism for computing matching substitutions, nor do we assume that the matches are unique. The purpose, at this stage, is to develop a framework for rewriting that is as general as possible, independent of any particular computational strategy.
Second, we define term rewriting using equational rewrite rules and, separately, term transitions using transitional rewrite rules. The latter captures the idea of rewriting along a path described by an action, thereby giving an operational interpretation to transitions in the system. This separation clarifies how terms transition in response to rules and how side conditions are validated through structured rewriting. Within this framework, we establish a completeness result for rewriting, thus ensuring that a goal follows (semantically) from a set of clauses only if can be operationally reduced to the empty set through a sequence of rewriting steps. In symbols, implies . This result bridges
Gäinä, Riesco and Tuutu
4
the gap between the model-theoretic semantics of TA and its operational semantics defined via rewriting. To achieve it, the set of rules needs to satisfy two key assumptions:
- Confluence of equational rewriting rules. This guarantees the consistency and determinism of computations based on equational reasoning. Confluence together with termination are crucial for ensuring that the rewriting of terms with respect to equational rules yields unique normal forms, irrespective of the rewriting path taken.
- Coherence of transitional rewrite rules. This property ensures that the interaction between equational and transitional reasoning behaves uniformly, i.e., the application of transitional rules respects the structure induced by equational rewriting. Coherence avoids discrepancies between the logical entailment of transitions and their realizability via rewriting sequences.
Narrowing. The definition of narrowing can be obtained directly from rewriting by replacing matching with unification. We use the same rewrite rules as those used for rewriting, without restricting ourselves to unconditional transitional rewrite rules. We consider queries defined as existentially quantified goals, revisit the classical notion of solution to a query, and propose a suitable narrowing relation. In this setting, we show that a query is satisfiable with respect to a set of clauses, meaning that there exists a substitution such that follows from , if and only if can be reduced to a trivial query of the form through a sequence of narrowing steps that 'compute' (or another suitable substitution that is more general than ). In symbols, if and only if for some substitutions and such that . The completeness of narrowing holds under similar conditions as those required for the completeness of rewriting: we need confluence, coherence, and also an additional termination requirement for goal rewriting.
To the best of our knowledge, the standard narrowing algorithm implemented in Maude 3.5 operates over rewrite theories that use only unconditional rules. This provides a solid foundation for equational reasoning and symbolic execution, but it limits the expressiveness of the rewrite theories that the system can handle. To address this limitation, the framework has been extended in recent work to support rewrite theories with conditional rules, allowing more complex computational behaviours to be modeled directly. Notably, Meseguer [35] and López-Rueda et al. [31] extended the standard narrowing algorithm with conditional rules that consist of SMT constraints, thereby broadening the scope of symbolic reasoning in Maude. Roughly, the conditional rules include quantifier-free first-order formulae. This extension significantly enhances the expressiveness of the framework, enabling the formal specification and analysis of systems with rich logical constraints within the narrowing-based symbolic reasoning paradigm [17, 18, 36, 44]. The narrowing relation proposed in this paper also supports unrestricted transitional rewrite rules, allowing for greater flexibility in the kinds of rewrite theories it can handle. However, we achieve that flexibility entirely within the scope of Transition Algebra, meaning that, instead of SMT constraints we use plain TA conditions that get solved by rewriting or narrowing, thus avoiding calls to external SMT solvers.
Theorem proving. In [28], we showed that TA is sufficiently expressive to control the cardinality of its own models. In particular, TA can naturally model both reachable and finite systems, two classes of structures that frequently arise in computer science. In this paper, we propose a verification method for proving properties of such models. The method is based on TA clauses and employs rewriting and narrowing techniques to discharge proof obligations. We illustrate the approach through two case studies: the natural numbers and the integers modulo a natural number. Although simple, these examples are particularly instructive, as they highlight both the strengths and the limitations of our framework. On the one hand, the method provides a high degree of automation in the verification process. On the other hand, the expressiveness and non-compactness of the underlying logical system entail certain inherent challenges, such as the necessity of employing the cut rule when reasoning about properties formalized by employing the transitive closures of relations despite the fact that completeness does not require the cut rule. This apparent contradiction arises from the fact that we employ infinitary proof rules, that is, proof rules with infinitely many premises. Such rules cannot, in general, be applied by a purely mechanical proof search procedure and must instead be justified by inductive arguments. Consequently, while our framework admits a highly automated treatment of many verification tasks through rewriting and narrowing, inductive reasoning remains indispensable for establishing the soundness of certain proof steps and for handling properties involving transitive closure. In this sense, the need for the cut rule should not be viewed as a deficiency of the method, but rather as a reflection of the intrinsic complexity of reasoning in a highly expressive setting, where finite proof objects are required to capture computational behaviours, possibly infinite.
Tool support. We have implemented a tool prototype for writing Transition Algebra specifications, reducing terms, checking transitions, and solving queries. This was made possible by SpeX [45], which is both a heterogeneous logical environment and a collection of Maude libraries that facilitate the development of new specification languages. We also took advantage of the fact that Rewriting Logic is reflective [5], and that Maude supports meta-level computations where modules and terms can be used as standard data. Thus it has been possible to define a dedicated syntax for TA specifications, to parse specifications, transform them into internal Maude representations, and then use those representations to reduce terms and solve queries. It is worth noting, however, that both the sentences and the execution mechanisms of Rewriting Logic and Transition Algebra are different, hence no direct translation is possible. For that reason, the tool that we have developed builds on the features provided by Maude to obtain specially designed resolution procedures for Transition Algebra, in line with the theoretical foundations described in the following sections.
Finally, we have worked in detail a medium-sized case study on process algebra in order to assess the effectiveness of both the logical framework and of the tool. We have conducted the case study at two levels of abstraction. First, at a more general level, we have developed a thorough TA specification of CCS; this showcases the expressiveness of TA, as it allows us to capture the operational semantics of CCS with minimal conceptual and notational overhead. Second, at a more particular level, building on the TA specification of CCS, we have given a formalization of the MapReduce programming model [9], and then we have checked that an instance of it is correct using narrowing; this demonstrates the potential of the TA framework for formal reasoning.
Organization of the paper. The rest of the paper is structured as follows: Section 2 presents Transition Algebra. Some preliminary concepts required to understand the rest of the paper are described in Section 3. Section 4 discusses conditions to ensure completeness of the proof rules for reasoning about queries. Sections 5 and 6 are devoted to the operational semantics, while Sections 7 and 8 discuss completeness. Section 9 demonstrates the expressiveness of TA by presenting methods for modeling reachability and finiteness, as well as verification techniques for ensuring the correctness of reachable and finite systems. Section 10 presents the tool support developed for Transition Algebra and an important case study from the domain of concurrent and distributed systems, namely MapReduce, a widely used framework for processing large datasets across distributed computing infrastructures. In Section 11, we present our conclusions and outline several directions for future work.
Gäinä, Riesco and Tutu
Signatures. We work with many-sorted algebraic signatures of the form , where is a set of sorts and is an -sorted set of function symbols, where denotes the set of strings over . We often write to indicate that , and we refer to and as the arity and sort, respectively, of the symbol . Under this notation, can also be regarded as an ordinary set consisting of function declarations of the form . When is the empty arity, we may speak of as a constant (symbol) of sort . Throughout the paper, we let range over arbitrary signatures of the form , , and , respectively.
As usual in institution theory [13, 43], important constructions such as signature extensions with constants as well as open formulae and quantifiers are realized in a multi-signature setting, so moving between signatures is common. A TA signature morphism is just an ordinary algebraic signature morphism .
Remark 1. Signature morphisms compose componentwise. Their composition has identities and is associative, thus leading to a category Sig of signatures.
Models. Given a signature , a -model is a -algebra equipped, for each sort and every element , with a family of -sorted transition relations . That is, every element of the algebra is mapped to a family of transition relations indexed by the sorts. A -homomorphism is an ordinary algebraic -homomorphism that preserves transitions: for all sorts and all elements . -homomorphisms form a subcategory, which we denote by , of the category of algebraic homomorphisms.
Remark 2. Each signature morphism determines a model-reduct functor where:
(1) For every -model , the -model is defined as follows:
for all sorts ;
for each function symbol ; and
for all sorts and all elements .
(2) For every -homomorphism , for any sort .
Moreover, the mapping is functorial.
For any signature morphism , any -model , and any -model , if , we say that is the -reduct of , and that is a -expansion of . For example, for any many-sorted set (say, of variables) that is disjoint from the set of constant-function symbols in , consider the inclusion morphism , where is the signature obtained from by adding the elements of to as new constants of appropriate sort. Then an expansion of a -model along can be seen as a pair , where is a valuation of into the elements of .
As in many-sorted algebra, there is a special, initial model in , which we denote by , whose elements are ground terms built from function symbols, and whose transitions are all empty. The -model of terms with variables from is defined as the -reduct of . That is, . The following property is an immediate consequence of the initiality of .
Remark 3. Any signature morphism determines uniquely a -homomorphism . In order to simplify notations later on, we denote that homomorphism by . Therefore, for any -term , we have .
Sentences. Given a signature , the set of actions is defined by the following grammar:
where is any term. Notice that actions are heterogeneous, meaning that we can compose, take unions, and iterate over terms of different sorts. We extend the notational convention that we use for the components of signatures to their corresponding sets of actions; that is, we usually denote by , and the sets of actions over signatures , and , respectively. Moreover, through a slight abuse of notation, we also denote by the obvious canonical map determined by a signature morphism .
To define sentences, we assume a countably infinite set of variable names . A variable for a signature is a triple , where (a) is a variable name and (b) is a sort in . The third component is used only to ensure that variables are distinct from the constant-operation symbols declared in , which is essential when dealing with quantifiers; but in most situations, unless there is some danger of confusion, we omit the third component and refer to variables either in a qualified form, as in , or just by their name, . A block of variables for is a set of variables for such that for all we have implies . The set of sentences over is given by the following grammar:
where (a) and are -terms of the same sort; (b) is any action; (c) is a finite set of -sentences; and (d) is a finite block of variables for and is a -sentence. A sentence of the form is called a transition, which can also be written in infix notation . An atomic sentence is a ground equation or a ground transition such that is an atomic action (i.e., a term).
When , we may write instead of . Besides the above core connectives, we also make use of the following convenient (and standard) abbreviations: for finite conjunctions; for falsity; for truth; if for implications; and for universally quantified sentences.
Remark 4. Any signature morphism can be canonically extended to a sentence-translation function given by:
and
Moreover, this sentence-translation mapping is functorial in .
Provided that there is no danger of confusion, if we identify variables only by their name and sort, then each inclusion morphism determines an inclusion function . This corresponds to the classical approach in model theory and simplifies the presentation greatly. A situation where we cannot apply this convention arises when translating a -sentence along the inclusion .
Satisfaction relation. Every -model interprets actions as binary relations as follows:
-
for each atomic action , the interpretation is already part of the model;
-
(i.e., diagrammatic composition of -sorted binary relations);
Gäinä, Riesco and Tuutu
-
(the union of -sorted binary relations); and
-
(the reflexive and transitive closure of -sorted binary relations).
We define the satisfaction relation between models and sentences as follows:
-
-
-
-
and
-
Notice that, since every term can be regarded as an action, we can quantify over transitions. For example, given a signature , a variable for and two -terms and of the same sort, is a well-defined sentence. However, even though it may seem so at a glance, this does not mean that we can quantify over arbitrary relations. Instead, Transition Algebra allows us to quantify only over those relations that are determined by the elements of models (which form a small fraction of the set all possible binary relations). Hence this form of quantification is still of first order. We present concrete examples of TA sentences that involve quantification over transitions in Section 10.
Let be sets of -sentences and a -model. We also use the following notations:
In particular, we write instead of for any set of sentences and any single sentence .
Proposition 1 (Satisfaction condition). For all signature morphisms , we have: .
Finite models. Many applications in computer science involve properties that hold only for finite models, or for models in which certain sorts are interpreted as finite sets. To account for this, we introduce Finite Transition Algebra (FTA), a variation of TA with signatures of the form , consisting of a TA signature together with a distinguished subset of sorts. The corresponding models are transition algebras in which every sort in is interpreted as a finite set. We write , we have .
3 Technical preliminaries
In this section, we introduce a series of previously developed concepts upon which the rest of the paper is built and we review some existing results to help contextualize our contributions.
Substitutions. Consider a signature and two sets of new constants and . A substitution over is a sort-preserving mapping from to . As in the case of signature morphisms, a substitution determines:
-
a sentence functor , which preserves and maps each constant to a term , and
-
a reduct functor , which preserves the interpretation of and interprets each constant the same as the term ; that is, for all we have (a) for all sorts in , (b) for all function symbols in , and (c) for all constants .
By a slight abuse of notion, we let denote both the substitution and the sentence functor . The following result is a straightforward generalization of [13, Proposition 5.8].
Proposition 2 (Satisfaction condition for substitutions). For all substitutions , all -models and all -sentences we have: iff .
For any substitution and any subset , we let denote the restriction of to . This notation is useful to define the operational semantics for transition algebra.
Reachable models. A -model is reachable [41] when the unique homomorphism is surjective. The following result gives an abstract characterization of the notion of reachable model based on substitutions.
Proposition 3. A model defined over a signature is reachable iff for each set of new constants for and any expansion of to , there exists a substitution over such that .
The proof of Proposition 3 can be found, for example, in [19, Proposition 8].
Example 1 (Natural numbers). Consider a signature with two sorts, Nat and Label, and the following function symbols: 0: \mapsto \mathrm{Nat}, s_ : \mathrm{Nat} \to \mathrm{Nat}, _ + _ : \mathrm{Nat} \mathrm{Nat} \to \mathrm{Nat}, \mathrm{succ} : \mapsto \mathrm{Label}. Let be a set of sentences consisting of:
(1) and if , which state that denotes the successor relation; and
(2) and , which define addition by induction on the first argument for all elements reachable from 0 via the successor relation.
This presentation of natural numbers can also be written using the TA specification language, as we describe next. The syntax that we employ follows the tradition of the OBJ family of languages [25] and is similar to that of Maude [4]. We use keywords such as spec to introduce specifications, protecting to import/reuse existing specifications, sort or sorts to declare sorts, op or ops for operations, vars for universally quantified variables, ax for axioms (Horn clauses), and so on. In the listing below, NAT is just the signature of natural numbers, SUCC introduces the successor relation, and NAT-ADD-REACH defines addition for elements that are reachable along the successor relation. The reason we split the overall specification into these three parts is that it enables us to reuse some of them later on in the paper.
spec NAT is sort Nat . op 0 : () -> Nat . op s_ : Nat -> Nat . endspec
spec SUCC is protecting NAT . sort Label . op succ : () -> Label . vars x, y : Nat . ax x = (succ) > s x . ax y = s x if x = (succ) > y . endspec
Here, protecting indicates that the newly defined specification should not introduce new elements on 'old' sorts, originating from the imported specification, nor should it identify 'old' elements of those sorts. That is, we adhere to the 'no junk' and 'no confusion' principles of OBJ [21].
Gäinä, Riesco and Tuutu
spec NAT-ADD-REACH is protecting NAT . protecting SUCC . op _+ : Nat Nat -> Nat . vars x, y : Nat . ax x + 0 = x if 0 =((succ))> x . ax x + s y = s (x + y) if 0 =((succ))> x and 0 =((succ)*)> y . endspec
Note that the second axiom from the SUCC module cannot be specified in Maude, as it would use a rewrite condition in an equation. Also notice that succ is just the relational counterpart of the successor operation s_. Hence, any model over the signature in Example 1 which satisfies the sentence is reachable, having elements obtained from 0 by repeated applications of the successor operation. As shown in finite model theory, reachability/connectedness is not first-order definable; equivalently, first-order logic cannot define the transitive closure of a binary relation. For standard references and an in-depth discussion, consult Libkin [30]. Also, if , which means that all reachable models of satisfies the commutativity of addition. However, there is no finite subset of which satisfies if . Therefore, TA is not compact.
Basic sentences. A set of sentences defined over a signature is called basic [11] if there exists a -model such that, for all -models ,
We say that is a basic model of . If in addition the morphisms is unique then the set is called epi basic. It is known that any set of atoms in first-order logic is epi basic and the basic model is reachable (see, for example, [13, Fact 5.23]). Similarly, any set of atomic sentences from TA is epi basic and the basic model is reachable. We denote by the sub-function of that maps each signature in TA to the set of atomic sentences from .
Entailment systems. The syntactic counterpart of the satisfaction relation for reasoning about the logical consequences of sentences is defined below.
Fig. 1. Entailment systems
Definition 1 (Entailment system). An entailment system is a family of relations between sets of sentences and sentences (that is, for all signatures ) satisfying (Monotonicity) and (Translation) defined in Fig. 1. We drop the subscript from the notion when there is no danger of confusion.
Remark 5. Entailment system are generally required to also satisfy (Cut), also called transitivity [33], as defined in Fig. 1. We omit it from the definition of entailment systems to emphasize the fact that lemma discovery is not needed for the proof calculus developed in this paper.
Definition 2 (Entailment properties). Let be an entailment system.
(1) is sound if for all signatures we have ; and complete when the opposite inclusion holds: .
(2) is compact if for all signatures , all sets of sentences and all sentences , we have: implies for some finite .
Contexts. We recall the notions of context and position from the term rewriting literature [2], which are fundamental to the development of an operational semantics.
Definition 3 (Context). Let be a distinguished variable name used to indicate a gap within a term. A context is a term that contains exactly one occurrence of a variable named . We typically denote contexts by , or by when we want to make explicit the sort of the gap. For any context and any sort of sort , we write for the term , where is the substitution that maps to .
We say that an equation is an extended context if either or is an ordinary term context. Similarly, a transition is an extended context if either is a context, is a context, or contains exactly one occurrence of an atomic sub-action (i.e., term) that is a context. A set of equations and transitions is also called an extended context if exactly one of the formulae is an extended context. We denote extended contexts by , and we write for the (set of) formulae obtained by substituting a term for within an extended context .
Definition 4 (Position). Assume a signature . The set of positions of a term is a set of strings with elements from the natural numbers, which is inductively defined as follows:
For , the subterm of at position , denoted by , is defined by induction on the length of :
Let and such that the sort of coincides with the sort of . We denote by the term obtained from by replacing the subterm at position by , that is:
4 Query completeness
In this section, we propose a notion of Horn clause that is more expressive than the classical one defined for first-order logic. A Horn clause is a sentence of the form if where (a) is a finite block of variables; (b) is a finite set of equations and transitions; and (c) is an atomic sentence. A query is an existentially quantified sentence , where is a finite set of equations and transitions. We define a system of proof rules for deducing queries from a set of Horn clauses. We develop a two-layered approach to the completeness of the proof rules proposed:
(1) We begin with a basic layer composed of atomic sentences. At this initial stage, we consider the deduction of an atomic sentence from a set of atomic sentences—that is, , where both and consist solely of atomic sentences.
Since and are semantically equivalent, for the sake of simplicity, we let if denote if .
Gäinä, Riesco and Tutu
Table 1. Basic proof rules
(2) In the second stage, we increase the complexity by allowing arbitrary clauses on the left-hand side of the turnstile and queries on the right-hand side of the turnstile. That is, may be any set of clauses, while is a query. Another important result here is the fact that any set of Horn clauses has an initial models and the satisfaction of a query by a program modeled as a set of Horn clauses , can be reduced to the computation of a substitution such that which is furthermore equivalent with the satisfaction in the initial model, that is, .
4.1 Basic clauses
In this section, we prove an important result about atomic sentences. The proof rules for reasoning about atomic sentences are defined in Table 1. Notice that from Table 1 stands for any set of sentences not only just for atomic sentences.
Lemma 1 (Basic soundness). The proof rules defined in Table 1 are sound. That is, the least entailment system closed under the proof rules defined in Table 1 is sound.
We show that each set of sentences and any sound entailment relation closed under the proof rules in Table 1 gives rise to a model that preserves formal deductions.
Theorem 1. Let be any sound entailment system closed under the proof rules defined in Table 1. Any set of sentences over a signature defines a model as follows:
(1) Let be the congruence on determined by .
(2) Given a -term , we let denote the equivalence class of under the congruence . Then is obtained from by interpreting each binary relation , where and for some , as a binary relation and .
Then iff for all atomic sentences defined over .
PROOF. It is straightforward to prove that is a congruence relation on . By , the definition of does not depend on the representatives , and of the classes , and , respectively. In other words, iff . Therefore, is well-defined. There are two cases for proving the statement of the theorem:
Completeness for atomic sentences follows from Theorem 1, showing that to reason about the consequences of a set of atomic sentences, it suffices to consider only its initial model.
Table 2. Actions, modus ponens and substitutivity
Corollary 1 (Basic completeness). Let be any sound entailment system closed under the proof rules defined in Table 1. For any set of atomic sentences and any atomic sentence defined over the same signature , the following are equivalent:
where is the model described in Theorem 1.
PROOF. We proceed as follows:
(a) (b) By soundness.
(b) (c) For any , since , by Theorem 1, . Therefore, . Since , we get .
(c) (a) By Theorem 1.
Notice that, by Corollary 1, is a model of , hence the initial model of .
4.2 Queries
Table 2 defines the proof rules used to deduce queries.
Lemma 2. The proof rules defined in Tables 1 and 2 are sound. That is, the least entailment system closed under the proof rules defined in Tables 1 and 2 is sound.
We show that any set of clauses has an initial reachable model, which preserves formal deductions of ground equations and transition rules.
Theorem 2 (Initiality & query completeness). Let be any sound entailment system closed under the proof rules defined in Tables 1 and 2. Let be a set of clauses defined over a signature .
(1) is the initial model of , where is the model defined in Theorem 1.
(2) For all queries , we have: (a) iff (b) iff (c) .
PROOF. First, we prove the following statement:
(†)
For statement , we proceed by induction on the structure of actions:
By Theorem 1.
Gäinä, Riesco and Tutu
We have iff iff or iff or . By the induction hypothesis, or . By .
We have . Since is reachable, we have and for some term . By induction hypothesis, and . Hence, by (Comp), .
We have . By semantics, for some natural number . By induction hypothesis, . By (Star), .
For the first statement of the theorem, by Corollary 1, it suffices to prove that . Let if be a clause in . Let be an expansion of to such that . Since is reachable, there exists a substitution such that . By the satisfaction condition for substitutions, since , we have . By statement , for all . By (MP), . By Corollary 1, . By the satisfaction condition for substitutions, .
The second statement is proved as follows:
(a) (b) By soundness.
(b) (c) Since .
(c) (a) Since , we have for some expansion of to . Since is reachable, there exists a substitution such that . Since , by the satisfaction condition for substitutions, . By the first part of the proof, for all . By (Subst), .
In the next three sections, we focus on providing a framework for proving queries automatically.
5 Operational semantics
In this section, we present the operational semantics of Transition Algebra, which will be used to formally describe system behaviour from the computational point of view. For this purpose, we consider two kinds of rewrite rules to ‘execute’ specifications. An equational rewrite rule is a Horn clause of the form if such that (a) is not a variable and (b) . Similarly, a transitional rewrite rule is a Horn clause of the form if such that (a) is not a variable and (b) . Hereafter, whenever we refer to a term rewriting system in TA we mean a pair consisting of a signature and a set of equation and transition rewrite rules.
5.1 Rewriting
In this section, we define a rewriting relation on Transition Algebra goals, which are sets of (ground) equations and transitions, and then prove its soundness with respect to the denotational semantics presented in Section 2.
Definition 5 (Goal rewriting step). Let be a term rewriting system. The one-step-rewriting relation on ground equations and transitions – referred to as goals in certain contexts – is defined as follows (we use different labels for the relation to indicate different cases):
EQ for all equational rules if and all substitutions ;
This form of rewriting, defined directly on formulae, is similar to the treatment of pararewriting in [3]. We use it instead of the more conventional approach (see, e.g., [32] and also [2, 10, 29, 42]) because it provides a more straightforward way to proving completeness and relating it to narrowing in the latter parts of the section. The connection with the conventional approach to term rewriting is established in Lemma 3 and Proposition 4.
Definition 6 (Goal rewriting). The general rewriting relation on Transition Algebra goals is the reflexive and transitive closure of the one-step-rewriting relation. We define it by , where: (a) , and (b) if and , then , for each label . When the label is irrelevant, we may omit it and write simply for a single rewriting step.
Remark 6. So far, we have defined rewriting on sets of ground equations and transitions. To extend it to equations and transitions with variables from some given block X, we treat the variables in X as new constants that we add to the underlying signature. Concretely, for any term rewriting system and block X of variables, rewriting equations and transitions with variables from X amounts to applying rewriting over .
This notion of goal rewriting is sound in the following sense: given the rewriting rules (Horn clauses) provided by , the outcome of a rewrite is always stronger, with respect to the satisfaction relation, than the original goal.
Theorem 3 (Soundness of rewriting). Let be a term rewriting system. For any goals ,
PROOF. We proceed by induction on the number of rewriting steps. For the base case, it suffices to notice that if and only if , which leads to the obvious entailment .
For the induction step, there are six cases to consider. Three of them, for =, ∪, and ∪, are straightforward. Therefore, we focus only on the remaining ones:
EQ Suppose , where for some rule if and some substitution . By the induction hypothesis, . Since if and , it follows that . Moreover, since and , we have . Hence, .
TR Assume that , where and , for some rewrite rule if and some substitution . By the induction hypothesis, . Since if and , it follows that . And because , , and , we infer . Hence, .
Gäinä, Riesco and Tutu
Suppose for some -term . By the induction hypothesis, we have . Since , by the semantics of Transition Algebra, . Therefore, .
Corollary 2. For any term rewriting system and goal , implies .
5.2 Narrowing
Next, we look for solutions to queries, which are defined as existentially quantified goals and are usually denoted , where is a block of variables and is a goal with variables from . As in equational logic programming [24], a solution to is a substitution such that . We solve queries by narrowing, which is similar to rewriting, but employs most general unifiers (mgu) instead of matching substitutions in order to compute 'values' for the variables in such that the equalities and transitions in hold true.
Definition 7 (Narrowing step). Let be a term rewriting system. The one-step-narrowing relation on queries, indexed by so-called computed substitutions, is defined as follows:
EQ when is not a variable and for some rule if ;
TR when for some rule if ;
, for any new variable , distinct from those in , and for the obvious inclusion ;
The narrowing relation corresponds to the reflexive and transitive closure of the one-step-narrowing relation.
Definition 8 (Narrowing). The general narrowing relation is defined by , where:
(1) , and
(2) if and , then , for each label .
Similarly to rewriting, we may drop the label lb when we want to refer to an arbitrary narrowing step.
The following result establishes soundness of narrowing based on the soundness of rewriting.
Theorem 4 (Reduction lemma & soundness of narrowing). Let be a term rewriting system.
(1) If , then .
(2) If , then for any solution to , the substitution is a solution to .
As in the case of clauses, abbreviates .
is the identity.
PROOF. We prove the first statement by induction on the number of steps. The base case is trivial, hence we deal only with the induction step. To shorten the proof, we present just the case of EQ, since all the other ones are similar.
EQ Suppose , where for some rule if and is the restriction of to . Let be the restriction of to , and be the unique extension of the composed substitution that maps to . It is easy to see that and . Moreover, since unifies and , it follows that . So, by the definition of rewriting, we have , from which we get . Chained with , which holds by the induction hypothesis, this EQ rewriting step entails .
For the second statement, notice that by the soundness of rewriting (Theorem 3), . By the general translation property of the semantic entailment system, and because leaves the clauses in unchanged, it follows that . But is already a consequence of because the substitution is a solution to . Therefore, . By applying once more the general properties of the semantic entailment system, it follows that , which shows that is a solution to .
Corollary 3. If , then is a solution to .
The converse of the Reduction Lemma also holds. This kind of result is generally known in the literature as a Lifting Lemma, and it plays a crucial role in proving the completeness of narrowing (see Section 7).
5.3 Term rewriting
In this section, we revisit the rewriting of terms and show how it relates to goal rewriting.
Definition 9 (Term rewriting). Let be a term rewriting system. We overload the notation used for rewriting goals and define a one-step-rewriting relation on -terms as follows: for any context ,
EQ if there exist an equational rule if and a substitution such that .
The family of -step rewriting relations is defined inductively as follows: (a) , and (b) if and , then . We write whenever for some .
The same idea of decoupling condition evaluation from actual term rewriting appears in [35], where background theories are used to evaluate more complex conditions such as quantifier-free formulas.
Remark 7. Let be a term rewriting system.
(1) Typically, the conditional rules if used in term rewriting are required to satisfy (see [22]). That is useful because it allows the block of variables to be omitted with no risk of confusion. Moreover, the matching substitution used during rewriting gets uniquely determined by the subterm that is being rewritten and the left-hand side of the (head of the) rule, thus eliminating a potential source of non-confluence—which we will revisit shortly.
(2) The condition on variables can sometimes be relaxed by introducing some additional mechanism to deal with the variables that do not occur in ; see, for example, the matching conditions of Maude [4]. The condition we employ
Gäinä, Riesco and Tutu
in this paper is . From an operational-semantics perspective, we can use narrowing to compute the action of on , provided that the rules in are written in such a way that, if a solution to exists, then it is unique.
(3) Term rewriting extends canonically from terms to actions: (a) when and ; (b) when and ; and (c) when .
Term rewriting together with action rewriting allows us to define a transition relation on terms.
Definition 10 (Term transition). Let be a term rewriting system. The relation on -terms is defined by induction on the structure of :
TR if there exist a rewrite rule if and a substitution such that (a) , (b) , (c) , and (d) ;
if and for some term ;
if for some ; and
if for some .
Remark 8. A note similar to that of Remark 7 applies to the transitional rewrite rules if used for computing transitions between terms. Here, we require that , and we use once more narrowing to determine how the substitution acts on variables in — i.e., on variables whose ‘values’ cannot be computed purely by matching.
The next result shows that the rewriting of goals can be reduced to rewriting terms and checking term transitions.
Lemma 3. Let be a term rewriting system.
(1) If and , then .
(2) for some term iff .
(3) If , then .
PROOF. The proofs of the above statements are straightforward by induction.
For transitions, the implication in the opposite direction to that of Lemma 3 (3) requires some additional constraints on , namely confluence and coherence. The following notions of confluence and termination are standard in the term rewriting literature (see, e.g., [2]). The only difference is that here we apply them to a new setting where arbitrary transitions can occur among the conditions of rewrite rules.
Definition 11 (Confluence, termination, and canonicity). A term rewriting system is:
-
ground confluent when for all -terms , , and such that there exists a term such that ;
-
confluent when is ground confluent for all finite blocks of variables X for ;
-
ground terminating when there is no infinite chain of -term rewrites .
-
terminating if is ground terminating for all finite blocks of variables X for .
-
canonical when it is confluent and terminating.
The following notion of coherence is closely related to the strong coherence property introduced in [46]. Coherence property guarantees that every transition which is possible in the equational semantics can also be computed using the oriented equations [40].
Definition 12 (Coherence). A term rewriting system is coherent if for
(1) all transition rules if and
(2) all substitutions
such that and , there exist a rule if and a substitution such that
(a) , (b) , (c) and (d) .
We present an example of a coherent term rewriting system implemented using our syntax (recall Example 1).
Example 2 (Bubble sort). Consider the following term rewriting systems:
spec BOOL is sort Bool . ops true, false : () -> Bool . endspec
spec NAT-LEQ is protecting NAT . protecting BOOL . op <= : Nat Nat -> Bool . vars x, y : Nat . ax ( ) = true . ax (s x <= ) = false . ax (s x <= s y) = (x <= y) . endspec
The signature of BOOL consists of a single sort, Bool, and two constants, true and false, of sort Bool. The term rewriting system BOOL has no rules. NAT-LEQ is built on top of BOOL and NAT (from Example 1); that is, the signatures of BOOL and NAT are included in the signature of NAT-LEQ. In addition, NAT-LEQ introduces a relation (as a Boolean-valued operation) <= : Nat Nat -> Bool, which is defined inductively with respect to both arguments.
Next, we define lists of natural numbers. These are often presented using subsorting (by letting Nat be a subsort of a newly declared sort of lists of natural numbers) and a list-concatenation operator that is declared associative and with an identity element using special operator attributes such as assoc and id: (e.g., [4]). Both of those features are compatible with TA. However, in order to keep the conceptual framework as simple as possible, we avoid them for now and define lists of natural numbers using an explicit injection of numbers as singleton lists, denoted by an operation i, and we also make explicit, using equation, the associativity and the identity properties of the concatenation. Last but not least, we label the axioms (using the keyword label:) to make it easier to reference them later in the text.
Gäinä, Riesco and Tuutu
spec NAT-LIST is protecting NAT . sort NatList . op empty : () -> NatList . op i : Nat -> NatList . op ; : NatList NatList -> NatList . vars z, z1, z2, z3 : NatList . ax empty ; z = z [label: id0] . ax z ; empty = z [label: id1] . ax (z1 ; z2) ; z3 = z1 ; (z2 ; z3) [label: dt] . endspec
The specification NAT-LIST includes both the signature and the rules of NAT. In addition, NAT-LIST introduces a new sort NatList together with three constructors (that is, function symbols that build the sort NatList): empty :→ NatList, i : Nat → NatList and ; : NatList NatList → NatList. The first two equations state that empty is the identity for ;, while the third equation orients associativity so that terms are normalized to a right-associated form.
Finally, we write a specification of a comparison sort algorithm for lists of natural numbers inspired by bubble sort – see [22] for an earlier algebraic-specification approach to bubble sort. In the specification BUBBLE below, the added conditional transitions capture the compare-and-swap steps of bubble sort. Each of the three conditional transitions applies to a different possible occurrence of a misordered pair of adjacent numbers: in the middle, at the end, or at the beginning of a list.
spec BUBBLE is protecting NAT-LIST . protecting NAT-LEQ . vars x, y : Nat . vars z1, z2 : NatList . ax z1 ; (i(x) ; (i(y) ; z2)) = (true)> z1 ; (i(y) ; (i(x) ; z2)) if (y <= x) = true [label: tr1] . ax z1 ; (i(x) ; i(y)) = (true)> z1 ; (i(y) ; i(x)) if (y <= x) = true [label: tr2] . ax i(x) ; i(y) = (true)> i(y) ; i(x) if (y <= x) = true [label: tr3] . endspec
To show that BUBBLE is coherent, we define a notion of critical pairs formed from a transition rule if and an equation rule if .
Critical overlap. Assume a substitution and a position such that
(a) is a unifier for , (b) is not a variable, (c) and (d) .
We have the following critical pair:
The critical pair is joinable if there exist a transition rule if and a substitution such that
Another ingredient needed to show that a term rewriting system is coherent is a notion of condition that is preserved under rewriting.
Definition 13 (Preservation under rewriting). Consider a term rewriting system and a set of equations and/or transitions with variables from . We say that is preserved under rewriting if for any substitutions such that (a) and (b) for all , we have .
If the underlying term rewriting system is ground confluent and consists solely of equations, then by Lemma 3(2), is preserved under rewriting.
Lemma 4 (Coherence). Let be a term rewriting system that is ground confluent and ground terminating. In addition, assume that
(1) all critical pairs arising from the interaction between equation rules and transition rules are joinable, and
(2) every transition rule if that forms a critical pair with an equation rule has a condition that is preserved under rewriting.
Then is coherent.
PROOF. Assume that for some transition rule and some substitution . Since the term rewriting relation is terminating, we proceed by well-founded induction on . Since the base case is straightforward, we focus on the induction step. There are two cases to consider.
Critical overlap. In this case, we assume a ground term , a transition rule if and an equation rule if such that , where (a) is a position such that is not a variable, and (b) is a unifier for such that and . Since all critical pairs are joinable, there exist a transition rule if and a substitution such that (a) , (b) , (c) and (d) .
By ground confluence, for some term . By the induction hypothesis applied to , there exist a transition rule if and a substitution such that (a) , (b) , (c) and (d) .
Non-critical overlap. In this case, we assume a ground term , a transition rule if and an equation rule if such that , where (a) such that for some variable , (b) such that , (c) such that , and (d) such that is not a variable and .
Gäinä, Riesco and Tutu
Let be the substitution defined by for all variables . Since and is preserved under rewriting, . By ground confluence, for some term . By the induction hypothesis applied to , there exist a transition rule if and a substitution such that (a) , (b) , (c) and (d) .
Hence, is coherent.
Observe that the second condition of Lemma 4 holds in any unconditional term rewriting system.
To further investigate coherence in rewriting modulo associativity, commutativity, and/or the identity element, the interested reader may consult [40]. It is straightforward to verify that BUBBLE is ground terminating and ground confluent. Critical pairs arise from the interaction of idi with trj, where and . We show that all critical pairs are joinable:
Observe that for all natural numbers we have . It follows that for any substitution , we have that and for some such that . For all and all , from idi and trj, we get the following critical pairs:
(1)
(2) list;
(3)
(4)
where list is any list of natural numbers. All critical pairs are joinable. Take, for example, the first one:
Hence, BUBBLE is coherent. Moreover, note that if any of the transition rules tr1, tr2, or tr3 is removed, the resulting term rewriting system is no longer coherent.
The main result of this section establishes conditions that (a) ensure a compatibility of transitions with equations and (b) allow goal rewriting to be carried out by means of term rewriting.
Proposition 4. Let be a ground confluent and coherent term rewriting system.
(1) If and , then there exists a term such that and .
(2) If , then for some -term .
PROOF. For the first statement, we proceed by induction on the structure of a:
TR Suppose is an atomic action . By the definition of , there exist a rule if and a substitution such that , and . Since , by ground confluence, there exists a term such that . By coherence, there exists a rewrite rule if and a substitution such that , and . Since , by ground confluence, for some -term .
It follows that and . Therefore, by the definition of term transitions, . Suppose . By definition, it follows that and for some term . By the induction hypothesis for , there exists a term such that and . Applying the induction hypothesis once more, for , we get and for some -term .
Hence, by the definition of term transitions, .
Suppose . This means that for some . So, by induction hypothesis for , and for some -term . It follows that and .
Suppose . This means that for some . That is, there is a sequence of terms such that , and for all . By the induction hypothesis for , there exists a sequence of terms such that and for all .
Now let be the term . It follows that and .
For the second statement, suppose for some label (we exclude the label ‘=’ since that kind of rewriting step does not apply to transitions). We proceed by case analysis on :
EQ Depending on the choice of extended context, the rewriting takes place either within , , or . Assume it does so within , since that is the most complex scenario; the other two are similar. This means that there exist actions and over the signatures and , respectively, and also a rule if , and a substitution such that , , and . Since , we have and for some natural numbers and such that . Since , we have . Since , by induction hypothesis, there is a -term such that . Finally, by Lemma 3(1), we get .
Gäinä, Riesco and Tutu
TR Suppose is an atomic action and that there exist a rule if and a substitution such that and . This means that . Therefore, since , we get both and . The former rewriting implies that there is a term such that , whereas the latter entails . We conclude, by the definition of term transition, that .
In this case, for any -term . It follows that and for some . By the induction hypothesis, there exist two -terms and such that and , as depicted below.
Since is ground confluent and coherent, by the first statement, we know there is a -term such that . Since and , we get .
Suppose . It follows that for some . By the induction hypothesis, there exists a -term such that . Therefore, by the definition of term transitions, .
In this case, for some . By the induction hypothesis, for some term , which entails, by the definition of term transitions, that .
6 Strict rewriting
Under coherence and canonicity, transitions from a given term can be computed in a concise and systematic way: the term is first reduced to its normal form, and a transition rule is then applied to the resulting term. To this end, we introduce a stricter form of rewriting goals:
Definition 14 (Strict goal rewriting). We say that a goal rewrites strictly to , and write , when there exists a sequence of rewriting steps where all the occurrences of the step are instances of the following stricter decomposition of actions:
that .
That is, , where: (a) , and (b) if and , then , for each label .
Strict goal rewriting induces a more constrained variant of term rewriting, which we call strict term rewriting, where conditions are rewritten according to Definition 14.
Definition 15 (Strict term rewriting). Let be a term rewriting system. For any context , we have
EQ! if there exist an equational rule if and a substitution such that .
The family of -step strict rewriting relations is defined inductively as follows: (a) , and (b) if and , then . We write whenever for some .
Observe that that for any unconditional term rewriting system, term rewriting coincides with strict term rewriting. Based on strict term rewriting, we define a constrained version of term transition, which we call strict term transition.
Definition 16 (Strict term transition). We say that a term transitions strictly to via an action , and write , when such that all the occurrences of 'tr' and 's' steps are instances of the following stricter rules:
TR! if there exist a rewrite rule if and a substitution such that (a) , (b) , (c) , and (d) ;
Proposition 5. Let be a term rewriting system.
(1) If and , then .
(2) for some term iff .
(3) for some term iff .
PROOF. The proof of the first statement is straightforward, by induction on the structure of the action a.
For the second statement, the forward implication, one can straightforwardly prove by induction on the number of strict rewrite steps that iff for any natural number and any new variable for . Then from we get and for some new variable for . It follows that and . Hence, .
The backward implication of the second statement follows easily by induction on the number of rewrite steps.
For the third statement, the forward implication, one can straightforwardly prove by induction on the number of strict rewrite steps that: (a) if , then , (b) if , then , and (c) if , then . Second, apply induction on the structure of to prove that implies . Third, we get implies .
For the third statement, the backward implication, suppose we have for some label (we exclude the label ‘=’ since that kind of rewriting step does not apply to transitions). We proceed by case analysis on :
EQ Depending on the choice of extended context, the rewriting takes place either within , , or . Assume it does so within , since that is the most complex scenario; the other two are similar. This means that there exist action over the signature , a rule if , and a substitution such that and . Let us denote by , and we have . It follows that and for some natural numbers and with . Since , we have . Since , by induction hypothesis, for some -term . Finally, from the first statement, we get .
TR! Suppose is an atomic action and that there exist a rule if and a substitution such that and . This means that . Therefore, since , we get both and . The former rewriting implies that there is a term such that , whereas the latter entails . We conclude, by the definition of term transition, that .
Gäinä, Riesco and Tuutu
Suppose . In this case, , where is an irreducible -term. We get and for some natural numbers and with . By the induction hypothesis, there exist two -terms and such that and . Since is irreducible, . Hence, .
Suppose . It follows that for some . By the induction hypothesis, there exists a -term such that . Therefore, by the definition of strict term transition, .
Suppose . In this case, for some . By the induction hypothesis, for some term , which entails, by the definition of strict term transition, that .
Obviously, strict rewriting and strict transition are special cases of rewriting and transition, respectively. This naturally leads us to ask under which conditions (a) strict rewriting is equivalent to ordinary rewriting, and (b) every sequence of transitions can be realized as a sequence of strict transitions.
We address the first question and we define a notion of modular term rewriting system.
Definition 17 (Modular term rewriting system). A term rewriting system is modular if is a disjoint union of rules, that is, such that
(1) is free of composition 's' and iteration 's'.
(2) contains all conditional equations from , that is, if whenever if .
(3) For all if and if , the sort of is different from the sort of .
The last condition in Definition 17 is a closure property ensuring that, when evaluating conditions from , no transition rules from are used; in particular, is a self-contained term rewriting system. Together with the first condition in Definition 17, this ensures that, for any modular term rewriting system, ordinary term rewriting coincides with strict term rewriting.
Lemma 5. Let be a modular term rewriting system, where and and satisfy the properties from Definition 17. For all -terms and of the same sort, the following are equivalent:
PROOF. By the second and third condition of Definition 17, over if and only if over . By the first condition of Definition 17, over if and only if over .
Maude specifications are modular by default in the sense of Definition 17, since the condition of an equation rule if is not permitted to contain transitions. The rest of the section provides conditions ensuring that every transition sequence can be realized by a sequence of strict transitions.
Definition 18 (Strict coherence). A term rewriting system is strictly coherent if for
(1) all transition rules if ,
(2) all substitutions such that , and
(3) all normal forms of ,
there exist a transition rule if and a substitution such that
(a) , (b) , (c) and (d) .
If the underlying term rewriting system is ground terminating then strict coherence implies coherence. However, this implication does not hold in general.
Example 3. The term rewriting system COLLAPSE is obtained by putting together two smaller term rewriting systems NAT and BOOL (from Examples 1 and 2) and then adding on top four more axioms. Note that, in this case, we are including NAT instead of protecting it because the last two of the added axioms identify 'old' elements (natural numbers).
spec COLLAPSE is including NAT. protecting BOOL. var x : Nat. ax . ax s x = (false) > s . ax . ax s x = s s x. endspec
Observe that the equation in COLLAPSE causes a failure of termination. As a consequence, no term of sort Nat has a normal form. This implies that COLLAPSE is strictly coherent. However, COLLAPSE is not coherent. Indeed, for any , we have and , while true false does not hold.
The main result of this section provides conditions ensuring that any sequence of transition steps can be achieved by a sequence of strict transitions.
Proposition 6. Consider a term rewriting system that is (a) ground confluent, (b) strictly coherent, and (c) modular in the sense of Definition 17 such that is ground terminating. If then , where denote the (unique) normal form of , for each .
PROOF. We proceed by induction on the structure of a:
TR Suppose is an atomic action . By the definition of , there exist a transition rule if and a substitution such that
By strict coherence, there exist a rule if and a substitution such that
Since , by ground confluence, .
Gäinä, Riesco and Tutu
It follows that and . Since is modular, by Lemma 5, and . By the definition of strict term transition, .
Suppose . By definition, it follows that and for some term . Since is ground terminating, has a normal form . By the induction hypothesis for , . Applying the induction hypothesis once more, for , we get . By definition, .
Suppose . This means that for some . So, by induction hypothesis for , . By definition, .
Suppose . This means that for some . By the induction hypothesis for , we have . By definition, .
7 Completeness of operational semantics
The completeness of rewriting and narrowing is much more complex than soundness and it holds only under certain conditions. All the results that we develop in this section are based on confluence and coherence assumptions.
7.1 Completeness of rewriting
In this section, we prove the completeness of both rewriting and strict rewriting.
Theorem 5 (Completeness rewriting and strict rewriting). Assume a ground confluent term rewriting system and a goal .
(1) If is coherent then following are equivalent: (a) , (b) , and (c) .
(2) If is strictly coherent and modular in the sense of Definition 17 such that is ground terminating then the following are equivalent: (i) , (ii) , and (iii) .
PROOF. Let be the usual convergence, or joinability, relation on terms. That is, if and only if for some term . Just as in equational logic, it is easy to see that is a congruence on the term algebra . Let be the transition algebra obtained from by interpreting each atomic action as follows:
where, for each term , is its congruence class with respect to .
We show that is well-defined. Suppose for some term and let , , and . This means that there exist terms , , and such that , , and as depicted in the diagram below. By the definition of term transitions, there also exist a rule if and a substitution such that , , and . The ground confluence property gives us the terms and in the diagram below. Then, by coherence, we know there exist a rule if and a substitution such that , , and . By ground confluence
(applied twice) we also obtain the terms and together with the four rewrites depicted in the diagram below.
We have thus obtained , , and . By the definition of term transitions, it follows that .
Next, we show two key properties of . The first one is that, for all goals ,
(†)
We prove it by induction on the structure of the sentences in G:
EQ Consider an equality . By the construction of , we know that if and only if there exists a term such that . By Lemma 3(2), the latter property entails .
TR Now consider an atomic transition . By definition, we have if and only if , which holds if and only if for some term . By Lemma 3(3), the latter implies .
For the composition of actions, since is reachable, iff there exists a term such that and . By the induction hypothesis, and . Therefore, by the definition of goal rewriting, we get .
The remaining cases, for unions and iterations, can be treated similarly to compositions, hence we leave out the details. The second property of interest of is that
(*)
To see why that is the case, consider a clause if . Since is reachable, it follows that if if and only if implies for all substitutions . Now let be a substitution such that . By ( ), we know that . Hence we have two cases to consider depending on the nature of :
(1) If is an equality , then . Therefore, by Lemma 3(2), for some term . By the definition of , this means that .
(2) If is an atomic transition , then . So, by Proposition 4(2), for some term , which is equivalent to .
By soundness, (a) (b). By , (b) (c). By , (c) (a).
For the second statement, notice that:
(1) Since is ground terminating, strict coherence implies coherence, which means implies .
(2) By Proposition 4(2), Proposition 6 and Proposition 5(3), implies .
Using the first statement, we get (i) (ii) (iii).
Gäinä, Riesco and Tuutu
7.2 Completeness of narrowing
As usual for narrowing-based procedures for solving queries (e.g., [37]), we cannot expect to compute arbitrary solutions to queries. Instead, we are looking only for those solutions that are normal, meaning that is a normal/irreducible term for all variables .
The final major tool used to prove the completeness of narrowing is a Lifting Lemma that allows us to retrace strict goal rewrites through narrowing.
Lemma 6 (Lifting Lemma). Let be a term rewriting system such that:
(1) for each equational rule if , , and
(2) for each transition rule if , .
For every query , normal substitution , and goal over such that , there exist a narrowing derivation and a normal substitution such that , and .
PROOF. We prove the statement by induction on the number of steps. Since the base case is trivial, we focus only on the induction step. We proceed by case analysis on the first step of the rewriting. The only interesting cases are EQ, ‘=’, and ‘;’, TR is analogous to EQ, hence we omit it, and the remaining ones are straightforward.
EQ Let be the extension of that maps to , and suppose for some rule if and substitution such that . Since the substitution is normal, and because is rewritten to , it follows that is not a variable, hence we can narrow it.
Without loss of generality, assume that the sets of variables and are disjoint. Now take as the unique substitution that agrees with and on and , respectively. It follows that unifies and . Therefore, and admit a most general unifier, say , with . Hence, there exists a substitution that . And because is normal, it follows that is normal too. To see why that holds, consider the following cases, for every :
(1) If for some variable , then is subterm of . Since is normal, it follows that must be normal as well.
(2) If for some variable , then because . Since , we deduce that , so there exists a variable such that . It follows that is a subterm of , and thus a normal subterm.
Finally, let us choose . It is straightforward to check that . Moreover, we have , and .
= Suppose . It follows that unifies and , so there is a most general unifier of and , with , and a substitution such that . Therefore, . Moreover, for every variable there exists such that is a subterm of . Since is normal, we deduce that must be normal too.
Suppose there exists a normal term such that . By the definition of narrowing, it follows that for some fresh variable and the inclusion . Let be the substitution that agrees with and and maps to . It follows that and . Moreover, since the substitution and the term are normal, is normal too.
We have thus shown that, given , there exists a narrowing step and a normal substitution such that and . By the induction hypothesis, we also have and a normal substitution such that and . To conclude, let . It follows that and .
The completeness of narrowing holds under much stricter conditions than for rewriting, as it requires confluence, termination, coherence, and also syntactical constraints on the use of variables within rules.
Theorem 6. Let be a term rewriting system that is confluent, strictly coherent and modular in the sense of Definition 17 such that and is terminating. Additionally, we assume that
(1) for each equational rule if , ,
(2) for each transition rule if , , and
(3) all equation rules in are free of composition () and iteration ().
For every normal solution to a query there exists a narrowing derivation and a substitution such that .
PROOF. By definition, is a solution to if and only if . Since is confluent, is ground confluent and is ground terminating. By the completeness of strict rewriting, it follows that . The latter gets lifted, by Lemma 6, to a derivation and a substitution such that (entailing ) and .
Corollary 4 (Completeness of narrowing). Under the conditions of Theorem 6, the following are equivalent:
PROOF. By Theorem 4, we get (a) (b). Since , we obtain (b) (c). For (c) (a), assume that . Let be a reachable initial model of as in Theorem 2. It follows that . By Proposition 3, for some substitution . Since is canonical, by soundness of term rewriting, we can assume without loss of generality that is normal. By Theorem 2 (1), , hence is a normal solution to . By Theorem 6, there exists a narrowing derivation .
8 Extending completeness
A program can be formalized as a set of clauses over a signature . However, the properties we aim to express about programs often extend beyond queries. To capture such properties, we introduce the notion of extended clause, defined as a sentence of the form , where and are queries. Evidently, every clause is a special instance of an extended clause in which no existential quantifiers occur. In this section, we are interested in proving , where is a set of clauses describing a program, while is an extended clause formalizing a property of that program. See Table 3 for the proof rules used to reason about extended clauses starting from a given set of (ordinary) clauses.
Lemma 7 (Soundness). The proof rules defined in Tables 1, 2, and 3 are sound. That is, the least entailment system closed under the proof rules defined in Tables 1, 2, and 3 is sound.
Gäinä, Riesco and Tuutu
Table 3. Actions, implication and quantification
Since the premises of the clauses may include arbitrary transitions, we must go beyond the realm of clauses and introduce proof rules that handle both clauses and transitions. For instance, to deduce a clause of the form using rule , we must add as a hypothesis to the clause set . However, since is not itself a set of clauses, this requires reasoning in a hybrid setting that incorporates both clauses and queries. Consequently, the completeness established in this section necessitates a more structured methodology than the ones introduced in [6, 19].
Moreover, if is finite for some sort , then, since the initial model is reachable, the set is finite as well. Based on this observation, if we work over FTA signatures such that is finite for all sorts and all finite blocks of variables , then we can extend the completeness results from TA to FTA.
Theorem 7 (Completeness). Let be any sound entailment system closed under the proof rules defined in Tables 1, 2, and 3. Assume a set of clauses and an extended clause defined over the same signature such that is finite for all finite blocks of variables and all sorts . Then the following are equivalent:
PROOF. First, we prove the following property for all sets of ground equations and transitions and all queries , the following are equivalent:
We proceed by well-founded induction on , where is the total number of occurrences of iteration operator in , and is the total number of occurrences of the composition or union operators in . The ordering we consider on these pairs is the usual lexicographic ordering.
For the base case, we assume that consists of atomic sentences. That is, and . This case is covered by Theorem 2(2) and the fact that is finite for all .
For the induction step, there are three cases to consider:
Assume that . Let be the total number of occurrences of the iteration operator in , and be the total number of occurrences of the composition or union operators in .
(c) (a) By soundness.
Assume that . Let be the total number of occurrences of the iteration operator in , and be the total number of occurrences of the composition or union operators in .
(c) (a) By soundness.
Assume that . Let be the total number of occurrences of the iteration operator in , and be the total number of occurrences of the composition or union operators in .
(c) (a) By soundness.
Secondly, from first part of the proof, by , for all queries and , we have:
Thirdly, we prove the statement of the theorem by induction on the structure of clauses.
base
By Theorem 2 (2).
if
In this case, and are queries.
(c) (a) By soundness.
Let be an extended clause.
Gäinä, Riesco and Tuutu
Observe that we can take to obtain the completeness of TA. Moreover, the conditions of Theorem 7 concerning the signature can be replaced with a more general assumption: for all finite blocks of variables , the set of clauses has an initial model over such that is finite for all . Take, for example, the signature of natural numbers and the equation , where . Then for all finite blocks of variables , the equation has an initial model over which is finite.
In practical case studies, when proving properties formalized as extended clauses free of existential quantification, the proof rules from Tables 1 and 2 are replaced with a single rewriting rule:
The completeness of extended clauses is preserved, provided that the underlying set of clauses forms a term rewriting system that satisfies the conditions of Theorem 5(1). Similarly, when proving properties formalized as extended clauses, the proof rules from Tables 1 and 2 are replaced by a single narrowing rule:
The completeness stated in Theorem 7 is preserved, provided that the underlying set of clauses forms a term rewriting system satisfying the conditions of Theorem 6.
9 Reachability, induction, and finite models
By defining an operational semantics for sets of clauses, we have taken significant steps toward establishing a methodology for verifying systems modeled with TA clauses. However, in practical case studies, the properties of interest often go far beyond individual clauses, and developing modeling techniques and formal proof methods with a high degree of automation remains challenging. The foundations laid in this paper enable the construction of several formal methods on top of them. In this section, we highlight the expressive power of TA by demonstrating its ability to model reachability and finiteness, and to prove properties of systems that are reachable or finite. In particular, this approach directly addresses the issue that from Table 3 contains an infinite number of proof rules. A proof rule is useful in practice only if its premise can be checked mechanically by a software tool. Clearly, an infinite number of premises can be handled only through inductive reasoning.
We return to the specification of natural numbers from Example 1, but we modify it, first by labelling the two axioms that define the successor relation, and then by dropping the conditions used in the two axioms defining the addition of natural numbers. In the specification below, those axioms of the addition operation, labelled add-base and add-ind, apply to all elements of sort Nat, not only to those that are reachable along the successor relation.
spec NAT-ADD is protecting NAT. protecting SUCC. op _+ : Nat Nat -> Nat. vars x, y : Nat. ax x = (succ) > s x [label: succ-a]. ax y = s x if x = (succ) > y [label: succ-b].
ax x + 0 = x [label: add-base] . ax x + s y = s (x + y) [label: add-ind] . endspec
Therefore, the set of clauses is . It is not difficult to check that NAT-ADD does not entail the left-identity property of 0; that is, .
Indeed, consider the model of natural numbers , which interprets all symbols in the usual way: (a) is the set of natural numbers , (b) , (c) , (d) is the successor function, (e) is the addition, (f) is the successor relation, and (g) is the empty set. Obviously, . We construct another model from by adding a new element such that (a) , (b) for all , (c) , (d) , and (e) . We have that but , which means .
However, satisfies the left identity property restricted to the elements reachable from 0 via the successor relation, that is, if , which is equivalent with if for all . We apply induction.
base if . 1 if by (UQ) and (Imp) 2 by (Star) 3 by (Rewrite) 4 over automatically checked
step Assuming if , we prove if , which is equivalent to if , where if . 1 if by (UQ) and (Imp) 2 by (Comp) 3 by 4 by (Rewrite) 5 over automatically checked
The verification methodology advanced in this paper focuses on simplifying the formula to prove by eliminating the sentence operators used in its construction. The first target of this process is the iteration operator * that appears in the conditions of the extended clauses. To handle it, we apply induction schemes, as illustrated in the case study above. However, the use of induction schemes—and the corresponding addition of induction hypotheses to the clause set—comes at a cost. We must rely on lemma discovery, that is, on the (Cut) rule, which we were able to avoid during the completeness proof. For example, in order to prove if we must first establish the following lemmas: if and if .
Another potential source of problems is that we may start from a specification that is terminating and confluent, but during the verification process the underlying specification undergoes transformations that may lead to the loss of these desirable properties, depending on how the property to be proved is formalized. In our example, the initial specification is , whereas the specifications at the leaves of the proof tree are and .
Gäinä, Riesco and Tutu
Suppose we are interested in properties that hold only for finite reachable models such as , where . Notice that while . In this case, we can add to and prove
The action succ (0,0) restricts the models to algebras which have a finite number of reachable elements, while the condition succ (0,y) asserts that y is reachable from 0 by applying the successor function a finite number of times.
(goal) The goal (2) is equivalent with if for all .
(lemma1) , since if for all .
(lemma2) for all and all .
(lemma3) for all and all .
(induction) Using the above lemmas, we prove by induction on that for all ,
For the base case, one can easily prove if .
For the induction step, we show if , where if . This is equivalent to
where .
10 Tool support
To showcase the usefulness of Transition Algebra, we have developed a dedicated tool that supports writing specifications, reducing terms, and checking properties both by rewriting and by narrowing. In this section, we outline the main aspects of our tool. First, we recall and also expand, by means of a case study, the syntax already introduced in Examples 1, 2, and 3. More precisely, we demonstrate how the TA specification language can be used to formalize the CCS process calculus and the MapReduce programming model. In addition, we present some of the commands available in the TA tool that can be used for verification purposes. Then, in the last part of the section, we outline the main aspects of the implementation. The tool is developed on top of SpeX [45], a rewriting-based environment written in Maude [4] that facilitates the experimental development of formal-specification languages. Its source code together with illustrative examples is available at https://github.com/Transition-Algebra/TATP.
10.1 Process Algebra
Building on work reported in [27], we use Robin Milner's calculus of communicating systems (CCS) [38, 39] for illustrating how to specify a complex system. CCS is a well known process calculus used for reasoning about concurrency by means
succ denotes the transitive closure of succ.
of inter-process interactions that take place along certain communication channels. Its basic building blocks are a set of so-called process identifiers together with a set of channel names, which model interactions between processes. We start our specification by describing channels and CCS actions, as follows:
spec CCS is sorts Channel, Action . op rcv : Channel -> Action . op snd : Channel -> Action . op tau : () -> Action .
The specification CCS simply declares two sorts: Channel and Action. Particular channel names will be defined later on for a concrete example. We use the operation symbols rcv and snd to make explicit the actions of receiving or sending information along a given channel. The silent action is specified as a constant tau. In CCS terminology, the terms tau, rcv(c) and rcv(c), where c denotes a channel name, are all regarded as actions. To avoid confusion with the actions of Transition Algebra, however, we will refer to them throughout this paper as CCS actions.
Processes are defined recursively as follows. First, let a constant stand for an inactive process:
sort Process . op : () -> Process .
Then, a CCS action can be used as a prefix for a process (for which we employ the infix syntax __.). This builds a new process, , whose execution is meant to start with and then, once is performed, to continue with :
op __. : Action Process -> Process . ax (A . P) = (A) > P [label: act] .
In the axiom above, A and P are variables of sort Action and Process, respectively (besides P, we will also use P', Q, Q', and R for processes in what follows, when discussing other operators). The syntax (A . P) = (A) > P specifies a transition between A . P and P using the CCS action A. We label this axiom act in order to be able to reference it later on, when checking properties – and we will do the same for some of the other axioms.
The operator + denotes a non-deterministic choice between processes. We declare it associative and commutative, which allows us to specify its operational semantics using just one axiom. That axiom states that, if any of two processes advances with a CCS action A (in the condition), then the composition also advances using that action:
op + : Process Process -> Process [assoc comm] . ax (P + Q) = (A) > P' if P = (A) > P' [label: sum] .
We also specify that the non-deterministic choice is idempotent and with as an identity using equations:
ax P + P = P . ax P + = P .
These axioms are not labelled since they are simple enough to be applied automatically when checking properties.
The operator | stands for the parallel composition of processes. In this case, the axiomatization requires two clauses. The first one (labelled ucom for unsynchronized composition) allows processes to advance independently from one another, while the second (labelled scom) is in charge of synchronization (when one of the processes sends information through a channel and the other one is waiting to receive information across the same channel). Note that, when synchronizing processes, the system advances silently.
op | : Process Process -> Process [assoc comm] . ax (P | Q) = (A) > R if P = (A) > P' and R = P' | Q [label: ucom] .
Gäinä, Riesco and Tuutu
ax (P | Q) = (tau) > R if P = (snd(C)) > P' and Q = (rcv(C)) > Q' and R = P' | Q' [label: scom] .
Similarly to non-deterministic choice, we specify that is also an identity for the parallel composition operator using an equation:
ax P | .
We limit the presentation of CCS to these three process-building operators, namely action prefixing, non-deterministic choice, and parallel composition, because they suffice for the case study that we will discuss next. However, it is worth noting that CCS is a richer language that also supports relabelling and label restriction, both of which can be specified in TA in a straightforward manner – see, for instance, [27] and the 'institute' example from that paper (which is now fully formalized in the repository of the TA tool) for a way to define and use label restriction.
Finally, to support recursive processes, whose behaviour may be infinite, CCS provides process definitions which are specified by transitions rules of the form , where (a) is a constant of sort Process, (b) is a process built from constants (possibly even ) using action prefixing, composition, etc, and (c) is a purposely defined label.
sort ProcDef .
op def : () -> ProcDef .
We use a fresh sort for in order to separate it from the CCS actions that define the behaviour of processes. Process definitions integrate into the semantics of CCS using the following rule for constants, which is standard for CCS:
ax P = (A) > Q' if P = (def) > Q and Q = (A) > Q' [label: con] .
The specification concludes with two special clauses for discarding processes defined as . These occur naturally when writing inductive definitions of parameterized processes, as we will see in the next case study on MapReduce.
ax P + Q = Q if P = (def) > .
ax P | Q = Q if P = (def) > .
endspec
10.2 Parallel and distributed data processing
We employ CCS as an intermediate language in order to specify and analyse MapReduce [9], a widely used programming framework for processing large data sets in a parallel and distributed manner. To set the stage, suppose we need to compute the outcome of a 'global' function for some fixed keys and a large input that is distributed across various 'nodes' (e.g., computers, file systems, databases). That is, is of type , where is a finite set of so-called keys, is the number of nodes, is the set of all possible data available at node , and is the set of output values. MapReduce enables the computation of through the composition of two kinds of processing units:
-
mappers, which are in one-to-one correspondence with the nodes; each mapper computes the local output of for all keys and for the local data stored at its corresponding node; that is, a mapper for node computes a function of the form ;
-
reducers, which are in one-to-one correspondence with the keys; each reducer aggregates all the local outputs for its corresponding key.
Therefore, MapReduce builds on the assumption that the local outputs of are computable and can be aggregated (which we will denote using addition); moreover, aggregation needs to be associative and commutative because the local outputs can arrive at reducers in any order. In symbols, this means that MapReduce computes
(5) where is the local output of at node for the key . Without loss of generality, to simplify notations, we assume and for all nodes . Alternatively, consider and given by for all keys , nodes , and local data .
The actual computation is performed in five stages, as follows: (1) first, we initialize the mappers and the reducers; (2) next, we run the mappers, which yield multiple local outputs, one for each node and key; (3) then, we shuffle the local outputs so that, for each key , all local outputs with key are delivered to the reducer; (4) we run the reducers, thus aggregating all local outputs; and, finally, (5) we collect the global outputs that are generated by reducers. Some of these stages may overlap. For instance, reducers can start aggregating local outputs as soon as they become available, without having to wait for all the mappers to finish their computations.
Example 4 (Counting occurrences). To illustrate the process, consider a simple distributed binary database consisting of three nodes, , , and with local data consisting of the following bit strings 100, 10, and 101, respectively. Suppose we aim to count the occurrences of the bits 0 and 1 in the database. For that purpose, we let the set of keys be , the set of values be , we define aggregation as addition, and as the function that counts the occurrences of a key (bit) in a bit string. Hence , , and so on. The diagram below depicts the corresponding MapReduce computation. On the left, we have the three nodes of the database. Each of them has an associated mapper; we use dashed lines to indicate what local data is available to each mapper. Next, we use solid arrows to represent the communication between mappers and reducers. Each arrow, say between a mapper and a reducer , is labelled with a local output, which is a key-value pair of the form . Lastly, on the right, we have the aggregated outcomes, which are obtained by summing all the local outputs that arrive at each reducer; again, we use dashed lines to indicate which outcome corresponds to each reducer. At the bottom of the diagram, we mark the three main stages of the MapReduce process: map, shuffle, and reduce.

To model MapReduce in TA, we start by extending the specification CCS with declarations of the basic entities involved in MapReduce: node identifiers, keys, finite sets of keys, data, values, key-value pairs, and the underlying function .^6 We write S1 S2 for the union of two sets S1 and S2 (of node identifiers, keys, or key-value pairs), none for the empty set, Id(X) for the singleton set consisting of a node identifier X, Key(K) for the singleton set consisting of a key K, V1 + V2 for the aggregation of values V1 and V2, 0 for the identity element of + (which we use as a starting value during reduction), and < K : V > for the singleton set consisting of the key-value pair with key K and value V.
spec MAP-REDUCE is extending CCS . sorts Id, IdSet .
^6We use the keyword extending to indicate that we add new elements on 'old' sorts, notably Process and Channel, imported from the specification CCS.
Gäinä, Riesco and Tuutu
40
op none : () -> IdSet . op Id : Id -> IdSet . op __ : IdSet IdSet -> IdSet [assoc comm id: (none)] . sort Data . sorts Key, KeySet . op none : () -> KeySet . op Key : Key -> KeySet . op __ : KeySet KeySet -> KeySet [assoc comm id: (none)] . sort Value . op 0 : () -> Value . op + : Value Value -> Value [assoc comm id: (0)] . sorts KVSet . op none : () -> KVSet . op <:-> : Key Value -> KVSet . op __ : KVSet KVSet -> KVSet [assoc comm id: (none)] . op f : Key Data -> Value .
Next, we define the CCS processes used in modelling MapReduce. The first two are JobManager and Node. Both are parameterized – as will be all other CCS processes that we declare. JobManager serves as a seed for MapReduce; its parameters are a set of keys and a set of node identifiers, which will be used to determine which mappers and which reducers need to be initialized. The Node process has two parameters as well; the first one is its identifier, and the second is its underlying local data. Hence we consider the following TA declarations:
op JobManager : KeySet IdSet -> Process . op Node : Id Data -> Process .
These enable us to capture the starting point of a MapReduce computation as a composed process of the form
where KS is a set of keys, is a node identifier for each , and is the local data at node .
The JobManager spawns four other processes that either initialize, monitor, or conclude the MapReduce computation. Its definition is as follows:
ax JobManager(KS, IdS) =(def)> TaskDistributor(KS, IdS) | TaskMonitor(KS, IdS) | Reducers(KS) | Collector(KS, none) [label: def-JobManager] .
where
-
TaskDistributor is a process that triggers the map stage of MapReduce, initializing mappers;
-
TaskMonitor (as the name implies) tracks the mapper processes and, when they terminate, notifies reducers in order to finalize the aggregation of the generated local outputs;
-
Reducers initializes the reducer processes; and
-
Collector gathers all global outputs compiled by reducers; its second parameter is an increasing subset (initially empty) of the set of key-value pairs that we aim to compute through MapReduce.
The signatures of all theses processes are declared similarly to those of JobManager and Node.
The TaskDistributor and Node processes work together to initialize mappers. To that end, they communicate along a parameterized channel map(KS, X), where KS is a set of keys and X is a node identifier. The TA declaration of map and the definitions of TaskDistributor and Node are as follows:
op map : KeySet Id -> Channel . ax TaskDistributor(KS, Id(X) IdS) =(def)> (snd(map(KS, X)) . TaskDistributor(KS, IdS)) [label: def-TaskDistributor] . ax TaskDistributor(KS, none) =(def)> 0 [label: def-TaskDistributor] . ax Node(X, D) =(def)> (rcv(map(KS, X)) . Mapper(X, KS, D)) [label: def-Node] .
It is worth noting that TaskDistributor sends information through map channels sequentially, but the choice of recipient (node) at each step is non-deterministic. That is because the set-building operator __ is associative and commutative. Also, what we are seeing here is actually an instance of value-passing in CCS: TaskDistributor provides the set KS of keys (through the map channel), which are unknown to nodes and which get coupled (through process synchronization) with the local data D of the node X in order to initialize the corresponding mapper for X.
Clauses such as def-Node having fresh variables in the right-hand side of transitions—an essential aspect for value-passing—are generally problematic from an operational perspective and fall outside the scope of the transition rules considered in Section 5. However, because the specification of MapReduce is based on CCS, we can mitigate this issue through narrowing applications of the axiom scom (from the specification CCS) that defines the operational semantics for the synchronous composition of processes. Take, for instance, a transition of the form , where ks, x, ids, and d are all constant terms. That transition can be derived through narrowing, using scom, by solving the following joint queries, where C is the variable introduced by scom:
• snd(C)(TaskDistributor(ks, Id(x) ids), TaskDistributor(ks, ids))
• rcv(C)(Node(x, d), Mapper(x, ks, d))
By continuing to apply narrowing for the first query using the axioms con (from CCS), def-TaskDistributor (from MAP-REDUCE), and act (from CCS), we get . Similarly, for the second query, using the axioms con, def-Node, and act, we get , where KS is the fresh variable introduced by def-Node. We put these steps together (in order to conclude the application of scom) by unifying the terms and . This yields a substitution for the variable KS, namely , thus avoiding the problem of having a fresh variable in the right-hand side of def-Node. We will use this line of reasoning repeatedly in the final part of the section (but assisted by the TA tool in that case) in order to check the correctness of MapReduce.
The reducers get initialized in a similar (non-deterministic) manner, by applying the following definitions:
ax Reducers(Key(K) KS) =(def)> Reducer(K, 0) | Reducers(KS) [label: def-Reducers] .
Gäinä, Riesco and Tuutu
ax Reducers(none) =(def)> 0 [label: def-Reducers] .
This concludes the initialization stage. The map, shuffle, and reduce stages are all condensed in the synchronization of mappers and reducers. First, mappers send local outputs for all the keys whose values they have been instructed to compute, followed by a special eom (end of mapping) message once all the local outputs have been delivered. That eom message is meant to indicate to TaskMonitor that the map stage has ended for the current node. In turn, reducers receive either a local output (through synchronization, from one of the mappers) or a special eor (end of reduction) message (from TaskMonitor). In the first case, they add the local output received to their tally and continue the computation; and in the second case, they inform the Collector of the global output computed for the current key and then terminate their execution. The formal CCS definitions are as follows:
ax Mapper(X, Key(K) KS, D) =(def)> (snd(local-output(K, f(K, D))) . Mapper(X, KS, D)) [label: def-Mapper] .
ax Mapper(X, none, D) =(def)> (snd(eom(X)) . Node(X, D)) [label: def-Mapper] .
ax Reducer(K, R) =(def)> ((rcv(local-output(K, V)) . Reducer(K, R + V))
- (rcv(eor(K)) . snd(global-output(K, R)) . 0)) [label: def-Reducer] .
We note, once more, that the specification does not commit to any ordering of sending and receiving local outputs. Instead, all possible synchronizations are explored in parallel, non-deterministically. That is due to two factors: first, because the process-composition operator | is associative and commutative, at each step, we can (try to) synchronize each available mapper and reducer; second, because the set-building operator __ is associative and commutative, the key K whose value is computed next by the selected mapper is also chosen non-deterministically.
The only remaining processes to describe are TaskMonitor and Collector. As mentioned above, the first one acts as a barrier: it waits for all mappers to end their execution, then notifies the reducers that they can conclude too.
ax TaskMonitor(KS, Id(X) IdS) =(def)> (rcv(eom(X)) . TaskMonitor(KS, IdS)) [label: def-TaskMonitor] .
ax TaskMonitor(Key(K) KS, none) =(def)> (snd(eor(K)) . TaskMonitor(KS, none)) [label: def-TaskMonitor] .
ax TaskMonitor(none, none) =(def)> 0 [label: def-TaskMonitor] .
Lastly, the Collector synchronizes with the terminating reducers in order to record their compiled global outputs. This brings to an end the final stage of MapReduce.
ax Collector(Key(K) KS, KVS) =(def)> (rcv(global-output(K, V)) . Collector(KS, < K, V > KVS)) [label: def-Collector] .
endspec
The full specifications of CCS and MapReduce, as well as the proof score for the next verification, are available as examples in the source-code repository of the tool at https://github.com/Transition-Algebra/TATP.
In the remaining part of this section, we look into the correctness of MapReduce. More specifically, we check that the CCS definitions given above allow for the computation of the function described in equation (5). To simplify the presentation, we fix the number of nodes and the number of keys: two in each case. But this is not a significant limitation, because the proof scales without difficulty to arbitrarily many nodes and keys simply by repeating some of the proof steps that we will discuss next. We can even consider a general proof by simultaneous structural induction on the parameters of JobManager (i.e., on the sets of nodes and keys used to initialize mappers and reducers), but that is beyond the scope of this paper. So what we want to check is that the specification MAP-REDUCE entails a quantified transition of the form
where
-
,
-
is a variable of sort Process,
-
, and
-
.
By , this is equivalent to checking that the axioms of MAP-REDUCE entail the query with respect to the extended signature . We can confirm that this entailment holds using narrowing, which the TA tool supports through a dedicated check command. But the general narrowing procedure is impractical for this property because the search space is vast. We can limit the number of narrowing steps used (via the set narrowing bound command), but that is still not enough. The transition that we are verifying can be witnessed by composing 12 atomic tau transitions: two to initialize the mappers, two to initialize the reducers and to deliver the first local outputs to them, two more to deliver the remaining local outputs, two to inform the TaskMonitor that the mappers have completed their execution, two to also complete the execution of the reducers, and lastly, two to collect the global outputs. All in all, these transitions require more than 100 narrowing steps. To make narrowing effective, we use an explicit-check command (introduced by the echeck keyword) that, in addition to a query, takes a list of axiom labels indicating which equations or rules are meant to be used in narrowing steps, and in which order. The list may include both labels from the specifications above, such as def-JobManager, def-Node, scom, or act, and labels that are intrinsic to Transition Algebra such as comp for 's' steps (as presented in Definition 7), choice for 'U' steps, and star for 'O' steps. We also write comments, introduced by ~, to indicate which narrowing steps are applied for each transition.
The full proof is written in an open-close environment reminiscent of the OBJ family of languages [21]. Within such an environment, we first indicate which specification is being used for verification purposes, then issue a series of commands that mechanize the proof. In our case, we use the specification MAP-REDUCE, then issue three let commands to extend the signature, and conclude with a verification by narrowing through the echeck command.
open MAP-REDUCE
let X1, X2 : Id
let D1, D2 : Data
let K1, K2 : Key
echeck
Gäinä, Riesco and Tuutu
JobManager(Key(K1) Key(K2), Id(X1) Id(X2)) | Node(X1, D1) | Node(X2, D2) =((tau)*)> Collector(null, < K1 : f(K1, D1) + f(K1, D2) > < K2 : f(K2, D1) + f(K2, D2) >) | R:Process using (star comp ^ 1st transition: initialize the 1st mapper by synchronizing TaskDistributor and one of the nodes scom con def-JobManager ucom con def-TaskDistributor act ucom con def-Node act star comp ^ 2nd transition: initialize the 2nd mapper by synchronizing TaskDistributor and the remaining node ucom scom con def-TaskDistributor act con def-Node act star comp ^ 3rd transition: initialize the 1st reducer and deliver the first local output to it ucom scom con def-Mapper act con def-Reducers ucom con def-Reducer sum act star comp ^ 4th transition: initialize the 2nd reducer and deliver the next local output ucom scom con def-Mapper act con def-Reducers con def-Reducer sum act star comp ^ 5th and 6th transitions: deliver the remaining local output to the reducers ucom scom con def-Mapper act con def-Reducer sum act star comp ucom scom con def-Mapper act con def-Reducer sum act star comp ^ 7th and 8th transitions: notify the TaskMonitor that the mappers have completed their execution ucom scom con def-Mapper act con def-TaskMonitor act star comp ucom scom con def-Mapper act con def-TaskMonitor act star comp ^ 9th and 10th transitions: inform the reducers that there are no more local outputs to aggregate ucom scom con def-TaskMonitor act con def-Reducer sum act star comp ucom scom con def-TaskMonitor act con def-Reducer sum act star comp ^ 11th and 12th transitions: collect the global outputs ucom scom act con def-Collector act star comp ucom scom act con def-Collector act star) close
10.3 Implementation notes
We summarize here how the main aspects of the implementation have been developed.
Reduction. We can take advantage of the meta-level capabilities of Maude for designing a resolution procedure for reductions. As with Maude itself, the resulting implementation is far from straightforward, involving numerous subtle interactions whose correct handling requires considerable care. In particular, given a term , we look for an equation if , such that matches (possibly not at the top), obtaining a substitution and a context . Then, a new substitution extending is required for satisfying the condition will be used for instantiating , replacing in the context . The whole process starts with the reduce command, where is the term to be reduced, and is repeated until no equations can be applied to the current term.
As explained in the previous sections, the condition may contain both equalities and transitions. For equalities, the current substitution is applied to both sides of the equation and they are reduced independently as described. Once they cannot be further reduced, equality modulo axioms is checked.
For transitions, which are not expected to be confluent, we do not compute a unique substitution but a set of them, so all reachable terms can be obtained. Moreover, the process is slightly different to the one before. First, the matching is twofold: we need the term to match the left-hand side and the actions to match the labels. Then, the implementation includes built-in transitions implementing the rules for composition, choice, and iteration, which are used when required. Finally, the matching with the right-hand side might extend the substitution.
The substitution is computed by using backtracking following a depth-first strategy and adding an extra condition requiring matching with the right-hand side. In particular, for each transition in the condition (equalities do not extend the substitution), as many child nodes can be generated as there are possible substitutions. It is important to note that, because we work modulo equational axioms such as associativity and commutativity, several different substitutions can be generated when matching a term and a pattern. Also note that equalities, even though they do not extend the substitution, might need to be recomputed in general when the substitution changes. Finally, fresh variables are required during the process because substitutions are propagated across transition applications, and the same variable may appear in several of them. Therefore, clashes must first be avoided. Once the process is completed, a substitution containing only user-defined variables is reconstructed.
Termination is ensured by supporting two bounds: in the number of steps (including both reductions and transitions) and in the number of conditions, as explained above. It is interesting to note that the bounds are considered differently: while the number of steps is computed globally, so each application of an equation or a transition reduces the bound (whether in the current reduction or in the following ones), the number of conditions is used locally for each reduction step and restarted again for the next one. Moreover, our implementation stores the terms already tried to reduce in the conditions, avoiding loops that often occur when dealing with some operators, in particular iteration.
Narrowing. For solving queries, we adapt and use a general logic-programming procedure that is already integrated into SpeX [45] and matches closely the definition of narrowing in Section 5. The implementation of that procedure relies on the Maude strategy language [16] and involves the rewriting of three kinds of 'configurations': initial, open, and solved. An initial configuration is merely an encoding of a logic-programming problem. That is, a pair consisting of a specification (set of Horn clauses) and a query that is meant to be checked. Optionally, for echeck, an initial configuration may also provide a list of (sets of) clauses (identified by labels) to be used in subsequent narrowing steps. An open configuration includes, besides the specification and a query, information about the partial solution computed up to that point. This means that, for any chain of narrowing steps we have a corresponding chain of configuration rewrites such that, for each index , the th open configuration includes an encoding of the substitution . Moreover, open configurations may also carry lists of (sets of) clauses
Gäinä, Riesco and Tutu
for echeck and information about the variables in use. The latter information is passed to built-in Maude functions for computing unifiers. Finally, a solved configuration is a configuration whose query is .
The rewriting of configurations is controlled using Maude strategies. Every change of configurations consists of several sub-steps: (a) first, we non-deterministically select a context or formula within the current query where narrowing is applied; (b) then we select (also non-deterministically) a suitable clause, (c) we compute all possible unifiers (which may not be unique if the computations are performed modulo associativity and commutativity), (d) apply substitutions (according to Definition 7), (e) compile new partial solutions, and (f) update the information on the variable names that are currently in use and on the list of (sets of) clauses meant to guide the following narrowing steps.
Similarly to term rewriting, termination can be enforced by specifying a bound on the number of narrowing steps that can be applied. Still, the search space for solved configurations can easily become infeasibly large even for low bounds. Because of this, the explicit search (implemented for echeck) is often more convenient as it drastically limits the extent of the search space by specifying which clauses are admissible at each step. Its downside is that the search procedure is no longer fully automatic, and completeness cannot be guaranteed. To counterbalance this limitation, if no solved configuration is found (given a sequence HCL of Horn-clause labels), then the explicit search returns a final list of open configurations that may be rewritten to a solved one (by modifying or extending HCL).
11 Conclusions and ongoing work
Several logics have been proposed for modelling and reasoning about the behaviour of concurrent systems, giving freedom to researchers to choose among them depending of their particular needs. In this paper, we have examined Transition Algebra, an extension of many-sorted first-order logic that includes features from dynamic logic, where actions are used as labels of transitions, thus allowing us to capture and analyse complex behaviours. This logic is useful for modelling and studying systems where the actions are as important as the system states upon which they produce an effect. Unlike previous definitions, and for greater flexibility in the use of actions, we have extended (and, at the same time, simplified) the framework introduced in [27] in order to support arbitrary terms as actions. We have devised a sound and complete set of proof rules for reasoning about Horn clauses. Moreover, we have developed an operational semantics for Transition Algebra based on term rewriting, transition checking, and narrowing, a powerful mechanism for solving queries. We have shown that rewriting and narrowing are both sound and complete, thus advocating for Transition Algebra as an appropriate logical setting for system verification. To further demonstrate its applicability, we have conducted a comprehensive case study on the analysis of the MapReduce programming framework.
The features above provide advantages from both theoretical and practical points of view. On the one hand, systems can be more easily and accurately described than with conventional equational logics. Furthermore, Transition Algebra allows for integrating specification and verification within a single framework, which is useful especially when considering properties that cannot be easily expressed equationally. On the other hand, its simple but powerful operational semantics is very well suited for axiomatization. We have implemented a Maude prototype that supports specifications in Transition Algebra and solving queries on them.
This work lays the foundation for a series of future developments. On the theoretical side, we want to explore additional action operators, such as tests and parallel composition. Also, we aim to continue the study of narrowing. Though sound and complete, in its current form, narrowing is still rather inefficient from a computational perspective. We intend to look further into different forms of narrowing, as can be found in the equational-logic literature. Moreover, we aim to explore the use of explicit narrowing, shown in Section 10, as a useful tool in interactive theorem proving.
On the practical side, we are interested in continuing the development of the tool, and also in specifying and analysing a variety of systems to assess the approach and to design strategies to ease the verification process.
References
[1] Egidio Astesiano, Michel Bidoit, Hélène Kirchner, Bernd Krieg-Brückner, Peter D. Mosses, Donald Sannella, and Andrzej Tarlecki. 2002. CASL: The Common Algebraic Specification Language. Theoretical Computer Science 286, 2 (2002), 153–196.
[2] Franz Baader and Tobias Nipkow. 1998. Term rewriting and all that. Cambridge University Press, Cambridge, United Kingdom.
[3] Virgil Emil Căzănescu and Denisa Diaconescu. 2009. Completeness of paramodulation without lifting lemma. Romanian journal of information science and technology 12, 1 (2009), 25–34.
[4] Manuel Clavel, Francisco Durán, Steven Eker, Patrick Lincoln, Narciso Marti-Oliet, José Meseguer, and Carolyn L. Talcott (Eds.). 2007. All About Maude – A High-Performance Logical Framework, How to Specify, Program and Verify Systems in Rewriting Logic. LNCS, Vol. 4350. Springer, Berlin, Germany.
[5] Manuel Clavel, José Meseguer, and Miguel Palomino. 2007. Reflection in membership equational logic, many-sorted equational logic, Horn logic with equality, and rewriting logic. Theor. Comput. Sci. 373, 1-2 (2007), 70–91.
[6] Mihai Codescu and Daniel Găină. 2008. Birkhoff Completeness in Institutions. Logica Universalis 2, 2 (2008), 277–309.
[7] Mihai Codescu, Till Mossakowski, Adrián Riesco, and Christian Maeder. 2010. Integrating Maude into Hets. In Algebraic Methodology and Software Technology - 13th International Conference, AMAST 2010, Lac-Beauport, QC, Canada, June 23-25, 2010. Revised Selected Papers (LNCS, Vol. 6486), Michael Johnson and Dusko Pavlovic (Eds.). Springer, Berlin, Germany, 60–75.
[8] Domenico Cotroneo, Luigi De Simone, Pietro Liguori, Roberto Natella, and Nematollah Bidokhti. 2019. How bad can a bug get? an empirical analysis of software failures in the OpenStack cloud computing platform. In Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (Tallinn, Estonia) (ESEC/FSE 2019). Association for Computing Machinery, New York, NY, USA, 200–211. doi:10.1145/3338906.3338916
[9] Jeffrey Dean and Sanjay Ghemawat. 2008. MapReduce: simplified data processing on large clusters. Commun. ACM 51, 1 (2008), 107–113.
[10] Nachum Dershowitz and Jean-Pierre Jouannaud. 1990. Rewriting systems. In Handbook of Theoretical Computer Science, Jan van Leeuwen (Ed.). Vol. B: Formal Methods and Semantics. North-Holland, Amsterdam, The Netherlands, 243–320.
[11] Rázzvan Diaconescu. 2003. Institution-independent Ultraproducts. Fundamenta Informaticae 55, 3-4 (2003), 321–348.
[12] Rázzvan Diaconescu. 2012. Three decades of institution theory. In Universal Logic: An Anthology, Jean-Yves Béziau (Ed.). Springer, Berlin, Germany, 309–322.
[13] Rázzvan Diaconescu. 2025. Institution-Independent Model Theory (2 ed.). Birkhäuser, Berlin, Germany.
[14] Rázzvan Diaconescu and Kokichi Futatsugi. 2002. Logical foundations of CaféOBJ. Theoretical Computer Science 285, 2 (2002), 289–318.
[15] Edsger W. Dijkstra. 1970. Notes on Structured Programming. Technical Report. Technological University Eindhoven, Eindhoven, The Netherlands.
[16] Steven Eker, Narciso Marti-Oliet, José Meseguer, Rubén Rubio, and Alberto Verdejo. 2023. The Maude strategy language. J. Log. Algebraic Methods Program. 134 (2023), 100887.
[17] Santiago Escobar, José Meseguer, and Prasanna Thati. 2005. Natural Narrowing for General Term Rewriting Systems. In Term Rewriting and Applications, 16th International Conference, RTA 2005, Nara, Japan, April 19-21, 2005, Proceedings (Lecture Notes in Computer Science, Vol. 3467), Jürgen Giesl (Ed.). Springer, Berlin, Germany, 279–293.
[18] Santiago Escobar, Ralf Sasse, and José Meseguer. 2012. Folding variant narrowing and optimal variant termination. J. Log. Algebraic Methods Program. 81, 7-8 (2012), 898–928.
[19] Daniel Găină, Kokichi Futatsugi, and Kazuhiro Ogata. 2012. Constructor-based Logics. Journal of Universal Computer Science 18, 16 (2012), 2204–2233.
[20] Joseph Goguen and José Meseguer. 1982. Completeness of many-sorted equational logic. ACM SIGPLAN Notices 17, 1 (1982), 9–17.
[21] Joseph Goguen, Timothy Winkler, José Meseguer, Kokichi Futatsugi, and Jean-Pierre Jouannaud. 2000. Introducing OBJ. Springer, Berlin, Germany, 3–167.
[22] Joseph A. Goguen. 2006. Theorem Proving and Algebra. arXiv, 9500 Gilman Drive, La Jolla CA 92093-0114 USA.
[23] Joseph A. Goguen and Rod M. Burstall. 1992. Institutions: Abstract Model Theory for Specification and Programming. J. ACM 39, 1 (1992), 95–146.
[24] Joseph A. Goguen and José Meseguer. 1987. Models and Equality for Logical Programming. In TAPSOFT'87: Proceedings of the International Joint Conference on Theory and Practice of Software Development, Pisa, Italy, March 23-27, 1987, Volume 2: Advanced Seminar on Foundations of Innovative Software Development II and Colloquium on Functional and Logic Programming and Specifications (CFLP) (Lecture Notes in Computer Science, Vol. 250), Hartmut Ehrig, Robert A. Kowalski, Giorgio Levi, and Ugo Montanari (Eds.). Springer, Berlin, Germany, 1–22.
[25] Joseph A. Goguen, Timothy Winkler, José Meseguer, Kokichi Futatsugi, and Jean-Pierre Jouannaud. 2000. Introducing OBJ. In Software Engineering with OBJ: Algebraic Specification in Action, Joseph A. Goguen and Grant Malcolm (Eds.). Kluwer Academic, Dordrecht, The Netherlands, 3–167.
[26] David Harel, Dexter Kozen, and Jerzy Tiuryn. 2000. Dynamic Logic. The MIT Press, Cambridge, MA, United States.
[27] Go Hashimoto, Daniel Găină, and Ionut Tutu. 2024. Forcing, Transition Algebras, and Calculi. In 51st International Colloquium on Automata, Languages, and Programming, ICALP 2024, July 8-12, 2024, Tallinn, Estonia (LIPIcs, Vol. 297), Karl Bringmann, Martin Grohe, Gabriele Puppis, and Ola Svensson (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, Wadern, Germany, 143:1–143:17.
Gäinä, Riesco and Tutu
[28] Go Hashimoto and Daniel Gäinä. 2025. Model-Theoretic Forcing in Transition Algebra. In 50th International Symposium on Mathematical Foundations of Computer Science, MFCS 2025, Warsaw, Poland, August 25-29, 2025 (LIPlcs, Vol. 345), Pawel Gawrychowski, Filip Mazowiecki, and Michal Skrzypczak (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, Wadern, Germany, 55:1-55:18. doi:10.4230/LIPICS.MFCS.2025.55
[29] Jan Willem Klop. 1992. Term rewriting systems: from Church-Rosser to Knuth-Bendix and beyond. In Handbook of Logic in Computer Science, Samson Abramsky, Dov Gabbay, and Tom Maibaum (Eds.). Oxford University Press, Oxford, United Kingdom, 1–117.
[30] Leonid Libkin. 2004. Elements of Finite Model Theory. Springer, Berlin, Germany. doi:10.1007/978-3-662-07003-1
[31] Raúl López-Rueda, Santiago Escobar, and Julia Sapiña. 2023. An efficient canonical narrowing implementation with irreducibility and SMT constraints for generic symbolic protocol analysis. J. Log. Algebraic Methods Program. 135 (2023), 100895.
[32] “Terese” (Marc Bezem, Jan Willem Klop, and Roel de Vrijer, eds.). 2003. Term rewriting systems. Cambridge tracts in theoretical computer science, Vol. 55. Cambridge University Press, Cambridge, United Kingdom.
[33] José Meseguer. 1989. General logics. In Logic Colloquium '87 (Studies in Logic and the Foundations of Mathematics Series, Vol. 129), Heinz-Dieter Ebbinghaus, José Fernández-Prida, Manuel Garrido, Daniel Lascar, and Mario Rodriquez-Artalejo (Eds.). Elsevier, Amsterdam, The Netherlands, 275–329.
[34] José Meseguer. 1990. Conditional Rewriting Logic: Deduction, Models and Concurrency. In Conditional and Typed Rewriting Systems, 2nd International CTRS Workshop, Montreal, Canada, June 11-14, 1990, Proceedings (LNCS, Vol. 516), Stéphane Kaplan and Mitsuhiro Okada (Eds.). Springer, Berlin, Germany, 64–91.
[35] José Meseguer. 2020. Generalized rewrite theories, coherence completion, and symbolic methods. J. Log. Algebraic Methods Program. 110 (2020), 100483.
[36] José Meseguer and Prasanna Thati. 2004. Symbolic Reachability Analysis Using Narrowing and its Application to Verification of Cryptographic Protocols. In Proceedings of the Fifth International Workshop on Rewriting Logic and Its Applications, WRLA 2004, Barcelona, Spain, March 27-28, 2004 (Electronic Notes in Theoretical Computer Science, Vol. 117), Narciso Marti-Oliet (Ed.). Elsevier, Amsterdam, The Netherlands, 153–182.
[37] Aart Middeldorp and Erik Hamoen. 1994. Completeness Results for Basic Narrowing. Appl. Algebra Eng. Commun. Comput. 5 (1994), 213–253.
[38] Robin Milner. 1980. A Calculus of Communicating Systems. LNCS, Vol. 92. Springer, Berlin, Germany.
[39] Robin Milner. 1989. Communication and concurrency. Prentice Hall, New Jersey, United States.
[40] Thomas Noll. 1999. On Coherence Properties in Team Rewriting Models of Concurrency. In CONCUR '99: Concurrency Theory, 10th International Conference, Eindhoven, The Netherlands, August 24-27, 1999, Proceedings (Lecture Notes in Computer Science, Vol. 1664), Jos C. M. Baeten and Sjouke Mauw (Eds.). Springer, Berlin, Germany, 478–493. doi:10.1007/3-540-48320-9_33
[41] Marius Petria. 2007. An Institutional Version of Gödel's Completeness Theorem. In Algebra and Coalgebra in Computer Science, Second International Conference, CALCO 2007, Bergen, Norway, August 20-24, 2007, Proceedings (LNCS, Vol. 4624), Till Mossakowski, Ugo Montanari, and Magne Haveraaen (Eds.). Springer, Berlin, Germany, 409–424.
[42] David Plaisted. 1992. Equational reasoning and term rewriting systems. In Handbook of Logic in AI and Logic Programming, Dov Gabbay and Jörg Siekmann (Eds.). Oxford University Press, Oxford, United Kingdom, 274–364.
[43] Donald Sannella and Andrzej Tarlecki. 2012. Foundations of Algebraic Specification and Formal Software Development. Springer, Berlin, Germany.
[44] Prasanna Thati and José Meseguer. 2006. Complete symbolic reachability analysis using back-and-forth narrowing. Theor. Comput. Sci. 366, 1-2 (2006), 163–179.
[45] Ionut Tutu. 2022. SpeX: A Rewriting-Based Formal Specification Environment. In Recent Trends in Algebraic Development Techniques - 26th IFIP WG 1.3 International Workshop, WADT 2022, Aveiro, Portugal, June 28-30, 2022, Revised Selected Papers (Lecture Notes in Computer Science, Vol. 13710), Alexandre Madeira and Manuel A. Martins (Eds.). Springer, Berlin, Germany, 163–178.
[46] Patrick Viry. 2002. Equational rules for rewriting logic. Theoretical Computer Science 285, 2 (2002), 487–517.