Rewriting rules:
21 -> 12 31 -> 13 32 -> 23
Input string:
Output string:
Amandine is a string-rewriting system.
The input given is rewritten accoding to the specified rules. This is how the process goes:
The first rule is applied repeatedly to the string until no more changes are made. Then the second rule is applied, followed by the third and so on. This process is repeated until the string can not be modified with any of the rules anymore. Rules are of the form <span style=”font-family:monospace;background-color:#DDD;font-weight:bold;”>source -> replacement</span> where <span style=”font-family:monospace;background-color:#DDD;font-weight:bold;”>source</span> is a JavaScript regular expression and <span style=”font-family:monospace;background-color:#DDD;font-weight:bold;”>replacement</span> is a normal string. Lines that start with a <span style=”font-family:monospace;background-color:#DDD;font-weight:bold;”>;</span> are ignored.
The default example shows how sorting a sequence of numbers is possible.
0 comments