tgbatest: drop support of Spot's legacy format from ltl2tgba

This is progress for #1.

* src/tgbatest/ltl2tgba.cc: Remove options -b and -X.  Change
-P to read HOA files instead.
* src/tgbatest/complementation.cc: Replace option -b by -H for
HOA output, and read files in HOA.
* src/tgbatest/complementation.test, src/tgbatest/cycles.test,
src/tgbatest/dbacomp.test, src/tgbatest/degenid.test,
src/tgbatest/dfs.test, src/tgbatest/emptchke.test,
src/tgbatest/ltl2tgba.test, src/tgbatest/renault.test,
src/tgbatest/satmin2.test, src/tgbatest/sccsimpl.test,
src/tgbatest/sim2.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-01-31 17:43:16 +01:00
parent 5852292c9f
commit 33a944705c
13 changed files with 755 additions and 527 deletions

View file

@ -20,8 +20,8 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include "tgbaalgos/dotty.hh" #include "tgbaalgos/dotty.hh"
#include "tgbaalgos/save.hh" #include "tgbaalgos/hoa.hh"
#include "tgbaparse/public.hh" #include "hoaparse/public.hh"
#include "tgba/tgbaproduct.hh" #include "tgba/tgbaproduct.hh"
#include "tgbaalgos/gtec/gtec.hh" #include "tgbaalgos/gtec/gtec.hh"
#include "tgbaalgos/ltl2tgba_fm.hh" #include "tgbaalgos/ltl2tgba_fm.hh"
@ -39,7 +39,7 @@ void usage(const char* prog)
{ {
std::cout << "usage: " << prog << " [options]" << std::endl; std::cout << "usage: " << prog << " [options]" << std::endl;
std::cout << "with options" << std::endl std::cout << "with options" << std::endl
<< "-b Output in spot's format\n" << "-H Output in HOA\n"
<< "-s buchi_automaton display the safra automaton\n" << "-s buchi_automaton display the safra automaton\n"
<< "-a buchi_automaton display the complemented automaton\n" << "-a buchi_automaton display the complemented automaton\n"
<< "-astat buchi_automaton statistics for !a\n" << "-astat buchi_automaton statistics for !a\n"
@ -58,7 +58,7 @@ int main(int argc, char* argv[])
bool stats = false; bool stats = false;
bool formula = false; bool formula = false;
bool print_formula = false; bool print_formula = false;
bool save_spot = false; bool save_hoa = false;
if (argc < 3) if (argc < 3)
{ {
@ -70,9 +70,9 @@ int main(int argc, char* argv[])
{ {
if (argv[i][0] == '-') if (argv[i][0] == '-')
{ {
if (strcmp(argv[i] + 1, "b") == 0) if (strcmp(argv[i] + 1, "H") == 0)
{ {
save_spot = true; save_hoa = true;
continue; continue;
} }
@ -121,10 +121,11 @@ int main(int argc, char* argv[])
if (print_automaton || print_safra) if (print_automaton || print_safra)
{ {
spot::ltl::environment& env(spot::ltl::default_environment::instance()); spot::ltl::environment& env(spot::ltl::default_environment::instance());
spot::tgba_parse_error_list pel; spot::hoa_parse_error_list pel;
spot::tgba_digraph_ptr a = spot::tgba_parse(file, pel, dict, env); auto h = spot::hoa_parse(file, pel, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, file, pel)) if (spot::format_hoa_parse_errors(std::cerr, file, pel))
return 2; return 2;
spot::tgba_digraph_ptr a = h->aut;
spot::tgba_ptr complement = 0; spot::tgba_ptr complement = 0;
@ -132,8 +133,8 @@ int main(int argc, char* argv[])
if (print_automaton) if (print_automaton)
{ {
if (save_spot) if (save_hoa)
spot::tgba_save_reachable(std::cout, complement); spot::hoa_reachable(std::cout, complement, nullptr);
else else
spot::dotty_reachable(std::cout, complement); spot::dotty_reachable(std::cout, complement);
} }
@ -177,11 +178,12 @@ int main(int argc, char* argv[])
} }
else else
{ {
spot::tgba_parse_error_list pel; spot::hoa_parse_error_list pel;
spot::ltl::environment& env(spot::ltl::default_environment::instance()); spot::ltl::environment& env(spot::ltl::default_environment::instance());
a = spot::tgba_parse(file, pel, dict, env); auto h = spot::hoa_parse(file, pel, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, file, pel)) if (spot::format_hoa_parse_errors(std::cerr, file, pel))
return 2; return 2;
a = h->aut;
} }
auto safra_complement = spot::make_safra_complement(a); auto safra_complement = spot::make_safra_complement(a);

View file

@ -39,20 +39,31 @@ EOF
# The following test-case was supplied by Martin Dieguez Lodeiro to # The following test-case was supplied by Martin Dieguez Lodeiro to
# demonstrate a bug in our Safra implementation. # demonstrate a bug in our Safra implementation.
cat >x.tgba <<EOF cat >x.hoa <<EOF
acc = "1"; HOA: v1
"1", "1", "1",; States: 3
"1", "2", "p",; Start: 0
"2", "3", "p", "1"; AP: 1 "p"
"2", "2", "1",; acc-name: Buchi
"3", "3", "p", "1"; Acceptance: 1 Inf(0)
"3", "2", "1",; properties: trans-labels explicit-labels trans-acc complete
--BODY--
State: 0
[t] 0
[0] 1
State: 1
[t] 1
[0] 2 {0}
State: 2
[t] 1
[0] 2 {0}
--END--
EOF EOF
# x.tgba accepts some run # x.tgba accepts some run
run 0 ../ltl2tgba -X -e x.tgba run 0 ../ltl2tgba -XH -e x.hoa
# so does its complement # so does its complement
run 0 ../complement -b -a x.tgba > nx.tgba run 0 ../complement -H -a x.hoa > nx.hoa
run 0 ../ltl2tgba -X -e nx.tgba run 0 ../ltl2tgba -XH -e nx.hoa
# however the intersection of both should not # however the intersection of both should not
# accept any run. # accept any run.
run 0 ../ltl2tgba -X -E -Pnx.tgba x.tgba run 1 ../../bin/autfilt -q nx.hoa --intersect x.hoa

View file

@ -21,63 +21,52 @@
. ./defs . ./defs
set -e set -e
# GNU systems have seq,
# BSD systems have jot.
# Neither of those are POSIX...
if test "*`(seq 1 1 2>/dev/null)`" = "1"; then
have_seq=true
else
have_seq=false
if test "`(jot 1 1 2>/dev/null)`" = "1"; then
have_jot=true
else
have_jot=false
fi
fi
# enum start end
enum() {
if $have_seq; then
seq $1 $2
elif $have_jot; then
jot `expr $2 - $1 + 1` $1
else
i=$1
while test $i -le $2; do
echo $i
i=`expr $i + 1`
done
fi
}
# Fig.1 from Johnson's SIAM J. Comput. 1975 paper. # Fig.1 from Johnson's SIAM J. Comput. 1975 paper.
cat >johnson-fig1.hoa <<EOF
HOA: v1
States: 12
Start: 0
AP: 0
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc complete
--BODY--
State: 0
[t] 1
[t] 3
[t] 4
State: 1
[t] 2
State: 2
[t] 5
[t] 6
State: 3
[t] 2
State: 4
[t] 2
State: 5
[t] 6
[t] 7
State: 6
[t] 8
[t] 10
[t] 11
State: 7
[t] 0
[t] 6
State: 8
[t] 2
[t] 9
State: 9
[t] 6
State: 10
[t] 9
State: 11
[t] 9
--END--
EOF
( run 0 ../ltl2tgba -KC -XH johnson-fig1.hoa > out
echo 'acc = ;'
k=3
v=`expr $k + 2`
w=`expr 2 \* $k + 2`
x=`expr 3 \* $k + 3`
for i in $(enum 2 `expr $k + 1`); do
echo "s1,s$i,,;"
echo "s$i,s$v,,;"
done
for i in $(enum `expr $k + 2` `expr 2 \* $k`); do
echo "s$i,s`expr $i + 1`,,;"
echo "s$i,s$w,,;"
done
echo "s`expr 2 \* $k + 1`,s$w,,;"
echo "s`expr 2 \* $k + 1`,s1,,;"
for i in $(enum `expr 2 \* $k + 3` `expr 3 \* $k + 2`); do
echo "s$w,s$i,,;"
echo "s$i,s$x,,;"
done
echo "s`expr 2 \* $k + 3`,s$v,,;"
echo "s$x,s$w,,;"
) > johnson-fig1.tgba
run 0 ../ltl2tgba -KC -X johnson-fig1.tgba > out
test `wc -l < out` -eq 10 test `wc -l < out` -eq 10
run 0 ../ltl2tgba -KW '(Ga -> Gb) W c' > out run 0 ../ltl2tgba -KW '(Ga -> Gb) W c' > out

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2013 Laboratoire de Recherche et # Copyright (C) 2013, 2015 Laboratoire de Recherche et
# Développement de l'Epita (LRDE). # Développement de l'Epita (LRDE).
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
@ -23,25 +23,37 @@ set -e
# This automaton used to trigger a bug in the complementation: its # This automaton used to trigger a bug in the complementation: its
# intersection with the complement was not empty! # intersection with the complement was not empty!
cat >input.tgba <<EOF cat >input.hoa <<EOF
acc = "a" "b" "c"; HOA: v1
"1", "1", "(a & d) | (a & b)", "b" "c"; States: 3
"1", "2", "a & !d & !c & !b",; Start: 0
"1", "1", "(d & !a) | (b & !a)", "a" "b" "c"; AP: 4 "a" "d" "b" "c"
"1", "2", "!a & !d & !c & !b", "a"; acc-name: generalized-Buchi 3
"2", "1", "a & c & b", "b" "c"; Acceptance: 3 Inf(0)&Inf(1)&Inf(2)
"2", "3", "a & b & !c", "b"; properties: trans-labels explicit-labels trans-acc deterministic
"2", "2", "a & !c & !b",; --BODY--
"2", "1", "c & b & !a", "a" "b" "c"; State: 0
"2", "3", "b & !a & !c", "a" "b"; [0&1 | 0&2] 0 {1 2}
"2", "2", "!a & !c & !b", "a"; [!0&1 | !0&2] 0 {0 1 2}
"3", "1", "(a & d & c) | (a & c & b)", "b" "c"; [0&!1&!2&!3] 1
"3", "3", "(a & d & !c) | (a & b & !c)", "b"; [!0&!1&!2&!3] 1 {0}
"3", "2", "a & !d & !c & !b",; State: 1
"3", "1", "(d & c & !a) | (c & b & !a)", "a" "b" "c"; [0&2&3] 0 {1 2}
"3", "3", "(d & !a & !c) | (b & !a & !c)", "a" "b"; [!0&2&3] 0 {0 1 2}
"3", "2", "!a & !d & !c & !b", "a"; [0&!2&!3] 1
[!0&!2&!3] 1 {0}
[0&2&!3] 2 {1}
[!0&2&!3] 2 {0 1}
State: 2
[0&1&3 | 0&2&3] 0 {1 2}
[!0&1&3 | !0&2&3] 0 {0 1 2}
[0&!1&!2&!3] 1
[!0&!1&!2&!3] 1 {0}
[0&1&!3 | 0&2&!3] 2 {1}
[!0&1&!3 | !0&2&!3] 2 {0 1}
--END--
EOF EOF
# Check emptiness of product with complement. # Check emptiness of product with complement.
run 0 ../ltl2tgba -Pinput.tgba -DC -E -C -X input.tgba run 0 ../ltl2tgba -H -DC -C -XH input.hoa > output.hoa
run 1 ../../bin/autfilt -q input.hoa --intersect output.hoa

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2011, 2013, 2014 Laboratoire de Recherche et # Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de Recherche et
# Développement de l'Epita (LRDE). # Développement de l'Epita (LRDE).
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
@ -26,12 +26,12 @@ set -e
for f in 'FGa|GFb' 'GFa & GFb & GFc' 'GF(a->FGb)&GF(c->FGd)'; do for f in 'FGa|GFb' 'GFa & GFb & GFc' 'GF(a->FGb)&GF(c->FGd)'; do
for opt in -DS -DT; do for opt in -DS -DT; do
../ltl2tgba $opt -b "$f" > autX.spot ../ltl2tgba $opt -H "$f" > autX.spot
../ltl2tgba -X -kt autX.spot > base.size ../ltl2tgba -XH -kt autX.spot > base.size
cat base.size cat base.size
for x in X XX XXX; do for x in X XX XXX; do
../ltl2tgba -X $opt -b aut$x.spot > autX$x.spot ../ltl2tgba -XH $opt -H aut$x.spot > autX$x.spot
../ltl2tgba -X -kt autX$x.spot > new.size ../ltl2tgba -XH -kt autX$x.spot > new.size
cat new.size cat new.size
cmp base.size new.size cmp base.size new.size
done done
@ -42,61 +42,91 @@ done
# This is another 6-state degeneralized automaton that # This is another 6-state degeneralized automaton that
# we used the "redegeneralize" to a 8-state BA... # we used the "redegeneralize" to a 8-state BA...
cat > bug <<EOF cat > bug <<EOF
acc = "1"; HOA: v1
"1", "2", "!b | !a", "1"; States: 6
"1", "5", "a & b", "1"; Start: 0
"2", "2", "b & !a", "1"; AP: 2 "a" "b"
"2", "3", "!b & !a", "1"; acc-name: Buchi
"2", "4", "a", "1"; Acceptance: 1 Inf(0)
"5", "1", "a & !b",; properties: trans-labels explicit-labels state-acc complete deterministic
"5", "2", "!b & !a",; --BODY--
"5", "5", "a & b",; State: 0 {0}
"5", "6", "b & !a",; [!0 | !1] 1
"3", "1", "a & b",; [0&1] 2
"3", "2", "b & !a",; State: 1 {0}
"3", "3", "!b & !a",; [!0&1] 1
"3", "4", "a & !b",; [!0&!1] 3
"4", "1", "b",; [0] 4
"4", "5", "a & !b",; State: 2
"4", "6", "!b & !a",; [0&!1] 0
"6", "1", "!b",; [!0&!1] 1
"6", "3", "b & !a",; [0&1] 2
"6", "4", "a & b",; [!0&1] 5
State: 3
[0&1] 0
[!0&1] 1
[!0&!1] 3
[0&!1] 4
State: 4
[1] 0
[0&!1] 2
[!0&!1] 5
State: 5
[!1] 0
[!0&1] 3
[0&1] 4
--END--
EOF EOF
run 0 ../ltl2tgba -ks -X -DS bug > out run 0 ../ltl2tgba -ks -XH -DS bug > out
grep 'states: 6' out grep 'states: 6' out
# This 8-state degeneralized automaton used # This 8-state degeneralized automaton used
# to be "degeneralized" to a 9-state BA... # to be "degeneralized" to a 9-state BA...
cat > bug2 <<EOF cat > bug2 <<EOF
acc = "1"; HOA: v1
"1", "2", "1",; States: 8
"2", "3", "1", "1"; Start: 0
"3", "3", "a & !b",; AP: 2 "a" "b"
"3", "4", "a & b",; acc-name: Buchi
"3", "5", "!a & !b",; Acceptance: 1 Inf(0)
"3", "6", "b & !a",; properties: trans-labels explicit-labels state-acc complete deterministic
"4", "3", "a", "1"; --BODY--
"4", "5", "!a", "1"; State: 0
"5", "3", "a & !b",; [t] 1
"5", "4", "a & b",; State: 1 {0}
"5", "6", "b & !a",; [t] 2
"5", "7", "!a & !b",; State: 2
"6", "3", "a & !b", "1"; [0&!1] 2
"6", "4", "a & b", "1"; [0&1] 3
"6", "6", "b & !a", "1"; [!0&!1] 4
"6", "7", "!a & !b", "1"; [!0&1] 5
"7", "3", "a & !b",; State: 3 {0}
"7", "4", "a & b",; [0] 2
"7", "8", "b & !a",; [!0] 4
"7", "7", "!a & !b",; State: 4
"8", "4", "a",; [0&!1] 2
"8", "8", "!a",; [0&1] 3
[!0&1] 5
[!0&!1] 6
State: 5 {0}
[0&!1] 2
[0&1] 3
[!0&1] 5
[!0&!1] 6
State: 6
[0&!1] 2
[0&1] 3
[!0&!1] 6
[!0&1] 7
State: 7
[0] 3
[!0] 7
--END--
EOF EOF
run 0 ../ltl2tgba -ks -X -DS bug2 >out run 0 ../ltl2tgba -ks -XH -DS bug2 >out
grep 'states: 8' out grep 'states: 8' out

View file

@ -35,51 +35,68 @@ set -e
# |_______| # |_______|
cat >blue_counter <<'EOF' cat >blue_counter <<'EOF'
acc = a; HOA: v1
s1, s2,, a; States: 9
s2, s3,,; Start: 0
s3, s1,,; AP: 0
s3, s4,,; acc-name: Buchi
s4, s4,,; Acceptance: 1 Inf(0)
s4, s5,,; properties: trans-labels explicit-labels state-acc complete
s4, s6,,; --BODY--
s4, s7,,; State: 0 {0}
s4, s8,,; [t] 1
s4, s9,,; State: 1
s5, s4,,; [t] 2
s5, s5,,; State: 2
s5, s6,,; [t] 0
s5, s7,,; [t] 3
s5, s8,,; State: 3
s5, s9,,; [t] 3
s6, s4,,; [t] 4
s6, s5,,; [t] 5
s6, s6,,; [t] 6
s6, s7,,; [t] 7
s6, s8,,; [t] 8
s6, s9,,; State: 4
s7, s4,,; [t] 3
s7, s5,,; [t] 4
s7, s6,,; [t] 5
s7, s7,,; [t] 6
s7, s8,,; [t] 7
s7, s9,,; [t] 8
s8, s4,,; State: 5
s8, s5,,; [t] 3
s8, s6,,; [t] 4
s8, s7,,; [t] 5
s8, s8,,; [t] 6
s8, s9,,; [t] 7
s9, s4,,; [t] 8
s9, s5,,; State: 6
s9, s6,,; [t] 3
s9, s7,,; [t] 4
s9, s8,,; [t] 5
s9, s9,,; [t] 6
[t] 7
[t] 8
State: 7
[t] 3
[t] 4
[t] 5
[t] 6
[t] 7
[t] 8
State: 8
[t] 3
[t] 4
[t] 5
[t] 6
[t] 7
[t] 8
--END--
EOF EOF
run 0 ../ltl2tgba -CR -eSE05 -X blue_counter run 0 ../ltl2tgba -CR -eSE05 -XH blue_counter
run 0 ../ltl2tgba -CR -eTau03_opt -X blue_counter run 0 ../ltl2tgba -CR -eTau03_opt -XH blue_counter
# s1->s2->s3->(large composant from s4 to s9) # s1->s2->s3->(large composant from s4 to s9)
# ^ || # ^ ||
@ -87,51 +104,68 @@ run 0 ../ltl2tgba -CR -eTau03_opt -X blue_counter
# ||______|| # ||______||
cat >blue_last <<'EOF' cat >blue_last <<'EOF'
acc = a; HOA: v1
s1, s2,,; States: 9
s2, s3,,; Start: 0
s3, s1,, a; AP: 0
s3, s4,,; acc-name: Buchi
s4, s4,,; Acceptance: 1 Inf(0)
s4, s5,,; properties: trans-labels explicit-labels trans-acc complete
s4, s6,,; --BODY--
s4, s7,,; State: 0
s4, s8,,; [t] 1
s4, s9,,; State: 1
s5, s4,,; [t] 2
s5, s5,,; State: 2
s5, s6,,; [t] 0 {0}
s5, s7,,; [t] 3
s5, s8,,; State: 3
s5, s9,,; [t] 3
s6, s4,,; [t] 4
s6, s5,,; [t] 5
s6, s6,,; [t] 6
s6, s7,,; [t] 7
s6, s8,,; [t] 8
s6, s9,,; State: 4
s7, s4,,; [t] 3
s7, s5,,; [t] 4
s7, s6,,; [t] 5
s7, s7,,; [t] 6
s7, s8,,; [t] 7
s7, s9,,; [t] 8
s8, s4,,; State: 5
s8, s5,,; [t] 3
s8, s6,,; [t] 4
s8, s7,,; [t] 5
s8, s8,,; [t] 6
s8, s9,,; [t] 7
s9, s4,,; [t] 8
s9, s5,,; State: 6
s9, s6,,; [t] 3
s9, s7,,; [t] 4
s9, s8,,; [t] 5
s9, s9,,; [t] 6
[t] 7
[t] 8
State: 7
[t] 3
[t] 4
[t] 5
[t] 6
[t] 7
[t] 8
State: 8
[t] 3
[t] 4
[t] 5
[t] 6
[t] 7
[t] 8
--END--
EOF EOF
run 0 ../ltl2tgba -CR -eSE05 -X blue_last run 0 ../ltl2tgba -CR -eSE05 -XH blue_last
run 0 ../ltl2tgba -CR -eTau03_opt -X blue_last run 0 ../ltl2tgba -CR -eTau03_opt -XH blue_last
# _______ # _______
# | | # | |
@ -142,51 +176,68 @@ run 0 ../ltl2tgba -CR -eTau03_opt -X blue_last
# ||______|| # ||______||
cat >red <<'EOF' cat >red <<'EOF'
acc = a; HOA: v1
s1, s2,,; States: 9
s1, s3,, a; Start: 0
s2, s3,,; AP: 0
s3, s1,,; acc-name: Buchi
s3, s4,,; Acceptance: 1 Inf(0)
s4, s4,,; properties: trans-labels explicit-labels trans-acc complete
s4, s5,,; --BODY--
s4, s6,,; State: 0
s4, s7,,; [t] 1
s4, s8,,; [t] 2 {0}
s4, s9,,; State: 1
s5, s4,,; [t] 2
s5, s5,,; State: 2
s5, s6,,; [t] 0
s5, s7,,; [t] 3
s5, s8,,; State: 3
s5, s9,,; [t] 3
s6, s4,,; [t] 4
s6, s5,,; [t] 5
s6, s6,,; [t] 6
s6, s7,,; [t] 7
s6, s8,,; [t] 8
s6, s9,,; State: 4
s7, s4,,; [t] 3
s7, s5,,; [t] 4
s7, s6,,; [t] 5
s7, s7,,; [t] 6
s7, s8,,; [t] 7
s7, s9,,; [t] 8
s8, s4,,; State: 5
s8, s5,,; [t] 3
s8, s6,,; [t] 4
s8, s7,,; [t] 5
s8, s8,,; [t] 6
s8, s9,,; [t] 7
s9, s4,,; [t] 8
s9, s5,,; State: 6
s9, s6,,; [t] 3
s9, s7,,; [t] 4
s9, s8,,; [t] 5
s9, s9,,; [t] 6
[t] 7
[t] 8
State: 7
[t] 3
[t] 4
[t] 5
[t] 6
[t] 7
[t] 8
State: 8
[t] 3
[t] 4
[t] 5
[t] 6
[t] 7
[t] 8
--END--
EOF EOF
run 0 ../ltl2tgba -CR -eSE05 -X red run 0 ../ltl2tgba -CR -eSE05 -XH red
run 0 ../ltl2tgba -CR -eTau03_opt -X red run 0 ../ltl2tgba -CR -eTau03_opt -XH red
rm -f red blue_counter blue_last rm -f red blue_counter blue_last

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2014 Laboratoire de Recherche et # Copyright (C) 2009, 2010, 2014, 2015 Laboratoire de Recherche et
# Développement de l'Epita (LRDE). # Développement de l'Epita (LRDE).
# Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de # Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
# Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), # Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
@ -28,21 +28,32 @@ set -e
expect_ce() expect_ce()
{ {
run 0 ../ltl2tgba -CR -e -X "$1" run 0 ../ltl2tgba -CR -e -XH "$1"
run 0 ../ltl2tgba -CR -e -DT -X "$1" run 0 ../ltl2tgba -CR -e -DT -XH "$1"
run 0 ../ltl2tgba -CR -e'Cou99(shy)' -X "$1" run 0 ../ltl2tgba -CR -e'Cou99(shy)' -XH "$1"
run 0 ../ltl2tgba -CR -e'Cou99(shy)' -DT -X "$1" run 0 ../ltl2tgba -CR -e'Cou99(shy)' -DT -XH "$1"
run 0 ../ltl2tgba -CR -eCVWY90 -X "$1" run 0 ../ltl2tgba -CR -eCVWY90 -XH "$1"
run 0 ../ltl2tgba -CR -eGV04 -X "$1" run 0 ../ltl2tgba -CR -eGV04 -XH "$1"
run 0 ../ltl2tgba -CR -eSE05 -X "$1" run 0 ../ltl2tgba -CR -eSE05 -XH "$1"
run 0 ../ltl2tgba -CR -eTau03 -X "$1" run 0 ../ltl2tgba -CR -eTau03 -XH "$1"
} }
cat >input <<'EOF' cat >input <<'EOF'
acc = c d; HOA: v1
s1, "s2", "a & !b", c d; States: 3
"s2", "state 3", "a", c; Start: 0
"state 3", s1,,; AP: 2 "a" "b"
acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1)
properties: trans-labels explicit-labels state-acc deterministic
--BODY--
State: 0 {0 1}
[0&!1] 1
State: 1 {0}
[0] 2
State: 2
[t] 0
--END--
EOF EOF
expect_ce input expect_ce input
@ -55,19 +66,36 @@ expect_ce input
# b->c e->f h->i # b->c e->f h->i
# #
cat >input <<'EOF' cat >input <<'EOF'
acc = A; HOA: v1
a, b, "1",; States: 9
b, c, "1",; Start: 0
c, a, "1",; AP: 0
a, d, "1",; acc-name: Buchi
d, e, "1",; Acceptance: 1 Inf(0)
e, f, "1",; properties: trans-labels explicit-labels state-acc complete
f, d, "1",; --BODY--
d, g, "1",; State: 0
g, h, "1",; [t] 1
h, i, "1",; [t] 3
i, g, "1", A; [t] 6
a, g, "1",; State: 1
[t] 2
State: 2
[t] 0
State: 3
[t] 4
[t] 6
State: 4
[t] 5
State: 5
[t] 3
State: 6
[t] 7
State: 7
[t] 8
State: 8 {0}
[t] 6
--END--
EOF EOF
expect_ce input expect_ce input
@ -100,15 +128,29 @@ expect_ce input
# and finally closes the cycle with c->d->a # and finally closes the cycle with c->d->a
# #
cat >input <<'EOF' cat >input <<'EOF'
acc = A B; HOA: v1
a, b, "1",; States: 6
b, c, "1",; Start: 0
c, d, "1",; AP: 0
d, a, "1",; acc-name: generalized-Buchi 2
b, e, "1", A; Acceptance: 2 Inf(0)&Inf(1)
e, f, "1",; properties: trans-labels explicit-labels trans-acc complete
f, b, "1", B; --BODY--
e, c, "1", B; State: 0
[t] 1
State: 1
[t] 2
[t] 4 {0}
State: 2
[t] 3
State: 3
[t] 0
State: 4
[t] 2 {1}
[t] 5
State: 5
[t] 1 {1}
--END--
EOF EOF
expect_ce input expect_ce input
@ -118,33 +160,61 @@ expect_ce input
# It triggered a bug in our implementation of GV04 (that didn't see any # It triggered a bug in our implementation of GV04 (that didn't see any
# accepting path). # accepting path).
cat >input <<EOF cat >input <<EOF
acc = "a0"; HOA: v1
"S0", "S12", "1",; States: 20
"S12", "S17", "1",; Start: 0
"S12", "S8", "1",; AP: 0
"S17", "S6", "1",; acc-name: Buchi
"S17", "S9", "1", "a0"; Acceptance: 1 Inf(0)
"S17", "S2", "1",; properties: trans-labels explicit-labels trans-acc
"S8", "S14", "1",; --BODY--
"S8", "S2", "1",; State: 0
"S6", "S1", "1",; [t] 1
"S9", "S18", "1",; State: 1
"S2", "S17", "1",; [t] 2
"S14", "S19", "1",; [t] 3
"S14", "S10", "1",; State: 2
"S1", "S15", "1",; [t] 4
"S18", "S5", "1",; [t] 5 {0}
"S19", "S5", "1",; [t] 6
"S19", "S7", "1",; State: 3
"S19", "S11", "1",; [t] 6
"S10", "S17", "1",; [t] 7
"S15", "S8", "1",; State: 4
"S5", "S4", "1",; [t] 8
"S11", "S6", "1",; State: 5
"S4", "S13", "1",; [t] 9
"S13", "S3", "1",; State: 6
"S3", "S16", "1",; [t] 2
"S3", "S19", "1",; State: 7
[t] 10
[t] 11
State: 8
[t] 12
State: 9
[t] 13
State: 10
[t] 13
[t] 14
[t] 15
State: 11
[t] 2
State: 12
[t] 3
State: 13
[t] 16
State: 14
State: 15
[t] 4
State: 16
[t] 17
State: 17
[t] 18
State: 18
[t] 10
[t] 19
State: 19
--END--
EOF EOF
expect_ce input expect_ce input

View file

@ -33,14 +33,12 @@
#include "tgbaalgos/ltl2tgba_fm.hh" #include "tgbaalgos/ltl2tgba_fm.hh"
#include "tgbaalgos/ltl2taa.hh" #include "tgbaalgos/ltl2taa.hh"
#include "tgba/bddprint.hh" #include "tgba/bddprint.hh"
#include "tgbaalgos/save.hh"
#include "tgbaalgos/dotty.hh" #include "tgbaalgos/dotty.hh"
#include "tgbaalgos/lbtt.hh" #include "tgbaalgos/lbtt.hh"
#include "tgbaalgos/hoa.hh" #include "tgbaalgos/hoa.hh"
#include "tgbaalgos/degen.hh" #include "tgbaalgos/degen.hh"
#include "tgba/tgbaproduct.hh" #include "tgba/tgbaproduct.hh"
#include "tgbaalgos/reducerun.hh" #include "tgbaalgos/reducerun.hh"
#include "tgbaparse/public.hh"
#include "dstarparse/public.hh" #include "dstarparse/public.hh"
#include "hoaparse/public.hh" #include "hoaparse/public.hh"
#include "tgbaalgos/dupexp.hh" #include "tgbaalgos/dupexp.hh"
@ -104,7 +102,7 @@ syntax(char* prog)
<< std::endl << std::endl
<< " "<< prog << " [-f|-l|-taa] -F [OPTIONS...] file" << " "<< prog << " [-f|-l|-taa] -F [OPTIONS...] file"
<< std::endl << std::endl
<< " "<< prog << " -X [OPTIONS...] file" << std::endl << " "<< prog << " -XH [OPTIONS...] file" << std::endl
<< std::endl << std::endl
<< "Translate an LTL formula into an automaton, or read the " << "Translate an LTL formula into an automaton, or read the "
@ -118,8 +116,6 @@ syntax(char* prog)
<< "Input options:" << std::endl << "Input options:" << std::endl
<< " -F read the formula from a file, not from the command line" << " -F read the formula from a file, not from the command line"
<< std::endl << std::endl
<< " -X do not compute an automaton, read it from a file"
<< std::endl
<< " -XD do not compute an automaton, read it from an" << " -XD do not compute an automaton, read it from an"
<< " ltl2dstar file" << std::endl << " ltl2dstar file" << std::endl
<< " -XDB read the from an ltl2dstar file and convert it to " << " -XDB read the from an ltl2dstar file and convert it to "
@ -266,8 +262,6 @@ syntax(char* prog)
<< std::endl << std::endl
<< "Output options (if no emptiness check):" << std::endl << "Output options (if no emptiness check):" << std::endl
<< " -b output the automaton in the format of spot"
<< std::endl
<< " -ks display statistics on the automaton (size only)" << " -ks display statistics on the automaton (size only)"
<< std::endl << std::endl
<< " -kt display statistics on the automaton (size + " << " -kt display statistics on the automaton (size + "
@ -349,7 +343,7 @@ checked_main(int argc, char** argv)
bool accepting_run = false; bool accepting_run = false;
bool accepting_run_replay = false; bool accepting_run_replay = false;
bool from_file = false; bool from_file = false;
enum { ReadSpot, ReadLbtt, ReadDstar, ReadHoa } readformat = ReadSpot; enum { ReadLbtt, ReadDstar, ReadHoa } readformat = ReadHoa;
bool nra2nba = false; bool nra2nba = false;
bool dra2dba = false; bool dra2dba = false;
bool scc_filter = false; bool scc_filter = false;
@ -415,11 +409,6 @@ checked_main(int argc, char** argv)
utf8_opt = true; utf8_opt = true;
spot::enable_utf8(); spot::enable_utf8();
} }
else if (!strcmp(argv[formula_index], "-b"))
{
output = 7;
}
else if (!strcmp(argv[formula_index], "-c")) else if (!strcmp(argv[formula_index], "-c"))
{ {
containment = true; containment = true;
@ -610,16 +599,15 @@ checked_main(int argc, char** argv)
{ {
tm.start("reading -P's argument"); tm.start("reading -P's argument");
spot::tgba_parse_error_list pel; spot::dstar_parse_error_list pel;
spot::tgba_digraph_ptr s; auto daut = spot::hoa_parse(argv[formula_index] + 2, pel,
s = spot::tgba_parse(argv[formula_index] + 2, dict, env, debug_opt);
pel, dict, env, debug_opt); if (spot::format_hoa_parse_errors(std::cerr,
if (spot::format_tgba_parse_errors(std::cerr, argv[formula_index] + 2, pel))
argv[formula_index] + 2, pel))
return 2; return 2;
s->merge_transitions(); daut->aut->merge_transitions();
system_aut = daut->aut;
tm.stop("reading -P's argument"); tm.stop("reading -P's argument");
system_aut = s;
} }
else if (!strcmp(argv[formula_index], "-r1")) else if (!strcmp(argv[formula_index], "-r1"))
{ {
@ -869,11 +857,6 @@ checked_main(int argc, char** argv)
translation = TransFM; translation = TransFM;
fm_exprop_opt = true; fm_exprop_opt = true;
} }
else if (!strcmp(argv[formula_index], "-X"))
{
from_file = true;
readformat = ReadSpot;
}
else if (!strcmp(argv[formula_index], "-XD")) else if (!strcmp(argv[formula_index], "-XD"))
{ {
from_file = true; from_file = true;
@ -984,18 +967,6 @@ checked_main(int argc, char** argv)
{ {
switch (readformat) switch (readformat)
{ {
case ReadSpot:
{
spot::tgba_digraph_ptr e;
spot::tgba_parse_error_list pel;
tm.start("parsing automaton");
a = e = spot::tgba_parse(input, pel, dict, env, debug_opt);
tm.stop("parsing automaton");
if (spot::format_tgba_parse_errors(std::cerr, input, pel))
return 2;
e->merge_transitions();
}
break;
case ReadLbtt: case ReadLbtt:
{ {
std::string error; std::string error;
@ -1530,9 +1501,6 @@ checked_main(int argc, char** argv)
case 6: case 6:
spot::lbtt_reachable(std::cout, a); spot::lbtt_reachable(std::cout, a);
break; break;
case 7:
spot::tgba_save_reachable(std::cout, a);
break;
case 8: case 8:
{ {
assert(degeneralize_opt == DegenSBA); assert(degeneralize_opt == DegenSBA);

View file

@ -175,14 +175,14 @@ grep 'transitions: 5$' stdout
grep 'states: 3$' stdout grep 'states: 3$' stdout
# Make sure FGa|GFb has the same number of states/transitions when # Make sure FGa|GFb has the same number of states/transitions when
# output as a never claim or are a degeneralized BA in Spot's textual # output as a never claim or are a degeneralized BA in HOAF.
# format. The option -R1q -R1t used to cause two degeneralizations to # The option -R1q -R1t used to cause two degeneralizations to
# occur. # occur.
run 0 ../ltl2tgba -R1q -R1t -N 'FGa|FGb' > out.never run 0 ../ltl2tgba -R1q -R1t -N 'FGa|FGb' > out.never
run 0 ../ltl2tgba -XN -kt out.never > count.never run 0 ../ltl2tgba -XN -kt out.never > count.never
run 0 ../ltl2tgba -R1q -R1t -DS -b 'FGa|FGb' > out.spot run 0 ../ltl2tgba -R1q -R1t -DS -H 'FGa|FGb' > out.hoa
run 0 ../ltl2tgba -X -kt out.spot > count.spot run 0 ../ltl2tgba -XH -kt out.hoa > count.hoa
cmp count.never count.spot cmp count.never count.hoa
# The following automaton should have only 4 states. # The following automaton should have only 4 states.
run 0 ../ltl2tgba -R3 -ks -f '(p&XF!p)|(!p&XFp)|X(Fp&F!p)' >stdout run 0 ../ltl2tgba -R3 -ks -f '(p&XF!p)|(!p&XFp)|X(Fp&F!p)' >stdout

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2012 Laboratoire de Recherche et Développement # Copyright (C) 2012, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE). # de l'Epita (LRDE).
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
@ -22,28 +22,46 @@
set -e set -e
cat >file <<EOF cat >file <<EOF
acc = "IOP.clear_interrupts"; HOA: v1
"1", "2", "a & b",; States: 10
"1", "3", "(!a & !b & !c) | (c & a)",; Start: 0
"1", "1", "(!a & !b & !c) | (c & a)", "IOP.clear_interrupts"; AP: 4 "a" "b" "c" "d"
"1", "4", "!a & !c",; acc-name: Buchi
"1", "5", "!a & !c", "IOP.clear_interrupts"; Acceptance: 1 Inf(0)
"1", "6", "a & b",; properties: trans-labels explicit-labels trans-acc
"2", "2", "a & b",; --BODY--
"2", "3", "c & a",; State: 0
"2", "1", "c & a", "IOP.clear_interrupts"; [!0&!1&!2 | 0&2] 0 {0}
"2", "6", "a & b",; [0&1] 1
"3", "8", "1",; [!0&!1&!2 | 0&2] 2
"4", "10", "!c",; [!0&!2] 3
"4", "8", "!b & !c",; [!0&!2] 4 {0}
"5", "3", "!a & !b & !c",; [0&1] 5
"5", "1", "!a & !b & !c", "IOP.clear_interrupts"; State: 1
"5", "4", "!a & !c",; [0&2] 0 {0}
"5", "5", "!a & !c", "IOP.clear_interrupts"; [0&1] 1
"6", "7", "b",; [0&2] 2
"6", "8", "c",; [0&1] 5
"7", "9", "b & !c & !d",; State: 2
"9", "9", "b & !c",; [t] 6
State: 3
[!1&!2] 6
[!2] 7
State: 4
[!0&!1&!2] 0 {0}
[!0&!1&!2] 2
[!0&!2] 3
[!0&!2] 4 {0}
State: 5
[2] 6
[1] 8
State: 6
State: 7
State: 8
[1&!2&!3] 9
State: 9
[1&!2] 9
--END--
EOF EOF
cat >outexp <<EOF cat >outexp <<EOF
@ -51,6 +69,6 @@ transitions: 12
states: 6 states: 6
EOF EOF
run 0 ../ltl2tgba -X -ks -RDS file > out run 0 ../ltl2tgba -XH -ks -RDS file > out
cmp out outexp cmp out outexp

View file

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2013 Laboratoire de Recherche et Développement # Copyright (C) 2013, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE). # de l'Epita (LRDE).
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
@ -28,14 +27,25 @@ set -e
# This is a counterexample for one of the optimization idea we had for # This is a counterexample for one of the optimization idea we had for
# the SAT-based minimization. # the SAT-based minimization.
cat >input.tgba <<EOF cat >input.hoa <<EOF
acc = "x"; HOA: v1
"1", "2", "a", "x"; States: 3
"1", "3", "!a",; Start: 0
"2", "1", "!a", "x"; AP: 1 "a"
"2", "3", "a",; acc-name: Buchi
"3", "3", "a", "x"; Acceptance: 1 Inf(0)
"3", "3", "!a",; properties: trans-labels explicit-labels trans-acc complete deterministic
--BODY--
State: 0
[0] 1 {0}
[!0] 2
State: 1
[!0] 0 {0}
[0] 2
State: 2
[0] 2 {0}
[!0] 2
--END--
EOF EOF
cat >expected <<EOF cat >expected <<EOF
@ -45,6 +55,5 @@ states: 1
nondeterministic states: 0 nondeterministic states: 0
EOF EOF
../ltl2tgba -RS1 -kt -X input.tgba > output ../ltl2tgba -RS1 -kt -XH input.hoa > output
diff output expected diff output expected

View file

@ -32,138 +32,207 @@ set -e
# G((!p0 | !p2 | (!p1 W (!p1 & p3 & X(!p1 U p4)))) U p1) # G((!p0 | !p2 | (!p1 W (!p1 & p3 & X(!p1 U p4)))) U p1)
# The formula does not really matter (except to show how # The formula does not really matter (except to show how
# such automata can occur). The important point is that the # such automata can occur). The important point is that the
# acceptance condition "p4", used a lot, is always present # acceptance set "0" contains the acceptance set "1", so
# when "p1" is used. So the "p4" acceptance can be removed. # "0" can be removed.
cat <<EOF > aut.txt cat <<EOF > aut.txt
acc = "p4" "p1"; HOA: v1
S1, S1, "p1", "p4" "p1"; States: 4
S1, S1, "!p0 | !p2", "p4"; Start: 0
S1, S2, "p3", "p4"; AP: 5 "p1" "p0" "p2" "p3" "p4"
S1, S3, "1", "p4"; acc-name: generalized-Buchi 2
S2, S1, "p1 & p4", "p4" "p1"; Acceptance: 2 Inf(0)&Inf(1)
S2, S1, "(p4 & !p0) | (p4 & !p2)", "p4"; properties: trans-labels explicit-labels trans-acc
S2, S2, "p3 & p4", "p4"; --BODY--
S2, S2, "(!p1 & !p0) | (!p1 & !p2) | (!p1 & p3)",; State: 0
S2, S3, "p4", "p4"; [0] 0 {0 1}
S2, S4, "!p1",; [!1 | !2] 0 {0}
S3, S2, "!p1 & p3", "p4"; [3] 1 {0}
S3, S3, "!p1", "p4"; [t] 2 {0}
S4, S2, "!p1 & p3 & p4", "p4"; State: 1
S4, S2, "!p1 & p3",; [0&4] 0 {0 1}
S4, S3, "!p1 & p4", "p4"; [!1&4 | !2&4] 0 {0}
S4, S4, "!p1",; [3&4] 1 {0}
[!0&!1 | !0&!2 | !0&3] 1
[4] 2 {0}
[!0] 3
State: 2
[!0&3] 1 {0}
[!0] 2 {0}
State: 3
[!0&3] 1
[!0&3&4] 1 {0}
[!0&4] 2 {0}
[!0] 3
--END--
EOF EOF
run 0 ../ltl2tgba -X -R3 -b aut.txt > out.txt run 0 ../ltl2tgba -XH -R3 -H aut.txt > out.txt
grep '^acc = "[^"]*";$' out.txt grep '^Acceptance: 1 Inf(0)' out.txt
# Here, acceptances A and C can both be removed. # Here, acceptance sets 0 and 2 can both be removed.
cat <<EOF > aut2.txt cat <<EOF > aut2.txt
acc = A B C D; HOA: v1
S1, S1, "a", A; States: 1
S1, S1, "b", A B; Start: 0
S1, S1, "c", A B C; AP: 4 "a" "b" "c" "d"
S1, S1, "d", C D; acc-name: generalized-Buchi 4
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0}
[1] 0 {0 1}
[2] 0 {0 1 2}
[3] 0 {2 3}
--END--
EOF EOF
run 0 ../ltl2tgba -X -R3 -b aut2.txt > out2.txt run 0 ../ltl2tgba -XH -R3 -H aut2.txt > out2.txt
grep '^acc = "." ".";$' out2.txt || exit 1 grep '^Acceptance: 2 ' out2.txt
# only 4 lines output, because the "b" and "c" lines have been merged. # only 3 transitions output, because [1] and [2] have been merged
test `wc -l < out2.txt` = 4 test `grep -c '\[.*\]' out2.txt` = 3
# Here, acceptances A and B can both be removed. # Here, acceptance sets 0 and 1 can both be removed.
cat <<EOF > aut3.txt cat <<EOF > aut3.txt
acc = A B C D; HOA: v1
S1, S1, "a", A; States: 1
S1, S1, "b", A B; Start: 0
S1, S1, "c", A B C; AP: 4 "a" "b" "c" "d"
S1, S1, "d", B D; acc-name: generalized-Buchi 4
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0}
[1] 0 {0 1}
[2] 0 {0 1 2}
[3] 0 {1 3}
--END--
EOF EOF
run 0 ../ltl2tgba -X -R3 -b aut3.txt > out3.txt run 0 ../ltl2tgba -XH -R3 -H aut3.txt > out3.txt
grep '^acc = "." ".";$' out3.txt || exit 1 grep '^Acceptance: 2 ' out3.txt
# only 4 lines output, because the "a" and "b" lines have been merged. # only 3 transitions output, because [0] and [1] have been merged
test `wc -l < out3.txt` = 4 test `grep -c '\[.*\]' out3.txt` = 3
# No simplification possible here # No simplification possible here
cat <<EOF > aut4.txt cat <<EOF > aut4.txt
acc = A B C D; HOA: v1
S1, S1, "a", A; States: 1
S1, S1, "b", A B; Start: 0
S1, S1, "c", A B C; AP: 5 "a" "b" "c" "d" "e"
S1, S1, "d", B D; acc-name: generalized-Buchi 4
S1, S1, "e", C D; Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0}
[1] 0 {0 1}
[2] 0 {0 1 2}
[3] 0 {1 3}
[4] 0 {2 3}
--END--
EOF EOF
run 0 ../ltl2tgba -X -R3 -b aut4.txt > out4.txt run 0 ../ltl2tgba -XH -R3 -H aut4.txt > out4.txt
test `grep '^acc' out4.txt | wc -w` = 6 grep '^Acceptance: 4 ' out4.txt
test `wc -l < out4.txt` = 6 test `grep -c '\[.*\]' out4.txt` = 5
# Make sure nothing wrong (like an assert()) # Make sure nothing wrong (like an assert())
# happens when no acceptance conditions are used. # happens when no acceptance conditions are used.
cat <<EOF > aut5.txt cat <<EOF > aut5.txt
acc = ; HOA: v1
S1, S1, "a", ; States: 1
S1, S1, "b", ; Start: 0
S1, S1, "c", ; AP: 3 "a" "b" "c"
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[0] 0
[1 | 2] 0
--END--
EOF EOF
run 0 ../ltl2tgba -X -R3 -b aut5.txt > out5.txt run 0 ../ltl2tgba -XH -R3 -H aut5.txt > out5.txt
test `wc -l < out5.txt` = 2 grep '^Acceptance: 0 t' out5.txt
test `grep -c '\[.*\]' out5.txt` = 1
# Here, one of A,B and one of C,D can be removed. # Here, one of 0,1 and one of 2,3 can be removed.
cat <<EOF > aut6.txt cat <<EOF > aut6.txt
acc = A B C D; HOA: v1
S1, S1, "a", A B; States: 1
S1, S1, "b", A B; Start: 0
S1, S1, "c", C D; AP: 4 "a" "b" "c" "d"
S1, S1, "d", C D; acc-name: generalized-Buchi 4
Acceptance: 4 Inf(0)&Inf(1)&Inf(2)&Inf(3)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0 {0 1}
[1] 0 {0 1}
[2] 0 {2 3}
[3] 0 {2 3}
--END--
EOF EOF
run 0 ../ltl2tgba -X -R3 -b aut6.txt > out6.txt run 0 ../ltl2tgba -XH -R3 -H aut6.txt > out6.txt
test `grep '^acc' out6.txt | wc -w` = 4 grep '^Acceptance: 2 ' out6.txt
test `wc -l < out6.txt` = 3 test `grep -c '\[.*\]' out6.txt` = 2
# This automaton comes from the formula # This automaton comes from the formula
# 1 U (p0 & (!p1 R ((1 U !p2) & (1 U !p3)))) # 1 U (p0 & (!p1 R ((1 U !p2) & (1 U !p3))))
# and and early implementation of our simplification # and an early implementation of our simplification
# missed the simplification. # missed the simplification.
cat <<EOF > aut7.txt cat <<EOF > aut7.txt
acc = ZZ "!p3" "!p2"; HOA: v1
S1, S2, "p0 & !p2 & !p3 & !p1", ZZ "!p3" "!p2"; States: 6
S1, S1, "!p0 | p1 | p2 | p3", "!p3" "!p2"; Start: 0
S1, S3, "p0 & p2 & !p3 & !p1", ZZ "!p3"; AP: 4 "p0" "p1" "p2" "p3"
S1, S4, "p0 & p3 & !p2 & !p1", ZZ "!p2"; acc-name: generalized-Buchi 3
S1, S5, "(p0 & p2 & !p1) | (p0 & p3 & !p1)", ZZ; Acceptance: 3 Inf(0)&Inf(1)&Inf(2)
S1, S6, "p0 & p1 & !p2 & !p3", ZZ "!p3" "!p2"; properties: trans-labels explicit-labels trans-acc complete
S1, S6, "(p0 & p1 & !p3) | (p0 & p2 & !p3)", ZZ "!p3"; --BODY--
S1, S6, "(p0 & p1 & !p2) | (p0 & p3 & !p2)", ZZ "!p2"; State: 0
S1, S6, "(p0 & p1) | (p0 & p2) | (p0 & p3)", ZZ; [!0 | 1 | 2 | 3] 0 {1 2}
S2, S2, "1", ZZ "!p3" "!p2"; [0&!1&!2&!3] 1 {0 1 2}
S3, S2, "!p2", ZZ "!p3" "!p2"; [0&!1&2&!3] 2 {0 1}
S3, S3, "p2", ZZ "!p3"; [0&!1&!2&3] 3 {0 2}
S4, S2, "!p3", ZZ "!p3" "!p2"; [0&!1&2 | 0&!1&3] 4 {0}
S4, S4, "p3", ZZ "!p2"; [0&1&!2&!3] 5 {0 1 2}
S5, S2, "!p2 & !p3", ZZ "!p3" "!p2"; [0&1&!3 | 0&2&!3] 5 {0 1}
S5, S3, "p2 & !p3", ZZ "!p3"; [0&1&!2 | 0&!2&3] 5 {0 2}
S5, S4, "p3 & !p2", ZZ "!p2"; [0&1 | 0&2 | 0&3] 5 {0}
S5, S5, "p2 | p3", ZZ; State: 1
S6, S2, "!p2 & !p3 & !p1", ZZ "!p3" "!p2"; [t] 1 {0 1 2}
S6, S3, "p2 & !p3 & !p1", ZZ "!p3"; State: 2
S6, S4, "p3 & !p2 & !p1", ZZ "!p2"; [!2] 1 {0 1 2}
S6, S5, "(p2 & !p1) | (p3 & !p1)", ZZ; [2] 2 {0 1}
S6, S6, "p1 & !p2 & !p3", ZZ "!p3" "!p2"; State: 3
S6, S6, "(p1 & !p3) | (p2 & !p3)", ZZ "!p3"; [!3] 1 {0 1 2}
S6, S6, "(p1 & !p2) | (p3 & !p2)", ZZ "!p2"; [3] 3 {0 2}
S6, S6, "p1 | p2 | p3", ZZ; State: 4
[!2&!3] 1 {0 1 2}
[2&!3] 2 {0 1}
[!2&3] 3 {0 2}
[2 | 3] 4 {0}
State: 5
[!1&!2&!3] 1 {0 1 2}
[!1&2&!3] 2 {0 1}
[!1&!2&3] 3 {0 2}
[!1&2 | !1&3] 4 {0}
[1 | 2 | 3] 5 {0}
[1&!2&!3] 5 {0 1 2}
[1&!3 | 2&!3] 5 {0 1}
[1&!2 | !2&3] 5 {0 2}
--END--
EOF EOF
run 0 ../ltl2tgba -X -R3 -b aut7.txt > out7.txt run 0 ../ltl2tgba -XH -R3 -H aut7.txt > out7.txt
test `grep '^acc' out7.txt | wc -w` = 4 grep '^Acceptance: 2 ' out7.txt
run 0 ../ltl2tgba -R3 -b '(GFa&GFb) | (GFc&GFd)' > out8.txt run 0 ../ltl2tgba -R3 -H '(GFa&GFb) | (GFc&GFd)' > out8.txt
test `grep '^acc' out8.txt | wc -w` = 4 grep 'Acceptance: 2 ' out8.txt
# This formula gives a 12-state automaton in which one acceptance # This formula gives a 12-state automaton in which one acceptance
# condition can be removed, and after what direct simulation should # condition can be removed, and after what direct simulation should

View file

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement # Copyright (C) 2013, 2014, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE). # de l'Epita (LRDE).
# #
# This file is part of Spot, a model checking library. # This file is part of Spot, a model checking library.
@ -21,8 +21,7 @@
. ./defs . ./defs
set -e set -e
../ltl2tgba -b -x -R3f -RDS '{(a&b)[*3]}<>=>G(a&!b)' > ref ../ltl2tgba -H -x -R3f -RDS '{(a&b)[*3]}<>=>G(a&!b)' > ref
for i in -R3 -R3f '-R3 -RDS' '-R3f -RDS'; do for i in -R3 -R3f '-R3 -RDS' '-R3f -RDS'; do
../ltl2tgba -Pref -E -x $i '(X!b R F!a) U (!a | G!b)' ../ltl2tgba -Pref -E -x $i '(X!b R F!a) U (!a | G!b)'