Skip to content

Commit

Permalink
PDDL Parser: more explicit error when facing empty expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Paleologue committed Jul 20, 2021
1 parent bdfedac commit cffea5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ after the corresponding tracker issues.

## Changes since the last release

- Better error messages for empty preconditions.
<http://issues.fast-downward.org/issue1030>

- Add debugging methods to LP solver interface.
<http://issues.fast-downward.org/issue960>
You can now assign names to LP variables and constraints for easier
Expand Down
2 changes: 2 additions & 0 deletions src/translate/pddl_parser/parsing_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def parse_condition(alist, type_dict, predicate_dict):

def parse_condition_aux(alist, negated, type_dict, predicate_dict):
"""Parse a PDDL condition. The condition is translated into NNF on the fly."""
if not alist:
raise RuntimeError("Empty condition expression")
tag = alist[0]
if tag in ("and", "or", "not", "imply"):
args = alist[1:]
Expand Down

0 comments on commit cffea5c

Please sign in to comment.