On this page:
3.1 State

3 Adding more variables

So far we have restricted our programs to have only one logic variable. However, with a little effort we can add support for multiple variables. We will now extend our implementation to support multiple variables

3.1 State

When we had only one variable, we could get away by having just the substitution as our state. But when we want multiple variables, this is not sufficient to track all the variables introduced in our programs. Therefore, we extend the state to hold information about introduced variables via a counter. Now our state is a pair where the car is a substitution and the cdr is a counter that counts the number of variables introduced so far.