A contextualiser is able to take in one format, and enhance it in some way.
The PDDL Contextualiser is able to give additional context to domains and problems, such as decorating correct types across all subnodes based on parameters. In details, the PDL contextualiser does the following:
- Decorate all constants in a ProblemDecl with types.
- Inserts the
=predicate (hidden, but needed for the analyser). - Decorates all content of ActionDecl, DurativeActionDecl and AxiomDecl so that subnodes matches the declared parameter types of the action.
- Converts all derived predicates into a DerivedPredicateExp.
- Decorates all predicates in the ProblemDecl with object types
- Decorates all subnodes of the GoalDecl in the ProblemDecl with types.
To contextualise a domain/problem:
IErrorListener listener = new ErrorListener();
IParser<INode> parser = new PDDLParser(listener);
PDDLDecl decl = new PDDLDecl(
parser.ParseAs<DomainDecl>(new FileInfo("domain.pddl")),
parser.ParseAs<ProblemDecl>(new FileInfo("problem.pddl"))
)
contextualiser.Contexturalise(decl);