From 073a6e819843878b15c7e34b5fc0015e0bb29595 Mon Sep 17 00:00:00 2001 From: Thomas Medioni Date: Thu, 30 Mar 2017 18:26:54 +0200 Subject: [PATCH] dtwa_complement: replace code with call to dualize * NEWS: Mention of this modification * spot/twaalgos/complement.cc: Replace dtwa_complement with a call to dualize --- NEWS | 2 ++ spot/twaalgos/complement.cc | 15 +++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index 538b84f7b..827a300df 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,8 @@ New in spot 2.3.2.dev (not yet released) - spot::dualize() implements the dual of any alternating automaton. + - spot::dtwa_complement now simply returns the result of dualize() + Bug fixes: - In "lenient" mode the parser would fail to recover from diff --git a/spot/twaalgos/complement.cc b/spot/twaalgos/complement.cc index 348b43406..2ac33d058 100644 --- a/spot/twaalgos/complement.cc +++ b/spot/twaalgos/complement.cc @@ -18,9 +18,9 @@ // along with this program. If not, see . #include +#include #include -#include -#include + namespace spot { @@ -31,15 +31,6 @@ namespace spot throw std::runtime_error("dtwa_complement() requires a deterministic input"); - // Simply complete the automaton, and complement its acceptance. - auto res = cleanup_acceptance_here(complete(aut)); - res->set_acceptance(res->num_sets(), res->get_acceptance().complement()); - // Complementing the acceptance is likely to break the terminal - // property, but not weakness. We make a useless call to - // prop_keep() just so we remember to update it in the future if a - // new argument is added. - res->prop_keep({true, true, true, true, true, true}); - res->prop_terminal(trival::maybe()); - return res; + return dualize(aut); } }