Commit d3b81809 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

dstar2tgba: new command.

* src/bin/dstar2tgba.cc, src/bin/man/dstar2tgba.x: New files.
* src/bin/Makefile.am, src/bin/man/Makefile.am: Add them.
* NEWS: Mention it.
* src/bin/ltl2tgba.cc, src/tgbaalgos/stats.cc, doc/org/ltl2tgba.org:
Rename the %S sequence as %c, for consistency with dstar2tgba.
* src/tgbatest/ltl2dstar.test: Add more tests.
* src/tgbatest/ltl2dstar2.test: New file.
* src/tgbatest/Makefile.am: Add it.
parent 9a7590a6
New in spot 1.1.4a (not relased)
* All the parsers implemented in Spot now use the same type
to store locations.
* Changes to command-line tools:
- ltlcross has a new option --color to color its output. It is
enabled by default when the output is a terminal.
- ltlcross will give an example of infinite word accepted by the
two automata when the product between a positive automaton and a
negative automaton is non-empty.
* ltlcross has a new option --color to color its output. It is enabled
by default when the output is a terminal.
- ltlcross can now read the Rabin and Streett automata output by
ltl2dstar. This type of output should be specified using '%D':
* ltlcross will give an example of infinite word accepted by the
two automata when the product between a positive automaton and
a negative automaton is non-empty.
ltlcross 'ltl2dstar --ltl2nba=spin:path/to/ltl2tgba@-s %L %D'
* ltlcross can now read the Rabin and Streett automata output by
ltl2dstar. This type of output should be specified using '%D':
However because Spot only supports Büchi acceptance, these Rabin
and Streett automata are immediately converted to TGBA before
further processing by ltlcross. This is still interesting to
search for bugs in translators to Rabin or Streett automata, but
the statistics might not be very relevant.
ltlcross 'ltl2dstar --ltl2nba=spin:path/to/ltl2tgba@-s %L %D'
- To help with debugging problems detected by ltlcross, the
environment variables SPOT_TMPDIR and SPOT_TMPKEEP control where
temporary files are created and if they should be erased. Read
the man page of ltlcross for details.
However because Spot only supports Büchi acceptance, these Rabin
and Streett automata are immediately converted to TGBA before
further processing by ltlcross. This is still interesting to
search for bugs in translators to Rabin or Streett automata, but
the statistics might not be very relevant.
- There is a new command, named dstar2tgba, that converts a
deterministic Rabin or Streett automaton as output by
ltl2dstar into a TGBA, BA or Monitor. When a deterministic
Rabin automaton is realizable by a deterministic Büchi automaton,
the conversion preserve determinism. (This is not implemented
for Streett.)
* Environment variables SPOT_TMPDIR and SPOT_TMPKEEP control where
temporary files are created and if they should be erased. Read
the man page of ltlcross for detail.
- The %S escape sequence used by ltl2tgba --stats to display the
number of SCCs in the output automaton has been renamed to %c.
This makes it more homogeneous with the --stats option of the
new dstar2tgba command.
* All the parsers implemented in Spot now use the same type
to store locations.
* Degeneralization was not indempotant on automata with an accepting
initial state that was on a cycle, but without self-loop.
......
......@@ -546,12 +546,12 @@ ltl2tgba --help | sed -n '/^ *%/p'
#+RESULTS:
: %% a single %
: %a number of acceptance sets
: %c number of SCCs
: %d 1 if the automaton is deterministic, 0 otherwise
: %e number of edges
: %f the formula, in Spot's syntax
: %n number of nondeterministic states
: %s number of states
: %S number of SCCs
: %t number of transitions
For instance we can study the size of the automata generated for the
......
......@@ -42,7 +42,8 @@ libcommon_a_SOURCES = \
common_setup.hh \
common_sys.hh
bin_PROGRAMS = ltlfilt genltl randltl ltl2tgba ltl2tgta ltlcross
bin_PROGRAMS = ltlfilt genltl randltl ltl2tgba ltl2tgta ltlcross \
dstar2tgba
# Dummy program used just to generate man/spot-x.7 in a way that is
# consistent with the other man pages (e.g., with a version number that
......@@ -55,5 +56,6 @@ randltl_SOURCES = randltl.cc
ltl2tgba_SOURCES = ltl2tgba.cc
ltl2tgta_SOURCES = ltl2tgta.cc
ltlcross_SOURCES = ltlcross.cc
dstar2tgba_SOURCES = dstar2tgba.cc
spot_x_SOURCES = spot-x.cc
ltlcross_LDADD = $(LDADD) $(LIB_GETHRXTIME)
This diff is collapsed.
......@@ -86,7 +86,7 @@ static const argp_option options[] =
{ "%t", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of transitions", 0 },
{ "%a", 0, 0, OPTION_DOC | OPTION_NO_USAGE,
"number of acceptance sets", 0 },
{ "%S", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of SCCs", 0 },
{ "%c", 0, 0, OPTION_DOC | OPTION_NO_USAGE, "number of SCCs", 0 },
{ "%n", 0, 0, OPTION_DOC | OPTION_NO_USAGE,
"number of nondeterministic states", 0 },
{ "%d", 0, 0, OPTION_DOC | OPTION_NO_USAGE,
......
......@@ -23,6 +23,7 @@ convman = ARGP_HELP_FMT=header-col=0 $(SHELL) "$(x_to_1)" \
"$(PERL)" "$(top_srcdir)/tools/help2man -N -L 'en_US.UTF-8'"
dist_man1_MANS = \
dstar2tgba.1 \
genltl.1 \
ltl2tgba.1 \
ltl2tgta.1 \
......@@ -35,6 +36,9 @@ dist_man7_MANS = \
MAINTAINERCLEANFILES = $(dist_man1_MANS) $(dist_man7_MANS)
EXTRA_DIST = $(dist_man1_MANS:.1=.x) $(dist_man7_MANS:.7=.x)
dstar2tgba.1: $(common_dep) $(srcdir)/dstar2tgba.x $(srcdir)/../dstar2tgba.cc
$(convman) ../dstar2tgba$(EXEEXT) $(srcdir)/dstar2tgba.x $@
ltl2tgba.1: $(common_dep) $(srcdir)/ltl2tgba.x $(srcdir)/../ltl2tgba.cc
$(convman) ../ltl2tgba$(EXEEXT) $(srcdir)/ltl2tgba.x $@
......
[NAME]
dstar2tgba \- convert Rabin or Streett automata into Büchi automata
[BIBLIOGRAPHY]
.TP
1.
<http://www.ltl2dstar.de/docs/ltl2dstar.html>
Documents the output format of ltl2dstar.
.TP
2.
Chistof Löding: Mehods for the Transformation of ω-Automata:
Complexity and Connection to Second Order Logic. Diploma Thesis.
University of Kiel. 1998.
Describes various tranformations from non-deterministic Rabin and
Streett automata to Büchi automata. Slightly optimized variants of
these transformations are used by dstar2tgba for the general cases.
.TP
3.
Sriram C. Krishnan, Anuj Puri, and Robert K. Brayton: Deterministic
ω-automata vis-a-vis Deterministic Büchi Automata. ISAAC'94.
Explains how to preserve the determinism of Rabin and Streett automata
when the property can be repreted by a Deterministic automaton.
dstar2tgba implements this for the Rabin case only. In other words,
translating a deterministic Rabin automaton with dstar2tgba will
produce a deterministic TGBA or BA if such a automaton exists.
[SEE ALSO]
.BR spot-x (7)
// Copyright (C) 2008, 2011, 2012 Laboratoire de Recherche et Développement
// Copyright (C) 2008, 2011, 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
......@@ -142,12 +142,13 @@ namespace spot
: format_(format)
{
declare('a', &acc_);
declare('c', &scc_);
declare('d', &deterministic_);
declare('e', &edges_);
declare('f', &form_);
declare('n', &nondetstates_);
declare('s', &states_);
declare('S', &scc_);
declare('S', &scc_); // Historical. Deprecated. Use %c instead.
declare('t', &trans_);
set_output(os);
prime(format);
......@@ -176,7 +177,7 @@ namespace spot
if (has('a'))
acc_ = aut->number_of_acceptance_conditions();
if (has('S'))
if (has('c') || has('S'))
{
scc_map m(aut);
m.build_map();
......
......@@ -111,6 +111,7 @@ TESTS = \
wdba2.test \
babiak.test \
ltl2dstar.test \
ltl2dstar2.test \
randtgba.test \
emptchk.test \
emptchke.test \
......
......@@ -33,6 +33,7 @@ ltl2tgba=../../bin/ltl2tgba
ltlcross=../../bin/ltlcross
randltl=../../bin/randltl
ltlfilt=../../bin/ltlfilt
dstar2tgba=../../bin/dstar2tgba
$ltlfilt -f 'a U b' -l |
ltl2dstar --ltl2nba=spin:$ltl2tgba@-s - - |
......@@ -62,11 +63,16 @@ EOF
diff expected out
RAB=--automata=rabin
STR=--automata=streett
$randltl -n 15 a b | $ltlfilt --nnf --remove-wm |
$ltlcross -F - -f 'GFa & GFb & GFc' -f '(GFa -> GFb) & (GFc -> GFd)' \
--timeout=10 \
--timeout=30 \
"$ltl2tgba -s %f >%N" \
"ltl2dstar --automata=rabin --output=nba --ltl2nba=spin:$ltl2tgba@-s %L %T" \
"ltl2dstar --automata=rabin --ltl2nba=spin:$ltl2tgba@-s %L %D" \
"ltl2dstar --automata=streett --output=nba --ltl2nba=spin:$ltl2tgba@-s %L %T" \
"ltl2dstar --automata=streett --ltl2nba=spin:$ltl2tgba@-s %L %D"
"ltl2dstar $RAB --output=nba --ltl2nba=spin:$ltl2tgba@-s %L %T" \
"ltl2dstar $RAB --ltl2nba=spin:$ltl2tgba@-s %L %D" \
"ltl2dstar $RAB --ltl2nba=spin:$ltl2tgba@-s %L - | $dstar2tgba --low -s >%N" \
"ltl2dstar $STR --output=nba --ltl2nba=spin:$ltl2tgba@-s %L %T" \
"ltl2dstar $STR --ltl2nba=spin:$ltl2tgba@-s %L %D" \
"ltl2dstar $STR --ltl2nba=spin:$ltl2tgba@-s %L - | $dstar2tgba --low -s >%N"
#!/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
# Skip this test if ltl2dstar is not installed.
(ltl2dstar --version) || exit 77
ltlfilt=../../bin/ltlfilt
ltl2tgba=../../bin/ltl2tgba
dstar2tgba=../../bin/dstar2tgba
randltl=../../bin/randltl
# Make sure all recurrence formulas are translated into deterministic
# Büchi automata by the DRA->TGBA converster.
$randltl -n -1 a b --tree-size=5..15 |
$ltlfilt --syntactic-recurrence --remove-wm -r -u \
--size-min=4 --size-max=15 --relabel=abc |
head -n 20 > formulas
$randltl -n -1 a b --tree-size=5..15 |
$ltlfilt -v --obligation |
$ltlfilt --syntactic-recurrence --remove-wm -r -u \
--size-min=4 --size-max=15 --relabel=abc |
head -n 20 >> formulas
while read f; do
$ltlfilt -f "$f" -l |
ltl2dstar --ltl2nba=spin:$ltl2tgba@-s - foo
echo "$f"
det=`$dstar2tgba foo --stats '%d'`
test $det -eq 1;
done < formulas
# Now make sure that some obviously non-deterministic property
# are not translated to deterministic.
cat >formulas <<EOF
FGa
GFa->GFb
GFa & FGb
FGa | FGb
FGa & FGb
EOF
while read f; do
$ltlfilt -f "$f" -l |
ltl2dstar --ltl2nba=spin:$ltl2tgba@-s - foo
echo "$f"
det=`$dstar2tgba foo --stats '%d'`
test $det -eq 0;
done < formulas
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment