dstarparse: Preliminary work on a parser for ltl2dstar.

Supports reading Rabin and Streett automata, and converting them to
nondeterministic Büchi automata (for Rabin) or TGBA (for Streett).

* src/dstarparse/Makefile.am, src/dstarparse/dstarparse.yy,
src/dstarparse/dstarscan.ll, src/dstarparse/fmterror.cc,
src/dstarparse/parsedecl.hh, src/dstarparse/public.hh,
src/dstarparse/nra2nba.cc, src/dstarparse/nsa2tgba.cc: New files.
* configure.ac, src/Makefile.am, README: Adjust.
* src/tgbatest/ltl2tgba.cc: Add options -XD, -XDB.
* src/tgbatest/dstar.test: New file.
* src/tgbatest/Makefile.am (TESTS): Add it.
This commit is contained in:
Alexandre Duret-Lutz 2013-07-24 19:16:18 +02:00
parent 5a3b1a9905
commit 2da0053c53
15 changed files with 1390 additions and 55 deletions

131
src/tgbatest/dstar.test Executable file
View file

@ -0,0 +1,131 @@
#!/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/>.
# Do some quick translations to make sure the neverclaims produced by
# spot actually look correct! We do that by parsing them via ltlcross.
# ltl2neverclaim-lbtt.test does the same with LBTT if it is installed.
. ./defs
set -e
cat >dra.dstar <<EOF
DRA v2 explicit
Comment: "Safra[NBA=2]"
States: 3
Acceptance-Pairs: 1
Start: 0
AP: 2 "a" "b"
---
State: 0
Acc-Sig:
1
0
2
2
State: 1
Acc-Sig: -0
1
1
1
1
State: 2
Acc-Sig: +0
2
2
2
2
EOF
run 0 ../ltl2tgba -XD dra.dstar | tee stdout
cat >expected <<EOF
digraph G {
0 [label="", style=invis, height=0]
0 -> 1
1 [label="0"]
1 -> 1 [label="a & !b\n"]
1 -> 2 [label="!a & !b\n"]
1 -> 3 [label="b\n"]
2 [label="1"]
2 -> 2 [label="1\n"]
3 [label="2"]
3 -> 3 [label="1\n"]
}
EOF
diff expected stdout
cat >dsa.dstar <<EOF
DSA v2 explicit
Comment: "Streett{Safra[NBA=2]}"
States: 3
Acceptance-Pairs: 1
Start: 1
AP: 1 "a"
---
State: 0
Acc-Sig: +0
0
2
State: 1
Acc-Sig:
0
0
State: 2
Acc-Sig:
0
2
EOF
run 0 ../ltl2tgba -XDB dsa.dstar | tee stdout
cat >expected <<EOF
digraph G {
0 [label="", style=invis, height=0]
0 -> 1
1 [label="0"]
1 -> 2 [label="1\n"]
1 -> 3 [label="1\n"]
2 [label="1"]
2 -> 2 [label="!a\n"]
2 -> 3 [label="!a\n"]
2 -> 4 [label="a\n"]
2 -> 5 [label="a\n"]
3 [label="2"]
3 -> 6 [label="!a\n"]
3 -> 5 [label="a\n{Acc[\"0\"]}"]
4 [label="3"]
4 -> 2 [label="!a\n"]
4 -> 3 [label="!a\n"]
4 -> 4 [label="a\n"]
4 -> 5 [label="a\n"]
5 [label="4"]
5 -> 6 [label="!a\n"]
5 -> 5 [label="a\n{Acc[\"0\"]}"]
6 [label="5"]
6 -> 6 [label="!a\n"]
6 -> 7 [label="a\n"]
7 [label="6"]
7 -> 6 [label="!a\n"]
7 -> 7 [label="a\n"]
}
EOF
diff expected stdout