AI-Planning / AI-Planning/pddl

Types validation is case sensitive

オープン
#95 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug high-priority
主要言語
Python
スター
177
フォーク
43
平均マージ
49分
マージ済み PR(30日)
1

説明

### Subject of the issue

When types are validated, if the same type is written with different cases (e.g., sometimes capitalized sometimes not), the parser throws an error.

The specific error happens at line 228 of `pddl/_validation.py` in the `_check_types_are_available` function.

```python
def _check_types_are_available(
self, type_tags: Collection[name_type], what: str
) -> None:
"""Check that the types are available in the domain."""
if not self._types.all_types.issuperset(type_tags):
raise PDDLValidationError(
f"types {sorted(type_tags)} of {what} are not in available types {self._types.all_types}"
)
```

### Steps to reproduce

Minimal example to reproduce the error:

PDDL domain:
```pddl
;Hello world domain to test numerical fluents (functions)
(define (domain hello-world-functions)
(:requirements :strips :typing :numeric-fluents)

(:types Counter - object)
(:functions
(hello_counter)
)

(:action say-hello-world
:parameters (?c - counter)
:precondition (and (<= (hello_counter) 3))
:effect (and (increase (hello_counter) 1))
)
)
```

PDDL problem:
```pddl
(define (problem hello-3-times)
(:domain hello-world-functions)
(:objects counter1 - counter)
(:init
(counter1)
; if this was undefined, some planners would not assumed `0`
(= (hello_counter) 0)
)

(:goal
(>= (hello_counter) 3)
)
)
```

### Actual behaviour
```python
raise VisitError(tree.data, tree, e)
lark.exceptions.VisitError: Error trying to process rule "domain":

types ['counter'] of term Variable(c) are not in available types {'Counter', 'object'}
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。