lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMResolvingJavaMachine.java
private int nextStackFrame()
    {
        // if E > B
        // then newB <- E + STACK[E + 2] + 3
        // else newB <- B + STACK[B] + 7

        if (ep == bp)
        {
            return STACK_BASE;
        }
        else if (ep > bp)
        {
            return ep + data.get(ep + 2) + 3;
        }
        else
        {
            return bp + data.get(bp) + 8;
        }
    }
private int nextStackFrame()
    {
        // if E > B
        // then newB <- E + STACK[E + 2] + 3
        // else newB <- B + STACK[B] + 7

        if (ep == bp)
        {
            return STACK_BASE;
        }
        else if (ep > bp)
        {
            return ep + data.get(ep + 2) + 3;
        }
        else
        {
            return bp + data.get(bp) + 8;
        }
    }
Computes the start of the next stack frame. This depends on whether the most recent stack frame is an environment
frame or a choice point frame, as these have different sizes. The size of the most recent type of frame is
computed and added to the current frame pointer to give the start of the next frame.

@return The start of the next stack frame.