ltlcross: adjust to work with generic acceptance
* src/bin/ltlcross.cc: Remove Fin-acceptance before doing checks. More --verbose output. * src/tgba/acc.cc, src/tgba/acc.hh: Add an eval_sets() function to find the set of acceptance sets needed to satisfy the condition in an accepting SCC. * src/tgbaalgos/gtec/ce.cc: Use eval_sets() when computing a counter example. * src/tgbaalgos/gtec/gtec.cc: Raise an exception when called on an acceptance that contains Fin. * src/tgbatest/ltl2dstar3.test, src/tgbatest/ltlcrossce2.test: New files. * src/tgbatest/Makefile.am: Add them. * src/tgba/tgba.cc (is_empty): Call remove_fin if needed. * src/tgbaalgos/product.cc, src/tgbaalgos/dtgbacomp.cc: Adjust to work with generic acceptance.
This commit is contained in:
parent
9ccbc34964
commit
717c857794
11 changed files with 293 additions and 17 deletions
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include "dtgbacomp.hh"
|
||||
#include "sccinfo.hh"
|
||||
#include "complete.hh"
|
||||
#include "cleanacc.hh"
|
||||
|
||||
namespace spot
|
||||
{
|
||||
|
|
@ -160,9 +162,22 @@ namespace spot
|
|||
|
||||
tgba_digraph_ptr dtgba_complement(const const_tgba_digraph_ptr& aut)
|
||||
{
|
||||
if (aut->is_inherently_weak())
|
||||
return dtgba_complement_weak(aut);
|
||||
if (aut->acc().is_generalized_buchi())
|
||||
{
|
||||
if (aut->is_inherently_weak())
|
||||
return dtgba_complement_weak(aut);
|
||||
else
|
||||
return dtgba_complement_nonweak(aut);
|
||||
}
|
||||
else
|
||||
return dtgba_complement_nonweak(aut);
|
||||
{
|
||||
// Simply complete the automaton, and complement its
|
||||
// acceptance.
|
||||
auto res = tgba_complete(aut);
|
||||
cleanup_acceptance(res);
|
||||
res->set_acceptance(res->acc().num_sets(),
|
||||
res->get_acceptance().complement());
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2010, 2011, 2013, 2014 Laboratoire de Recherche et
|
||||
// Copyright (C) 2010, 2011, 2013, 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
|
|
@ -149,7 +149,8 @@ namespace spot
|
|||
void
|
||||
couvreur99_check_result::accepting_cycle()
|
||||
{
|
||||
acc_cond::mark_t acc_to_traverse = ecs_->aut->acc().all_sets();
|
||||
acc_cond::mark_t acc_to_traverse =
|
||||
ecs_->aut->acc().accepting_sets(ecs_->root.top().condition);
|
||||
// Compute an accepting cycle using successive BFS that are
|
||||
// restarted from the point reached after we have discovered a
|
||||
// transition with a new acceptance conditions.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2011, 2014 Laboratoire de Recherche et
|
||||
// Copyright (C) 2008, 2011, 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
|
||||
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
|
|
@ -131,6 +131,15 @@ namespace spot
|
|||
emptiness_check_result_ptr
|
||||
couvreur99_check::check()
|
||||
{
|
||||
{
|
||||
auto acc = ecs_->aut->acc();
|
||||
if (acc.get_acceptance().is_false())
|
||||
return nullptr;
|
||||
if (acc.uses_fin_acceptance())
|
||||
throw std::runtime_error
|
||||
("Fin acceptance is not supported by couvreur99()");
|
||||
}
|
||||
|
||||
// We use five main data in this algorithm:
|
||||
// * couvreur99_check::root, a stack of strongly connected components (SCC),
|
||||
// * couvreur99_check::h, a hash of all visited nodes, with their order,
|
||||
|
|
@ -384,6 +393,14 @@ namespace spot
|
|||
emptiness_check_result_ptr
|
||||
couvreur99_check_shy::check()
|
||||
{
|
||||
{
|
||||
auto acc = ecs_->aut->acc();
|
||||
if (acc.get_acceptance().is_false())
|
||||
return nullptr;
|
||||
if (acc.uses_fin_acceptance())
|
||||
throw std::runtime_error
|
||||
("Fin acceptance is not supported by couvreur99()");
|
||||
}
|
||||
// Position in the loop seeking known successors.
|
||||
pos = todo.back().q.begin();
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,11 @@ namespace spot
|
|||
return p.first->second;
|
||||
};
|
||||
|
||||
new_state(left_state, right_state);
|
||||
res->set_init_state(new_state(left_state, right_state));
|
||||
if (right_acc.is_false())
|
||||
// Do not bother doing any work if the resulting acceptance is
|
||||
// false.
|
||||
return res;
|
||||
while (!todo.empty())
|
||||
{
|
||||
auto top = todo.front();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue