@dziban A lot of this is correct, and a lot of it is simpler than you've specified.
Variable assignment and expression evaluation isn't a built-in feature of the language, but instead considered a part of the standard library.
Rule priority is source-order, and rules consume the tuples they match. The left-hand side of a rule is the tuples it consumes, while the right-hand side is the tuples it produces.
I've updated the snippet with more code.
https://gitlab.com/-/snippets/3716812
⦶
@wryl how does this standard library work? is it literally some rules provided that operate on the same tuple system? how does addition work under this?