From 4d2c096ec0ce9fee9701ad26af1ed66d1e552341 Mon Sep 17 00:00:00 2001 From: Florian Renkin Date: Sat, 3 Sep 2022 14:13:23 +0200 Subject: [PATCH] dot: fix 'g' with a Mealy machine * spot/twaalgos/dot.cc: here * tests/python/mealy.py: add test --- spot/twaalgos/dot.cc | 9 ++++++--- tests/python/mealy.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/spot/twaalgos/dot.cc b/spot/twaalgos/dot.cc index 70b707edc..19a638b9e 100644 --- a/spot/twaalgos/dot.cc +++ b/spot/twaalgos/dot.cc @@ -1084,9 +1084,12 @@ namespace spot { if (aut->acc().is_t()) opt_show_acc_ = false; - bdd out = *p; - opt_mealy_output_ = out; - opt_mealy_ = true; + if (opt_showlabel_) + { + bdd out = *p; + opt_mealy_output_ = out; + opt_mealy_ = true; + } } incomplete_ = aut->get_named_prop>("incomplete-states"); diff --git a/tests/python/mealy.py b/tests/python/mealy.py index 71c7739f9..7a884235e 100644 --- a/tests/python/mealy.py +++ b/tests/python/mealy.py @@ -611,3 +611,18 @@ State: 1 res = spot.reduce_mealy(aut, True) tc.assertEqual(res.to_str(), exp) + +exp = """digraph "" { + rankdir=LR + node [shape="circle"] + I [label="", style=invis, width=0] + I -> 0 + 0 [label="0"] + 0 -> 1 [label=""] + 0 -> 1 [label=""] + 0 -> 1 [label=""] + 1 [label="1"] + 1 -> 1 [label=""] +} +""" +tc.assertEqual(res.to_str("dot", "g"), exp)