forq: swap arguments of contains_forq

* spot/twaalgos/forq_contains.hh,
spot/twaalgos/forq_contains.cc (contains_forq): Swap arguments so
they follow the same order as contains().
* tests/python/forq_contains.py: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2023-09-07 16:01:46 +02:00
parent 3861c04581
commit ca4e6c4b48
3 changed files with 5 additions and 6 deletions

View file

@ -630,7 +630,7 @@ namespace spot
"acceptance conditions."); "acceptance conditions.");
if (lhs->get_dict() != rhs->get_dict()) if (lhs->get_dict() != rhs->get_dict())
throw std::runtime_error throw std::runtime_error
("The two input graphs must utilize the same twa_dict."); ("The two input automata must use the same twa_dict.");
if (lhs->ap() != rhs->ap()) if (lhs->ap() != rhs->ap())
throw std::runtime_error("The two input graphs must use the same set " throw std::runtime_error("The two input graphs must use the same set "
"of APs"); "of APs");
@ -648,7 +648,7 @@ namespace spot
bool contains_forq(forq::const_graph lhs, forq::const_graph rhs) bool contains_forq(forq::const_graph lhs, forq::const_graph rhs)
{ {
return !difference_word_forq(lhs, rhs); return !difference_word_forq(rhs, lhs);
} }
} }

View file

@ -41,10 +41,10 @@ namespace spot
/// \ingroup containment /// \ingroup containment
/// \brief Returns a boolean value indicating /// \brief Returns a boolean value indicating
/// whether \a left is included in the language of \a right. /// whether the language of \a left includes in the language of \a right.
/// ///
/// This implements a FORQ-based language containment algorithm /// This implements a FORQ-based language containment algorithm
/// to check whether L(left)L(right). \cite doveri.22.cav /// to check whether L(left)L(right). \cite doveri.22.cav
/// ///
/// \pre Automata \a left and \a right should be non-alternating /// \pre Automata \a left and \a right should be non-alternating
/// Büchi-automata. /// Büchi-automata.

View file

@ -23,7 +23,7 @@ from unittest import TestCase
tc = TestCase() tc = TestCase()
def do_test(subset, superset, expected=True): def do_test(subset, superset, expected=True):
result = spot.contains_forq(subset, superset) result = spot.contains_forq(superset, subset)
truth = spot.contains(superset, subset) truth = spot.contains(superset, subset)
tc.assertTrue(truth == expected) tc.assertTrue(truth == expected)
tc.assertTrue(result == truth) tc.assertTrue(result == truth)
@ -324,4 +324,3 @@ State: 11 {0}
--END--""") --END--""")
do_symmetric_test(subset, superset) do_symmetric_test(subset, superset)