opt_dest formula_or_ident
%type transition src_dest
%type transitions transition_block
-%type ident_list
+%type one_ident ident_list
%destructor { delete $$; }
@@ -118,13 +119,22 @@ states:
| states ';' state
| states ';'
-ident_list:
- IDENT ':'
+one_ident: IDENT ':'
{
namer->new_state(*$1);
+ std::pair::const_iterator, bool>
+ res = labels.insert(std::make_pair(*$1, @1));
+ if (!res.second)
+ {
+ error(@1, std::string("redefinition of ") + *$1 + "...");
+ error(res.first->second, std::string("... ") + *$1 + " previously defined here");
+ }
$$ = $1;
}
- | ident_list IDENT ':'
+
+
+ident_list: one_ident
+ | ident_list one_ident
{
namer->alias_state(namer->get_state(*$1), *$2);
// Keep any identifier that starts with accept.
@@ -319,6 +329,7 @@ namespace spot
}
accept_all_needed = false;
accept_all_seen = false;
+ labels.clear();
delete namer;
return result;
diff --git a/src/tgbaalgos/hoaf.cc b/src/tgbaalgos/hoaf.cc
index 9417bbc83..0139cea29 100644
--- a/src/tgbaalgos/hoaf.cc
+++ b/src/tgbaalgos/hoaf.cc
@@ -276,9 +276,9 @@ namespace spot
os << "Acceptance: " << num_acc;
if (num_acc > 0)
{
- os << " I(0";
+ os << " Inf(0";
for (unsigned i = 1; i < num_acc; ++i)
- os << ")&I(" << i;
+ os << ")&Inf(" << i;
os << ')';
}
else
diff --git a/src/tgbatest/ltl2dstar.test b/src/tgbatest/ltl2dstar.test
index 190bc149b..640c3fd23 100755
--- a/src/tgbatest/ltl2dstar.test
+++ b/src/tgbatest/ltl2dstar.test
@@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
-# Copyright (C) 2013 Laboratoire de Recherche et
+# Copyright (C) 2013, 2014 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@@ -61,3 +61,17 @@ grep '"in_type"' out.csv
grep '"DSA"' out.csv
grep '"DRA"' out.csv
grep ',,,,' out.csv
+
+
+# A bug in ltlcross <=1.2.5 caused it to not use the complement of the
+# negative automaton. So running ltlcross with GFa would check one
+# complement (the positive one), but running with FGa would ignore
+# the negative complement.
+$ltlcross -f 'GFa' --verbose \
+"ltl2dstar $RAB --ltl2nba=spin:$ltl2tgba@-s %L %D" \
+"ltl2dstar $STR --ltl2nba=spin:$ltl2tgba@-s %L %D" 2>err
+test `grep -c 'info: check_empty.*Comp' err` = 1
+$ltlcross -f 'FGa' --verbose \
+"ltl2dstar $RAB --ltl2nba=spin:$ltl2tgba@-s %L %D" \
+"ltl2dstar $STR --ltl2nba=spin:$ltl2tgba@-s %L %D" 2>err
+test `grep -c 'info: check_empty.*Comp' err` = 1
diff --git a/src/tgbatest/neverclaimread.test b/src/tgbatest/neverclaimread.test
index 22e8565b4..de5810c2d 100755
--- a/src/tgbatest/neverclaimread.test
+++ b/src/tgbatest/neverclaimread.test
@@ -169,7 +169,7 @@ run 2 ../ltl2tgba -XN input > stdout 2>stderr
cat >expected <<\EOF
input:9.16: syntax error, unexpected $undefined, expecting fi or ':'
EOF
-grep input: stderr >> stderrfilt
+grep input: stderr > stderrfilt
diff stderrfilt expected
@@ -206,6 +206,87 @@ run 0 ../ltl2tgba -ks -XN input > output
diff output expected
+# Test duplicated labels. The following neverclaim was produced by
+# ltl2ba 1.1 for '[](<>[]p1 U X[]<>Xp0)', but is rejected by Spin
+# because of a duplicate label (accept_S10). We should
+# complain as well. This was reported by Joachim Klein.
+
+cat >input <<\EOF
+never { /* [](<>[]p1 U X[]<>Xp0) */
+T0_init:
+ if
+ :: (1) -> goto accept_S2
+ :: (1) -> goto T1_S3
+ :: (p1) -> goto T2_S4
+ fi;
+accept_S2:
+ if
+ :: (1) -> goto accept_S39
+ :: (1) -> goto T1_S24
+ :: (p1) -> goto accept_S10
+ fi;
+accept_S39:
+ if
+ :: (p0) -> goto accept_S39
+ :: (1) -> goto T0_S39
+ :: (1) -> goto T0_S24
+ :: (p1) -> goto T0_S10
+ fi;
+T0_S39:
+ if
+ :: (p0) -> goto accept_S39
+ :: (1) -> goto T0_S39
+ :: (1) -> goto T0_S24
+ :: (p1) -> goto T0_S10
+ fi;
+T0_S24:
+ if
+ :: (1) -> goto T0_S24
+ :: (p1) -> goto T0_S10
+ fi;
+T0_S10:
+ if
+ :: (p0 && p1) -> goto accept_S10
+ :: (p1) -> goto T0_S10
+ fi;
+accept_S10:
+ if
+ :: (p0 && p1) -> goto accept_S10
+ :: (p1) -> goto T0_S10
+ fi;
+T1_S24:
+ if
+ :: (1) -> goto T1_S24
+ :: (p1) -> goto accept_S10
+ fi;
+accept_S10:
+ if
+ :: (p1) -> goto accept_S10
+ fi;
+T1_S3:
+ if
+ :: (1) -> goto T1_S3
+ :: (1) -> goto T1_S24
+ :: (p1) -> goto T2_S4
+ :: (p1) -> goto accept_S10
+ fi;
+T2_S4:
+ if
+ :: (p1) -> goto T2_S4
+ :: (p1) -> goto accept_S10
+ fi;
+}
+EOF
+
+run 2 ../ltl2tgba -ks -XN input > stdout 2>stderr
+cat stderr
+cat >expected-err <<\EOF
+input:48.1-10: redefinition of accept_S10...
+input:38.1-10: ... accept_S10 previously defined here
+EOF
+grep input: stderr > stderrfilt
+diff stderrfilt expected-err
+
cat >formulae<