public void PushGoalStack(Symbol functor, object[] args, ushort parentFrame) { if (GoalStackDepth >= goalStack.Count) { goalStack.Add(new GoalStackFrame(functor, args, parentFrame)); goalStackCurrentRules.Add(null); } else { goalStack[GoalStackDepth] = new GoalStackFrame(functor, args, parentFrame); goalStackCurrentRules[GoalStackDepth] = null; } GoalStackDepth++; }