acc: avoid superfluous parentheses when printing acceptance

* src/tgba/acc.cc: Do not output (Inf(x)) or (Fin(x)).
* src/tgbatest/acc.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-02-20 08:53:01 +01:00
parent 76c676dba0
commit f325cddc1c
2 changed files with 10 additions and 4 deletions

View file

@ -88,6 +88,9 @@ namespace spot
} }
else else
{ {
if (!top)
// Avoid extra parentheses if there is only one set
top = code[pos - 1].mark.count() == 1;
unsigned level = 0; unsigned level = 0;
const char* and_ = ""; const char* and_ = "";
if (!top) if (!top)
@ -118,6 +121,9 @@ namespace spot
} }
else else
{ {
if (!top)
// Avoid extra parentheses if there is only one set
top = code[pos - 1].mark.count() == 1;
unsigned level = 0; unsigned level = 0;
const char* or_ = ""; const char* or_ = "";
if (!top) if (!top)

View file

@ -60,10 +60,10 @@ stripping
#1: {4} #1: {4}
#1: {2} #1: {2}
2 Inf(0)&Inf(1)&Inf(3) 2 Inf(0)&Inf(1)&Inf(3)
5 (Fin(2)) | (Inf(0)&Inf(1)&Inf(3)) 5 Fin(2) | (Inf(0)&Inf(1)&Inf(3))
7 (Fin(0)) | (Fin(2)) | (Inf(0)&Inf(1)&Inf(3)) 7 Fin(0) | Fin(2) | (Inf(0)&Inf(1)&Inf(3))
7 (Fin(0)) | (Fin(2)) | (Inf(0)&Inf(1)&Inf(3)) 7 Fin(0) | Fin(2) | (Inf(0)&Inf(1)&Inf(3))
7 (Fin(0)) | (Fin(2)) | (Inf(0)&Inf(1)&Inf(3)) 7 Fin(0) | Fin(2) | (Inf(0)&Inf(1)&Inf(3))
2 f 2 f
EOF EOF