This is not at all my specialty, but might the problem go away if instead of directly passing in the next term into your lambda calculus machine, you first quote it? By “quoting”, I mean converting it to a representation that the lambda calculus machine can inspect, like the QUOTE operator in Lisp.
This is not at all my specialty, but might the problem go away if instead of directly passing in the next term into your lambda calculus machine, you first quote it? By “quoting”, I mean converting it to a representation that the lambda calculus machine can inspect, like the QUOTE operator in Lisp.