Acme::URM is a Perl module that gives you the methods needed to emulate an URM in Perl.
Why? Because we can.
What is URM?
URM stands for unlimited register machine.
URM has unlimited number of registers: R0, R1, ... Those contain natural numbers: r0, r1, ... Default values for ri are 0.
Instruction for URM is one of the following instructions:
* Z(n) - set up register with index n to zero
* S(n) - increment value of register with index n by 1
* T(m, n) - set up register with index n to value of register with index m
* J(m, n, q) - conditional instruction: if values of registers with indexes m, n are equal, then go to insturction with index q (zero based index), else move to following instruction
Program of URM is a finite list of URM instructions.
my $rm = Acme::URM->new();
# program that summarize parameters given in R0,R1
$urm->register( 0, 2, 2 ); # fill the registers
my $res = $urm->run(); # res must be 4