Advanced maths

Word rewriting calculator with a bounded confluence check

Reduce a lowercase word with a finite string-rewriting system and inspect critical overlaps for confluence.

Your numbers

One lowercase left->right rule per line. Empty right sides are allowed.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Reduce a lowercase word with a finite string-rewriting system and inspect critical overlaps for confluence. Each rule must strictly decrease length, or preserve length while decreasing lexicographic order, ensuring termination. The calculator explores normal forms of the input word and critical-pair descendants within a state cap. A completed joinability check supports a confluence conclusion; an exhausted cap is explicitly inconclusive.

THE FORMULAEvery rule strictly decreases length-lex order; terminating critical pairs are checked for joinability.

A worked example

Rules aa→a, bb→b, ba→ab make letters idempotent and ordered. The word bbaaba reduces to ab. The solver enumerates all reachable normal forms of the entered word and checks overlap critical pairs; the confluence conclusion requires all capped searches to finish.

Good to know

1–12 lowercase rules, entered word≤30 characters. Right sides must decrease length then lexicographic order. At most 100,000 descendant states across all checks. No general undecidable word-problem solver or confluence claim from unfinished critical-pair searches.

Rules act inside any context

A rule replaces an occurrence of its left side wherever that substring appears, leaving surrounding letters unchanged. More than one rule or occurrence may be available at a step.

Different reduction choices can lead to different intermediate words and, for a nonconfluent system, different irreducible results. The calculator explores those choices rather than merely applying the first matching rule repeatedly. Empty right sides delete a substring, while empty left sides are forbidden.

A critical overlap needs both reduction branches to joinOverlapping rule applicationsLeft descendantRight descendantCommon normal form?
Rules aa→a, bb→b, ba→ab make letters idempotent and ordered. The word bbaaba reduces to ab. The solver enumerates all reachable normal forms of the entered word and checks overlap critical pairs; the confluence conclusion requires all capped searches to finish. Static schematic; numerical labels define the example.

Computes presented-word reductions under supplied relations, rather than composing a known finite permutation action. The Two dimensional rational cone Hilbert basis calculator offers a complementary calculation under its own stated assumptions.

Why the ordering restriction proves termination

Every accepted rule decreases length-lex order on a finite alphabet. Length cannot decrease forever, and at a fixed length there are only finitely many words below any starting word.

Infinite reduction sequences are therefore excluded. A rule that preserves length but increases lexicographic order is rejected even if a particular sample word happens to terminate. This is a sufficient global termination certificate for the supported systems, not an algorithm deciding termination of arbitrary rewrite rules.

Worked example and mathematical rule

Rules aa→a, bb→b, ba→ab make letters idempotent and ordered. The word bbaaba reduces to ab. The solver enumerates all reachable normal forms of the entered word and checks overlap critical pairs; the confluence conclusion requires all capped searches to finish.

Every rule strictly decreases length-lex order; terminating critical pairs are checked for joinability.

Normal forms of one word

A normal form has no applicable rule. Termination guarantees each reduction branch eventually reaches one, but not that all branches agree.

The listed distinct normal forms of the entered word reveal its local ambiguity. A word with one normal form does not establish confluence of the entire system, because another word may contain a conflicting overlap. Conversely, several normal forms for one word immediately demonstrate nonconfluence.

Critical overlaps and inclusions

Conflicts arise when two rule applications overlap, including when one left side occurs inside another. Disjoint reductions commute and do not need separate critical-pair tests.

For every compatible overlap, the calculator constructs the two one-step descendants and searches their normal forms for a common descendant. With termination, joinability of all critical pairs gives local confluence and hence confluence. The inclusion cases matter; checking only proper suffix-prefix overlaps would miss some ambiguities.

Bounded search is not a negative proof

A terminating system can still have many descendants. If the total state cap is exceeded, the page reports an unresolved computation rather than declaring a pair unjoinable.

Completed disjoint normal-form sets establish nonjoinability under termination. The tool does not add completion rules or perform an unrestricted Knuth–Bendix completion. Such added rules would change the supplied system and could substantially expand the search problem.

Reading a confluence result correctly

Confluence means every pair of reductions from the same word can be joined; together with termination it gives unique normal forms. It does not mean every word reduces to the empty word or that two arbitrary words are equivalent.

For equality reasoning, compare normal forms only when the rewrite rules model the intended equations and the confluence check completed. Retain rule orientation, alphabet convention and cap status with any claim, because a successful reduction of one example is much weaker evidence.

A few questions, answered

Why reject some terminating-looking rules?

The page requires a specific length-lex decrease certificate and does not decide arbitrary termination.

Does one normal form prove confluence?

Only for that word’s explored descendants, not for the whole system.

Are contained left sides checked?

Yes. Critical inclusions are included alongside partial overlaps.

Does this complete a nonconfluent system?

No. It reports overlaps and normal forms without adding new rules.

Find your calculator

Start typing to explore the library.