dot: replace large labels by "(label too long)"
Based on a report by Victor Khomenko. * spot/twaalgos/dot.cc: Here. * tests/core/readsave.test: Add test case. * NEWS: Mention it.
This commit is contained in:
parent
09d9e0c52a
commit
11e8f9592f
3 changed files with 20 additions and 2 deletions
7
NEWS
7
NEWS
|
|
@ -1,6 +1,11 @@
|
||||||
New in spot 2.7.4.dev (not yet released)
|
New in spot 2.7.4.dev (not yet released)
|
||||||
|
|
||||||
Nothing yet.
|
Library:
|
||||||
|
|
||||||
|
- print_dot will replace labels that have more 2048 characters by a
|
||||||
|
"(label too long)" string. This works around a limitation of
|
||||||
|
GraphViz that aborts when some label exceeds 16k characters, and
|
||||||
|
also helps making large automata more readable.
|
||||||
|
|
||||||
New in spot 2.7.4 (2019-04-27)
|
New in spot 2.7.4 (2019-04-27)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -440,7 +440,15 @@ namespace spot
|
||||||
print_sclatex_psl(os << '$', f) << '$';
|
print_sclatex_psl(os << '$', f) << '$';
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
return escape_for_output(os, str_psl(f));
|
// GraphViz (2.40.1) has a strict limit of 16k for label
|
||||||
|
// length. The limit we use below is more conservative,
|
||||||
|
// because (1) escaping the html element in the string
|
||||||
|
// (e.g., "&" -> "&") can increase it a lot, and (2)
|
||||||
|
// a label of size 2048 is already unreasonable to display.
|
||||||
|
std::string s = str_psl(f);
|
||||||
|
if (s.size() > 2048)
|
||||||
|
s = "(label too long)";
|
||||||
|
return escape_for_output(os, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
|
|
|
||||||
|
|
@ -1085,3 +1085,8 @@ digraph "a U b" {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
diff out expected
|
diff out expected
|
||||||
|
|
||||||
|
f="{{!a;!b}:{{c <-> d} && {e xor f} && {m | {l && {k | {j <-> {i xor {g && h}"
|
||||||
|
f="$f}}}}} && {{n && o} | {!n && p}} && {q -> {r <-> s}}}:{[*0..1];t}}[]-> u"
|
||||||
|
ltl2tgba -f "$f" --dot=bar > out.dot
|
||||||
|
grep 'label too long' out.dot
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue