Rewriting systems
\[\gdef\badDispatch#1{\textbf{\textcolor{e1432d}{#1}}} \gdef\noKatexForm#1{\badDispatch{#1}} \gdef\largeDot{\raisebox{0.06em}{\tiny∙}} \gdef\rarrbar{{\raisebox{-0.05em}{→}\mkern{-0.13em}{\large\shortmid}}} \gdef\larrbar{{{\large\shortmid}\mkern{-0.13em}{\raisebox{-0.05em}{←}}}} \gdef\suptrans{^\mathsf{T}} \gdef\supdagger{^\dagger} \gdef\cardinalRewrite#1#2{\rewrite{#1}{#2}} \gdef\primed#1{{#1}^{\prime}} \gdef\tinybullet{{\tiny●}} \gdef\factsym#1{\mathord{#1}} \gdef\forwardFactor{\factsym{\uparrow}} \gdef\backwardFactor{\factsym{\downarrow}} \gdef\forwardBackwardFactor{\factsym{\updownarrow}} \gdef\forwardBackwardNeutralFactor{\factsym{\mathrlap{\downarrow}{\mathrlap{\uparrow}{\endash} } }} \gdef\neutralFactor{\factsym{\shornarrow}} \gdef\edgedot{↫} \gdef\desym{\mathbin{↣}} \gdef\uesym{\mathbin{↢}} \gdef\de#1#2{{{#1}\desym{#2}}} \gdef\ue#1#2{{{#1}\uesym{#2}}} \gdef\shifttag#1{\raisebox{-1em}{$#1$}} \gdef\shifttag#1{#1} \gdef\tde#1#2#3{{#1}\:\xrightedge{\shifttag{#3}}\;{#2}} \gdef\tue#1#2#3{{#1}\;\xundirectededge{\shifttag{#3}}\;{#2}} \gdef\shiftunderset#1#2{\underset{\raisebox{0.15em}{\scriptsize $#1$}}{#2}} \gdef\mdtde#1#2#3#4{{#1}\,\;\shiftunderset{#4}{\xrightedge{#3}}\;{#2}} \gdef\mtue#1#2#3#4{{#1}\,\;\shiftunderset{#4}{\xundirectededge{#3}}\;\,{#2}} \gdef\mtde#1#2#3#4{{#1}\,\;\operatornamewithlimits{\xrightedge{#3}}\limits_{#4} \;{#2}} \gdef\mapsfrom{\htmlClass{hreflect}{\mapsto}} \gdef\longmapsfrom{\htmlClass{hreflect}{\longmapsto}} \gdef\diffd{𝕕} \gdef\partialdof#1{\partial {#1}} \gdef\textAnd{\text{\,and\,}} \gdef\identicallyEqualSymbol{\equiv} \gdef\congruentSymbol{\equiv} \gdef\isomorphicSymbol{\simeq} \gdef\homeomorphicSymbol{\cong} \gdef\homotopicSymbol{\simeq} \gdef\approxEqualSymbol{\approx} \gdef\bijectiveSymbol{\approx} \gdef\defeq{\mathrel{≝}} \gdef\defEqualSymbol{\mathrel{≝}} \gdef\syntaxEqualSymbol{\mathrel{\textcolor{888888}{\equiv}}} \gdef\tailEqualSymbol{\underdot{=}} \gdef\headEqualSymbol{\dot{=}} \gdef\ruledelayed{:\to} \gdef\mathdollar{\text{\textdollar}} \gdef\hyphen{\text{-}} \gdef\endash{\text{--}} \gdef\emdash{\text{---}} \gdef\updownarrows{\uparrow\!\downarrow} \gdef\vthinspace{\mkern{1pt}} \gdef\dlq{\text{\textquotedblleft}} \gdef\drq{\text{\textquotedblright}} \gdef\dprime{{\prime\prime}} \gdef\inverse#1{{{#1}^{-1}}} \gdef\inverseSymbol{\inverse{□}} \gdef\groupDirectProduct#1{#1} \gdef\groupDirectProductSymbol{\times} \gdef\groupInverse{\inverse} \gdef\groupPower#1#2{{#1}^{#2}} \gdef\groupCommutator#1#2{\left[{#1},{#2}\right]} \gdef\groupoidInverse{\inverse} \gdef\latticeBFS#1{\textrm{bfs}({#1})} \gdef\pathHomomorphism#1{#1} \gdef\groupoidFunction#1{#1} \gdef\groupoidHomomorphism#1{#1} \gdef\affineModifier#1{\overrightharpoon{#1}} \gdef\supercirc#1{#1^{\circ}} \gdef\supercircb#1{#1^{\bullet}} \gdef\blackCircleModifier#1{\supercircb{#1}} \gdef\whiteCircleModifier#1{\supercirc{#1}} \gdef\totalSpaceStyle#1{\piFo{#1}} \gdef\baseSpaceStyle#1{\blFo{#1}} \gdef\fiberSpaceStyle#1{\reFo{#1}} \gdef\totalSpaceElementStyle#1{\daPiFo{#1}} \gdef\baseSpaceElementStyle#1{\daBlFo{#1}} \gdef\fiberSpaceElementStyle#1{\daReFo{#1}} \gdef\bundleProjectionStyle#1{\daGrFo{#1}} \gdef\bundleGraphStyle#1{\piFo{#1}} \gdef\bundleSectionStyle#1{\daOrFo{#1}} \gdef\bundleFunctionStyle#1{\daPiFo{#1}} \gdef\graphFunctionStyle#1{\totalSpaceStyle{#1}} \gdef\projectionFunctionStyle#1{\totalSpaceStyle{#1}} \gdef\sectionFunctionStyle#1{\totalSpaceStyle{#1}} \gdef\functionGraph#1{G_{#1}} \gdef\toroidalModifier#1{\supercirc{#1}} \gdef\modulo#1{\supercirc{#1}} \gdef\dividesSymbol{\mathrel{|}} \gdef\groupFunction#1{#1} \gdef\groupHomomorphism#1{#1} \gdef\automorphisms{\operatorname{Aut}} \gdef\endomorphisms{\operatorname{End}} \gdef\transportMap#1{\transportMapSymbol_{#1}} \gdef\transportMapSymbol{\tau} \gdef\action#1{#1} \gdef\selfAction#1{\hat{#1}} \gdef\actionGroupoid#1{\utilde{#1}} \gdef\cardinalGroup#1{G^*({#1})} \gdef\signed#1{{#1}^*} \gdef\transportAtlas#1{T_{#1}} \gdef\inverted#1{\underline{#1}} \gdef\mirror#1{\overline{#1}} \gdef\pathComposeSymbol{\mathbin{∷}} \gdef\pathCompose#1#2{{#1}\pathComposeSymbol{#2}} \gdef\translateSymbol{\mathbin{\uparrow}} \gdef\backwardTranslateSymbol{\mathbin{\downarrow}} \gdef\pathHead#1{\pathHeadVector{#1}} \gdef\pathTail#1{\pathTailVector{#1}} \gdef\pathHeadVector#1{{#1}^{\bullet}} \gdef\pathTailVector#1{{#1}_{\bullet}} \gdef\pathReverse#1{{#1}^{\dagger}} \gdef\pathIntegral#1#2{{#1} \int {#2}} \gdef\pathIntegralSymbol{{\int}} \gdef\pathDot#1#2{{#1} \cdot {#2}} \gdef\pathDotSymbol{{\cdot}} \gdef\compactBasis#1{\mathscr{B}} \gdef\length{\operatorname{len}} \gdef\signedLength{\operatorname{len^*}} \gdef\andFn{\operatorname{and}} \gdef\orFn{\operatorname{or}} \gdef\notFn{\operatorname{not}} \gdef\vertexList{\operatorname{vertices}} \gdef\vertexList{\operatorname{vertices}} \gdef\edgeList{\operatorname{edges}} \gdef\pathList{\operatorname{paths}} \gdef\cardinalList{\operatorname{cards}} \gdef\signedCardinalList{\operatorname{cards^*}} \gdef\wordOf{\operatorname{word}} \gdef\headVertex{\operatorname{head}} \gdef\tailVertex{\operatorname{tail}} \gdef\basis{\operatorname{basis}} \gdef\split{\operatorname{split}} \gdef\lcm{\operatorname{lcm}} \gdef\minimalContractionSets{\operatorname{MCSets}} \gdef\minimalContractions{\operatorname{MC}} \gdef\grade{\operatorname{grade}} \gdef\support{\operatorname{support}} \gdef\coefficient{\operatorname{coeff}} \gdef\domain{\operatorname{domain}} \gdef\codomain{\operatorname{codomain}} \gdef\modFunction{\operatorname{mod}} \gdef\clip{\operatorname{clip}} \gdef\sign{\operatorname{sign}} \gdef\step{\operatorname{step}} \gdef\projection{\operatorname{proj}} \gdef\lift{\operatorname{lift}} \gdef\identity{\operatorname{id}} \gdef\total{\operatorname{total}} \gdef\torus{\operatorname{torus}} \gdef\mobius{\operatorname{mobius}} \gdef\stateCompose{\operatorname{glue}} \gdef\infixStateComposeSymbol{\_} \gdef\stateDecompose{\operatorname{melt}} \gdef\stateJoin{\operatorname{conj}} \gdef\stateMeet{\operatorname{disj}} \gdef\stateExtent{\operatorname{extent}} \gdef\stateIntent{\operatorname{intent}} \gdef\infixStateJoinSymbol{\sqcup} \gdef\infixStateMeetSymbol{\sqcap} \gdef\isPrime#1{#1\textrm{ prime}} \gdef\blank{\_} \gdef\emptyWord{} \gdef\multiwordSymbol#1{\mathbf{#1}} \gdef\wordSymbol#1{\mathtt{#1}} \gdef\word#1{#1} \gdef\pathMap#1{#1} \gdef\function#1{#1} \gdef\imageModifier#1{{#1}^{\rightarrow}} \gdef\preimageModifier#1{{#1}^{\leftarrow}} \gdef\multiImageColorModifier#1{\msetCol{#1}} \gdef\multiImageModifier#1{{#1}^{\Rightarrow}} \gdef\multiPreimageModifier#1{{#1}^{\Leftarrow}} \gdef\functionComposition#1{#1} \gdef\functionCompositionSymbol{\mathbin{\small ∘}} \gdef\rightFunctionComposition#1{#1} \gdef\rightFunctionCompositionSymbol{\mathbin{\tiny ●}} \gdef\route#1#2#3{[{#1}\!:\!{#2}\!:\!{#3}]} \gdef\multiroute#1#2#3{[{#1}\!:\!{#2}\!:\!{#3}]} \gdef\pathWord#1#2#3{{#1}\!:\!{#2}\!:\!{#3}} \gdef\parenPathWord#1#2#3{\left(\pathWord{#1}{#2}{#3}\right)} \gdef\nullPath{\bot} \gdef\nullElement{\bot} \gdef\path#1{#1} \gdef\vert#1{#1} \gdef\underdot#1{\underset{\raisebox{0.3em}{.}}{#1}} \gdef\headVertexSymbol{◨} \gdef\tailVertexSymbol{◧} \gdef\placeholderVertexSymbol{\mathrlap{◨}{◧}} \gdef\tvert#1{\underdot{#1}} \gdef\hvert#1{\dot{#1}} \gdef\edge#1{#1} \gdef\card#1{\mathtt{#1}} \gdef\path#1{#1} \gdef\quiver#1{#1} \gdef\bindingRuleSymbol{\to} \gdef\compactBindingRuleSymbol{:} \gdef\cayleyQuiverSymbol#1{\selfAction{#1}} \gdef\bindCayleyQuiver#1#2{\selfAction{#1}[#2]} \gdef\bindActionQuiver#1#2{#1[#2]} \gdef\bindSize#1#2{#1(#2)} \gdef\bindCardSize#1#2{#1[#2]} \gdef\bindCards#1#2{#1[#2]} \gdef\subSize#1#2{#1_{#2}} \gdef\gridQuiver#1{\textrm{Grid}^{#1}} \gdef\treeQuiver#1{\textrm{Tree}^{#1}} \gdef\bouquetQuiver#1{\textrm{Bq}^{#1}} \gdef\lineQuiver{\textrm{L}} \gdef\cycleQuiver{\textrm{C}} \gdef\squareQuiver{\textrm{Sq}} \gdef\cubicQuiver{\textrm{Cbc}} \gdef\triangularQuiver{\textrm{Tri}} \gdef\hexagonalQuiver{\textrm{Hex}} \gdef\rhombilleQuiver{\textrm{Rmb}} \gdef\limit#1#2{\lim_{#2}\,#1} \gdef\realVectorSpace#1{\mathbb{R}^{#1}} \gdef\complexVectorSpace#1{\mathbb{C}^{#1}} \gdef\matrixRing#1#2{M_{#2}(#1)} \gdef\groupoid#1{#1} \gdef\group#1{#1} \gdef\field#1{#1} \gdef\ring#1{#1} \gdef\variable#1{#1} \gdef\semiring#1{#1} \gdef\sym#1{#1} \gdef\matrix#1{#1} \gdef\tupleSym#1{#1} \gdef\polynomial#1{#1} \gdef\setLetter{\mathcal{S}} \gdef\signedSetLetter{\mathcal{S^*}} \gdef\multisetLetter{\mathcal{M}} \gdef\signedMultisetLetter{\mathcal{M^*}} \gdef\multisetSemiringSymbol#1{#1} \gdef\multisetSemiring#1#2{\multisetLetter\left[#1, #2\right]} \gdef\signedMultisetRingSymbol#1{#1} \gdef\signedMultisetRing#1#2{\signedMultisetLetter\left[#1, #2\right]} \gdef\polynomialRing#1#2{#1[{#2}]} \gdef\routeSymbol#1{#1} \gdef\multirouteSymbol#1{\mathbf{#1}} \gdef\planSymbol#1{\mathbf{#1}} \gdef\ringElement#1{#1} \gdef\tuplePart#1#2{#1\llbracket{#2}\rrbracket} \gdef\matrixPart#1#2#3{#1\llbracket{#2,#3}\rrbracket} \gdef\matrixRowPart#1{#1} \gdef\matrixColumnPart#1{#1} \gdef\subMatrixPart#1#2#3{#1_{#2,#3}} \gdef\matrixDotSymbol{\cdot} \gdef\matrixPlusSymbol{+} \gdef\wordGroup#1{\wordGroupSymbol_{#1}} \gdef\wordGroupSymbol{\Omega} \gdef\wordRing#1{\wordRingSymbol_{#1}} \gdef\wordRingSymbol{\Omega\!\degree} \gdef\wordRingElement#1{#1} \gdef\wordRingBasisElement#1{e_{#1}} \gdef\linearCombinationCoefficient#1{{\textcolor{888888}{#1}}} \gdef\plan#1{#1} \gdef\planRing#1{\planRingSymbol_{#1}} \gdef\planRingSymbol{\Phi} \gdef\basisPath#1#2{\mathbf{#1}_{#2}} \gdef\basisPathWeight#1#2{{#1}_{#2}} \gdef\unitSymbol{\mathbf{e}} \gdef\unitVertexField{\unitSymbol_1} \gdef\forwardSymbol{f} \gdef\backwardSymbol{b} \gdef\symmetricSymbol{s} \gdef\antisymmetricSymbol{a} \gdef\wordVector#1#2{\unitSymbol_{#1}^{#2}} \gdef\gradOf#1{\grad\,{#1}} \gdef\grad{\nabla} \gdef\divOf#1{\div\,{#1}} \gdef\div{\dot{\nabla}} \gdef\laplacianOf#1{\laplacian\,{#1}} \gdef\laplacian{\ddot{\nabla}} \gdef\suchThat#1#2{{#1}\,\big|\,{#2}} \gdef\chart#1{\chartSymbol_{#1}} \gdef\chartSymbol{C} \gdef\graphRegionIntersectionSymbol{\cap} \gdef\graphRegionUnionSymbol{\cup} \gdef\pathIso{\simeq} \gdef\factorial#1{#1!} \gdef\power#1#2{{#1}^{#2}} \gdef\repeatedPower#1#2{{#1}^{#2}} \gdef\kroneckerDeltaForm#1{\kroneckerDeltaSymbol_{#1}} \gdef\kroneckerDeltaSymbol{\delta} \gdef\contractionLattice#1{\operatorname{Con}(#1)} \gdef\contractedRelation#1{\sim_{#1}} \gdef\isContracted#1#2{{#1} \sim {#2}} \gdef\isContractedIn#1#2#3{{#1} \sim_{#3} {#2}} \gdef\isNotContracted#1#2{{#1} \not \sim {#2}} \gdef\isNotContractedIn#1#2#3{{#1} \not \sim_{#3} {#2}} \gdef\contractionSum#1{#1} \gdef\contractionSumSymbol{\sqcup} \gdef\contractionProduct#1{#1} \gdef\contractionProductSymbol{{\cdot}} \gdef\graph#1{#1} \gdef\graphHomomorphism#1{#1} \gdef\coversSymbol{\sqsupseteq} \gdef\coveredBySymbol{\sqsubseteq} \gdef\strictlyCoversSymbol{\sqsupset} \gdef\strictlyCoveredBySymbol{\sqsubset} \gdef\graphCovering#1#2#3{{#2} \sqsupseteq_{#1} {#3}} \gdef\quiverCovering#1#2#3{{#2} \sqsupseteq^{#1} {#3}} \gdef\powerSetSymbol{\mathcal{P}} \gdef\powerSet#1{\powerSetSymbol({#1})} \gdef\existsForm#1#2{\exists\,{#1}\,:\,{#2}} \gdef\forAllForm#1#2{\forall\,{#1}\,:\,{#2}} \gdef\notted#1{\notSymbol {#1}} \gdef\andSymbol{\land} \gdef\orSymbol{\lor} \gdef\notSymbol{\lnot} \gdef\latticeSymbol#1{#1} \gdef\meetSemilatticeSymbol#1{#1} \gdef\joinSemilatticeSymbol#1{#1} \gdef\posetSymbol#1{#1} \gdef\latticeElementSymbol#1{#1} \gdef\meetSemilatticeElementSymbol#1{#1} \gdef\joinSemilatticeElementSymbol#1{#1} \gdef\posetElementSymbol#1{#1} \gdef\latticeMeetSymbol{\wedge} \gdef\latticeJoinSymbol{\vee} \gdef\latticeTop{\top} \gdef\latticeBottom{\bot} \gdef\semilatticeMeetSymbol{\wedge} \gdef\semilatticeJoinSymbol{\vee} \gdef\semilatticeTop{\top} \gdef\semilatticeBottom{\bot} \gdef\semilatticeSemimeetSymbol{\wedge} \gdef\semilatticeSemijoinSymbol{\vee} \gdef\latticeGreaterSymbol{>} \gdef\latticeGreaterEqualSymbol{\ge} \gdef\latticeLessSymbol{<} \gdef\latticeLessEqualSymbol{\le} \gdef\posetGreaterSymbol{>} \gdef\posetGreaterEqualSymbol{\ge} \gdef\posetLessSymbol{<} \gdef\posetLessEqualSymbol{\le} \gdef\posetCoversSymbol{⋗} \gdef\posetCoveredBySymbol{⋖} \gdef\grpname#1{\operatorname{\mathsf{#1}}} \gdef\mkg#1#2#3{\grpname{#1}({#2},{#3})} \gdef\mka#1#2#3{\mathfrak{#1}({#2},{#3})} \gdef\generalLinearAlgebra#1#2{\mka{gl}{#1}{#2}} \gdef\generalLinearGroup#1#2{\mkg{GL}{#1}{#2}} \gdef\specialLinearAlgebra#1#2{\mka{sl}{#1}{#2}} \gdef\specialLinearGroup#1#2{\mkg{SL}{#1}{#2}} \gdef\projectiveGeneralLinearAlgebra#1#2{\mka{pgl}{#1}{#2}} \gdef\projectiveGeneralLinearGroup#1#2{\mkg{PGL}{#1}{#2}} \gdef\projectiveSpecialLinearAlgebra#1#2{\mka{psl}{#1}{#2}} \gdef\projectiveSpecialLinearGroup#1#2{\mkg{PSL}{#1}{#2}} \gdef\orthogonalAlgebra#1#2{\mka{o}{#1}{#2}} \gdef\orthogonalGroup#1#2{\mkg{O}{#1}{#2}} \gdef\specialOrthogonalAlgebra#1#2{\mka{so}{#1}{#2}} \gdef\specialOrthogonalGroup#1#2{\mkg{SO}{#1}{#2}} \gdef\unitaryAlgebra#1{\mka{u}{#1}{#2}} \gdef\unitaryGroup#1{\mkg{U}{#1}{#2}} \gdef\specialUnitaryAlgebra#1#2{\mka{su}{#1}{#2}} \gdef\specialUnitaryGroup#1#2{\mkg{su}{#1}{#2}} \gdef\spinAlgebra#1#2{\mka{spin}{#1}{#2}} \gdef\spinGroup#1#2{\mkg{Spin}{#1}{#2}} \gdef\pinAlgebra#1#2{\mka{pin}{#1}{#2}} \gdef\pinGroup#1#2{\mkg{Pin}{#1}{#2}} \gdef\symmetricGroup#1{\grpname{Sym}({#1})} \gdef\presentation#1{#1} \gdef\groupPresentation#1#2{\left\langle\,{#1}\,\,\middle|\mathstrut\,\,{#2}\,\right\rangle} \gdef\groupRelationIso{=} \gdef\groupGenerator#1{#1} \gdef\groupRelator#1{#1} \gdef\groupElement#1{#1} \gdef\identityElement#1{#1} \gdef\groupoidElement#1{#1} \gdef\groupIdentity#1{#1} \gdef\groupoidIdentityElement#1#2{#1_{#2}} \gdef\ringIdentity#1{#1} \gdef\iconstruct#1#2{{#1}\,\,\middle|{\large\mathstrut}\,\,{#2}} \gdef\setConstructor#1#2{\left\{\,\iconstruct{#1}{#2}\,\right\}} \gdef\multisetConstructor#1#2{\left\{\mkern{-2.3pt}\left|\,\,\iconstruct{#1}{#2}\,\right|\mkern{-2.3pt}\right\}} \gdef\cardinalityConstructor#1#2{\left|\,\iconstruct{#1}{#2}\,\right|} \gdef\setToMultiset#1{{#1}^\uparrow} \gdef\multisetToSet#1{{#1}^\downarrow} \gdef\subsets#1{\setLetter({#1})} \gdef\signedSubsets#1{\signedSetLetter({#1})} \gdef\multisets#1{\multisetLetter({#1})} \gdef\signedMultisets#1{\signedMultisetLetter({#1})} \gdef\circleSpaceSymbol{S} \gdef\topologicalSpace#1{#1} \gdef\bundleSection#1{#1} \gdef\bundleProjection#1{#1} \gdef\setSymbol#1{#1} \gdef\signedSetSymbol#1{#1} \gdef\multisetSymbol#1{#1} \gdef\signedMultisetSymbol#1{#1} \gdef\setElementSymbol#1{#1} \gdef\signedSetElementSymbol#1{#1} \gdef\multisetElementSymbol#1{#1} \gdef\signedMultisetElementSymbol#1{#1} \gdef\negated#1{\bar{#1}} \gdef\positiveSignedPart#1{{#1}^+} \gdef\negativeSignedPart#1{{#1}^-} \gdef\multisetMultiplicitySymbol{\,\raisebox{.1em}{\small\#}\mkern{.1em}\,} \gdef\signedMultisetMultiplicitySymbol{\,\raisebox{.1em}{\small\#}\mkern{.1em}\,} \gdef\boundMultiplicityFunction#1{{#1}^{\sharp}} \gdef\boundSignedMultiplicityFunction#1{\operatorname{{#1}^{\sharp}}} \gdef\constructor#1#2{\left.{#1}\,\,\middle|\mathstrut\,\,{#2}\right.} \gdef\elemOf#1#2{{ {#1} \in {#2} }} \gdef\notElemOf#1#2{{ {#1} \notin {#2} }} \gdef\edgeOf#1#2{{ {#1} {\in}_E {#2} }} \gdef\vertOf#1#2{{ {#1} {\in}_V {#2} }} \gdef\pathOf#1#2{{ {#1} {\in}_P {#2} }} \gdef\pathType#1{\operatorName{path}{#1}} \gdef\vertexType#1{\operatorName{vertex}{#1}} \gdef\edgeType#1{\operatorName{edge}{#1}} \gdef\multisetType#1{\operatorName{mset}{#1}} \gdef\signedMultisetType#1{\operatorName{mset^*}{#1}} \gdef\submset{\mathbin{\dot{\subset}}} \gdef\submseteq{\mathbin{\dot{\subseteq}}} \gdef\supmset{\mathbin{\dot{\supset}}} \gdef\supmseteq{\mathbin{\dot{\supseteq}}} \gdef\unitInterval{\mathbb{I}} \gdef\fromTo#1{#1} \gdef\fromToSymbol{\mapsto} \gdef\vertexCountOf#1{|{#1}|} \gdef\vertices#1{ V_{#1} } \gdef\edges#1{ E_{#1} } \gdef\vertexField#1{#1} \gdef\edgeField#1{#1} \gdef\pathVector#1{\mathbf{#1}} \gdef\pathVectorSpace#1{\mathscr{#1}} \gdef\baseField#1{#1} \gdef\finiteField#1{\mathbb{F}_{#1}} \gdef\functionSpace#1#2{#2^{#1}} \gdef\finiteTotalFunctionSpace#1#2{#2^{\sub #1}} \gdef\pathGroupoid#1{{ \Gamma_{#1} }} \gdef\forwardPathQuiver#1#2{{\overrightharpoon{#1}_{#2}}} \gdef\backwardPathQuiver#1#2{{\overrightharpoon{#1}^{#2}}} \gdef\pathQuiver#1{{\overrightharpoon{#1}}} \gdef\mto#1#2{{#1}\mapsto{#2}} \gdef\mtoSymbol{\mapsto} \gdef\groupWordRewriting#1{\langle{#1}\rangle} \gdef\rewrite#1#2{{#1}\mapsto{#2}} \gdef\rewritingRule#1#2{{#1}\mapsto{#2}} \gdef\rewritingSystem#1{\mathcal{#1}} \gdef\multiwayBFS#1{\textrm{bfs}({#1})} \gdef\rewritingStateBinding#1#2{{\left.{#1}\!\mid\!{#2}\right.}} \gdef\rewritingRuleBinding#1#2{#1{\left[\,{#2}\,\right]}} \gdef\namedSystem#1{\mathtt{#1}} \gdef\genericRewritingSystem{\namedSystem{Sys}} \gdef\stringRewritingSystem{\namedSystem{Str}} \gdef\circularStringRewritingSystem{\namedSystem{CStr}} \gdef\turingMachineRewritingSystem{\namedSystem{TM}} \gdef\cellularAutomatonRewritingSystem{\namedSystem{CA}} \gdef\graphRewritingSystem{\namedSystem{Gr}} \gdef\hypergraphRewritingSystem{\namedSystem{HGr}} \gdef\petriNetRewritingSystem{\namedSystem{Petri}} \gdef\localStates#1{\localStatesSymbol^#1} \gdef\regionalStates#1{\regionalStatesSymbol^#1} \gdef\globalStates#1{\globalStatesSymbol^#1} \gdef\keySubStates#1{\keySubStatesSymbol^#1} \gdef\valueSubStates#1{\valueSubStatesSymbol^#1} \gdef\localState#1#2{#2_{#1}} \gdef\regionalState#1{#1} \gdef\globalState#1{#1} \gdef\keySubState#1{#1} \gdef\valueSubState#1{#1} \gdef\lhsState#1{#1_{L}} \gdef\rhsState#1{#1_{R}} \gdef\rewriteLHSRegionalState#1{#1_{L}} \gdef\rewriteRHSRegionalState#1{#1_{R}} \gdef\regionalStateForm#1{\daGFo{(}#1\daGFo{)}} \gdef\invalidRegionalState{\reFo{\times}} \gdef\emptyRegionalState{\regionalStateForm{}} \gdef\regionalSubstateSymbol{\sqsubseteq} \gdef\regionalSuperstateSymbol{\sqsupseteq} \gdef\comparableRegionalStatesSymbol{\mathbin{\square}} \gdef\incomparableRegionalStatesSymbol{\mathbin{\boxtimes}} \gdef\namedStateSet#1{\mathbf #1} \gdef\localStatesSymbol{\namedStateSet L} \gdef\regionalStatesSymbol{\namedStateSet R} \gdef\globalStatesSymbol{\namedStateSet G} \gdef\keySubStatesSymbol{\namedStateSet L_K} \gdef\valueSubStatesSymbol{\namedStateSet L_V} \gdef\localStateSymbol#1{#1} \gdef\regionalStateSymbol#1{#1} \gdef\globalStateSymbol#1{#1} \gdef\keySubStateSymbol#1{#1} \gdef\valueSubStateSymbol#1{#1} \gdef\infixComposeLocalStatesSymbol{\_} \gdef\composeLocalStatesSymbol{\operatorname{glue}} \gdef\composeLocalStatesForm#1{\composeLocalStatesSymbol(#1)} \gdef\ncard#1{\card{\inverted{#1}}} \gdef\mcard#1{\card{\mirror{#1}}} \gdef\nmcard#1{\card{\inverted{\mirror{#1}}}} \gdef\assocArray#1{\left\langle {#1} \right\rangle} \gdef\openMultiset{\lBrace} \gdef\closeMultiset{\rBrace} \gdef\set#1{\{ {#1} \}} \gdef\signedSet#1{\{ {#1} \}} \gdef\list#1{\{ {#1} \}} \gdef\multiset#1{\openMultiset {#1} \closeMultiset} \gdef\signedMultiset#1{\openMultiset {#1} \closeMultiset} \gdef\styledSet#1#2{#1\{ {#1} #1\}} \gdef\styledList#1#2{#1\{ {#1} #1\}} \gdef\styledMultiset#1#2{#1\openMultiset {#2} #1\closeMultiset} \gdef\styledSignedMultiset#1#2{\openMultiset {#2} \closeMultiset} \gdef\permutationCycle#1{#1} \gdef\permutationCycleSymbol{\to} \gdef\permutationSet#1{#1} \gdef\permutationSetSymbol{;} \gdef\transposition#1#2{{#1} \leftrightarrow {#2}} \gdef\tuple#1{( {#1} )} \gdef\concat#1{ {#1} } \gdef\paren#1{\left( {#1} \right)} \gdef\ceiling#1{\lceil{#1}\rceil} \gdef\floor#1{\lfloor{#1}\rfloor} \gdef\translationVector#1{\left[{#1}\right]_{\textrm{T}}} \gdef\quotient#1#2{{#1} / {#2}} \gdef\compactQuotient#1#2#3{{#1}\;{\upharpoonright_{#2}}\;{#3}} \gdef\multilineQuotient#1#2{\frac{#1}{#2}} \gdef\idElem#1{e_{#1}} \gdef\minus#1{-{#1}} \gdef\elem{\ \in\ } \gdef\vsp{\mkern{0.4pt}} \gdef\iGmult{\vsp} \gdef\gmult{\vsp\ast\vsp} \gdef\Gmult{\vsp\ast\vsp} \gdef\gdot{\vsp\cdot\vsp} \gdef\gDot{\vsp\mathbin{\largeDot}\vsp} \gdef\mdot{\vsp\cdot\vsp} \gdef\smallblackcirc{\vsp\raisebox{0.15em}{\tiny∙}\vsp} \gdef\smallwhitecirc{\vsp\raisebox{0.15em}{\tiny∘}\vsp} \gdef\sgdot{\mathbin{\smallwhitecirc}} \gdef\srdot{\mathbin{\smallblackcirc}} \gdef\srplus{+} \gdef\verticalEllipsis{\vdots} \gdef\appliedRelation#1{#1} \gdef\setUnionSymbol{\cup} \gdef\setIntersectionSymbol{\cap} \gdef\setRelativeComplementSymbol{-} \gdef\msetCol{\textcolor{bb4444}} \gdef\repeatedMultiset#1#2{#1\,#2} \gdef\msrdot{\mathbin{\smallblackcirc}} \gdef\msrplus{+} \gdef\smrdot{\mathbin{\smallblackcirc}} \gdef\smrplus{+} \gdef\dotminus{\mathbin{\dot{-}}} \gdef\dotcap{\mathbin{\dot{\cap}}} \gdef\dotcup{\mathbin{\dot{\cup}}} \gdef\multisetUnionSymbol{\dotcup} \gdef\multisetIntersectionSymbol{\dotcap} \gdef\multisetRelativeComplementSymbol{\dotminus} \gdef\multisetSumSymbol{\dotplus} \gdef\cartesianProductSymbol{\times} \gdef\functionType#1#2{{#1} \to {#2}} \gdef\functionSignature#1#2#3{{{#1} : {#2} \to {#3}}} \gdef\partialFunctionSignature#1#2#3{{{#1} : {#2} \rightharpoonup {#3}}} \gdef\poly#1{#1} \gdef\quiverProdPoly#1{#1} \gdef\quiverProdPower#1#2{#1^{#2}} \gdef\quiverProdTimes#1{#1} \gdef\parenLabeled#1#2{#1\ ({#2})} \gdef\parenRepeated#1#2{\parenLabeled{#1}{{#2}\text{ times}}} \gdef\underLabeled#1#2{\underbrace{#1}_{#2}} \gdef\underRepeated#1#2{\underbrace{#1}_{#2\text{ times}}} \gdef\overLabeled#1#2{\overbrace{#1}^{#2}} \gdef\overRepeated#1#2{\overbrace{#1}^{#2\text{ times}}} \gdef\modLabeled#1#2{{#1 }\textrm{ mod }{#2}} \gdef\freeGroup#1{F_{#1}} \gdef\cyclicGroup#1{\mathbb{Z}_{#1}} \gdef\componentSuperQuiverOfSymbol{\succ} \gdef\setCardinality#1{|{#1}|} \gdef\multisetCardinality#1{|{#1}|} \gdef\dependentQuiverProductSymbol{\mathbin{\times}} \gdef\rightIndependentQuiverProductSymbol{\mathbin{⋊}} \gdef\leftIndependentQuiverProductSymbol{\mathbin{⋉}} \gdef\rightStrongQuiverProductSymbol{\mathbin{⧒}} \gdef\leftStrongQuiverProductSymbol{\mathbin{⧑}} \gdef\rightFiberQuiverProductSymbol{\mathbin{⧕}} \gdef\leftFiberQuiverProductSymbol{\mathbin{⧔}} \gdef\lockedQuiverProductSymbol{\mathbin{\searrow}} \gdef\rightFreeQuiverProductSymbol{\mathbin{\smallerthan}} \gdef\leftFreeQuiverProductSymbol{\mathbin{\largerthan}} \gdef\strongIndependentQuiverProductSymbol{\mathbin{⨝}} \gdef\cartesianQuiverProductSymbol{\mathbin{□}} \gdef\strongQuiverProductSymbol{\mathbin{⊠}} \gdef\graphUnionSymbol{\sqcup} \gdef\graphProductSymbol{\times} \gdef\inlineProdSymbol{|} \gdef\serialCardSymbol{{:}} \gdef\parallelCardSymbol{{\mid}} \gdef\cardinalSequenceSymbol{{:}} \gdef\cardinalProduct#1{(#1)} \gdef\vertexProduct#1{(#1)} \gdef\edgeProduct#1{(#1)} \gdef\cardinalProductSymbol{\inlineProdSymbol} \gdef\vertexProductSymbol{\inlineProdSymbol} \gdef\edgeProductSymbol{\inlineProdSymbol} \gdef\verticalVertexProduct#1#2{\cfrac{#1}{#2}} \gdef\verticalCardinalProduct#1#2{\cfrac{#1}{#2}} \gdef\indexSum#1#2#3{{\sum_{#2}^{#3} #1}} \gdef\indexProd#1#2#3{{\prod_{#2}^{#3} #1}} \gdef\indexMax#1#2#3{{\max_{#2}^{#3} #1}} \gdef\indexMin#1#2#3{{\min_{#2}^{#3} #1}} \gdef\indexUnion#1#2#3{{\bigcup_{#2}^{#3} #1}} \gdef\indexIntersection#1#2#3{{\bigcap_{#2}^{#3} #1}} \gdef\indexGraphUnion#1#2#3{{\bigcup_{#2}^{#3} #1}} \gdef\indexGraphDisjointUnion#1#2#3{{\bigcup_{#2}^{#3} #1}} \gdef\styledIndexSum#1#2#3#4{{#1\sum_{#3}^{#4} #2}} \gdef\styledIndexProd#1#2#3#4{{#1\prod_{#3}^{#4} #2}} \gdef\styledIndexMax#1#2#3#4{{#1\max_{#3}^{#4} #2}} \gdef\styledIndexMin#1#2#3#4{{#1\min_{#3}^{#4} #2}} \gdef\indexSumSymbol{\sum} \gdef\indexProdSymbol{\prod} \gdef\indexMaxSymbol{\max} \gdef\indexMinSymbol{\min} \gdef\openInterval#1#2{(#1,#2)} \gdef\closedInterval#1#2{[#1,#2]} \gdef\openClosedInterval#1#2{(#1,#2]} \gdef\closedOpenInterval#1#2{[#1,#2)} \gdef\oneTo#1{1..{#1}} \gdef\zeroTo#1{0..{#1}} \gdef\qstring#1{\mathtt{"}{#1}\mathtt{"}} \gdef\wstring#1{\textcolor{6b6b6b}{#1}} \gdef\qchar#1{\mathtt{'}{#1}\mathtt{'}} \gdef\lstr#1{\mathtt{#1}} \gdef\lchar#1{\mathtt{#1}} \gdef\string#1{{#1}} \gdef\character#1{{#1}} \gdef\homomorphismMapping#1{\assocArray{#1}} \gdef\starModifier#1{{#1}^*} \gdef\translationPresentation#1{\textrm{Z}_{#1}} \gdef\starTranslationPresentation#1{\textrm{Z}^*_{#1}} \gdef\translationPathValuation#1{\mathcal{\overrightharpoon Z}_{#1}} \gdef\starTranslationPathValuation#1{\overrightharpoon{\mathcal{Z}^*_{#1}}} \gdef\translationWordHomomorphism#1{\mathcal{Z}_{#1}} \gdef\starTranslationWordHomomorphism#1{\mathcal{Z}^*_{#1}} \gdef\translationCardinalValuation#1{\textrm{T}_{#1}} \gdef\starTranslationCardinalValuation#1{\textrm{T}^*_{#1}} \gdef\reFo#1{\textcolor{e1432d}{#1}} \gdef\grFo#1{\textcolor{4ea82a}{#1}} \gdef\blFo#1{\textcolor{3e81c3}{#1}} \gdef\orFo#1{\textcolor{dc841a}{#1}} \gdef\piFo#1{\textcolor{c74883}{#1}} \gdef\teFo#1{\textcolor{47a5a7}{#1}} \gdef\gFo#1{\textcolor{929292}{#1}} \gdef\puFo#1{\textcolor{8b7ebe}{#1}} \gdef\liReFo#1{\textcolor{ff775e}{#1}} \gdef\liGrFo#1{\textcolor{82dd63}{#1}} \gdef\liBlFo#1{\textcolor{6caff4}{#1}} \gdef\liOrFo#1{\textcolor{ffbb5f}{#1}} \gdef\liPiFo#1{\textcolor{fb77b0}{#1}} \gdef\liTeFo#1{\textcolor{7fdbdc}{#1}} \gdef\liGFo#1{\textcolor{c5c5c5}{#1}} \gdef\liPuFo#1{\textcolor{bbaff2}{#1}} \gdef\daReFo#1{\textcolor{b50700}{#1}} \gdef\daGrFo#1{\textcolor{217f00}{#1}} \gdef\daBlFo#1{\textcolor{165e9d}{#1}} \gdef\daOrFo#1{\textcolor{ae5900}{#1}} \gdef\daPiFo#1{\textcolor{9e1f61}{#1}} \gdef\daTeFo#1{\textcolor{0e7c7e}{#1}} \gdef\daGFo#1{\textcolor{6b6b6b}{#1}} \gdef\daPuFo#1{\textcolor{665996}{#1}} \gdef\boFo#1{\mathbf{#1}} \gdef\itFo#1{\mathit{#1}} \gdef\unFo#1{\underline{#1}} \gdef\stFo#1{\struckthrough{#1}} \gdef\plTeFo#1{\textrm{#1}} \gdef\maTeFo#1{\textrm{#1}} \gdef\ZNFuFo#1{\operatorname{#1}} \gdef\ZAFo#1#2{#1(#2)} \gdef\noApSy{\gFo{\text{---}}} \gdef\unSy{\gFo{?}} \gdef\emSeSy{\gFo{ \emptyset }} \gdef\tiSy{\boFo{ \vthinspace ✓ \vthinspace }} \gdef\unIn{\mathbb{I}} \gdef\blSy{\gFo{\_}} \gdef\plSqSy{□} \gdef\baToSy{\boFo{ \vthinspace | \vthinspace }} \gdef\fiToSy{●} \gdef\fiSqToSy{■} \gdef\fiReToSy{▮} \gdef\emToSy{○} \gdef\emSqToSy{□} \gdef\emReToSy{▯} \gdef\plElSy{\,...\,} \gdef\ceElSy{\,\cdot\!\cdot\!\cdot\,} \gdef\elSy{\,\gFo{...}\,} \gdef\veElSy{\vdots} \gdef\coFo{\sqsubseteq} \gdef\CoFo#1#2{#1 \coFo #2} \gdef\coByFo{⊑} \gdef\CoByFo#1#2{#1 \coByFo #2} \gdef\stCoFo{\sqsupset} \gdef\StCoFo#1#2{#1 \stCoFo #2} \gdef\stCoByFo{\sqsubset} \gdef\StCoByFo#1#2{#1 \stCoByFo #2} \gdef\inCoFo{\sqsubseteq} \gdef\InCoFo#1#2{#1 \inCoFo #2} \gdef\InCoFoⅡ#1#2#3{#1 \inCoFo_{#3} #2} \gdef\grInCoFo{\sqsubseteq} \gdef\GrInCoFo#1#2{#1 \grInCoFo #2} \gdef\GrInCoFoⅡ#1#2#3{#1 \grInCoFo_{#3} #2} \gdef\quInCoFo{\sqsubseteq} \gdef\QuInCoFo#1#2{#1 \quInCoFo #2} \gdef\QuInCoFoⅡ#1#2#3{#1 \quInCoFo_{#3} #2} \gdef\coPrFo{\cdot} \gdef\CoPrFo#1{#1} \gdef\coSuFo{\sqcup} \gdef\CoSuFo#1{#1} \gdef\isCoFo{\sim} \gdef\IsCoFo#1#2{#1 \isCoFo #2} \gdef\IsCoFoⅡ#1#2#3{#1 \isCoFo_{#3} #2} \gdef\isNoCoFo{\nsim} \gdef\IsNoCoFo#1#2{#1 \isNoCoFo #2} \gdef\IsNoCoFoⅡ#1#2#3{#1 \isNoCoFo_{#3} #2} \gdef\coReFo{\sim} \gdef\CoReFo#1{#1} \gdef\TuFo#1{(#1)} \gdef\SeFo#1{\left\{#1\right\}} \gdef\StSeFo#1#2#3{#1#3#2} \gdef\inArSy{⏵} \gdef\arSy{⏴} \gdef\upArSy{⏶} \gdef\doArSy{⏷} \gdef\leArSy{⏴} \gdef\riArSy{⏵} \gdef\grAuFu{\operatorname{Aut}} \gdef\PaFo#1{\;#1\;} \gdef\na{\mathbb{n}} \gdef\poNa{\mathbb{N} ^+} \gdef\poRe{\mathbb{R} ^+} \gdef\pr{\mathbb{P}} \gdef\re{\mathbb{R}} \gdef\piSy{\pi} \gdef\taSy{\tau}\]

Rewriting systems #

Introduction #

We now make our first foray into dynamics: quivers that describe systems that change in time. To do this we will use the lens of rewriting systems. A (computational) rewriting system is a non-deterministic automaton that successively transforms some global state, represented by an arbitrary data structure, by finding and applying well-defined rules that match particular sub-elements of this data structure, replacing them with other elements.

Rewriting systems provide a flexible and general model of computation, and any computational system can be cast into this model: Turing machines, cellular automata, graph rewriting systems, string rewriting systems, register machines, etc. In all cases, these systems can be non-deterministic, although deterministic systems are special cases, which from our point of view will result in rather trivial theories.

Note: this section is only partially complete. The roadmap for this section can be found here.

Local vs global states #

We referred to rewrite systems as involving rewrites that match and replace sub-elements of the data structure representing the full global state. What are these sub-elements? We will approach this idea slowly. For now, we'll suggest that the local states are the smallest possible sub-elements from which a global state can be reconstructed. We'll look at some concrete rewrite systems to build intuition for the behavior of these local states.

Here we show a table indicating reasonable notions of local state for various types of rewriting system:

system type global state local state
\( \stringRewritingSystem{} \) string r.s. string \( \qstring{\character{c}_1 \character{c}_2 \elSy \character{c}_{\sym{n}}} \) \( \TuFo{\sym{i}, \character{c}_{\sym{i}}} \)
\( \circularStringRewritingSystem{} \) circular string r.s. circular string \( \qstring{\elSy \character{c}_{\sym{n} - 1} \character{c}_{\sym{n}} \character{c}_1 \character{c}_2 \elSy} \) \( \TuFo{\sym{i}, \character{c}_{\sym{i}}} \)
\( \turingMachineRewritingSystem{} \) Turing machine head in state \( \sym{s} \) at cell \( \sym{i} \) on tape \( \qstring{\character{c}_1 \elSy \character{c}_{\sym{n}}} \) \( \sym{s},\sym{i},\TuFo{\sym{i}, \character{c}_{\sym{i}}} \)
\( \cellularAutomatonRewritingSystem{} \) cellular automaton vector of cells \( \list{\character{c}_1,\character{c}_2,\elSy,\character{c}_{\sym{n}}} \) \( \TuFo{\sym{i}, \sym{c}_{\sym{i}}} \)
\( \graphRewritingSystem{} \) graph r.s. set of edges \( \list{\de{\vert{\sym{t}_1}}{\vert{\sym{h}_1}},\elSy,\de{\vert{\sym{t}_{\sym{n}}}}{\vert{\sym{h}_{\sym{n}}}}} \) edge \( \de{\vert{\sym{t}_{\sym{i}}}}{\vert{\sym{h}_{\sym{i}}}} \)
\( \hypergraphRewritingSystem{} \) hypergraph r.s. set of hyperedges \( \list{\sym{e}_1,\sym{e}_2,\elSy,\sym{e}_{\sym{n}}} \) hyperedge \( \sym{e}_{\sym{i}} \)
\( \petriNetRewritingSystem{} \) Petri net place occupancy \( \assocArray{\mto{\sym{t}_1}{\sym{N}_1},\elSy,\mto{\sym{t}_{\sym{n}}}{\sym{N}_{\sym{n}}}} \) \( \TuFo{\sym{t}_{\sym{i}}, \sym{N}_{\sym{i}}} \)

We will limit our attention initially to string rewriting systems, as these have a simple notion of spatial locality that originates in the linear order of character positions in the string.

Evolution #

Once a particular rewriting system type has been chosen, it remains to specify the rewriting rules that should be applied. We'll indicate the system in a script typeface, typically \( \rewritingSystem{R} \), and list its rules as:

\[ \rewritingSystem{R} = \rewritingRuleBinding{\genericRewritingSystem{}}{\rewritingRule{\sym{L}_1}{\sym{R}_1},\rewritingRule{\sym{L}_2}{\sym{R}_2},\elSy,\rewritingRule{\sym{L}_{\sym{n}}}{\sym{R}_{\sym{n}}}} \]

where \( \sym{L}_{\sym{i}} \) is the left-hand-side, or lhs, of the $i^{\textrm{th}}$ rule, and \( \sym{R}_{\sym{i}} \) is the right-hand-side, or rhs.

The lhs specifies a pattern that should match sub-elements of the global state, and the rhs specifies how the matched state should be rewritten to yield a new local state, and hence a new global state. We will also use the word match as a noun, to refer to the sub-elements (the set of local states) that were matched by the rule.

The match can be rewritten, giving us a new global state. Multiple matches can be present in a particular global state: only one of them is rewritten in a particular evolution of the rewriting system. If multiple matches can occur in a given global state, the system is non-deterministic. If a maximum of one match can occur, the system is deterministic.

We will study non-deterministic systems globally, considering all possible evolutions that can occur: we apply all possible matches in a kind of branching process in order to explore their consequences holistically.

After specifying \( \rewritingSystem{R} \), we can now choose an initial state, written \( \sym{s}_0 \). We write the combined data of a rewriting system and an initial state as \( \rewritingStateBinding{\rewritingSystem{R}}{\sym{s}_0} \).

At that point we can evolve the system, which is an iterative process that is carried out either for a fixed number of steps, or alternatively in an ongoing fashion that never terminates. The matches in a particular global state yield successor states of that state. We may sometimes reach a global state that cannot be rewritten because there are no matches: we say that a particular global state has halted.

This process generates a graph, known as a multiway graph or rewrite graph, in which vertices represent global states, and edges represent rewrites. We'll write the process that generates this graph to depth \( \sym{n} \) as:

\[ \multiwayBFS{\rewritingStateBinding{\rewritingSystem{R}}{\sym{s}_0},\sym{n}}\syntaxEqualSymbol \multiwayBFS{\rewritingSystem{R},\sym{s}_0,\sym{n}} \]

Computationally, this is a breadth first search that yields a finite a (finite) rewrite graph if it terminates after some finite number of steps. We'll initially avoid defining or reasoning about infinite rewrite graphs.

String rewriting systems #

To illustrate this setup, we'll focus on string rewriting systems, since they are both easy to visualize, familiar to those with experience with computer programming, and fairly easy to analyze.

Our first example will be the following extremely simple system:

\[ \rewritingSystem{R_0}\defEqualSymbol \rewritingRuleBinding{\stringRewritingSystem{}}{\rewritingRule{\lstr{\texttt{b}}}{\lstr{\texttt{a}}}} \]

This rewrite system simply replaces the letter \( \lchar{\texttt{b}} \) with the letter \( \lchar{\texttt{a}} \) whereever it occurs.

Here we visualize the rewrite graph generated by \( \multiwayBFS{\rewritingSystem{R_0},\qstring{\lstr{\texttt{bab}}}, \infty } \):

As you can see, there are two matches of the rewrite rule \( \rewritingRule{\lstr{\texttt{b}}}{\lstr{\texttt{a}}} \) in the initial state \( \qstring{\lstr{\texttt{bab}}} \): one corresponding to the character \( \lchar{\texttt{b}} \) occuring in the first string position, the other for the character \( \lchar{\texttt{b}} \) occuring in the third string position. When these matches are rewritten, we obtain two successor global states \( \qstring{\lstr{\texttt{aab}}} \) and \( \qstring{\lstr{\texttt{baa}}} \) respectively. Each of these two global states contain exactly one match, corresponding to the remaining \( \lchar{\texttt{b}} \). Rewriting these, we obtain the same successor global state \( \qstring{\lstr{\texttt{aaa}}} \). This global state contains no matches, as there are no remaining \( \lchar{\texttt{b}} \)'s.

Rewrite quiver #

Notice the important fact here that the two matches, at positions 1 and 3 of the original string, do not overlap: we say that these rewrites commute. This implies that we can rewrite those matches in either order, and the non-rewritten match will still remain. This gives us a hint of how we might attach a cardinal structure to the rewrite graph, yielding the rewrite quiver.

The rewrite quiver is the quiver whose cardinals are the labels formed by the following data taken as a whole: the rule that was matched, and the local states that were involved in the match.

Here we show the rewrite quiver for this simple system, where the two cardinals correspond to the two independent rewrites:

We have named these cardinals with the string position of the match they rewrite, since this is enough to uniquely determine the match for this system.

Let's consider a slightly more complex initial condition of \( \qstring{\lstr{\texttt{bbb}}} \).

And lastly the initial condition \( \qstring{\lstr{\texttt{bbbb}}} \):

We can see already that this rewrite system yields a rewrite quiver given by \( \subSize{\gridQuiver{\sym{n}}}{2} \), a hypercube of dimension \( \sym{n} \), where \( \sym{n} \) is the count of \( \lchar{\texttt{b}} \)'s in the initial condition. The rewrite quiver is insensitive to the order of the characters in the string, only depending on the \( \lchar{\texttt{b}} \)-count. This is a generic feature of string rewriting systems in which matches do not overlap (whether because of some "cosmic conspiracy" or because the form of the rules prevent this from occurring).

More generally, in any global state of a rewriting system in which we have \( \sym{n} \) commuting rewrites available, we will obtain a subquiver that is isomorphic to \( \subSize{\gridQuiver{\sym{n}}}{2} \).

Sorting system #

We'll now focus on the "sorting system" that partially sorts substrings:

\[ \rewritingSystem{R_1}\defEqualSymbol \rewritingRuleBinding{\stringRewritingSystem{}}{\rewritingRule{\lstr{\texttt{ba}}}{\lstr{\texttt{ab}}}} \]

Here we show the rewrite quiver for a variety of initial conditions:

Notice the obvious fact that all of these quivers terminate in a single final state, in which the characters of the string are in sorted order, with all \( \lchar{\texttt{b}} \)'s occurring to the right of all \( \lchar{\texttt{a}} \)'s. This must always happen, since a rewrite always "moves one \( \lchar{\texttt{b}} \) to the right", and will always be able to do so if any \( \lchar{\texttt{a}} \)'s are to the right of any \( \lchar{\texttt{b}} \)'s. The only halting state therefore is the state in which all \( \lchar{\texttt{b}} \)’s are to the right of all \( \lchar{\texttt{a}} \)’s.

Local and global states #

Local and global states #

To ground our discussion, we'll discuss the rewriting system introduced above, initialized to global state \( \lstr{\texttt{bbaa}} \):

\[ \rewritingSystem{R_2}\defEqualSymbol \rewritingStateBinding{\rewritingRuleBinding{\stringRewritingSystem{}}{\rewritingRule{\lstr{\texttt{ba}}}{\lstr{\texttt{ab}}}}}{\lstr{\texttt{bbaa}}} \]

This yields the following multiway quiver:

We've already mentioned local states and global states. We'll write the set of local, global states for any initialized rewriting system \( \rewritingSystem{R} \) as \( \localStates{\rewritingSystem{R}} \), \( \globalStates{\rewritingSystem{R}} \), or just \( \localStatesSymbol ,\globalStatesSymbol \) when the rewriting system \( \rewritingSystem{R} \) is fixed. Let's enumerate them for our example \( \rewritingSystem{R_2} \):

\[ \begin{aligned} \globalStates{\rewritingSystem{R_2}}&= \SeFo{\qstring{\lstr{\texttt{bbaa}}}, \qstring{\lstr{\texttt{baba}}}, \qstring{\lstr{\texttt{baab}}}, \qstring{\lstr{\texttt{abba}}}, \qstring{\lstr{\texttt{abab}}}, \qstring{\lstr{\texttt{aabb}}}}\\ \localStates{\rewritingSystem{R_2}}&= \SeFo{\TuFo{1, \lchar{\texttt{a}}}, \TuFo{2, \lchar{\texttt{a}}}, \TuFo{3, \lchar{\texttt{a}}}, \TuFo{4, \lchar{\texttt{a}}}, \TuFo{1, \lchar{\texttt{b}}}, \TuFo{2, \lchar{\texttt{b}}}, \TuFo{3, \lchar{\texttt{b}}}, \TuFo{4, \lchar{\texttt{b}}}}\end{aligned} \]

Local key and value substates #

In a string rewriting system, the local states are pairs \( \TuFo{\keySubStateSymbol{p}, \keySubStateSymbol{c}} \) that bind together a string position \( \keySubStateSymbol{p} \) and the character \( \keySubStateSymbol{c} \) that "lives" there. The generic terms we'll use for these are key local substates and value local substates respectively. To explain this terminology: we take the terms key and value from associative array data structures in computer science because a global state cannot contain two local states that share the same key -- this would correspond to characters living at the same string position. We use the term local substate to indicate that these are ingredients of a local state, but they do not individually constitute local states.

The set of key local substates for an initialized rewriting system \( \rewritingSystem{R} \) will be written \( \keySubStates{\rewritingSystem{R}} \), and the set of value local substates will be written \( \valueSubStates{\rewritingSystem{R}} \). Again we'll abbreviate these to \( \keySubStatesSymbol ,\valueSubStatesSymbol \) when \( \rewritingSystem{R} \) is fixed. The set of local substates is then a subset of Cartesian product of these:

\[ \localStatesSymbol \subseteq \keySubStatesSymbol \cartesianProductSymbol \valueSubStatesSymbol \]

To be more concise we'll also sometimes write a local substate \( \TuFo{\keySubStateSymbol{p}, \keySubStateSymbol{c}} \) as \( \localState{\keySubStateSymbol{p}}{\keySubStateSymbol{c}} \). Using this notation, the set of local states for \( \rewritingSystem{R_2} \) is:

\[ \localStates{\rewritingSystem{R_2}} = \SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{a}}}, \localState{3}{\lchar{\texttt{a}}}, \localState{4}{\lchar{\texttt{a}}}, \localState{1}{\lchar{\texttt{b}}}, \localState{2}{\lchar{\texttt{b}}}, \localState{3}{\lchar{\texttt{b}}}, \localState{4}{\lchar{\texttt{b}}}} \]

We have \( \localStatesSymbol \subseteq \keySubStatesSymbol \cartesianProductSymbol \valueSubStatesSymbol \) rather than \( \localStatesSymbol = \keySubStatesSymbol \cartesianProductSymbol \valueSubStatesSymbol \) because, for a given initialized rewriting system, rewriting might not produce all of the theoretically possible local states. For example, the system \( \rewritingSystem{R} = \rewritingStateBinding{\rewritingRuleBinding{\stringRewritingSystem{}}{\rewritingRule{\lstr{\texttt{b}}}{\lstr{\texttt{a}}}}}{\qstring{\lstr{\texttt{aab}}}} \) never creates the local state \( \localState{1}{\lchar{\texttt{b}}} \). The set of local states is actually \( \localStates{\rewritingSystem{R}} = \SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{a}}}, \localState{3}{\lchar{\texttt{a}}}, \localState{3}{\lchar{\texttt{b}}}} \).

For the main example \( \rewritingSystem{R_2} \), we happen to have that every possible local state is generated by the system:

\[ \begin{aligned} \keySubStates{\rewritingSystem{R_2}}&= \SeFo{1, 2, 3, 4}\\ \valueSubStates{\rewritingSystem{R_2}}&= \SeFo{\lchar{\texttt{a}}, \lchar{\texttt{b}}}\\[0.75em] \localStates{\rewritingSystem{R_2}}&= \keySubStates{\rewritingSystem{R_2}}\cartesianProductSymbol \valueSubStates{\rewritingSystem{R_2}}\\ &= \SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{a}}}, \localState{3}{\lchar{\texttt{a}}}, \localState{4}{\lchar{\texttt{a}}}, \localState{1}{\lchar{\texttt{b}}}, \localState{2}{\lchar{\texttt{b}}}, \localState{3}{\lchar{\texttt{b}}}, \localState{4}{\lchar{\texttt{b}}}}\end{aligned} \]

Key substates and length-preserving systems #

In the definitions above, we have implicitly relied the fact the rewrites in the system \( \rewritingSystem{R_2} = \rewritingRuleBinding{\stringRewritingSystem{}}{\rewritingRule{\lstr{\texttt{ba}}}{\lstr{\texttt{ab}}}} \) do not change the length of the string. That is to say, the length of the lhs and rhs are equal, both being 2. This allows us to unambiguously talk of global string positions, and making the set \( \keySubStates{\rewritingSystem{R_2}} = \SeFo{1, 2, 3, 4} \) well defined.

For a rewriting system like \( \rewritingRuleBinding{\stringRewritingSystem{}}{\rewritingRule{\lstr{\texttt{ab}}}{\lstr{\texttt{a}}}} \), however, rewrites will change the length of the string. We might regard such rewrites as effectively removing key substates, making them inaccessible from all rewrites that follow. Conversely, systems like \( \rewritingRuleBinding{\stringRewritingSystem{}}{\rewritingRule{\lstr{\texttt{a}}}{\lstr{\texttt{ab}}}} \) effectively introduce new key substates. To handle such cases, we can expect to define equivalence classes that capture when two local states involving different key substates are actually the same from the point of view of a global or regional state.

There is a host of subtle issues hiding here, and so we will postpone considering such systems for now.

Regional states #

We can see local and global states as living at either end of a continuum of specificity: local states are the "minimal units" of information we have about the state of a rewrite system, whereas global states are maximal in that same sense.

This continuum contains other kinds of states, which are intermediate in the amount of information they contain about the state of the rewrite system. We'll call these regional states. One way to approach conceptualize regional states is by building them up from local states. More precisely, we can think of a regional state as being a set of compatible local states, meaning a set of local states in which there is only one element with any given key substate. In the case of string rewrite systems, compatibility amounts to saying that only one character can live at a given position of a string.

Notation #

We’ll write a regional state consisting of \( \sym{n} \) local states \( \localStateSymbol{l_{\sym{i}}} \) as \( \regionalStateForm{\localStateSymbol{l_1} \localStateSymbol{l_2} \elSy \localStateSymbol{l_{\sym{n}}}} \), and the set of all regional states of a system \( \rewritingSystem{R} \) as \( \regionalStates{\rewritingSystem{R}} \), abbreviating to \( \regionalStatesSymbol \) when \( \rewritingSystem{R} \) is fixed.

A regional state is a partial description of a global state. For string rewriting systems, in which global states are strings, a regional state is then a partial description of a string, which defines that certain string positions have certain character values, but can leave other parts of the string unspecified. We can therefore use wildcard notation to evoke this interpretation, where a dash to indicates a wildcard -- a position in the string for what the regional state does not specify a character value.

Here we show some string regional states written in parentheses notation as well as wildcard notation:

\[ \begin{aligned} \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}}&\syntaxEqualSymbol \wstring{\lstr{\texttt{abab}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{b}}}}&\syntaxEqualSymbol \wstring{\lstr{\texttt{ab-b}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}}}&\syntaxEqualSymbol \wstring{\lstr{\texttt{a---}}}\\ \regionalStateForm{\localState{4}{\lchar{\texttt{b}}}}&\syntaxEqualSymbol \wstring{\lstr{\texttt{---b}}}\\ \emptyRegionalState &\syntaxEqualSymbol \wstring{\lstr{\texttt{----}}}\end{aligned} \]

Gluing #

We can form a regional states by gluing a set of local states. We’ll write this function explicitly as \( \stateCompose \), or an infix form as \( \infixStateComposeSymbol \). This gluing function has the following signature:

\[ \partialFunctionSignature{\stateCompose}{\powerSet{\localStatesSymbol }}{\regionalStatesSymbol } \]

Note the symbol \( \rightharpoonup \), which indicates that \( \stateCompose \) is a partial function, not necessarily defined on all sets of local states. This is due to the fact that we cannot glue incompatible local states: local states that share a key substate but differ in their value substate -- we cannot have more than one distinct character at a given string position. We indicate this with notation \( \stateCompose(\elSy) = \invalidRegionalState \).

Examples #

Here we give some examples of gluing operations and their results, both in parentheses and wildcard notation:

\[ \begin{csarray}{rllllll}{acccccc} & & \stateCompose(\SeFo{}) & = & \wstring{\lstr{\texttt{----}}} & \syntaxEqualSymbol & \emptyRegionalState \\ & & \stateCompose(\SeFo{\localState{1}{\lchar{\texttt{a}}}}) & = & \wstring{\lstr{\texttt{a---}}} & \syntaxEqualSymbol & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}}}\\ \localState{1}{\lchar{\texttt{a}}}\infixStateComposeSymbol \localState{2}{\lchar{\texttt{b}}} & \syntaxEqualSymbol & \stateCompose(\SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{b}}}}) & = & \wstring{\lstr{\texttt{ab--}}} & \syntaxEqualSymbol & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}}}\\ \localState{1}{\lchar{\texttt{a}}}\infixStateComposeSymbol \localState{2}{\lchar{\texttt{b}}}\infixStateComposeSymbol \localState{4}{\lchar{\texttt{b}}} & \syntaxEqualSymbol & \stateCompose(\SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{b}}}, \localState{4}{\lchar{\texttt{b}}}}) & = & \wstring{\lstr{\texttt{ab-b}}} & \syntaxEqualSymbol & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{b}}}}\\ \localState{1}{\lchar{\texttt{a}}}\infixStateComposeSymbol \localState{2}{\lchar{\texttt{b}}}\infixStateComposeSymbol \localState{3}{\lchar{\texttt{b}}}\infixStateComposeSymbol \localState{4}{\lchar{\texttt{a}}} & \syntaxEqualSymbol & \stateCompose(\SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{b}}}, \localState{3}{\lchar{\texttt{b}}}, \localState{4}{\lchar{\texttt{a}}}}) & = & \wstring{\lstr{\texttt{abba}}} & \syntaxEqualSymbol & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{a}}}} \end{csarray} \]

Melting #

The inverse to gluing is melting, in which we dissolve the glue, obtaining the set of local states that form a particular regional state. The function that melts a regional state into a set of local states is written \( \stateDecompose \), and has the following signature:

\[ \functionSignature{\stateDecompose}{\regionalStatesSymbol }{\powerSet{\localStatesSymbol }} \]

We show some obvious examples:

\[ \begin{aligned} \stateDecompose(\wstring{\lstr{\texttt{----}}})&= \SeFo{}\\ \stateDecompose(\wstring{\lstr{\texttt{a---}}})&= \SeFo{\localState{1}{\lchar{\texttt{a}}}}\\ \stateDecompose(\wstring{\lstr{\texttt{ab--}}})&= \SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{b}}}}\\ \stateDecompose(\wstring{\lstr{\texttt{ab-b}}})&= \SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{b}}}, \localState{4}{\lchar{\texttt{b}}}}\\ \stateDecompose(\wstring{\lstr{\texttt{abba}}})&= \SeFo{\localState{1}{\lchar{\texttt{a}}}, \localState{2}{\lchar{\texttt{b}}}, \localState{3}{\lchar{\texttt{b}}}, \localState{4}{\lchar{\texttt{a}}}}\end{aligned} \]

Gluing the melt of a regional state yields that regional state:

\[ \forAllForm{\elemOf{\regionalStateSymbol{R}}{\regionalStatesSymbol }}{\stateCompose(\stateDecompose(\regionalStateSymbol{R})) = \regionalStateSymbol{R}} \]

Melting the glue of a set of compatible local states yields that set:

\[ \forAllForm{\elemOf{\setSymbol{S}}{\powerSet{\localStatesSymbol }},\stateCompose(\setSymbol{S}) \neq \invalidRegionalState }{\stateDecompose(\stateCompose(\regionalStateSymbol{S})) = \setSymbol{S}} \]

Identifying global and local states with regional states #

We can identify global states of \( \rewritingSystem{R} \), shown on the left, with "maximal" regional states, shown on the right, first in parentheses and then wildcard notation:

\[ \begin{aligned} \qstring{\lstr{\texttt{aabb}}}& \approx \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{b}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{aabb}}}\\ \qstring{\lstr{\texttt{abab}}}& \approx \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{abab}}}\\ \qstring{\lstr{\texttt{abba}}}& \approx \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{a}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{abba}}}\\ \qstring{\lstr{\texttt{baab}}}& \approx \regionalStateForm{\localState{1}{\lchar{\texttt{b}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{baab}}}\\ \qstring{\lstr{\texttt{baba}}}& \approx \regionalStateForm{\localState{1}{\lchar{\texttt{b}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{a}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{baba}}}\\ \qstring{\lstr{\texttt{bbaa}}}& \approx \regionalStateForm{\localState{1}{\lchar{\texttt{b}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{a}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{bbaa}}}\end{aligned} \]

Note that there are no wildcards actually present in the right hand column, since global states imply a character value for every string position.

Similarly we can identify local states, shown on the left, with "minimal" regional states, shown on the right in set and then wildcard notation:

\[ \begin{csarray}{rclrcl}{aeeiee} \localState{1}{\lchar{\texttt{a}}} & \approx & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{a---}}} & \localState{1}{\lchar{\texttt{b}}} & \approx & \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{b---}}}\\ \localState{2}{\lchar{\texttt{a}}} & \approx & \regionalStateForm{\localState{2}{\lchar{\texttt{a}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{-a--}}} & \localState{2}{\lchar{\texttt{b}}} & \approx & \regionalStateForm{\localState{2}{\lchar{\texttt{b}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{-b--}}}\\ \localState{3}{\lchar{\texttt{a}}} & \approx & \regionalStateForm{\localState{3}{\lchar{\texttt{a}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{--a-}}} & \localState{3}{\lchar{\texttt{b}}} & \approx & \regionalStateForm{\localState{3}{\lchar{\texttt{b}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{--b-}}}\\ \localState{4}{\lchar{\texttt{a}}} & \approx & \regionalStateForm{\localState{4}{\lchar{\texttt{a}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{---a}}} & \localState{4}{\lchar{\texttt{b}}} & \approx & \regionalStateForm{\localState{4}{\lchar{\texttt{b}}}}\syntaxEqualSymbol \wstring{\lstr{\texttt{---b}}} \end{csarray} \]

We'll denote both the functions that embed global and local states into the regional states with \( \function{ \iota } \):

\[ \begin{nsarray}{c} \functionSignature{\function{ \iota }}{\localStatesSymbol }{\regionalStatesSymbol }\\ \functionSignature{\function{ \iota }}{\globalStatesSymbol }{\regionalStatesSymbol } \end{nsarray} \]

Conjunctions #

It is possible to lift the idea of gluing up a level, obtaining an operation we'll call conjunction. Gluing applies to sets of local states; conjunction applies to sets of regional states. We'll write conjunction as \( \stateJoin \) or in infix form as \( \infixStateJoinSymbol \). Conjunction has the following signature:

\[ \partialFunctionSignature{\stateJoin}{\powerSet{\regionalStatesSymbol }}{\regionalStatesSymbol } \]

Conjunction of two regional states can be defined in terms of their underlying local states: we form the conjunction by gluing the union of their melts:

\[ \regionalStateSymbol{R}\infixStateJoinSymbol \regionalStateSymbol{S}\defEqualSymbol \stateCompose(\stateDecompose(\regionalStateSymbol{R})\setUnionSymbol \stateDecompose(\regionalStateSymbol{S})) \]

This operation can clearly fail when there is a local state in one regional state that is incompatible with a local state in the other regional state, hence \( \stateJoin \) is a partial function.

Here are some examples of conjunction on regional states:

\[ \begin{csarray}{ccccc}{acccc} \emptyRegionalState & \sqcup & \emptyRegionalState & = & \emptyRegionalState \\ \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}} & \sqcup & \emptyRegionalState & = & \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}} & \sqcup & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}}} & = & \invalidRegionalState \\ \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}} & \sqcup & \regionalStateForm{\localState{2}{\lchar{\texttt{a}}}} & = & \regionalStateForm{\localState{1}{\lchar{\texttt{b}}} \localState{2}{\lchar{\texttt{a}}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{a}}}} & \sqcup & \regionalStateForm{\localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}} & = & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}}} & \sqcup & \regionalStateForm{\localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}} & = & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}}} & \sqcup & \regionalStateForm{\localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{b}}}} & = & \invalidRegionalState \end{csarray} \]

We can also depict these same examples with wildcard notation, with the conjunction appearing under its operands:

\[ \begin{array}{cccccccc} \regionalStateSymbol{R} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{b---}}} & \wstring{\lstr{\texttt{b---}}} & \wstring{\lstr{\texttt{b---}}} & \wstring{\lstr{\texttt{aba-}}} & \wstring{\lstr{\texttt{ab--}}} & \wstring{\lstr{\texttt{aaa-}}}\\[1em] \regionalStateSymbol{S} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{a---}}} & \wstring{\lstr{\texttt{-a--}}} & \wstring{\lstr{\texttt{-bab}}} & \wstring{\lstr{\texttt{--ab}}} & \wstring{\lstr{\texttt{-bbb}}}\\[1em] \regionalStateSymbol{R}\infixStateJoinSymbol \regionalStateSymbol{S} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{b---}}} & \invalidRegionalState & \wstring{\lstr{\texttt{ba--}}} & \wstring{\lstr{\texttt{abab}}} & \wstring{\lstr{\texttt{abab}}} & \invalidRegionalState \end{array} \]

Disjunctions #

Similar to the operation of conjunction, we can define disjunction, which finds the regional state that is in common to two or more input regional states. We'll write the disjunction function as \( \stateMeet \), and in infix form as \( \infixStateMeetSymbol \). Disjunction has the following signature:

\[ \functionSignature{\stateMeet}{\powerSet{\regionalStatesSymbol }}{\regionalStatesSymbol } \]

Unlike conjunction, disjunction is a total function: it is defined on every set of regional states. We can define the disjunction of two regional states in terms of \( \stateDecompose \) and \( \stateCompose \) as follows:

\[ \regionalStateSymbol{R}\infixStateMeetSymbol \regionalStateSymbol{S}\defEqualSymbol \stateCompose(\stateDecompose(\regionalStateSymbol{R})\setIntersectionSymbol \stateDecompose(\regionalStateSymbol{S})) \]

The totality of \( \stateMeet \) is a consequence of the fact that the local states in the melt of \( \regionalStateSymbol{R} \) are, by definition, compatible, and likewise for \( \regionalStateSymbol{S} \). Hence the local states in their intersection must be compatible too.

\[ \begin{csarray}{ccccc}{acccc} \emptyRegionalState & \sqcap & \emptyRegionalState & = & \emptyRegionalState \\ \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}} & \sqcap & \emptyRegionalState & = & \emptyRegionalState \\ \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}} & \sqcap & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}}} & = & \emptyRegionalState \\ \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}} & \sqcap & \regionalStateForm{\localState{1}{\lchar{\texttt{b}}} \localState{2}{\lchar{\texttt{b}}}} & = & \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}}} & \sqcap & \regionalStateForm{\localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{a}}}} & = & \regionalStateForm{\localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{a}}}} & \sqcap & \regionalStateForm{\localState{1}{\lchar{\texttt{b}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}} & = & \regionalStateForm{\localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}}}\\ \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{a}}}} & \sqcap & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{a}}}} & = & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{a}}}} \end{csarray} \]

As before, we can depict these same examples with wildcard notation, with the disjunction appearing under its operands:

\[ \begin{array}{cccccccc} \regionalStateSymbol{R} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{b---}}} & \wstring{\lstr{\texttt{b---}}} & \wstring{\lstr{\texttt{b---}}} & \wstring{\lstr{\texttt{aaa-}}} & \wstring{\lstr{\texttt{aaaa}}} & \wstring{\lstr{\texttt{aaaa}}}\\[1em] \regionalStateSymbol{S} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{a---}}} & \wstring{\lstr{\texttt{bb--}}} & \wstring{\lstr{\texttt{-aaa}}} & \wstring{\lstr{\texttt{baab}}} & \wstring{\lstr{\texttt{aaaa}}}\\[1em] \regionalStateSymbol{R}\infixStateMeetSymbol \regionalStateSymbol{S} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{----}}} & \wstring{\lstr{\texttt{b---}}} & \wstring{\lstr{\texttt{-aa-}}} & \wstring{\lstr{\texttt{-aa-}}} & \wstring{\lstr{\texttt{aaaa}}} \end{array} \]

Extent #

Regional states represent partial descriptions of global states. Therefore it is natural to ask which global states a regional state describes. This is called the extent of the regional state, written \( \stateExtent \), with the following signature:

\[ \functionSignature{\stateExtent}{\regionalStatesSymbol }{\powerSet{\globalStatesSymbol }} \]

We can summarize the behavior of the \( \stateExtent \) function using a table whose rows are global states and whose columns are regional states. Every entry of the table contains a tick if that global state is described by that regional state. Here we show such a table for all global states and a selection of regional states:

\[ \begin{csarray}{cccccccccccccccc}{aicccccccccccccc} & \emptyRegionalState & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}}} & \regionalStateForm{\localState{1}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{2}{\lchar{\texttt{a}}}} & \regionalStateForm{\localState{2}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{3}{\lchar{\texttt{a}}}} & \regionalStateForm{\localState{3}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{4}{\lchar{\texttt{a}}}} & \regionalStateForm{\localState{4}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{b}}}} & \regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{a}}}}\\[1em] \qstring{\lstr{\texttt{aabb}}} & \tiSy & \tiSy & & \tiSy & & & \tiSy & & \tiSy & & \tiSy & & & & \\[0.5em] \qstring{\lstr{\texttt{abab}}} & \tiSy & \tiSy & & & \tiSy & \tiSy & & & \tiSy & \tiSy & & \tiSy & \tiSy & & \\[0.5em] \qstring{\lstr{\texttt{abba}}} & \tiSy & \tiSy & & & \tiSy & & \tiSy & \tiSy & & \tiSy & & & \tiSy & \tiSy & \tiSy\\[0.5em] \qstring{\lstr{\texttt{baab}}} & \tiSy & & \tiSy & \tiSy & & \tiSy & & & \tiSy & & & \tiSy & & & \\[0.5em] \qstring{\lstr{\texttt{baba}}} & \tiSy & & \tiSy & \tiSy & & & \tiSy & \tiSy & & & \tiSy & & & & \\[0.5em] \qstring{\lstr{\texttt{bbaa}}} & \tiSy & & \tiSy & & \tiSy & \tiSy & & \tiSy & & & & & & & \end{csarray} \]

The extent \( \stateExtent(\regionalStateSymbol{R}) \) of a regional state \( \regionalStateSymbol{R} \) is then the set of global states with a tick in the column for \( \regionalStateSymbol{R} \).

Here we show some examples of the extent of some regional states:

\[ \begin{csarray}{rcl}{acc} \stateExtent(\emptyRegionalState )\syntaxEqualSymbol \stateExtent(\wstring{\lstr{\texttt{----}}}) & = & \SeFo{\qstring{\lstr{\texttt{aabb}}}, \qstring{\lstr{\texttt{abab}}}, \qstring{\lstr{\texttt{abba}}}, \qstring{\lstr{\texttt{baab}}}, \qstring{\lstr{\texttt{baba}}}, \qstring{\lstr{\texttt{bbaa}}}}\\ \stateExtent(\regionalStateForm{\localState{1}{\lchar{\texttt{a}}}})\syntaxEqualSymbol \stateExtent(\wstring{\lstr{\texttt{a---}}}) & = & \SeFo{\qstring{\lstr{\texttt{aabb}}}, \qstring{\lstr{\texttt{abab}}}, \qstring{\lstr{\texttt{abba}}}}\\ \stateExtent(\regionalStateForm{\localState{1}{\lchar{\texttt{b}}}})\syntaxEqualSymbol \stateExtent(\wstring{\lstr{\texttt{b---}}}) & = & \SeFo{\qstring{\lstr{\texttt{baab}}}, \qstring{\lstr{\texttt{baba}}}, \qstring{\lstr{\texttt{bbaa}}}}\\ \stateExtent(\regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}}})\syntaxEqualSymbol \stateExtent(\wstring{\lstr{\texttt{ab--}}}) & = & \SeFo{\qstring{\lstr{\texttt{abab}}}, \qstring{\lstr{\texttt{abba}}}}\\ \stateExtent(\regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{b}}}})\syntaxEqualSymbol \stateExtent(\wstring{\lstr{\texttt{abb-}}}) & = & \SeFo{\qstring{\lstr{\texttt{abba}}}}\\ \stateExtent(\regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{b}}} \localState{3}{\lchar{\texttt{b}}} \localState{4}{\lchar{\texttt{a}}}})\syntaxEqualSymbol \stateExtent(\wstring{\lstr{\texttt{abba}}}) & = & \SeFo{\qstring{\lstr{\texttt{abba}}}}\\ \stateExtent(\regionalStateForm{\localState{1}{\lchar{\texttt{a}}} \localState{2}{\lchar{\texttt{a}}} \localState{3}{\lchar{\texttt{a}}} \localState{4}{\lchar{\texttt{a}}}})\syntaxEqualSymbol \stateExtent(\wstring{\lstr{\texttt{aaaa}}}) & = & \SeFo{} \end{csarray} \]

Intent #

Comparing regional states #

The regional states \( \regionalStatesSymbol \) naturally have a specificity relation \( \regionalSubstateSymbol \) on them that captures when a regional state is more or less specific than another, defined as follows:

\[ \regionalStateSymbol{R}\regionalSubstateSymbol \regionalStateSymbol{S}\iff \stateDecompose(\regionalStateSymbol{R}) \subseteq \stateDecompose(\regionalStateSymbol{S}) \]

We will use the following terminology:

z z
\( \regionalStateSymbol{S}\regionalSuperstateSymbol \regionalStateSymbol{R} \) \( \regionalStateSymbol{S} \) is more specific than \( \regionalStateSymbol{R} \)
\( \regionalStateSymbol{S}\regionalSubstateSymbol \regionalStateSymbol{T} \) \( \regionalStateSymbol{S} \) is less specific than \( T \)
\( \regionalStateSymbol{R}\comparableRegionalStatesSymbol \regionalStateSymbol{S} \) \( \regionalStateSymbol{R} \) is compatible with \( \regionalStateSymbol{S} \)
\( \regionalStateSymbol{R}\incomparableRegionalStatesSymbol \regionalStateSymbol{S} \) \( \regionalStateSymbol{R} \) is incompatible with \( \regionalStateSymbol{S} \)

Note the slightly confusing aspect of the terminology that a state is more specific than itself. We can say strictly more specific, etc, when we wish to exclude this case.

Two regional states are compatible if one is more specific than the other, in other words, if they are comparable in the partial order. Two regional states can also be incompatible -- neither more nor less specific -- when a local state in one is incompatible with a local state in the other.

Intuition #

The terminology of specificity is helpful if we think about regional states as filters of global states. A more specific regional state (which has more constraints in the form of local states) will filter out more / match fewer global states. The least specific regional state of all is an empty filter with no constraints, which matches all global states.

This avoids the confusion of talking about "larger" or "smaller" regional states, since there is an inverse (contravariant) relationship between the number of local states in a regional state, and the number of global states it matches: increasing the number of local states in a regional state (making it more specific) decreases the number of global states that it matches. This inverse relationship makes a consistent interpretation of the term "larger" hard to remember.

Partial order #

This specificity relation defines a partial order on \( \regionalStatesSymbol \), since it is reflexive, transitive, and if both \( \regionalStateSymbol{R}\regionalSubstateSymbol \regionalStateSymbol{S} \) and \( \regionalStateSymbol{S}\regionalSubstateSymbol \regionalStateSymbol{R} \) then the contain the same local states and are therefore equal as regional states.

We can visualize this partial order for our example \( \regionalStates{\rewritingSystem{R}} \) via its Hasse diagram:

Notice that the global states \( \globalStatesSymbol \) correspond to the maximal elements of this partial order. The unique minimal element of the entire semilattice is the empty regional state \( \emptyRegionalState \syntaxEqualSymbol \wstring{\lstr{\texttt{----}}} \), which is less specific than any regional state. This element is written \( \semilatticeBottom \) in an order-theoretic context, and is called the bottom element.

Notice that the local states \( \localStatesSymbol \) correspond to the minimal non-bottom elements of this order (known as the atoms of the semilattice). We can also identify the local states by way of the covering relation: an element \( \posetElementSymbol{x} \) is said to cover and \( \posetElementSymbol{y} \) in a poset, written \( \posetElementSymbol{x}\posetCoversSymbol \posetElementSymbol{y} \), when both \( \posetElementSymbol{x}\posetGreaterSymbol \posetElementSymbol{y} \) and there does not exist another element \( \posetElementSymbol{z} \) such that \( \posetElementSymbol{x}\posetGreaterSymbol \posetElementSymbol{z}\posetGreaterSymbol \posetElementSymbol{y} \). Then the local states are those that cover the bottom element \( \semilatticeBottom \):

\[ \localStatesSymbol = \setConstructor{\regionalStateSymbol{R}}{\elemOf{\regionalStateSymbol{R}}{\regionalStatesSymbol },\regionalStateSymbol{R}\posetCoversSymbol \emptyRegionalState } \]

Meet semilattice #

The set of regional states \( \regionalStatesSymbol \) has the additional order-theoretic structure of a meet semilattice. What is a meet semilattice? It is a partially ordered set \( \TuFo{\posetSymbol{X}, \posetLessEqualSymbol } \) with an additional binary operation called meet: \( \functionSignature{\function{\semilatticeMeetSymbol }}{\TuFo{\posetSymbol{X}, \posetSymbol{X}}}{\posetSymbol{X}} \) that takes a pair of elements to their greatest lower bound under the partial order \( \posetLessEqualSymbol \). In other words, the meet is defined to be the following operation:

\[ \meetSemilatticeElementSymbol{x}\semilatticeMeetSymbol \meetSemilatticeElementSymbol{y}\defEqualSymbol \indexMax{\suchThat{\meetSemilatticeElementSymbol{z}}{\meetSemilatticeElementSymbol{z}\posetLessEqualSymbol \meetSemilatticeElementSymbol{x},\meetSemilatticeElementSymbol{y}}}{\substack{\elemOf{\meetSemilatticeElementSymbol{z}}{\posetSymbol{X}}}}{} \]

This function must be well-defined, that is, there must be a unique such maximal element for a poset to be a meet semilattice (in a total order, the maximum is always unique, but a set of elements of a poset that is not a total order can have several such maxima, which are necessarily pairwise incomparable).

In the case of regional states, the partial order is given by containment \( \regionalSubstateSymbol \), and the meet \( \regionalStateSymbol{R}\semilatticeMeetSymbol \regionalStateSymbol{S} \) of two regional states is simply the disjunction \( \regionalStateSymbol{R}\infixStateMeetSymbol \regionalStateSymbol{S} \) we have already defined, which satisfies the required property by definition.

Illustration of meets #

Here we illustrate several meet operations in the regional state semilattice.

Relation between extent and specificity #

Phrased in terms of extent, then, we can have the following implication:

\[ \regionalStateSymbol{S}\regionalSubstateSymbol \regionalStateSymbol{R}\implies \stateExtent(\regionalStateSymbol{R}) \subseteq \stateExtent(\regionalStateSymbol{S}) \]

In other words, if \( \regionalStateSymbol{R} \) is more specific than \( \regionalStateSymbol{S} \), the extent of \( \regionalStateSymbol{R} \) is a subset of the extent of \( \regionalStateSymbol{S} \). This makes sense: making a filter more specific will necessarily cause fewer global states to match it. This makes the function \( \stateExtent \) into a monotone function between the poset \( \TuFo{\regionalStatesSymbol , \regionalSubstateSymbol } \) of regional states and the poset \( \TuFo{\powerSet{\globalStatesSymbol }, \subseteq } \) of sets of global states.

Intent #

There is a natural "inverse" of the extent function, which we'll call intent. It maps a set of global states to a regional state that attempts to describe this set. The signature of \( \stateIntent \) is:

\[ \functionSignature{\stateIntent}{\powerSet{\globalStatesSymbol }}{\regionalStatesSymbol } \]

Formally, it is defined to be the most specific regional state whose extent includes the input set of global states:

\[ \stateIntent(\setSymbol{G})\defEqualSymbol \indexMax{\suchThat{\regionalStateSymbol{R}}{\elemOf{\regionalStateSymbol{R}}{\regionalStatesSymbol },\stateExtent(\regionalStateSymbol{R}) \supseteq \setSymbol{G}}}{}{} \]

The intent is bounded below by the disjunction of the input global states (when they are embedded into the corresponding regional states), since this disjunction matches all the input global states and so participates in the above maximization.

\[ \stateIntent(\setSymbol{G})\regionalSuperstateSymbol \stateMeet(\setConstructor{\function{ \iota }(\globalStateSymbol{g})}{\elemOf{\globalStateSymbol{g}}{\setSymbol{G}}}) = \stateCompose(\indexIntersection{\stateDecompose(\function{ \iota }(\globalStateSymbol{g}))}{\elemOf{\globalStateSymbol{g}}{\setSymbol{G}}}{}) \]

In some cases, the intent is exactly the inverse of the extent. This is true whenever we apply intent to an set of global states that can be described exactly as the extent of some regional state:

\[ \forAllForm{\elemOf{\regionalStateSymbol{R}}{\regionalStatesSymbol }}{\stateIntent(\stateExtent(\regionalStateSymbol{R}))\identicallyEqualSymbol \regionalStateSymbol{R}} \]

As an example, consider the set \( \setSymbol{G} = \SeFo{\qstring{\lstr{\texttt{aabb}}}, \qstring{\lstr{\texttt{baba}}}} \). The intent of \( \setSymbol{G} \) is the regional state \( \wstring{\lstr{\texttt{-ab-}}} \), because specifying any characters beyond the middle two will prevent one or both of the elements of \( \setSymbol{G} \) from matching. Moreover, this regional state specifies exactly one \( \lchar{\texttt{a}} \) and one \( \lchar{\texttt{b}} \), and so there are only two ways of fixing the unspecified string positions, meaning the regional state has exactly the extent \( \setSymbol{G} \). Summarizing this situation:

\[ \begin{aligned} \setSymbol{G}&= \SeFo{\qstring{\lstr{\texttt{aabb}}}, \qstring{\lstr{\texttt{baba}}}}\\ \stateIntent(\setSymbol{G})&= \wstring{\lstr{\texttt{-ab-}}}\\[1em] \stateExtent(\stateIntent(\setSymbol{G}))&= \stateExtent(\wstring{\lstr{\texttt{-ab-}}})\\ &= \SeFo{\qstring{\lstr{\texttt{aabb}}}, \qstring{\lstr{\texttt{baba}}}}\\ &= \setSymbol{G}\end{aligned} \]

However, not all sets of global states are of this form. In particular, if there is pair of incompatible states within a pair of global states in the input set, this forces a blind spot in any regional state whose extent includes this pair of global states, and this blind spot can let other global states through that are not in the input set.

A simple example of this situation for \( \rewritingSystem{R_2} \) occurs for the set \( \setSymbol{G} = \SeFo{\qstring{\lstr{\texttt{aabb}}}, \qstring{\lstr{\texttt{bbaa}}}} \). This two global states are maximally incompatible, in that the only regional state that matches both of them is the empty regional state. This is because the melt of these two global states has zero intersection: they disagree in all string positions. Hence, the intent of \( \setSymbol{G} \) is \( \emptyRegionalState \syntaxEqualSymbol \wstring{\lstr{\texttt{----}}} \), which in turn matches all global states:

\[ \begin{aligned} \setSymbol{G}&= \SeFo{\qstring{\lstr{\texttt{aabb}}}, \qstring{\lstr{\texttt{bbaa}}}}\\ \stateIntent(\setSymbol{G})&= \wstring{\lstr{\texttt{----}}}\\[1em] \stateExtent(\stateIntent(\setSymbol{G}))&= \stateExtent(\wstring{\lstr{\texttt{----}}})\\ &= \globalStatesSymbol \end{aligned} \]

Notice that while we do not have equality between \( \setSymbol{G} \) and \( \stateExtent(\stateIntent(\setSymbol{G})) \) for some arbitrary set \( \elemOf{\setSymbol{G}}{\powerSet{\globalStatesSymbol }} \), they are at least comparable:

\[ \setSymbol{G} \subseteq \stateExtent(\stateIntent(\setSymbol{G})) \]

In words: taking the extent of the intent of a set of global states can either keep the set the same or enlarge it with novel states.

Galois connection #

Diagram #

This diagram illustrates the functions between local, regional, and global states. A half-arrowhead indicates a partial function. We enumerate these functions here:

z z
\( \functionSignature{\function{ \iota }}{\localStatesSymbol }{\regionalStatesSymbol } \) embeds local state into atomic regional state
\( \functionSignature{\function{ \iota }}{\globalStatesSymbol }{\regionalStatesSymbol } \) embeds global state into maximal regional state
\( \partialFunctionSignature{\stateCompose}{\powerSet{\localStatesSymbol }}{\regionalStatesSymbol } \) glues set of local states into regional state
\( \functionSignature{\stateDecompose}{\regionalStatesSymbol }{\powerSet{\localStatesSymbol }} \) melts regional state into set of compatible local states
\( \functionSignature{\stateExtent}{\powerSet{\globalStatesSymbol }}{\regionalStatesSymbol } \) gives set of global states matching regional state
\( \functionSignature{\stateIntent}{\regionalStatesSymbol }{\powerSet{\globalStatesSymbol }} \) gives most specific regional state that matches set of global states
\( \partialFunctionSignature{\stateJoin}{\powerSet{\regionalStatesSymbol }}{\regionalStatesSymbol } \) gives least specific regional state more specific than set of regional states
\( \functionSignature{\stateMeet}{\powerSet{\regionalStatesSymbol }}{\regionalStatesSymbol } \) gives most specific regional state less specific than set of regional states

Rewrite rules as schemas #

Generalizing linear algebra with atrices #

Petri nets #

Causal bigraph and causal hypergraph #

Compilation #

Rewriting systems to hypergraph rewriting systems #

Hypergraph rewriting systems to petri nets #