A PDDL 3.1 parser implementation in Rust based on nom.
See src/briefcase_world.rs
for an example.
Parser and domain/problem types can be used separately and will be completely decoupled through crate features in the future.
Documentation comments are assembled from the PDDL papers and nergmada/planning-wiki.
At this point the parser supports all domain and problem definition elements required to fully describe a PDDL 3.1 (and earlier) environment.
However, since types and enum variants are named closely to the underlying BNF descriptions (see below), they may be a bit unwieldy to use still.
Parsers were implemented based on the BNF elements listed in the paper:
"Complete BNF description of PDDL 3.1 (completely corrected)", Daniel L. Kovacs
See ELEMENTS.md for a graph of BNF elements.
Additional elements were added based on the individual specification papers.
<domain>
](src/parsers/domain.rs)<require-def>
](src/parsers/predicates_def.rs)<require-key>
](src/parsers/requirements.rs)<types-def>
](src/parsers/types_def.rs)<constants-def>
](src/parsers/constants_def.rs)<predicates-def>
](src/parsers/predicates_def.rs)<atomic formula skeleton>
](src/parsers/atomicformulaskeleton.rs)<predicate>
](src/parsers/predicate.rs)<variable>
](src/parsers/variable.rs)<atomic function skeleton>
](src/parsers/atomicformulaskeleton.rs)<function-symbol>
](src/parsers/function_symbol.rs)<functions-def>
](src/parsers/functions_def.rs)<function typed list (x)>
](src/parsers/functiontypedlist.rs)<function type>
](src/parsers/function_type.rs)<constraints>
](src/parsers/domainconstraintsdef.rs)<structure-def>
](src/parsers/structure_def.rs)<typed list (x)>
](src/parsers/typed_list.rs)<primitive-type>
](src/parsers/primitive_type.rs)<type>
](src/parsers/type.rs)<emptyOr (x)>
](src/parsers/empty_or.rs)<action-def>
](src/parsers/action_def.rs)<action-symbol>
](src/parsers/action_symbol.rs)<action-def body>
](src/parsers/action_def.rs)<pre-GD>
](src/parsers/pre_gd.rs)<pref-GD>
](src/parsers/pref_gd.rs)<pref-name>
](src/parsers/pref_name.rs)<GD>
](src/parsers/gd.rs)<f-comp>
](src/parsers/f_comp.rs)<literal(t)>
](src/parsers/literal.rs)<atomic formula(t)>
](src/parsers/atomic_formula.rs)<term>
](src/parsers/term.rs)<function-term>
](src/parsers/function_term.rs)<f-exp>
](src/parsers/f_exp.rs)<f-head>
](src/parsers/f_head.rs)<binary-op>
](src/parsers/binary_op.rs)<multi-op>
](src/parsers/multi_op.rs)<binary-comp>
](src/parsers/binary_comp.rs)<name>
](src/parsers/name.rs)<letter>
](src/parsers/name.rs)<any char>
](src/parsers/name.rs)<number>
](src/parsers/number.rs)<digit>
](src/parsers/number.rs)<decimal>
](src/parsers/number.rs)<effect>
](src/parsers/effect.rs)<c-effect>
](src/parsers/c_effect.rs)<p-effect>
](src/parsers/p_effect.rs)<cond-effect>
](src/parsers/cond_effect.rs)<assign-op>
](src/parsers/assign_op.rs)<durative-action-def>
](src/parsers/da_def.rs)<da-symbol>
](src/parsers/da_symbol.rs)<da-def body>
](src/parsers/da_def.rs)<da-GD>
](src/parsers/da_gd.rs)<pref-timed-GD>
](src/parsers/preftimedgd.rs)<timed-GD>
](src/parsers/timed_gd.rs)<time-specifier>
](src/parsers/time_specifier.rs)<interval>
](src/parsers/interval.rs)<duration-constraint>
](src/parsers/duration_constraint.rs)<simple-duration-constraint>
](src/parsers/simpledurationconstraint.rs)<d-op>
](src/parsers/d_op.rs)<d-value>
](src/parsers/d_value.rs)<da-effect>
](src/parsers/da_effect.rs)<timed-effect>
](src/parsers/timed_effect.rs)<f-assign-da>
](src/parsers/fassignda.rs)<f-exp-da>
](src/parsers/fexpda.rs)<assign-op-t>
](src/parsers/assignopt.rs)<f-exp-t>
](src/parsers/fexpt.rs)<derived-def>
](src/parsers/derived_predicate.rs)Additional elements:
<extension-def>
](src/parsers/domain.rs)<domain-vars-def>
<timeless-def>
](src/parsers/timeless_def.rs)<problem>
](src/parsers/problem.rs)<object declaration>
](src/parsers/objects_def.rs)<init>
](src/parsers/init_def.rs)<init-el>
](src/parsers/init_el.rs)<basic-function-term>
](src/parsers/basicfunctionterm.rs)<goal>
](src/parsers/goal_def.rs)<constraints>
](src/parsers/problemconstraintsdef.rs)<pref-con-GD>
](src/parsers/prefcongd.rs)<con-GD>
~~](src/parsers/con_gd.rs) (uses embedded modal operators below)<metric-spec>
](src/parsers/metric_spec.rs)<optimization>
](src/parsers/optimization.rs)<metric-f-exp>
](src/parsers/metricfexp.rs)<length-spec>
](src/parsers/length_spec.rs)Using embedded modal operators:
<con-GD>
](src/parsers/con_gd.rs)<con2-GD>
](src/parsers/con_gd.rs)The following requirements can be parsed. Note that all requirement specific features are parsed unconditionally. A planner needs to ensure that it accepts or rejects a plan accordingly based on the stated domain requirements.
:strips
](src/parsers/requirements.rs):typing
](src/parsers/requirements.rs):negative-preconditions
](src/parsers/requirements.rs):disjunctive-preconditions
](src/parsers/requirements.rs):equality
](src/parsers/requirements.rs):existential-preconditions
](src/parsers/requirements.rs):universal-preconditions
](src/parsers/requirements.rs):quantified-preconditions
](src/parsers/requirements.rs):conditional-effects
](src/parsers/requirements.rs):fluents
](src/parsers/requirements.rs):numeric-fluents
](src/parsers/requirements.rs):adl
](src/parsers/requirements.rs):durative-actions
](src/parsers/requirements.rs):duration-inequalities
](src/parsers/requirements.rs):continuous-effects
](src/parsers/requirements.rs):derived-predicates
](src/parsers/requirements.rs):timed-initial-literals
](src/parsers/requirements.rs):preferences
](src/parsers/requirements.rs):constraints
](src/parsers/requirements.rs):action-costs
](src/parsers/requirements.rs)