Add support for unambiguous automata
* src/twaalgos/ltl2tgba_fm.hh, src/twaalgos/ltl2tgba_fm.cc: Implement generation of unambiguous automata. * src/tests/ltl2tgba.cc: Add option -fu to test it. * src/bin/common_post.cc: Adjust the group of options so we can easily add more from ltl2tgba.cc. * src/bin/ltl2tgba.cc: Add support for -U and --unambigous. * src/twaalgos/translate.cc, src/twaalgos/translate.hh: Add support for Unambiguous. * src/tests/ltlcross.test, src/tests/ltlcross2.test: Test both bin/ltl2tgba and tgbatest/ltl2tgba. * NEWS: Mention the change.
This commit is contained in:
parent
f55211336e
commit
9f3a7a49de
10 changed files with 154 additions and 23 deletions
|
|
@ -28,6 +28,7 @@ namespace spot
|
|||
void translator::setup_opt(const option_map* opt)
|
||||
{
|
||||
comp_susp_ = early_susp_ = skel_wdba_ = skel_simul_ = 0;
|
||||
unambiguous_ = false;
|
||||
|
||||
if (!opt)
|
||||
return;
|
||||
|
|
@ -63,6 +64,21 @@ namespace spot
|
|||
|
||||
twa_graph_ptr translator::run(const ltl::formula** f)
|
||||
{
|
||||
if (unambiguous_)
|
||||
{
|
||||
if (type_ == postprocessor::Monitor)
|
||||
{
|
||||
// Deterministic monitor are unambiguous, so the
|
||||
// unambiguous option is not really relevant for monitors.
|
||||
unambiguous_ = false;
|
||||
set_pref(postprocessor::Deterministic);
|
||||
}
|
||||
else if (pref_ == postprocessor::Deterministic)
|
||||
{
|
||||
unambiguous_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
const ltl::formula* r = simpl_->simplify(*f);
|
||||
(*f)->destroy();
|
||||
*f = r;
|
||||
|
|
@ -74,9 +90,10 @@ namespace spot
|
|||
twa_graph_ptr aut;
|
||||
if (comp_susp_ > 0)
|
||||
{
|
||||
// FIXME: Handle unambiguous_ automata?
|
||||
int skel_wdba = skel_wdba_;
|
||||
if (skel_wdba < 0)
|
||||
skel_wdba = (pref_ == spot::postprocessor::Deterministic) ? 1 : 2;
|
||||
skel_wdba = (pref_ == postprocessor::Deterministic) ? 1 : 2;
|
||||
|
||||
aut = compsusp(r, simpl_->get_dict(), skel_wdba == 0,
|
||||
skel_simul_ == 0, early_susp_ != 0,
|
||||
|
|
@ -84,8 +101,9 @@ namespace spot
|
|||
}
|
||||
else
|
||||
{
|
||||
bool exprop = level_ == spot::postprocessor::High;
|
||||
aut = ltl_to_tgba_fm(r, simpl_->get_dict(), exprop);
|
||||
bool exprop = unambiguous_ || level_ == postprocessor::High;
|
||||
aut = ltl_to_tgba_fm(r, simpl_->get_dict(), exprop,
|
||||
true, false, false, 0, 0, unambiguous_);
|
||||
}
|
||||
aut = this->postprocessor::run(aut, r);
|
||||
return aut;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue