User:TenBillionPlusOne/Sandbox
Jump to navigation
Jump to search
It's my sandbox. You can edit here, but please leave your signature/timestamp.
Computational model
Memory:
- A mutable function that maps each symbol to a symbol, 0 by default.
- Position of the machine. A symbol, 0 by default.
- State of the machine. A symbol, 0 by default.
The program always begins with the list of symbols surrounded with parentheses. It's the list of base symbols. It must contain 0.
The rest of the program is the list of declarations in form:
ABCD
where all arguments are symbols.
Every instruction is an if statement:
- Is A value under current symbol and B the state of the machine?
- If yes:
- Set the state of the machine to D.
- Set the machine's position to C.
- Jump to the start of the program.
- If no, jump to next instruction.
Symbols:
- All base symbols are symbols.
- (xy) is a symbol, where x and y are symbols.
Names that aren't symbols are variables - they are wildcards that can be replaced by any symbol that match, althrough they must be consistent in the instruction. In CD part there can be only symbols that appeared in AB part.