Preliminirary support for generic acceptance.
* src/tgba/acc.hh: Add creation and printing of generic acceptance code. * src/tgba/acc.cc: New file. * src/tgba/Makefile.am: Add it. * src/tgbatest/acc.cc: More tests. * src/tgbatest/acc.test: Update. * src/tgba/tgba.hh (set_acceptance, get_acceptance): New methods. * src/tgba/tgbagraph.hh: Store acceptance code. * src/hoaparse/hoaparse.yy: Read any acceptance. * src/dstarparse/nsa2tgba.cc, src/ta/taexplicit.cc, src/tgba/tgbaproduct.cc, src/tgba/tgbasafracomplement.cc, src/tgbaalgos/degen.cc, src/tgbaalgos/hoa.cc, src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/product.cc, src/tgbaalgos/stutter.cc, src/tgbatest/hoaparse.test: Adjust.
This commit is contained in:
parent
c61f053e2d
commit
fd1f6c4d61
19 changed files with 778 additions and 176 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
|
||||
// Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita.
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -128,13 +128,12 @@ namespace spot
|
|||
|
||||
public:
|
||||
unsigned
|
||||
next_level(const acc_cond& acc, int slevel,
|
||||
acc_cond::mark_t set, bool skip_levels)
|
||||
next_level(int slevel, acc_cond::mark_t set, bool skip_levels)
|
||||
{
|
||||
// Update the order with any new set we discover
|
||||
if (auto newsets = set - found_)
|
||||
{
|
||||
acc.fill_from(newsets, std::back_inserter(order_));
|
||||
newsets.fill(std::back_inserter(order_));
|
||||
found_ |= newsets;
|
||||
}
|
||||
|
||||
|
|
@ -161,20 +160,19 @@ namespace spot
|
|||
// Accepting order for each SCC
|
||||
class scc_orders
|
||||
{
|
||||
const acc_cond& acc_;
|
||||
std::map<int, acc_order> orders_;
|
||||
bool skip_levels_;
|
||||
|
||||
public:
|
||||
scc_orders(const acc_cond& acc, bool skip_levels):
|
||||
acc_(acc), skip_levels_(skip_levels)
|
||||
scc_orders(bool skip_levels):
|
||||
skip_levels_(skip_levels)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned
|
||||
next_level(int scc, int slevel, acc_cond::mark_t set)
|
||||
{
|
||||
return orders_[scc].next_level(acc_, slevel, set, skip_levels_);
|
||||
return orders_[scc].next_level(slevel, set, skip_levels_);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -226,7 +224,7 @@ namespace spot
|
|||
}
|
||||
|
||||
// Initialize scc_orders
|
||||
scc_orders orders(a->acc(), skip_levels);
|
||||
scc_orders orders(skip_levels);
|
||||
|
||||
// and vice-versa.
|
||||
ds2num_map ds2num;
|
||||
|
|
|
|||
|
|
@ -252,25 +252,18 @@ namespace spot
|
|||
}
|
||||
os << nl;
|
||||
unsigned num_acc = aut->acc().num_sets();
|
||||
if (num_acc == 0)
|
||||
os << "acc-name: all";
|
||||
else if (num_acc == 1)
|
||||
os << "acc-name: Buchi";
|
||||
else
|
||||
os << "acc-name: generalized-Buchi " << num_acc;
|
||||
os << nl;
|
||||
os << "Acceptance: " << num_acc;
|
||||
if (num_acc > 0)
|
||||
if (aut->acc().is_generalized_buchi())
|
||||
{
|
||||
os << " Inf(0";
|
||||
for (unsigned i = 1; i < num_acc; ++i)
|
||||
os << ")&Inf(" << i;
|
||||
os << ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
os << " t";
|
||||
if (num_acc == 0)
|
||||
os << "acc-name: all";
|
||||
else if (num_acc == 1)
|
||||
os << "acc-name: Buchi";
|
||||
else
|
||||
os << "acc-name: generalized-Buchi " << num_acc;
|
||||
os << nl;
|
||||
}
|
||||
os << "Acceptance: " << num_acc << ' ';
|
||||
os << aut->acc().get_acceptance();
|
||||
os << nl;
|
||||
os << "properties: trans-labels explicit-labels";
|
||||
if (acceptance == Hoa_Acceptance_States)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2012, 2013, 2014 Laboratoire de Recherche
|
||||
// et Développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2009, 2010, 2012, 2013, 2014, 2015 Laboratoire de
|
||||
// Recherche et Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -423,6 +423,7 @@ namespace spot
|
|||
auto taa = v.result(); // Careful: before the destroy!
|
||||
f2->destroy();
|
||||
delete lcc;
|
||||
taa->acc().set_generalized_buchi();
|
||||
return taa;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2505,10 +2505,14 @@ namespace spot
|
|||
|
||||
dict->register_propositions(fc.used_vars(), a);
|
||||
|
||||
auto& acc = a->acc();
|
||||
|
||||
unsigned ns = a->num_states();
|
||||
for (unsigned s = 0; s < ns; ++s)
|
||||
for (auto& t: a->out(s))
|
||||
t.acc = a->acc().comp(t.acc);
|
||||
t.acc = acc.comp(t.acc);
|
||||
|
||||
acc.set_generalized_buchi();
|
||||
|
||||
if (!simplifier)
|
||||
// This should not be deleted before we have registered all propositions.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2014 Laboratoire de Recherche et
|
||||
// Copyright (C) 2014, 2015 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -52,8 +52,11 @@ namespace spot
|
|||
auto res = make_tgba_digraph(left->get_dict());
|
||||
res->copy_ap_of(left);
|
||||
res->copy_ap_of(right);
|
||||
res->set_acceptance_conditions(left->acc().num_sets()
|
||||
+ right->acc().num_sets());
|
||||
auto left_num = left->acc().num_sets();
|
||||
auto right_acc = right->get_acceptance();
|
||||
right_acc.shift_left(left_num);
|
||||
right_acc.append_and(left->get_acceptance());
|
||||
res->set_acceptance(left_num + right->acc().num_sets(), right_acc);
|
||||
|
||||
auto v = new product_states;
|
||||
res->set_named_prop("product-states", v);
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ namespace spot
|
|||
get_dict()->register_all_propositions_of(&a_, this);
|
||||
assert(acc_.num_sets() == 0);
|
||||
acc_.add_sets(a_->acc().num_sets());
|
||||
acc_.set_generalized_buchi();
|
||||
}
|
||||
|
||||
virtual ~tgbasl()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue