contains: generalize second argument to a twa

This was triggered by a question from Pierre Ganty on the mailing
list.

* spot/twaalgos/contains.hh, spot/twaalgos/contains.cc (contains):
Generalize second argument to const_twa_ptr instead of
const_twa_graph_ptr.
* NEWS: Mention this.
* tests/python/ltsmin-pml.ipynb: Show that it work.
* THANKS: Mention Pierre.
This commit is contained in:
Alexandre Duret-Lutz 2022-06-22 23:43:07 +02:00
parent be28365db4
commit 288b1c7958
5 changed files with 56 additions and 18 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2018, 2019 Laboratoire de Recherche et Développement de
// Copyright (C) 2018, 2019, 2022 Laboratoire de Recherche et Développement de
// l'Epita.
//
// This file is part of Spot, a model checking library.
@ -34,7 +34,7 @@ namespace spot
}
}
bool contains(const_twa_graph_ptr left, const_twa_graph_ptr right)
bool contains(const_twa_graph_ptr left, const_twa_ptr right)
{
return !complement(left)->intersects(right);
}
@ -44,7 +44,7 @@ namespace spot
return contains(left, translate(right, left->get_dict()));
}
bool contains(formula left, const_twa_graph_ptr right)
bool contains(formula left, const_twa_ptr right)
{
return !translate(formula::Not(left), right->get_dict())->intersects(right);
}

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2018 Laboratoire de Recherche et Développement de
// Copyright (C) 2018, 2022 Laboratoire de Recherche et Développement de
// l'Epita.
//
// This file is part of Spot, a model checking library.
@ -38,10 +38,15 @@ namespace spot
/// associated to the complement of \a left. It helps if \a left
/// is a deterministic automaton or a formula (because in both cases
/// complementation is easier).
///
/// Complementation is only supported on twa_graph automata, so that
/// is the reason \a left must be a twa_graph. Right will be
/// explored on-the-fly if it is not a twa_graph.
///
/// @{
SPOT_API bool contains(const_twa_graph_ptr left, const_twa_graph_ptr right);
SPOT_API bool contains(const_twa_graph_ptr left, const_twa_ptr right);
SPOT_API bool contains(const_twa_graph_ptr left, formula right);
SPOT_API bool contains(formula left, const_twa_graph_ptr right);
SPOT_API bool contains(formula left, const_twa_ptr right);
SPOT_API bool contains(formula left, formula right);
/// @}