private void DumpPrologStack(PrologContext context) { if (context.GoalStackDepth > 0) { for (ushort i = 0; i <= context.CurrentFrame; i++) { Structure g = context.GoalStackGoal(i); if (g != null) { ushort frame = i; while (frame != 0) { //Output.Write("{0}/", frame); Output.Write(" "); frame = context.GoalStackParent(frame); } //Output.Write(' '); //Output.Write("{0}<{1}: ", i, PrologContext.GoalStackParent(i)); Output.WriteLine(Term.ToStringInPrologFormat(g)); } } } else { Output.WriteLine("Goal stack is empty."); } }
private void DumpPrologStack(PrologContext context) { if (context.GoalStackDepth > 0) for (ushort i = 0; i <= context.CurrentFrame; i++) { Structure g = context.GoalStackGoal(i); if (g != null) { ushort frame = i; while (frame != 0) { //Output.Write("{0}/", frame); Output.Write(" "); frame = context.GoalStackParent(frame); } //Output.Write(' '); //Output.Write("{0}<{1}: ", i, PrologContext.GoalStackParent(i)); Output.WriteLine(Term.ToStringInPrologFormat(g)); } } else Output.WriteLine("Goal stack is empty."); }