1. Home
  2. /
  3. Thue
  4. /
  5. Swap Two Symbols

Swap Two Symbols - Thue Typing CST Test

Loading…

Swap Two Symbols — Thue Code

Swaps two symbols A and B in the string.

S::=AB
AB::=BA
BA::=AB

Thue Language Guide

Thue is an abstract computational model based on string rewriting systems. It allows defining rules to transform strings, serving as a theoretical model for computation and a framework for exploring universal computation.

Primary Use Cases

  • ▸Study of formal languages and rewriting systems
  • ▸Turing-completeness demonstrations
  • ▸Exploration of non-deterministic algorithms
  • ▸Teaching computational theory concepts
  • ▸Theoretical experiments in automata and computation

Notable Features

  • ▸Pattern-based string rewriting
  • ▸Support for non-deterministic rule application
  • ▸Turing-complete computational model
  • ▸Minimalistic and formal
  • ▸Flexible for theoretical exploration

Origin & Creator

Thue was created in 1914 by the Norwegian mathematician Axel Thue to study sequences and combinatorial problems in strings; it later became recognized as a model of computation.

Industrial Note

Thue is mainly of academic and theoretical interest, used in formal language research, computational theory, and exploring Turing-completeness in minimal systems.

More Thue Typing Exercises

Hello World in ThueSimple IncrementSimple DecrementPrint Numbers 1 to 3Simple Copy RuleConditional Output ExamplePalindrome CheckReverse StringFactorial Concept

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher