Translators are capable of taking in one format, and transform it into another.
There are two grounders in PDDLSharp available. One for IParametized (e.g. ActionDecl, ForAllExp, ExistsExp, etc.) nodes, one for PredicateExp nodes and one for ActionDecl nodes. The grounders will take in the lifted version of the node, and generate grounded copies of them. The two grounders principally works the same:
- Generate Parameter Permutations (i.e. all possible combination of objects for the node)
- Foreach parameter permutation, make a copy of the original node and insert the new parameters into it. The grounders need for there to either be objects declared in the problem, or constants in the domain (or both) The IParametized grounder also take into account if the permutation does not violate the actions static predicates.
Example of the predicate grounder:
PDDLDecl decl = new PDDLDecl(...)
IGrounder<PredicateExp> grounder = new PredicateGrounder(decl);
PredicateExp predicate = new PredicateExp(...);
List<PredicateExp> groundedPredicates = grounder.Ground(predicate);Example of the IParametized grounder with ForAllExp input:
PDDLDecl decl = new PDDLDecl(...)
IGrounder<IParametized> grounder = new ParametizedGrounder(decl);
ForAllExp exp = new ForAllExp (...);
List<IParametized> groundedForAllExps = grounder.Ground(exp);