{ "docs": { "description": [ "An implementation of a Universal Turing Machine", "See the included Busy Beaver ParamsDiffs for examples on how to program it." ] }, "commons": { "string_sources": { "initial-state": "a", "halt-state": "halt", "blank-symbol": "0", "key": {"Join": {"sources": [{"ScratchpadVar": "state"}, ",", {"ScratchpadVar": "read"}]}} }, "mappers": { "r": {"All": [ {"IfCondition": { "condition": {"StringMatches": { "source": {"ScratchpadVar": "tape"}, "matcher": {"LengthIs": 0} }}, "mapper": {"ModifyScratchpadVar": { "name": "tape", "modification": {"Append": {"Common": "blank-symbol"}} }} }}, {"ModifyScratchpadVar": { "name": "tape-behind", "modification": {"Append": {"Modified": {"source": {"ScratchpadVar": "tape"}, "modification": {"KeepRange": {"start": 0, "end": 1}}}}} }}, {"ModifyScratchpadVar": { "name": "tape", "modification": {"Remove": 0} }} ]}, "l": {"All": [ {"IfCondition": { "condition": {"StringMatches": { "source": {"ScratchpadVar": "tape-behind"}, "matcher": {"LengthIs": 0} }}, "mapper": {"ModifyScratchpadVar": { "name": "tape-behind", "modification": {"Append": {"Common": "blank-symbol"}} }} }}, {"ModifyScratchpadVar": { "name": "tape", "modification": {"Prepend": {"Modified": {"source": {"ScratchpadVar": "tape-behind"}, "modification": {"KeepRange": {"start": -1}}}}} }}, {"ModifyScratchpadVar": { "name": "tape-behind", "modification": {"Remove": -1} }} ]}, "s": "None" } }, "rules": [ { "condition": "Always", "mapper": {"All": [ {"SetScratchpadVar": { "name": "state", "value": {"Common": "initial-state"} }}, {"SetScratchpadVar": { "name": "tape-behind", "value": "" }}, {"SetScratchpadVar": { "name": "tape", "value": {"Part": {"QueryParam": "tape"}} }} ]} }, {"Repeat": { "rules": [ { "condition": {"Not": {"StringIs": {"source": {"ScratchpadVar": "state"}, "value": {"Common": "halt-state"}}}}, "mapper": {"All": [ {"IfCondition": { "condition": {"StringMatches": { "source": {"ScratchpadVar": "tape"}, "matcher": {"LengthIs": 0} }}, "mapper": {"ModifyScratchpadVar": { "name": "tape", "modification": {"Append": {"Common": "blank-symbol"}} }} }}, {"SetScratchpadVar": { "name": "read", "value": { "Modified": { "source": {"ScratchpadVar": "tape"}, "modification": {"KeepRange": { "start": 0, "end": 1 }} } } }}, {"SetScratchpadVar": { "name": "tape", "value": {"Join": { "sources": [ {"MapKey": {"map": "state_set", "key": {"Common": "key"}}}, {"Modified": {"source": {"ScratchpadVar": "tape"}, "modification": {"KeepRange": {"start": 1}}}} ] }} }}, {"Common": {"name": {"MapKey": {"map": "state_move", "key": {"Common": "key"}}}}}, {"SetScratchpadVar": { "name": "state", "value": {"MapKey": {"map": "state_map", "key": {"Common": "key"}}} }} ]} } ], "limit": 18446744073709551615 }}, { "condition": "Always", "mapper": {"SetPart": { "part": {"QueryParam": "tape"}, "value": {"Join": {"sources": [{"ScratchpadVar": "tape-behind"}, {"ScratchpadVar": "tape"}]}} }} } ] }