AI-Planning / pddl

Unquestionable PDDL 3.1 parser
https://ai-planning.github.io/pddl/
MIT License
85 stars 27 forks source link

Constant/Variable types are not checked against the Domain's available types #77

Closed marcofavorito closed 1 year ago

marcofavorito commented 1 year ago

Subject of the issue

Constants' and variables' types are not checked against domain's available types.

Your environment

Steps to reproduce

Run the following code:

from pddl.parser.domain import DomainParser
domain_str = """
    (define (domain test)
        (:requirements :typing)
        (:types t1)
        (:constants c1 - non_existing_type)
        (:predicates  (p1 ?v1 - non_existing_type))
        (:action a1
        :parameters (?v - non_existing_type)
        :effect (c1))
)"""
domain = DomainParser()(domain_str)

Expected behaviour

A validation error should be raised that says non_existing_type is not available in the current domain.

Actual behaviour

Nothing happens; the domain is parsed correctly.