Fix failures detected on MacOS X with g++ 4.0.
* src/tgbaalgos/cycles.hh (state_info): Initialize mark and reach to false. * src/tgbatest/cycles.test: Use jot if seq is missing, and a custom loop of jot is missing too.
This commit is contained in:
parent
c6840d81e4
commit
f711f9d097
2 changed files with 35 additions and 3 deletions
|
|
@ -85,6 +85,10 @@ namespace spot
|
||||||
// Extra information required for the algorithm for each state.
|
// Extra information required for the algorithm for each state.
|
||||||
struct state_info
|
struct state_info
|
||||||
{
|
{
|
||||||
|
state_info()
|
||||||
|
: reach(false), mark(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
// Whether the state has already left the stack at least once.
|
// Whether the state has already left the stack at least once.
|
||||||
bool reach;
|
bool reach;
|
||||||
// set to true when the state current state w is stacked, and
|
// set to true when the state current state w is stacked, and
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,34 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# GNU systems have seq,
|
||||||
|
# BSD systems have jot.
|
||||||
|
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.
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
@ -39,17 +67,17 @@ k=3
|
||||||
v=`expr $k + 2`
|
v=`expr $k + 2`
|
||||||
w=`expr 2 \* $k + 2`
|
w=`expr 2 \* $k + 2`
|
||||||
x=`expr 3 \* $k + 3`
|
x=`expr 3 \* $k + 3`
|
||||||
for i in $(seq 2 `expr $k + 1`); do
|
for i in $(enum 2 `expr $k + 1`); do
|
||||||
echo "s1,s$i,,;"
|
echo "s1,s$i,,;"
|
||||||
echo "s$i,s$v,,;"
|
echo "s$i,s$v,,;"
|
||||||
done
|
done
|
||||||
for i in $(seq `expr $k + 2` `expr 2 \* $k`); do
|
for i in $(enum `expr $k + 2` `expr 2 \* $k`); do
|
||||||
echo "s$i,s`expr $i + 1`,,;"
|
echo "s$i,s`expr $i + 1`,,;"
|
||||||
echo "s$i,s$w,,;"
|
echo "s$i,s$w,,;"
|
||||||
done
|
done
|
||||||
echo "s`expr 2 \* $k + 1`,s$w,,;"
|
echo "s`expr 2 \* $k + 1`,s$w,,;"
|
||||||
echo "s`expr 2 \* $k + 1`,s1,,;"
|
echo "s`expr 2 \* $k + 1`,s1,,;"
|
||||||
for i in $(seq `expr 2 \* $k + 3` `expr 3 \* $k + 2`); do
|
for i in $(enum `expr 2 \* $k + 3` `expr 3 \* $k + 2`); do
|
||||||
echo "s$w,s$i,,;"
|
echo "s$w,s$i,,;"
|
||||||
echo "s$i,s$x,,;"
|
echo "s$i,s$x,,;"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue