Commit f5b261d8 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

remfin: call remove_alternation if needed

* spot/twaalgos/remfin.cc: Here.
* tests/core/alternating.test: Add a test case.
parent 071d819c
......@@ -24,6 +24,7 @@
#include <spot/twaalgos/totgba.hh>
#include <spot/twaalgos/isdet.hh>
#include <spot/twaalgos/mask.hh>
#include <spot/twaalgos/alternation.hh>
//#define TRACE
#ifdef TRACE
......@@ -494,6 +495,9 @@ namespace spot
if (aut->prop_weak().is_true())
return remove_fin_weak(aut);
if (aut->is_alternating())
return remove_fin(remove_alternation(aut));
if (auto maybe = streett_to_generalized_buchi_maybe(aut))
return maybe;
......
......@@ -157,3 +157,48 @@ State: 2 "t"
EOF
test 3 = `autfilt --stats=%s out.hoa`
test 2 = `autfilt --tgba --stats=%s out.hoa`
# If we have a weak input, remove-fin can just transform co-Büchi into
# Büchi.
autfilt --remove-fin out.hoa >res
cat >expected <<EOF
HOA: v1
States: 3
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels state-acc complete
properties: very-weak
--BODY--
State: 0 {0}
[t] 1&0
State: 1
[0] 2
[t] 1
State: 2 {0}
[t] 2
--END--
EOF
diff expected res
# If we do not know that the input is weak, remove-fin will call
# remove_alternation().
autfilt --remove-fin --trust-hoa=no out.hoa >res
cat >expected <<EOF
HOA: v1
States: 2
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc complete
--BODY--
State: 0
[t] 1 {0}
State: 1
[t] 1
[0] 1 {0}
--END--
EOF
diff expected res
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment