-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: check terms consistency wrt type tag
i.e. terms with the same name should have the same type tags.
- Loading branch information
1 parent
b8e0a2b
commit 3661f64
Showing
6 changed files
with
70 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# Copyright 2021-2023 WhiteMech | ||
# | ||
# ------------------------------ | ||
# | ||
# This file is part of pddl. | ||
# | ||
# Use of this source code is governed by an MIT-style | ||
# license that can be found in the LICENSE file or at | ||
# https://opensource.org/licenses/MIT. | ||
# | ||
|
||
"""Test pddl.logic.predicates module.""" | ||
import pytest | ||
|
||
from pddl.logic import Predicate | ||
from pddl.logic.terms import Variable | ||
|
||
|
||
def test_inconsistent_predicate_terms() -> None: | ||
"""Test that terms of a predicate must have consistent typing.""" | ||
with pytest.raises( | ||
ValueError, | ||
match=r"Term \?a has inconsistent type tags: previous type tags \['t1', 't2'\], new type tags " | ||
r"\['t3', 't4'\]", | ||
): | ||
a1, a2 = Variable("a", ["t1", "t2"]), Variable("a", ["t3", "t4"]) | ||
Predicate("p", a1, a2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters