implement a FORQ-based inclusion check for SBAs

* spot/twaalgos/forq_contains.cc, spot/twaalgos/forq_contains.hh: New
files.
* spot/twaalgos/Makefile.am, python/spot/impl.i: Add them.
* tests/python/forq_contains.py: New file.
* tests/Makefile.am: Add it.
This commit is contained in:
Jonah Romero 2023-08-03 12:04:47 +02:00 committed by Alexandre Duret-Lutz
parent c2832cabfc
commit d1c5b2efdf
6 changed files with 1574 additions and 0 deletions

View file

@ -51,6 +51,7 @@ twaalgos_HEADERS = \
dualize.hh \
emptiness.hh \
emptiness_stats.hh \
forq_contains.hh \
game.hh \
genem.hh \
gfguarantee.hh \
@ -124,6 +125,7 @@ libtwaalgos_la_SOURCES = \
dtwasat.cc \
dualize.cc \
emptiness.cc \
forq_contains.cc \
genem.cc \
gfguarantee.cc \
gv04.cc \

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,51 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2023 Laboratoire de Recherche et Développement
// de l'Epita. IMDEA Software Institute.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <spot/twa/twagraph.hh>
#include <spot/twaalgos/word.hh>
namespace spot
{
/// \brief Returns a word accepted by \a left that is rejected by \a right,
/// or nullptr.
///
/// This implements the language containment algorithm from
/// \cite{doveriFORQBasedLanguageInclusion2022}
/// to check whether L(left)⊆L(right), in which case, it returns nullptr.
/// Otherwise, it returns a counterexample, i.e., a word that is accepted
/// by $L(left)\setminus L(right)$, hence the name of the function.
///
/// \pre Automata \a left and \a right should be
/// non-alternating state-based Büchi-automata.
SPOT_API twa_word_ptr difference_word_forq(
const_twa_graph_ptr left, spot::const_twa_graph_ptr right);
/// \brief Returns a boolean value indicating
/// whether \a left is included in the language of \a right.
///
/// This implements the language containment algorithm from
/// \cite{doveriFORQBasedLanguageInclusion2022}
/// to check whether L(left)⊆L(right).
///
/// \pre Automata \a left and \a right should be
/// non-alternating state-based Büchi-automata.
SPOT_API bool contains_forq(
const_twa_graph_ptr left, const_twa_graph_ptr right);
}