GTPS

From Esolang
Jump to navigation Jump to search

Group Theory Programming System is a programming language made by User: A() with the intention of being based on wikipedia:group theory. Every program loops forever, so it's the polar opposite of being total.

Syntax

  • ι n - Makes group with n elements
  • z: [x, y] - cycle x and y and label the action as z
  • {z} - do z
  • z' - opposite of z
  • z + w - action z first then action w
  • \(x){z} - while element x is not in its initial position do z
  • 2z - z two times
  • {code}(!) - Execute code once and only once

Programs

Truth-machine

ι 2
a : [1, 2]
∅ : {a + a'}
{a}(!) ; input
\(1){∅}

A+B

ι 90
a : [1,...45]
b : [46,...90]
{2a}(!) ; change the 2 to any number
{2b}(!) ; change the 2 to any number
\(46){a + b'} ; dec cycle b and inc cycle a

A-B

ι 90
a : [1,...45]
b : [46,...90]
{2a}(!) ; change the 2 to any number
{2b}(!) ; change the 2 to any number
\(46){a' + b'} ; dec cycle a and dec cycle b

A*B

ι 180
a : [1,...45]
b : [46,...90]
c : [91,...135]
d : [136,...180]
{2a + 2b}(!) ; change the 2's to any number. Only set a to 2 and b to 2 once
\(46)
{
 \(1){a' + c + d} ; add a to c and d
 {b'} ; subtract 1 from b
 \(136) {a + d'} ; set a to d
}