dbacomp: connect only back-links and generalize to tgba

* src/tgbaalgos/dbacomp.cc: Here.
* src/tgbaalgos/dbacomp.hh: Adjust documentation.
* src/tgbatest/dbacomp.test: New file.
* src/tgbatest/Makefile.am (TESTS): Add it.
* src/tgbatest/det.test: Update.
This commit is contained in:
Alexandre Duret-Lutz 2013-02-03 00:16:32 +01:00
parent 63b7cdb6c8
commit 78e76eb07d
5 changed files with 140 additions and 35 deletions

View file

@ -107,6 +107,7 @@ TESTS = \
lbttparse.test \
scc.test \
sccsimpl.test \
dbacomp.test \
obligation.test \
wdba.test \
wdba2.test \

46
src/tgbatest/dbacomp.test Executable file
View file

@ -0,0 +1,46 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
# Spot is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Spot is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. ./defs
# This automaton used to trigger a bug in the complementation: its
# intersection with the complement was not empty!
cat >input.tgba <<EOF
acc = "a" "b" "c";
"1", "1", "(a & d) | (a & b)", "b" "c";
"1", "2", "a & !d & !c & !b",;
"1", "1", "(d & !a) | (b & !a)", "a" "b" "c";
"1", "2", "!a & !d & !c & !b", "a";
"2", "1", "a & c & b", "b" "c";
"2", "3", "a & b & !c", "b";
"2", "2", "a & !c & !b",;
"2", "1", "c & b & !a", "a" "b" "c";
"2", "3", "b & !a & !c", "a" "b";
"2", "2", "!a & !c & !b", "a";
"3", "1", "(a & d & c) | (a & c & b)", "b" "c";
"3", "3", "(a & d & !c) | (a & b & !c)", "b";
"3", "2", "a & !d & !c & !b",;
"3", "1", "(d & c & !a) | (c & b & !a)", "a" "b" "c";
"3", "3", "(d & !a & !c) | (b & !a & !c)", "a" "b";
"3", "2", "!a & !d & !c & !b", "a";
EOF
# Check emptiness of product with complement.
run 0 ../ltl2tgba -Pinput.tgba -DC -E -C -X input.tgba

View file

@ -69,6 +69,7 @@ acc = "1";
"3", "1", "!a",;
EOF
# FIXME: we should improve this output
cat >ex.tgba <<'EOF'
acc = "1";
"1", "2", "a",;
@ -76,13 +77,35 @@ acc = "1";
"1", "-1", "!a",;
"2", "3", "a",;
"2", "1", "!a",;
"2", "-1", "!a",;
"-1", "-1", "!a", "1";
"3", "3", "a",;
"3", "-3", "a",;
"3", "1", "!a",;
"3", "-1", "!a",;
"-3", "-3", "a", "1";
"-3", "-1", "!a", "1";
EOF
run 0 ../ltl2tgba -b -DC -X in.tgba > out.tgba
cmp out.tgba ex.tgba
diff out.tgba ex.tgba
run 0 ../ltl2tgba -x -DC 'GFa & XGFb' > out.tgba
cat >ex.tgba <<EOF
digraph G {
0 [label="", style=invis, height=0]
0 -> 1
1 [label="1"]
1 -> 2 [label="1\n"]
2 [label="2"]
2 -> 2 [label="1\n"]
2 -> 3 [label="!a\n"]
2 -> 4 [label="!b\n"]
3 [label="-4"]
3 -> 3 [label="!a\n{Acc[1]}"]
4 [label="-3"]
4 -> 4 [label="!b\n{Acc[1]}"]
}
EOF
diff out.tgba ex.tgba