cirt e mys

From Esolang
Jump to navigation Jump to search

cirt e mys is an Esolang created by User:Yayimhere as a more well thought through successor to Apraxia. As such, it is also pattern based. It uses a more sophisticated, though strange syntax. Unlike Apraxia, no special meaning is assigned to something like "the last symbol of the program". cirt e mys also had the secondary goal of being more balanced between halting and looping.

Etymology

cirt e mys is named after noit o' mnain worb, and specifically, when reversed, it reads as symmetric, based on how symmetric strings affect the programs

Notation

cirt e mys is built on top of a special string rewriting notation. And as such, it will be described here:

  • x': reversed x.
  • x^: x without its first character(empty string if single character).
  • x-: first character of x.
  • x+y: concatenation.
  • x*: (x'+x)^.

these cannot actually be used in the program.

Expressions

cirt e mys programs are all expressions(specifically, a strange form of S-expressions). Brackets are substrings of length >1, that "match" with their reverse. Meanwhile, the objects are simply (greedily matched) strings that dont match with anything. Note that brackets can "overlap", like for example:

abc ... ba ... cb

as you can see, abc acts as the left bracket for two other substrings. As such, the substring between abc and ba is c ..., and between abc and cb is ... ba .... These brackets are called "bracket snapshots", and non brackets are called "nodes". Note that brackets always match with their closest possible match. In the special case of a program made up of only a single character, it isnt matched as brackets. However, aaa ... aa ... aa is matched, as long as the ... doesnt end or start with a.

Rewriting rules

cirt e mys uses two types of rewriting rules, one for bracket snapshots and one for nodes. These are defined as:

bracket snapshots: b x b' -> (x^-+x^^-)'+b^+x-+x'
nodes: x p -> p+x* (note that in this case p is the rest of the program)

these are applied left to right. When a rewrite has been applied, the whole program is reinterpreted and another rule is applied, and so on until the string stops changeing.

Demonstration

The program:

ababa

which matches:

ab a ba

and evaluates:

ababa
baa
abbaa
a

which then halts.

Emergent behaviour

cirt e mys' rewriting rules often destroy one bracket match, and create another, in two steps(first bracket snapshot rewrites, and the nodes). I dont really know why this happens but it's interesting.

Examples

Looping counter(*2+1):

**