forq: make it easier to select contains's version
* spot/twaalgos/contains.hh, spot/twaalgos/contains.cc (containment_select_version): New function. (contains): Use it. * spot/twa/twa.cc (exclusive_word): Likewise. * bin/autfilt.cc (--included-in): Adjust to use forq depending on containement_select_version. * bin/man/spot-x.x: Adjust documentation of CONTAINMENT_SELECT_VERSION. * tests/core/included.test, tests/python/forq_contains.py: Add more tests. * NEWS: Mention the new feature.
This commit is contained in:
parent
ca4e6c4b48
commit
05d7622f8f
8 changed files with 178 additions and 83 deletions
|
|
@ -45,6 +45,7 @@
|
|||
#include <spot/misc/timer.hh>
|
||||
#include <spot/parseaut/public.hh>
|
||||
#include <spot/tl/exclusive.hh>
|
||||
#include <spot/twaalgos/alternation.hh>
|
||||
#include <spot/twaalgos/are_isomorphic.hh>
|
||||
#include <spot/twaalgos/canonicalize.hh>
|
||||
#include <spot/twaalgos/cobuchi.hh>
|
||||
|
|
@ -984,12 +985,24 @@ parse_opt(int key, char* arg, struct argp_state*)
|
|||
break;
|
||||
case OPT_INCLUDED_IN:
|
||||
{
|
||||
auto aut = ensure_deterministic(read_automaton(arg, opt->dict), true);
|
||||
aut = spot::dualize(aut);
|
||||
if (!opt->included_in)
|
||||
opt->included_in = aut;
|
||||
auto aut = read_automaton(arg, opt->dict);
|
||||
if (spot::containment_select_version() == 0)
|
||||
{
|
||||
aut = spot::complement(aut);
|
||||
if (!aut->is_existential())
|
||||
aut = spot::remove_alternation(aut);
|
||||
if (!opt->included_in)
|
||||
opt->included_in = aut;
|
||||
else
|
||||
opt->included_in = ::product_or(opt->included_in, aut);
|
||||
}
|
||||
else
|
||||
opt->included_in = ::product_or(opt->included_in, aut);
|
||||
{
|
||||
if (opt->included_in)
|
||||
error(2, 0, "FORQ-based inclusion check only works "
|
||||
"with one inclusion-test at a time");
|
||||
opt->included_in = aut;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OPT_INHERENTLY_WEAK_SCCS:
|
||||
|
|
@ -1519,7 +1532,12 @@ namespace
|
|||
if (opt->intersect)
|
||||
matched &= aut->intersects(opt->intersect);
|
||||
if (opt->included_in)
|
||||
matched &= !aut->intersects(opt->included_in);
|
||||
{
|
||||
if (spot::containment_select_version() == 0)
|
||||
matched &= !aut->intersects(opt->included_in);
|
||||
else
|
||||
matched &= spot::contains(opt->included_in, aut);
|
||||
}
|
||||
if (opt->equivalent_pos)
|
||||
matched &= !aut->intersects(opt->equivalent_neg)
|
||||
&& spot::contains(aut, opt->equivalent_pos);
|
||||
|
|
|
|||
|
|
@ -51,12 +51,13 @@ If this variable is set to any value, statistics about BDD garbage
|
|||
collection and resizing will be output on standard error.
|
||||
|
||||
.TP
|
||||
\fSPOT_CONTAINMENT_CHECK\fR
|
||||
Specifies which inclusion algorithm spot should use. This can currently
|
||||
take on 1 of 2 values: 0 for the legacy implementation, and 1 for the
|
||||
forq implementation [6] (See bibliography below). Forq uses buchi
|
||||
automata in order to determine inclusion, and will default to the legacy
|
||||
version if these constraints are not satisfied.
|
||||
\fBSPOT_CONTAINMENT_CHECK\fR
|
||||
Specifies which inclusion algorithm Spot should use. If the variable
|
||||
is unset, or set to \fB"default"\fR, containment checks are done
|
||||
using a complementation-based procedure. If the variable is set to
|
||||
\fB"forq"\fR, and FORQ-based containment check is used for Büchi automata
|
||||
(the default procedure is still used for non-Büchi automata). See
|
||||
[6] in the bibliography below.
|
||||
|
||||
.TP
|
||||
\fBSPOT_DEFAULT_FORMAT\fR
|
||||
|
|
@ -335,24 +336,12 @@ disabled with \fB-x gf-guarantee=0\fR.
|
|||
|
||||
.TP
|
||||
6.
|
||||
Doveri, Kyveli and Ganty, Pierre and Mazzocchi, Nicolas:
|
||||
Kyveli Doveri and Pierre Ganty and Nicolas Mazzocchi:
|
||||
FORQ-Based Language Inclusion Formal Testing.
|
||||
Proceedings of CAV'22. LNCS 13372.
|
||||
|
||||
We propose a novel algorithm to decide the language inclusion between
|
||||
(nondeterministic) Büchi automata, a PSpace-complete problem. Our approach,
|
||||
like others before, leverage a notion of quasiorder to prune the search for a
|
||||
counterexample by discarding candidates which are subsumed by others for the
|
||||
quasiorder.Discarded candidates are guaranteed to not compromise the
|
||||
completeness of the algorithm. The novelty of our work lies in the quasiorder k
|
||||
used to discard candidates. We introduce FORQs (family of right quasiorders)
|
||||
that we obtain by adapting the notion of family of right congruences put forward
|
||||
by Maler and Staiger in 1993. We define a FORQ-based inclusion algorithm which
|
||||
we prove correct and instantiate it for a specific FORQ, called the structural
|
||||
FORQ, induced by the B\"uchi automaton to the right of the inclusion sign. The
|
||||
resulting implementation, called Forklift, scales up better than the
|
||||
state-of-the-art on a variety of benchmarks including benchmarks from program
|
||||
verification and theorem proving for word combinatorics.
|
||||
The containment check implemented as spot::contains_forq(), and
|
||||
used for Büchi automata when \fBSPOT_CONTAINMENT_CHECK=forq\fR.
|
||||
|
||||
[SEE ALSO]
|
||||
.BR ltl2tgba (1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue