/// <summary> /// Builds PDDL term from the input data. /// </summary> /// <param name="term">Input data term.</param> /// <returns>Built term.</returns> public ITerm Build(InputData.PDDL.Term term) { Debug.Assert(TermStack.Count == 0); TermStack.Clear(); term.Accept(this); Debug.Assert(TermStack.Count == 1); return(TermStack.Pop()); }
/// <summary> /// Grounds the PDDL term. /// </summary> /// <param name="term">Input data term.</param> /// <param name="substitution">Variables substitution.</param> /// <param name="referenceState">Reference state.</param> /// <returns>Grounded term, i.e. constant name ID.</returns> public int Ground(IExpressionTerm term, ISubstitution substitution, State referenceState) { Debug.Assert(TermStack.Count == 0); TermStack.Clear(); Substitution = substitution; ReferenceState = referenceState; term.Accept(this); Substitution = null; ReferenceState = null; Debug.Assert(TermStack.Count == 1); return(TermStack.Pop()); }