Abstract 1 Introduction 2 Preliminaries 3 Semi-Thue Systems 4 Conditional Semi-Thue Systems 5 Conclusion References

An Isabelle/HOL Formalization of Semi-Thue and Conditional Semi-Thue Systems

Dohan Kim ORCID Department of Computer Science, University of Innsbruck, Austria
Abstract

We present a formalized framework for semi-Thue and conditional semi-Thue systems for studying monoids and their word problem using the Isabelle/HOL proof assistant. We provide a formalized decision procedure for the word problem of monoids if they are finitely presented by complete semi-Thue systems. In particular, we present a new formalized method for checking confluence using (conditional) critical pairs for certain conditional semi-Thue systems. We propose and formalize an inference system for generating conditional equational theories and Thue congruences using conditional semi-Thue systems. Then we provide a new formalized decision procedure for the word problem of monoids which have finite complete (reductive) conditional presentations.

Keywords and phrases:
semi-Thue systems, conditional semi-Thue systems, conditional string rewriting, monoids, word problem
Copyright and License:
[Uncaptioned image] © Dohan Kim; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Logic and verification
; Theory of computation Equational logic and rewriting
Supplementary Material:
Software  (Source Code): http://cl-informatik.uibk.ac.at/experiments/ITP2025/material.zip
Acknowledgements:
The author would like to thank René Thiemann for his valuable comments on this paper. The author also would like to thank the anonymous reviewers for their valuable comments to improve the presentation of this paper.
Funding:
This research was funded by the Austrian Science Fund (FWF) project I 5943-N.
Editors:
Yannick Forster and Chantal Keller

1 Introduction

It is generally accepted that semi-Thue systems, also known as string rewriting systems, were first introduced by Axel Thue in 1910’s in order to solve the word problem of semigroups and monoids [39]. They can also be viewed as presentations of monoids, where monoids are fundamental algebraic structures widely used in mathematics and computer science. In particular, they serve as a well-known framework for solving the word problem for monoids and groups. The word problem of monoids (or groups) is undecidable in general but it is decidable if they are presented by finite complete (i.e., terminating and confluent) semi-Thue systems over finite alphabets. If a finite semi-Thue system is terminating, then the critical pair lemma provides a decision procedure for confluence. If a monoid is presented by a finite terminating semi-Thue system S but it is not confluent, then one may attempt to construct a finite complete semi-Thue system S equivalent to S using a completion procedure.

Semi-Thue systems can also be considered as a special case of term rewriting systems (TRSs), where term rewriting systems play an important role in programming languages (e.g., functional programming) [26], software engineering (e.g., equationally specified abstract data types) [37], computer algebra [29], and automated theorem proving [20]. For example, a semi-Thue system S on Σ can be associated with a term rewriting system (TRS) S in such a way that S:={(x)r(x)|rS} [7], where each letter from an alphabet Σ is interpreted as a unary function symbol. Here, variables in S are renamed whenever necessary.

The formalization111In this paper, by “formalization”, we mean a computer-assisted formalization using a proof assistant. of TRSs has been done extensively via Isabelle/HOL (e.g., IsaFoR [44]) and Coq (e.g., [8, 9]), and word problems of algebraic structures using TRSs were also discussed in early systems, such as the RRL [25] and the REVE system [31]. However, they are not directly suited for monoid and group presentations.

Our Isabelle/HOL formalization of semi-Thue systems and their related results is based on the simple string matching methods instead of using the more complex term structures. It also uses the simple shortlex order (i.e. length-lexicographic order) [7] on strings, which is simpler than the usual term orderings, such as the lexicographic path order (LPO) [22], the Knuth–Bendix order (KBO) [29] and the weighted path order (WPO) [45]. Some results of semi-Thue systems were also formalized, for example, in Lean [15] and Coq [17].

Meanwhile, conditional semi-Thue systems are extensions of semi-Thue systems, where each of their rules has the form rs1t1,,sntn for strings ,r,s1,t1,,sn,tn. (Here, r can also be denoted as an ordered pair (,r).) A finitely generated monoid with decidable word problem may not admit a finite complete (unconditional) presentation, but it may admit a finite complete conditional presentation [11]. For example, the monoid presented by ={ababa} on Σ={a,b} does not admit a finite complete (unconditional) presentation by a semi-Thue system but admits a finite complete conditional presentation by a conditional semi-Thue system.

The equality symbol in conditional string rewriting rules of conditional semi-Thue systems can be interpreted in different ways, yielding different types of conditional semi-Thue systems. Note that some conditional semi-Thue systems, such as right conditional semi-Thue systems, can be associated with conditional term rewriting systems (CTRSs) [23], but this is not the case for all types of conditional semi-Thue systems, for example, left-right conditional semi-Thue systems. We classify and formalize different types of conditional semi-Thue systems, which extend the classification of conditional semi-Thue systems discussed in [11].

We also formalize conditional equational theories and Thue congruences using conditional semi-Thue systems for the associated monoids and their word problem. In particular, we provide a formalized method for checking confluence using (conditional) critical pairs for certain types of conditional semi-Thue systems, which provides a decision procedure for confluence if they are reductive w.r.t. the shortlex order.

Our Isabelle/HOL formalization of semi-Thue and conditional semi-Thue systems along with their related results is built on IsaFoR (Isabelle/HOL Formalization of Rewriting) [44], where Isabelle/HOL [36] is a generic proof assistant and a theorem prover allowing the users to express concepts in mathematics and computer science and to prove properties about them. It also relies on the “A Case Study in Basic Algebra” AFP (archive of formal proofs) entry [4] for a formalization of monoids and groups, and the “Abstract Rewriting” AFP entry [42] for a formalization of the abstract rewriting systems (ARSs) [1] and their related properties, such as the Church-Rosser (CR) and the strong normalization (SN) property.

To the best of our knowledge, conditional semi-Thue systems and their related results have not been formalized in any proof assistant. Our formalization may provide a formalized framework for string rewriting and conditional string rewriting along with their wide variety of applications. The relevant Isabelle/HOL theory files222http://cl-informatik.uibk.ac.at/experiments/ITP2025/material.zip. inside IsaFoR under the directory thys/Conditional_Semi_Thue_Systems are as follows:

Semi_Thue_Systems.thy Conditional_Semi_Thue_Systems.thy
String_Rewriting Conditional_String_Rewriting.thy
ShortLex.thy STS_Completion.thy
Conditional_Equational_Theories.thy STS_Critical_Pairs.thy
CSTS_P_Critical_Pairs.thy CSTS_R_Critical_Pairs.thy.thy

In the remainder of this paper, we use hyperlinks marked by for providing an HTML rendering for our formalized proofs in Isabelle/HOL.

2 Preliminaries

The definitions and results in this section can be found, for example, in [13, 7, 14, 19, 40].

Let Σ be a finite alphabet, > be a strict order on Σ (i.e. a precedence on Σ), and Σ be the set of all finite (possibly empty) strings from Σ.

The shortlex order (or length-lexicographic order) sl on Σ induced by > is defined as follows: s=s1sislt1tj=t if i>j, or they have the same length (i.e., i=j) and s1si comes before t1ti lexicographically using a precedence > on Σ. Here, s1si comes before t1ti lexicographically using a precedence > on Σ if there is a k such that s1sk1=t1tk1 and sk>tk. If slr, then uvslurv for all u,vΣ.

A monoid is a set equipped with an associative binary operation and a (two-sided) identity element. Note that a monoid cannot be empty because of an identity element. For example, Σ is a (free) monoid generated by Σ under the operation of concatenation as an associative binary operation with the empty string ε as an identity element. A homomorphism between two monoids (M,) and (M,) is a function ϕ:MM such that ϕ(xy)=ϕ(x)ϕ(y) for all x,yM and ϕ(1)=1, where 1 and 1 are the identities of M and M, respectively. A bijective monoid homomorphism is called a monoid isomorphism. Two monoids are said to be isomorphic if there is a monoid isomorphism between them. An element a of a monoid (M,) is invertible if there is an element bM such that ab=ba=1, where 1 is an identity element of M. A group is a monoid in which every element is invertible.

The reflexive and transitive closure of a binary relation is denoted by , and the reflexive, symmetric and transitive closure of is denoted by called conversion.

A derivation for a binary relation is a sequence of form t0t1t2. A binary relation is terminating (or strongly normalizing) if there are no infinite derivations t0t1t2. An element s is reducible (w.r.t. a given binary relation ) if there is an element u such that su; otherwise, s is irreducible. We say that u is an -normal form of s if su and u is irreducible via . A binary relation is confluent if there is an element w such that uw and vw whenever su and sv. A binary relation is locally confluent if there is an element w such that uw and vw whenever su and sv. A binary relation is Church-Rosser if there is an element w such that uw and vw whenever uv. Here, is Church-Rosser iff it is confluent. Two elements u and v are joinable w.r.t. a binary relation , denoted by uv, if there is an element w such that uwv (i.e., uw and vw). A binary relation is complete if it is both terminating and confluent. If is terminating, then it is confluent iff it is locally confluent (see Newman’s lemma [35, 1]).

3 Semi-Thue Systems

A semi-Thue system (STS) [7] over a finite alphabet Σ is a subset of Σ×Σ. If is an STS over a finite alphabet Σ, then the single-step string rewriting relation on Σ induced by is defined as follows: for any u,vΣ, uv iff there exists (,r) such that for some x,yΣ, u=xy and v=xry. Also, denotes the reflexive, transitive closure of . By extension, the terms “terminating”, “confluent”, etc., used in Section 2 are also applied to an STS whose single-step string rewriting relation has those properties. In the remainder of this paper, unless otherwise stated, we denote by Σ a finite alphabet and assume that a total precedence > on Σ is always given so that the shortlext order sl is a well-founded total order on Σ.

An STS with the property that (,r) implies (r,) is called a Thue system. The Thue congruence induced by is the relation . Two strings u,vΣ are congruent (modulo ) if uv. The congruence class [w] of a word wΣ is defined as [w]:={vΣ|wv}. The set {[w]|wΣ} of congruence classes (modulo ) is denoted by . In this section, we refer to [7, 21, 18] for the definitions and results related to STSs, monoids, and completion.

Lemma 1.

The set is a monoid under the operation [u][v]:=[uv] with identity [ε].

In fact, is the factor monoid of the free monoid Σ modulo the congruence , i.e., =Σ/.

Definition 2.
  1. (i)

    Let be an STS over Σ. If a monoid is isomorphic to the factor monoid (), then the ordered pair (Σ;) is a presentation of , and simply write =(Σ;). If is complete, then (Σ;) is a complete presentation of .

  2. (ii)

    The monoid =(Σ;) is finitely presented if both Σ and are finite.

  3. (iii)

    The word problem of the monoid =(Σ;) is the following decision problem: Given two words u,vΣ, decide if u=v in .

Our formalization of STSs and their associated monoids is based on the following Isabelle’s locale, where a locale [3] is a named context for fixed parameters with assumptions.

localesemi_Thue =

  fixesR:: sts   andT:: sts   andS:: "charset"

assumes "T=(ststepR)" and "finiteS" and "S{}" and "finiteR" and "(ststepR)S×S"

begin

  

Above, R denotes a finite STS over a finite non-empty alphabet S, while T denotes the Thue congruence induced by R. The sts type for R and T is declared as follows:

type_synonym sts = "srule set"

where the type srule is declared simply as string×string. (Alternatively, instead of using the Isabelle’s dedicated string type (i.e., char list type), one can use the ’a list type, which is suitable for more general STSs.) Also, (ststepR)S×S represents the assumption Σ×Σ, which also implies Σ×Σ. Our formalization of Lemma 1 also uses the locale monoid in the AFP entry [4]. It is instantiated as a sublocale using the following parameters, where S/T represents the factor monoid with identity [ε].

sublocalemonoid"S/T" "([])" "eq.Classε"

We also use the locale group in the same AFP entry, which extends the locale monoid by adding the assumption that every element of a monoid is invertible. This can be further refined as in the following lemma.

Lemma 3.

The monoid is a group if for all uΣ, there is some vΣ such that uvε and vuε .

If an STS is complete, then each congruence class contains a unique irreducible word only, which can be chosen as a normal form for this congruence class. Therefore, if is finite and complete, then the word problem of the monoid M=(Σ;) can be solved using string rewriting, that is, given two strings u,vΣ, reduce u and v by to their respective -normal forms u¯ and v¯ and simply compare them. Now, if one can show that (Σ;) is a finite complete presentation, then one can decide the word problem of the monoid (Σ;). First, in order to show that is terminating, there is an easy sufficient condition for it.

Lemma 4.

If slr for each (,r), then is terminating.

Lemma 5.

If is terminating, then is confluent iff is locally confluent.

In Lemma 4, the shortlex order sl is formalized as follows:

fun shortlex:: "stringstringbool" where

 "shortlexstr1str2=(iflenorderstr1str2thenTrueelseiflenorderstr2str1thenFalse

elselexorderstr1str2)

where the lenorder function is used for comparing the lengths of two strings and the lexorder function is used for comparing two strings of the same length via the lexicographic order (see below).

fun lenorder:: "stringstringbool" where

 "lenorderst=(lengths>lengtht)"

fun lexorder:: "stringstringbool" where

 "lexorderst=(u1u2u3ch1ch2.s=u1@[ch1]@u2t=u1@[ch2]@u3ch1pch2)"

Above, “@” denotes the list append function in Isabelle/HOL. Here, the list append function “@” serves as the string concatenation function. Accordingly, both ch1 and ch2 are characters, where ch1pch2 denotes that ch1 has a higher precedence than ch2. It is also the case that s is greater than t w.r.t. the lexicographic order if t is a strict prefix of s (see [14]). We omit this case because this case is not necessary for the shortlex order. The shortlex order using the shortlex function is abbreviated as sl.

abbreviation shortlex_s (infix "sl" 50) where "ssltshortlexst"

abbreviation shortlex_ns (infix "sl" 50) where "ssltshortlexsts=t"

Definition 6.
  1. (i)

    For each pair of not necessarily distinct string rewriting rules from , say (u0,v0) and (u0,v0), the set of critical pairs, denoted by CP(), corresponding to this pair is {(v0y,xv0)|there are x,yΣ such that u0y=xu0 and |x|<|u0|}{(v0,xv0y)|there are x,yΣ such that u0=xu0y}.

  2. (ii)

    A critical pair (z1,z2) is joinable if z1z2 .

Lemma 7.

If tsu, then tu or tCP()u.

Lemma 8.

is locally confluent iff all its critical pairs are joinable.

By using Definition 6(i), the set of critical pairs for an STS is formalized as follows:

definition sts_critical_pairs where

 "sts_critical_pairsR={(v@y,x@v)|xyuvuv.(u,v)R(u,v)Ru@y=x@u

lengthx<lengthu}{(v,x@v@y)|xyuvuv.(u,v)R(u,v)Ru=x@u@y}"

lemma sts_critical_pair_lemma:

 "WCR(ststepR)((s,t)sts_critical_pairsR.(s,t)(ststepR))"

Our formalization of Lemma 8 is as above. Here, WCR [42] is the existing formalized definition of the Weak Church-Rosser property, where WCR(ststepR) denotes that is locally confluent.

Theorem 9.

If is terminating, then is confluent iff all its critical pairs are joinable.

The following theorem and its proof provide a decision procedure for the word problem of a monoid if it is presented by a finite complete STS.

Theorem 10.

Let be a finite STS on Σ. If is complete, then we can decide whether s and t in Σ are the same element in the monoid .

Proof.

Observe that if st, then s and t are the same element in :=Σ/; otherwise, they are the different elements in . Since is finite and complete, we can decide whether st by comparing the normal forms of s and t w.r.t. , that is, if the normal forms of s and t w.r.t.  are the same, then they are the same element in (i.e., [s]=[t]); otherwise, they are the different elements in (i.e., [s][t]).

Figure 1: Inference rules for completion of a semi-Thue system on Σ.
 Remark 11.

Thus far, this section has been concerned with the word problem of monoids and its decision procedure if they are presented by finite complete STSs. Our formalization can also be used for the word problem for finitely presented groups. Group presentations can be converted into monoid presentations (see [19, 40]). (Recall that groups are also monoids.) Let S be a set of generators of a group G, R be a set of relations of G, and Sα={sα|sS,α{1,1}}. Then the group defined by the presentation <S|R> is equivalent to the monoid defined by the presentation (Σ;), where Σ=Sα and is an STS orienting the equations in {ss11|sSα}R using the total shortlex order on Sα. (Here, if u=v1Sα, then u1 is defined to be equal to v.) Therefore, Theorem 10 can also be used for the word problem of a group if its group presentation yields the monoid presentation (Σ;) such that is a finite complete STS on Σ.

Completion [1, 29, 18] attempts to transform a set of equations (or string rewriting rules in equational form) on Σ into an equivalent complete string rewriting system. It basically converts non-joinable critical pairs into string rewriting rules so that they are joinable. It uses a reduction order [19] (e.g. the shortlex order) to orient equations on Σ, and also uses string rewriting for simplification. (Here, an equation is an unordered pair (s,t) of strings on Σ, written as st.) The inference rules, which are given in Figure 1, operate on pairs (,), where is a set of equations and is a set of string rewriting rules on Σ. Intuitively speaking, is a set of input equations or critical pairs that have not yet been transformed (i.e., oriented) into string rewriting rules, while is a terminating set of string rewriting rules.

Definition 12.

We write (,)SR(,) if (,) can be obtained from (,) by applying one of the inference rules in Figure 1.

Definition 13.
  1. (i)

    A (finite) run for an initial set of equations is a finite sequence (0,0)SR(1,1)SRSR(n,n), where 0= and 0=.

  2. (ii)

    A run (0,0)SR(1,1)SRSR(n,n) fails if n.

  3. (iii)

    A run (0,0)SR(1,1)SRSR(n,n) is fair if CP(n)i=0ni.

Lemma 14.

For every non-failing run (0,0)SR(1,1)SRSR(n,n), 0=n.

Definition 15 (cf. [18]).

Let be an STS on Σ and M be a finite multiset of strings on Σ. We write (the labeled string rewriting) s𝑀t if st and there are some s,tM such that ssls and tslt. Here, sl denotes the reflexive closure of sl.

Lemma 16.

Let (,)SR(,). If t𝑀u and sl, then t𝑀u.

The following definition is due to [43, 18].

Definition 17.
  1. (i)

    An abstract rewrite system (ARS) 𝒜 is a set A equipped with a binary relation . We also write an ARS 𝒜 as A,{α}αI where we denote by α the part of the binary relation with label α indexed by I so that ={ααI}.

  2. (ii)

    An ARS 𝒜=A,{α}αI is peak decreasing if there exists a well-founded order > on I such that for all α,βI the inclusion

    αβαβ

    holds. Here, αβ denotes the set {γIα>γ or β>γ} and if JI then 𝐽 denotes a conversion consisting of J={γγJ} steps.

See [18] for the proof of the following lemma and its Isabelle/HOL formalization.

Lemma 18.

Every peak decreasing ARS is confluent.

Theorem 19 (cf. [18]).

For every fair non-failing run (0,0)SR(1,1)SRSR(n,n), n is a complete STS for an initial finite set of equations =0 on Σ.

Sketch of the proof.

We first show that n is terminating. If (,)SR(,) and sl, then sl by the case analysis of each inference rule in Figure 1. We leave the straightforward induction proof to our formalization for showing nsl, which in turn shows that n is terminating. Now, we let tnM1snM2u be a labeled local peak in n and show that n is peak decreasing. By Lemma 7, we have tnu or tCP(n)u, and thus tnu or (t,u)i=0ni by fairness and Definition 13(iii). Here, we only consider the case where (t,u)i=0ni and leave the proof of the other case to our formalization. Since (t,u)i=0ni, there is some k such that (t,u)k. Now, let M:={t,u}. Then, we have (t,u)k𝑀, and thus (t,u)kk𝑀. By repeated applications of Lemma 16, we have (t,u)n𝑀. This means that there is a conversion between t and u, where each step in the conversion is labeled by M. Let slmul denote the multiset extension of sl. Then, slmul is well-founded because sl is well-founded. Since M1slmulM and M2slmulM, n is peak decreasing, and thus confluent by Lemma 18.

Our formalization of the inference rules in Figure 1 for a completion step uses the “inductively defined predicates” in Isabelle/HOL.

inductivests_compl_step:: "sts×stssts×stsbool" (infix "SR" 55) where

deduce: "(E,R)SR(E{(s@u3,u1@t)},R)"

  if "(u1@u2,s)R" and "(u2@u3,t)R" and "u2[]"

|simplifyl: "(E{(u1@u2@u3,s)},R)SR(E{(u1@t@u3,s)},R)"

  if "(u2,t)R"

|simplifyr: "(E{(s,u1@u2@u3)},R)SR(E{(s,u1@t@u3)},R)"

  if "(u2,t)R"

|orientl: "(E{(s,t)},R)SR(E,{R{(s,t)})"  if "sslt"

|orientr: "(E{(s,t)},R)SR(E,{R{(t,s)})"  if "tsls"

|collapse: "(E,R{(u1@u2@u3,s)})SR(E{(u1@t@u3,s)},R)"  if "(u2,t)R"

|compose: "(E,R{(s,u1@u2@u3)})SR(E,R{(s,u1@t@u3)})"  if "(u2,t)R"

|delete: "(E{(s,s)},R)SR(E,R)"

Note that in Figure 1, consists of unordered pairs (i.e., equations). In our formalization above, it consists of ordered pairs for technical convenience, so we use simplifyl and simplifyr for the simplify rule and orientl and orieintr for the orient rule in Figure 1.

Now, Theorem 19 is formalized as follows, where the assumptions describe a fair non-failing run (0,0)SR(1,1)SRSR(n,n) in Theorem 19.

theoremsts_finite_fair_run_complete: assumesR 0={} and En={}

and  "i<n.(Ei,Ri)SR(E(Suci),R(Suci))"

and  "sts_critical_pairs(Rn)(in.(ststep(Ei)))"

shows  "complete(ststep(Rn))"

 Remark 20.

Using an inference system for a completion procedure is known to be simple and efficient, and it is easy to apply simplification rules [1]. An inference system-based completion procedure for TRSs was already discussed in the literature [2, 18, 1]. Our inference system in Figure 1 is adapted from the existing Knuth-Bendix completion procedures for STSs [24, 7] that do not use an inference system. (There are also inference systems for equational reasoning over strings, such as [27, 28], but they are not directly applicable to a completion procedure for STSs.) Regarding a completion procedure for finitely presented monoids and groups, one may attempt to use an inference system discussed in abstract completion [18, 2] by converting STSs into TRSs as discussed in Section 1. This is not tailored toward a completion procedure for finitely presented monoids and groups. In particular, we use the simple string matching method and the simple shortlex order on strings in Figure 1 rather than using more complex term structures for unification/matching and ordering. Note that given a fixed signature with its precedence, it takes only linear time to compare two finite strings w.r.t. the shortlex order. It takes also linear time to match two finite strings using, for example, the Knuth–Morris–Pratt (KMP) algorithm [30].

4 Conditional Semi-Thue Systems

Conditional semi-Thue systems (CSTSs) [11] are extensions of STSs in the sense that their rules may admit non-empty conditions. A CSTS on Σ [11] is defined to be a set of conditional string rewriting rules, where each rule has the form (,r)ϕ (also denoted as rϕ) consisting of strings ,rΣ and a sequence ϕ of unordered pairs of strings on Σ. Here, ϕ can be thought of as a conjunction of conditions for the rule (,r)ϕ. In the following, let be a CSTS on Σ.

Definition 21.

We write lrst if the equation st is derivable from the inference rules in Figure 2, and say that st belongs to the left-right conditional equational theory induced by .

Figure 2: Inference rules for yielding a left-right conditional equational theory induced by a conditional semi-Thue system on Σ.

We may also consider other types of conditional equational theories depending on how contexts are used for the conditions in each conditional string rewriting rule (cf. [11]).

Above, each condition is considered with a right context uΣ and this context is also used for the conclusion.

Definition 22.

We write rst if the equation st is derivable from the inference rules in Figure 2 substituting the above “Replacement (R)” rule for the “Replacement (LR)” rule. If rst, then we say that st belongs to the right conditional equational theory induced by .

Above, no additional context is used for each condition and the conclusion.

Definition 23.

We write pst if the equation st is derivable from the inference rules in Figure 2 substituting the above “Replacement (P)” rule for the “Replacement (LR)” rule. If pst, then we say that st belongs to the pure conditional equational theory induced by .

Our formalization of the inference rules in Figure 2 for the left-right conditional equational theory induced by also uses the “inductively defined predicates” in Isabelle/HOL.

inductivecond_eq_lr_theory:: "cstsstring×stringbool" (infix "celr" 55) where

refl: "Rcelr(s,s)"

|symmetry: "Rcelr(s,t)" if "Rcelr(t,s)"

|transitive: "Rcelr(s,u)" if "Rcelr(s,t)Rcelr(t,u)"

|congruence: "Rcelr(u@s@v,u@t@v)" if "Rcelr(s,t)"

|replacement: "Rcelr(u@l@w,u@r@w)"

  if "((l,r),cs)R((si,ti)setcs.Rcelr(u@si@w,u@ti@w))"

Above, Rcelr(s,t) denotes that st belongs to the left-right conditional equational theory induced by . The right (resp. pure) conditional equational theory induced by can be formalized in a similar way, where cer (resp. cep) is used for inductively defined predicate for the right (resp. pure) conditional equational theory induced by . They are only different from the replacement part (see below):

replacement: "Rcer(l@w,r@w)"

  if "((l,r),cs)R((si,ti)setcs.Rcelr(si@w,ti@w))"

replacement: "Rcep(l,r)"

  if "((l,r),cs)R((si,ti)setcs.Rcelr(si,ti))"

Meanwhile, the types of CSTSs depend on the string rewriting relations induced by CSTSs. More specifically, the types of CSTSs depend on how conditions are evaluated in the conditional parts of their conditional string rewriting rules (cf. [5, 46]). The induced string rewriting relations from CSTSs are structured into levels (cf. [41, 46]).

Definition 24.

The string rewriting relation ,lr,s for a left-right-semi-equational CSTS on Σ is defined as follows: t1,lr,st2 iff t1nt2 for some n0. Here, the unconditional STS n are inductively defined as follows:

{0:=n+1:={(uv,urv)|(,r)ϕ, and usvnutv for all stϕ and u,vΣ}

The string rewriting relation ,lr,j for a left-right-join CSTS on Σ is defined as: t1,lr,jt2 iff t1nt2 for some n0, where n are inductively defined as follows:

{0:=n+1:={(uv,urv)|(,r)ϕ, and usvnutv for all stϕ and u,vΣ}
Definition 25.

The string rewriting relation ,r,s for a right-semi-equational CSTS on Σ is defined as follows: t1,r,st2 iff t1nt2 for some n0. Here, the unconditional STS n are inductively defined as follows:

{0:=n+1:={(v,rv)|(,r)ϕ, and svntv for all stϕ and vΣ}

The string rewriting relation ,r,j for a right-join CSTS on Σ is defined as: t1,r,jt2 iff t1nt2 for some n0, where n are inductively defined as follows:

{0:=n+1:={(v,rv)|(,r)ϕ, and svntv for all stϕ and vΣ}
Definition 26.

The string rewriting relation ,p,s for a pure-semi-equational CSTS on Σ is defined as follows: t1,p,st2 iff t1nt2 for some n0. Here, the unconditional STS n are inductively defined as follows:

{0:=n+1:={(,r)|(,r)ϕ, and snt for all stϕ}

The string rewriting relation ,p,j for a pure-join CSTS on Σ is defined as: t1,p,jt2 iff t1nt2 for some n0, where n are inductively defined as follows:

{0:=n+1:={(,r)|(,r)ϕ, and snt for all stϕ}

The following lemma says that our inference system for yielding the left-right, right, and pure conditional equational theories is sound w.r.t. the Thue congruences induced by the string rewriting relations associated with the left-right-semi-equational, right-semi-equational, and pure-semi-equational CSTSs, respectively.

Lemma 27.

Let be a CSTS on Σ and t1,t2Σ.

  1. (i)

    t1,lr,st2 iff lrt1t2.

  2. (ii)

    t1,r,st2 iff rt1t2.

  3. (iii)

    t1,p,st2 iff pt1t2.

The bidirectional use of the string rewriting relations for evaluating the conditions in semi-equational CSTSs is both inefficient and unnatural (cf. [46]). We can use the join CSTSs instead of the semi-equational CSTSs if they have the confluence property.

Lemma 28.

Let be a CSTS on Σ.

  1. (i)

    If ,lr,j is confluent, then ,lr,s=,lr,j.

  2. (ii)

    If ,r,j is confluent, then ,r,s=,r,j.

  3. (iii)

    If ,p,j is confluent, then ,p,s=,p,j.

 Remark 29.

Recall that an STS S on Σ can be associated with a TRS S, where each letter from Σ is interpreted as a unary function symbol. Similarly, a right-join CSTS S on Σ can be associated with a join CTRS S in such a way that S:={(x)r(x)s1(x)t1(x),,sn(x)tn(x)|rs1t1,,sntnS} [11]. (Here, variables in S are renamed whenever necessary.) However, this is not the case for left-right-join CSTSs.

Example 30.

Consider ={ab,ambm,cdab}, where Σ={a,b,c,d,,m} with a>b>c>d>>m. If is a pure-join CSTS, then neither c,p,jd nor cm,p,jdm holds. If is a right-join CSTS, then c,r,jd holds, but cm,r,jdm does not hold. If is a left-right-join CSTS, then both c,rl,jd and cm,rl,jdm hold.

Now, we discuss our formalization of right-join and pure-join CSTSs. (Our formalization of left-right-join CSTSs is similar and is omitted.) First, the string rewriting relation ,r,j associated with a right-join CSTS is formalized as follows:

definition "csr_r_join_step =(n.csr_r_join_step_nn)"

fun csr_r_join_step_n:: "cstsnatstringrel" where

 "csr_r_join_step_n 0={}" |

 "csr_r_join_step_n(Sucn)=

  {(C@w,Cr@w)|Crcsw.((,r),cs)

((si,ti)setcs.(si@w,ti@w)(csr_r_join_step_nn))}

In the csr_r_join_step_n function, C is a (string) context and C@w (resp. Cr@w) denotes the application of the context C to the string w (resp. rw). We formalize a context for strings based on the existing formalization of contexts for terms in IsaFoR.

datatype sctxt = Hole "()" |  More "string" "sctxt" "string"

fun sctxt_apply_string :: "sctxtstringstring" ("__" [900, 0] 900) where

 "s=s" |

 "(More ss1 C ss2)s=(ss1@(Cs)@ss2)"

Using the above function, Cs denotes usv for some (possibly empty) strings u and v. In the csr_r_join_step_n function, we consider all possible contexts C because ,r,j is a string rewriting relation, i.e., ,r,jr implies uv,r,jurv for all (possibly empty) strings u and v. Next, the string rewriting relation ,p,j associated with a pure-join CSTS is formalized as follows. Here, no additional string is appended for evaluating each condition.

definition "csr_p_join_step =(n.csr_p_join_step_nn)"

fun csr_p_join_step_n:: "cstsnatstringrel" where

 "csr_p_join_step_n 0={}" |

 "csr_p_join_step_n(Sucn)=

  {(C,Cr)|Crcs.((,r),cs)((si,ti)

setcs.(si,ti)(csr_p_join_step_nn))}

Our formalization of CSTSs and their associated monoids relies on the following locale.

localeconditional_semi_Thue =

  fixesR:: csts   andS:: "charset"

assumes "finiteS" and "S{}" and "finiteR"

For example, the locale for right-join CSTSs extends the above locale and is described as:

localeconditional_r_join_semi_Thue = reductive_r_join + conditional_semi_ThueRS

  forR::csts andS:: "charset" +

  fixesThue_R_Congruence:: sts

assumes "Thue_R_Congruence=(csr_r_join_stepR)" and "Thue_R_CongruenceS×S"

begin

Since the locale conditional_r_join_semi_Thue extends the locale conditional_semi_Thue, the alphabet denoted by S is assumed to be finite and non-empty. The assumptions in the locale conditional_r_join_semi_Thue also represent the assumption ,r,jΣ×Σ, which also implies the assumption ,r,jΣ×Σ.

Definition 31.
  1. (i)

    We call a CSTS reductive if for all (,r)ϕ, slr, slsi, and slti for all (si,ti)ϕ (cf. decreasingness [12] in CTRSs).

  2. (ii)

    Two STSs 1 and 2 on Σ are equivalent if 1=2, that is, they present the same monoid.

  3. (iii)

    An STS 1 and a reductive right-join (resp. a pure-join) CSTS 2 on Σ are equivalent if 1=2,r,j (resp. 1=2,p,j).

Example 32 (see [11]).

The monoid =(Σ;), where Σ={a,b} and ={ababa}, is finitely presented and have decidable word problem, but does not admit an equivalent monoid presentation with (Σ;), where is a finite complete STS. More specifically, a completion procedure for may only yield an infinite complete semi-Thue system {abnabna|n1}. However, admits an equivalent finite complete (reductive) right-join CSTS ′′={ababa,abbbbabb}. (Here, (Σ;′′) is a finite complete (reductive) conditional presentation of , which will be discussed later in this section.)

Unlike the string rewriting relations induced by semi-Thue systems, ,r,j is not necessarily decidable even if it is terminating (cf. [37]).

Lemma 33.
  1. (i)

    If is a finite reductive right-join CSTS, then ,r,j is terminating and the set ΔR,r,j,s={t|s,r,jt} is finite for all sΣ.

  2. (ii)

    If is a finite reductive pure-join CSTS, then ,p,j is terminating and the set ΔR,p,j,s={t|s,p,jt} is finite for all sΣ.

In the above lemma, if is finite and reductive and ,r,j (resp. ,p,j) is terminating, then we may simulate the decidability of ,r,j (resp. ,p,j) using the finiteness of the set of descendants ΔR,r,j,s (resp. ΔR,p,j,s) for all sΣ. Here, the set ΔR,r,j,s (resp. ΔR,p,j,s) can be shown to be computable for all sΣ using the well-founded induction on sl if is finite and reductive (cf. Theorem 7.2.9 in [37]).

Definition 34.
  1. (i)

    Let be a right-join CSTS. For each pair of not necessarily distinct conditional string rewriting rules from , say (u0,v0)i=1muivi and (u0,v0)i=1nuivi, the set of critical pairs w.r.t. ,r,j corresponding to this pair is {(v0y,xv0)i=1muiyviyi=1nuivi|there are x,yΣ such that u0y=xu0 and |x|<|u0|}{(v0,xv0y)i=1muivii=1nuiyviy|there are x,yΣ such that u0=xu0y}.

  2. (ii)

    A critical pair (s0,t0)i=1nsiti is joinable w.r.t. ,r,j if for any yΣ, siy,r,jtiy for all 1in implies s0y,r,jt0y.

  3. (iii)

    Let be a pure-join CSTS. For each pair of not necessarily distinct conditional string rewriting rules from , say (u0,v0)i=1muivi and (u0,v0)i=1nuivi, the set of critical pairs w.r.t. ,p,j corresponding to this pair is {(v0y,xv0)i=1muivii=1nuivi|there are x,yΣ such that u0y=xu0 and |x|<|u0|}{(v0,xv0y)i=1muivii=1nuivi|there are x,yΣ such that u0=xu0y}.

  4. (iv)

    A critical pair (s0,t0)i=1nsiti is joinable w.r.t. ,p,j if si,p,jti for all 1in implies s0,p,jt0.

Now, we discuss our formalization of Definition 34. First, the set of critical pairs for a right-join CSTS is formalized as follows:

definition csts_r_critical_pairs where

 "csts_r_critical_pairsR={((v@y,x@v),cs@map(λ(lhs,rhs).(lhs@y,rhs@y))cs)|

xyuvuvcscs.((u,v),cs)R((u,v),cs)Ru@y=x@ulengthx<lengthu}

{((v,x@v@y),cs@map(λ(lhs,rhs).(lhs@y,rhs@y))cs)|xyuvuvcscs.((u,v),cs)

R((u,v),cs)Ru=x@u@y}"

Above, if cs is of the form i=1muivi, then map(λ(lhs,rhs).(lhs@y,rhs@y))cs is i=1muiyviy. Also, ((,r),cs) denotes the conditional string rewriting rule (,r)cs, where cs is the list type for technical convenience. Based on Definition 34(ii), the statement that all critical pairs of are joinable w.r.t. ,r,j is formalized as follows:

definition all_ccps_r_joinable where

 "all_ccps_r_joinableR=(stcs.((s,t),cs)csts_r_critical_pairsR

(y.csts_conds_r_satRcsy(s@y,t@y)(csr_r_join_stepR)))"

where the definition of csts_conds_r_sat is formalized as follows:

definition csts_conds_r_sat where

 "csts_conds_r_satRcsy((si,ti)setcs.(si@y,ti@y)(csr_r_join_stepR))"

Meanwhile, the set of critical pairs for a pure-join CSTS is formalized as follows:

definition csts_p_critical_pairs where

 "csts_p_critical_pairsR={((v@y,x@v),cs@cs)|xyuvuvcscs.((u,v),cs)R

((u,v),cs)Ru@y=x@ulengthx<lengthu}{((v,x@v@y),cs@cs|

xyuvuvcscs.((u,v),cs)R((u,v),cs)Ru=x@u@y}"

Note that conditions are evaluated without using any context in the above formalization. The statement that all critical pairs of are joinable w.r.t. ,p,j is formalized as follows:

definition all_ccps_p_joinable where

 "all_ccps_p_joinableR=(stcs.((s,t),cs)csts_p_critical_pairsR

csts_conds_p_satRcs(s,t)csr_p_join_stepR))"

where the definition of csts_conds_p_sat is simply formalized as follows:

definition csts_conds_p_sat where

 "csts_conds_p_satRcs((si,ti)setcs.(si,ti)(csr_p_join_stepR))"

Lemma 35 (see [11]).

Let be a finite reductive right-join CSTS. Then, ,r,j is confluent if and only if all critical pairs of are joinable w.r.t. ,r,j.

Lemma 36.

Let be a finite reductive pure-join CSTS. Then, ,p,j is confluent if and only if all critical pairs of are joinable w.r.t. ,p,j.

Proof.

Since the “only if” direction is straightforward, we only show the “if” direction. Suppose that all critical pairs of are joinable w.r.t. ,p,j. Since is finite and reductive, ,p,j is terminating and decidable by Lemma 33(ii), so by Newman’s Lemma, it suffices to show that ,p,j is locally confluent. Let s,p,jt and s,p,ju, and let (,r)i=1msiti and (,r)i=1nsiti be two rules to reduce s to t and u, respectively. We show that t,p,ju by considering the following three cases according to the positions of and in s.

  1. 1.

    and do not overlap, i.e., s=xyz and t=xryz,p,jxyz,p,jxyrz=u using the rules (,r)i=1msiti and (,r)i=1nsiti, where x,y,zΣ. Since i=1msi,p,jti and i=1nsi,p,jti, we have t=xryz,p,jxryrz,p,jxyrz=u. Therefore, t and u are joinable w.r.t. ,p,j.

  2. 2.

    is a substring of , i.e., s=xy=xuvy and t=xry,p,jxy=xuvy,p,jxurvy=u using the rules (,r)i=1msiti and (,r)i=1nsiti, where x,y,u,vΣ. Since =uv, we have a critical pair (r,urv)i=1msitii=1nsiti. This critical pair is joinable w.r.t. ,p,j by hypothesis with i=1msi,p,jti and i=1nsi,p,jti, so there is some w such that r,p,jw and urv,p,jw. Since xry,p,jxwy and xurvy,p,jxwy, we have xry,p,jxurvy, and thus t and u are joinable w.r.t. ,p,j.

  3. 3.

    and have an overlap in such a way that s=xuy=xvy and t=xruy,p,jxuy=xvy,p,jxvry=u using the rules (,r)i=1msiti and (,r)i=1nsiti, where |v|<|| and x,y,u,vΣ. Since u=v with |v|<||, we have a critical pair (ru,vr)i=1msitii=1nsiti. This critical pair is also joinable w.r.t. ,p,j by hypothesis with i=1msi,p,jti and i=1nsi,p,jti, so there is some w such that ru,p,jw and vr,p,jw. Since xruy,p,jxwy and xvry,p,jxwy, we have xruy,p,jxvry, and thus t and u are joinable w.r.t. ,p,j.

This shows that t,p,ju, and thus ,p,j is locally confluent.

Lemmas 35 and 36 are simply formalized respectively as follows:

lemma csts_r_critical_pair_lemma: assumes  "reductiveR"

 "CR(csr_r_join_stepR)all_ccps_r_joinableR"

lemma csts_p_critical_pair_lemma: assumes  "reductiveR"

 "CR(csr_p_join_stepR)all_ccps_p_joinableR"

For reductive right-join (or pure-join) CSTSs, joinability of critical pairs suffices to show confluence by Lemma 35 (resp. Lemma 36). However, this is not the case for reductive left-right-join CSTSs. In particular, unlike reductive right-join or pure-join CSTSs, non-overlap may not be joinable for reductive left-right-join CSTSs as shown in the following example.

Example 37.

Consider the left-right-join CSTS ={buij,cvlm,aicajc,bldbmd} over Σ={a,b,c,d,i,j,l,m,u,v}. Using the shortlex ordering sl induced by the precedence a>b>c>d>i>j>l>m>u>v, we see that is reductive. Now, consider a non-overlap aucd,rl,jabcd,rl,jabvd. Here, the step abcd,rl,jaucd uses the rules buij and aicajc, and the step abcd,rl,jabvd uses the rules cvlm and bldbmd. However, it is not the case that aucd,rl,jabvd.

Now, we discuss the monoids defined by certain congruence relations induced by the string rewriting relations ,r,j and ,p,j.

Definition 38.

Let be a reductive right-join (resp. a pure-join) CSTS on Σ. The Thue congruence induced by ,r,j (resp. ,p,j) is the relation ,r,j (resp. ,p,j). Two strings u,vΣ are congruent w.r.t. ,r,j (resp. ,p,j) if u,r,jv (resp. u,p,jv). The congruence class [w],r,j (resp. [w],p,j) of a word wΣ is defined as [w],r,j:={vΣ|w,r,jv} (resp. [w],p,j:={vΣ|w,p,jv}). The set {[w],r,j|wΣ} (resp. {[w],p,j|wΣ}) of congruence classes w.r.t. ,r,j (resp. ,p,j) is denoted by ,r,j (resp. ,p,j).

 Remark 39.

In Definition 38, one can alternatively define ,r,j (resp. ,p,j) only if ,r,j (resp. ,p,j) is confluent so that ,r,j (,p,j) is the same as the right (resp. pure) conditional equational theory induced by (see Lemmas 27 and 28). In this case, ,r,j (resp. ,p,j) can be directly associated with the right (resp. pure) conditional equational theory induced by . We use the simpler definition of ,r,j (resp. ,p,j) as in Definition 38 instead of adding the restriction that ,r,j (resp. ,p,j) is confluent (cf. Theorem 42).

Lemma 40.
  1. (i)

    The set ,r,j is a monoid under the operation [u],r,j[v],r,j:=[uv],r,j with the identity element [ε],r,j.

  2. (ii)

    The set ,p,j is a monoid under the operation [u],p,j[v],p,j:=[uv],p,j with the identity element [ε],p,j.

Definition 41.

Let be a reductive right-join (resp. a pure-join) CSTS over Σ. The ordered pair (Σ;) is a (reductive) conditional presentation of the monoid ,r,j (resp. ,p,j). The monoid ,r,j (resp. ,p,j) is finitely presented if both Σ and are finite in (Σ;). The ordered pair (Σ;) is a complete (reductive) conditional presentation of the monoid ,r,j (resp. ,p,j) if ,r,j (resp. ,p,j) is complete.

The following theorem and its proof provide a decision procedure for the word problem of monoids with finite complete (reductive) conditional presentations.

Theorem 42.
  1. (i)

    Let be a finite reductive right-join CSTS on Σ. If ,r,j is confluent, then we can decide whether s and t on Σ are the same element in the monoid ,r,j:=Σ/,r,j.

  2. (ii)

    Let be a finite reductive pure-join CSTS on Σ. If ,p,j is confluent, then we can decide whether s and t on Σ are the same element in the monoid ,p,j:=Σ/,p,j.

Proof.

For the proof of (i), if s,r,jt, then s and t are the same element in ,r,j. Otherwise, s and t are the different elements in ,r,j. Since is finite and reductive, ,r,j is terminating and decidable. Furthermore, ,r,j is confluent by hypothesis, so we can decide whether s,r,jt by comparing the normal forms of s and t w.r.t. ,r,j. In other words, if the normal forms of s and t w.r.t. ,r,j are the same, then they are the same element in ,r,j, and they are the different elements in ,r,j, otherwise. We omit the proof of (ii) because it is similar to the proof of (i).

Our formalization of Theorem 42 is an extension of the formalization of Theorem 10 discussed in Section 3 in conditional setting, where the locale monoid is instantiated using the different parameters for ,r,j and ,p,j, respectively:

monoid"S/Thue_R_Congruence" "([]r)" "equiv_r.Classε"

monoid"S/Thue_P_Congruence" "([]p)" "equiv_p.Classε"

Above, Thue_R_Congruence and Thue_P_Congruence are (csr_r_join_stepR) and (csr_p_join_stepR), respectively. They correspond to the Thue congruence relations induced by ,r,j and ,p,j, respectively. Also, []r (resp. []p) represents an associative binary operator for the monoid ,r,j (resp. ,p,j) in such a way that [u],r,j[]r[v],r,j=[uv],r,j (resp. [u],p,j[]p[v],p,j=[uv],p,j) for all u,vΣ, where Σ is represented by S in the above. Finally, equiv_r.Classε (resp. equiv_p.Classε) represents the congruence class [ε],r,j (resp. [ε],p,j) corresponding to the identity element in ,r,j (resp. ,p,j).

5 Conclusion

Semi-Thue and certain types of conditional semi-Thue systems can be viewed as presentations of monoids because they define a quotient of the free monoid modulo the Thue congruence that they induce. We have presented an Isabelle/HOL formalization of semi-Thue and conditional semi-Thue systems along with a decision procedure for the word problem of monoids with finite complete unconditional or reductive conditional presentations. Also, our formalized framework for semi-Thue and Thue systems can provide formalized building blocks for different kinds applications because there is a wide variety of applications of semi-Thue and Thue systems, such as formal language theory [7, 38], group theory [10, 33, 19, 40], and algebraic protocols [7, 6].

The main contributions of this paper are as follows: (i) We have presented the first (computer-aided) formalization of conditional semi-Thue systems (using a proof assistant). In particular, we have provided a new formalized method for checking confluence using (conditional) critical pairs for finite reductive right-join and pure-join conditional semi-Thue systems. (ii) The existing classification of conditional semi-Thue systems basically consists only of left-right-join and right-join conditional semi-Thue systems (see [11]). We have extended this classification depending on how conditions are evaluated in the conditional parts of their rules, and provided a formalized framework for the different types of conditional semi-Thue systems. (For the classification of conditional term rewriting systems, see [46].) Furthermore, we have proposed and formalized a new inference system for generating different conditional equational theories and Thue congruences for the associated monoids along with their word problem. (iii) We have presented and formalized an inference system for a completion procedure of semi-Thue systems, which is adapted from the existing Knuth-completion procedure [24, 7] of semi-Thue systems and an abstract completion procedure [18, 2] of term rewriting systems. When attempting to construct a finite complete presentation of a monoid or a group, our inference-system based completion procedure is straightforward and easy to use (in comparison to algorithm-based completion procedures [24, 7]) by means of simple string matching. We have also provided the formalized proof of its correctness.

Yet, much work still remains ahead. Unlike semi-Thue systems, conditional semi-Thue systems have not been well researched. For example, effective/operation termination [32, 37], confluence, and the reachability analysis [16] of the different types of conditional semi-Thue systems along with their formalization are possible future research directions. Another possible future research direction is to classify and formalize the different types of conditional string rewriting in terms of the expressive power [34] of string rewriting.

References

  • [1] Franz Baader and Tobias Nipkow. Term Rewriting and All That. Cambridge University Press, Cambridge, UK, 1998. doi:10.1017/CBO9781139172752.
  • [2] Leo Bachmair, Nachum Dershowitz, and Jieh Hsiang. Orderings for Equational Proofs. In Proceedings of the Symposium on Logic in Computer Science (LICS ’86), Cambridge, Massachusetts, USA, June 16-18, 1986, pages 346–357. IEEE Computer Society, 1986.
  • [3] Clemens Ballarin. Tutorial to Locales and Locale Interpretation, 2010. URL: http://isabelle.in.tum.de/doc/locales.pdf.
  • [4] Clemens Ballarin. A Case Study in Basic Algebra. Arch. Formal Proofs, 2019. URL: https://www.isa-afp.org/entries/Jacobson_Basic_Algebra.html.
  • [5] Jan A. Bergstra and Jan Willem Klop. Conditional Rewrite Rules: Confluence and Termination. J. Comput. Syst. Sci., 32(3):323–362, 1986. doi:10.1016/0022-0000(86)90033-4.
  • [6] Ronald V. Book and Friedrich Otto. On the Verifiability of Two-Party Algebraic Protocols. Theor. Comput. Sci., 40:101–130, 1985. doi:10.1016/0304-3975(85)90161-6.
  • [7] Ronald V. Book and Friedrich Otto. String-Rewriting Systems. Springer, New York, NY, 1993. doi:10.1007/978-1-4613-9771-7.
  • [8] Thomas Braibant and Damien Pous. Tactics for Reasoning Modulo AC in Coq. In Jean-Pierre Jouannaud and Zhong Shao, editors, Certified Programs and Proofs - First International Conference, CPP 2011, Kenting, Taiwan, December 7-9, 2011. Proceedings, volume 7086 of Lecture Notes in Computer Science, pages 167–182. Springer, 2011. doi:10.1007/978-3-642-25379-9_14.
  • [9] Jacek Chrzaszcz and Daria Walukiewicz-Chrzaszcz. Towards Rewriting in Coq. In Hubert Comon-Lundh, Claude Kirchner, and Hélène Kirchner, editors, Rewriting, Computation and Proof, Essays Dedicated to Jean-Pierre Jouannaud on the Occasion of His 60th Birthday, volume 4600 of Lecture Notes in Computer Science, pages 113–131. Springer, 2007. doi:10.1007/978-3-540-73147-4_6.
  • [10] Daniel E. Cohen. String Rewriting – A Survey for Group Theorists. In Graham A. Niblo and Martin A. Roller, editors, Geometric Group Theory, London Mathematical Society Lecture Note Series, pages 37–47. Cambridge University Press, 1993.
  • [11] Thomas Deiß. Conditional Semi-Thue systems for Presenting Monoids. Technical report, Universität Kaiserslautern, 1992. SEKI Report SR-92-12 available at https://agent.informatik.uni-kl.de/seki/1992/Deiss.SR-92-12.english.ps.Z. A shorter version of the paper was presented at Annual Symposium on Theoretical Aspects of Computer Science in 1992 (STACS 92) with the same title.
  • [12] Nachum Dershowitz, Mitsuhiro Okada, and G. Sivakumar. Confluence of Conditional Rewrite Systems. In Stéphane Kaplan and Jean-Pierre Jouannaud, editors, Conditional Term Rewriting Systems, 1st International Workshop, Orsay, France, July 8-10, 1987, Proceedings, volume 308 of LNCS, pages 31–44. Springer, 1987. doi:10.1007/3-540-19242-5_3.
  • [13] Nachum Dershowitz and David A. Plaisted. Rewriting. In John Alan Robinson and Andrei Voronkov, editors, Handbook of Automated Reasoning (in 2 volumes), pages 535–610. Elsevier and MIT Press, 2001. doi:10.1016/B978-044450813-3/50011-4.
  • [14] Patrick Baxter Dragon, Oscar I. Hernandez, Joe Sawada, Aaron Williams, and Dennis Wong. Constructing de Bruijn sequences with co-lexicographic order: The k-ary Grandmama sequence. Eur. J. Comb., 72:1–11, 2018. doi:10.1016/J.EJC.2018.03.006.
  • [15] Hannah Fechtner. Braids in Lean. Master’s thesis, Carnegie Mellon University, PA, USA, 2024.
  • [16] Guillaume Feuillade, Thomas Genet, and Valérie Viet Triem Tong. Reachability Analysis over Term Rewriting Systems. J. Autom. Reason., 33(3-4):341–383, 2004. doi:10.1007/S10817-004-6246-0.
  • [17] Yannick Forster, Dominique Larchey-Wendling, Andrej Dudenhefner, Edith Heiter, Dominik Kirst, Fabian Kunze, Gert Smolka, Simon Spies, Dominik Wehr, and Maximilian Wuttke. A Coq Library of Undecidable Problems. In CoqPL 2020 The Sixth International Workshop on Coq for Programming Languages, New Orleans, USA, 2020. URL: https://hal.science/hal-02944217.
  • [18] Nao Hirokawa, Aart Middeldorp, Christian Sternagel, and Sarah Winkler. Abstract Completion, Formalized. Log. Methods Comput. Sci., 15(3), 2019. doi:10.23638/LMCS-15(3:19)2019.
  • [19] D. F. Holt, B. Eick, and E. A. O’Brien. Handbook of computational group theory. CRC Press, Boca Raton, FL, 2005.
  • [20] Jieh Hsiang, Hélène Kirchner, Pierre Lescanne, and Michaël Rusinowitch. The Term Rewriting Approach to Automated Theorem Proving. J. Log. Program., 14(1&2):71–99, 1992. doi:10.1016/0743-1066(92)90047-7.
  • [21] Nathan Jacobson. Basic algebra I. Dover Publications, Inc., Mineola, NY, 2nd edition, 2009.
  • [22] Sam Kamin and Jean-Jacques Levy. Two generalizations of the recursive path ordering. Technical report, Dept. of Computer Science, Univ. of Illinois at Urbana-Champaign, 1980.
  • [23] Stéphane Kaplan. Conditional Rewrite Rules. Theor. Comput. Sci., 33:175–193, 1984. doi:10.1016/0304-3975(84)90087-2.
  • [24] Deepak Kapur and Paliath Narendran. The Knuth-Bendix Completion Procedure and Thue Systems. SIAM J. Comput., 14(4):1052–1072, 1985. doi:10.1137/0214073.
  • [25] Deepak Kapur and G. Sivakumar. RRL: theorem proving environment based on rewriting techniques. SIGSOFT Softw. Eng. Notes, 10(4):67–68, 1985. doi:10.1145/1012497.1012522.
  • [26] Yutaka Kikuchi and Takuya Katayama. An Application of Term Rewriting Systems for Functional Programming. In Yutaka Ohno and Toshiko Matsuda, editors, Distributed Environments: Software Paradigms and Workstations, pages 79–106. Springer Japan, 1991. doi:10.1007/978-4-431-68144-1_7.
  • [27] Dohan Kim. Equational theorem proving for clauses over strings. Mathematical Structures in Computer Science, 34(10):1055–1078, 2024. doi:10.1017/S0960129524000112.
  • [28] Dohan Kim. Congruence Closure Modulo Groups. Logical Methods in Computer Science, Volume 21, Issue 1, 2025. doi:10.46298/lmcs-21(1:20)2025.
  • [29] D. E. Knuth and P. B. Bendix. Simple Word Problems in Universal Algebras. In Jörg H. Siekmann and Graham Wrightson, editors, Automation of Reasoning: 2: Classical Papers on Computational Logic 1967–1970, pages 342–376. Springer Berlin Heidelberg, 1983. doi:10.1007/978-3-642-81955-1.
  • [30] Donald E. Knuth, James H. Morris Jr., and Vaughan R. Pratt. Fast Pattern Matching in Strings. SIAM J. Comput., 6(2):323–350, 1977. doi:10.1137/0206024.
  • [31] Pierre Lescanne. Computer experiments with the REVE term rewriting system generator. In Proceedings of the 10th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL ’83, pages 99–108, 1983. doi:10.1145/567067.567078.
  • [32] Salvador Lucas, Claude Marché, and José Meseguer. Operational termination of conditional term rewriting systems. Inf. Process. Lett., 95(4):446–453, 2005. doi:10.1016/J.IPL.2005.05.002.
  • [33] Klaus Madlener and Friedrich Otto. Using String-Rewriting for Solving the Word Problem for Finitely Presented Groups. Inf. Process. Lett., 24(5):281–284, 1987. doi:10.1016/0020-0190(87)90149-9.
  • [34] Massimo Marchiori. On the Expressive Power of Rewriting. In S. Ramesh and G. Sivakumar, editors, Foundations of Software Technology and Theoretical Computer Science, 17th Conference, Kharagpur, India, December 18-20, 1997, Proceedings, volume 1346 of Lecture Notes in Computer Science, pages 88–102. Springer, 1997. doi:10.1007/BFB0058025.
  • [35] M. H. A. Newman. On Theories with a Combinatorial Definition of “Equivalence”. Annals of Mathematics, 43(2):223–243, 1942. doi:10.2307/1968867.
  • [36] Tobias Nipkow, Lawrence C. Paulson, and Markus Wenzel. Isabelle/HOL - A Proof Assistant for Higher-Order Logic, volume 2283 of Lecture Notes in Computer Science. Springer, 2002. doi:10.1007/3-540-45949-9.
  • [37] Enno Ohlebusch. Advanced topics in term rewriting. Springer Science & Business Media, Berlin/Heidelberg, Germany, 2002.
  • [38] Friedrich Otto. On the Connections between Rewriting and Formal Language Theory. In Paliath Narendran and Michaël Rusinowitch, editors, Rewriting Techniques and Applications, 10th International Conference, RTA-99, Trento, Italy, July 2-4, 1999, Proceedings, volume 1631 of LNCS, pages 332–355. Springer, 1999. doi:10.1007/3-540-48685-2_27.
  • [39] James F Power. Thue’s 1914 paper: a translation. arXiv preprint arXiv:1308.5858, 2013. doi:10.48550/arXiv.1308.5858.
  • [40] C. C. Sims. Computation with finitely presented groups. Cambridge University Press, New York, NY, 1994.
  • [41] Christian Sternagel and Thomas Sternagel. Certifying Confluence of Quasi-Decreasing Strongly Deterministic Conditional Term Rewrite Systems. In Leonardo de Moura, editor, Automated Deduction - CADE 26 - 26th International Conference on Automated Deduction, Gothenburg, Sweden, August 6-11, 2017, Proceedings, volume 10395 of Lecture Notes in Computer Science, pages 413–431. Springer, 2017. doi:10.1007/978-3-319-63046-5_26.
  • [42] Christian Sternagel and René Thiemann. Abstract Rewriting. Arch. Formal Proofs, 2010, 2010. URL: https://www.isa-afp.org/entries/Abstract-Rewriting.shtml.
  • [43] Terese. Term Rewriting Systems, volume 55 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 2003.
  • [44] René Thiemann and Christian Sternagel. Certification of Termination Proofs Using CeTA. In Stefan Berghofer, Tobias Nipkow, Christian Urban, and Makarius Wenzel, editors, Theorem Proving in Higher Order Logics, 22nd International Conference, TPHOLs 2009, Munich, Germany, August 17-20, 2009. Proceedings, volume 5674 of Lecture Notes in Computer Science, pages 452–468. Springer, 2009. doi:10.1007/978-3-642-03359-9_31.
  • [45] Akihisa Yamada, Keiichirou Kusakari, and Toshiki Sakabe. A unified ordering for termination proving. Sci. Comput. Program., 111:110–134, 2015. doi:10.1016/J.SCICO.2014.07.009.
  • [46] Toshiyuki Yamada, Jürgen Avenhaus, Carlos Loría-Sáenz, and Aart Middeldorp. Logicality of conditional rewrite systems. Theor. Comput. Sci., 236(1-2):209–232, 2000. doi:10.1016/S0304-3975(99)00210-8.