#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2016, 2017 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 .
. ./defs
set -e
cat >alt.hoa <alt.dot
cat >expect.dot < -11 [arrowhead=onormal]
-11 [label=<>,shape=point]
-11 -> 0
-11 -> 2
subgraph cluster_0 {
color=green
label=""
2 [label="G(a)"]
2 -> 2 [label="a"]
}
subgraph cluster_1 {
color=red
label=""
1 [label="FG(a)\n⓿"]
1 -> 2 [label="a"]
1 -> 1 [label="1"]
}
subgraph cluster_2 {
color=green
label=""
6 [label="t"]
6 -> 6 [label="1"]
}
subgraph cluster_3 {
color=red
label=""
4 [label="F(b)\n⓿"]
4 -> 6 [label="b"]
4 -> 4 [label="!b"]
}
subgraph cluster_4 {
color=green
label=""
3 [label="GF(b)"]
3 -> 3 [label="b"]
3 -> -8.4 [label="!b", style=bold, color="#FAA43A", arrowhead=onormal]
-8.4 [label=<>,shape=point]
-8.4 -> 3 [style=bold, color="#FAA43A"]
-8.4 -> 4 [style=bold, color="#FAA43A"]
}
subgraph cluster_5 {
color=red
label=""
5 [label="((a) U (b))\n⓿"]
5 -> 6 [label="b"]
5 -> 5 [label="a & !b"]
}
subgraph cluster_6 {
color=black
label=""
0 [label="((((a) U (b)) && GF(b)) && FG(a))"]
0 -> -1 [label="b", arrowhead=onormal]
-1 [label=<>,shape=point]
-1 -> 1
-1 -> 3
0 -> -4 [label="a & !b", style=bold, color="#F15854", arrowhead=onormal]
-4 [label=<>,shape=point]
-4 -> 1 [style=bold, color="#F15854"]
-4 -> 3 [style=bold, color="#F15854"]
-4 -> 5 [style=bold, color="#F15854"]
}
}
EOF
diff expect.dot alt.dot
autfilt --trust=no --check=strength alt.hoa | grep properties: >output
cat >expected <out.hoa <res
cat >expected <res
cat >expected <ex1<ex2<ex3<ex4<expect4<expect4d< out4
diff expect4 out4
run 0 autfilt --remove-dead-states ex4 > out4
diff expect4d out4
cat >ex5< out5
cat >expect <ex6< ex6.dot
style='arrowhead=onormal'
cat >expect6.dot<⓿)>
labelloc="t"
node [shape="circle"]
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]
I [label="", style=invis, width=0]
I -> -1 [arrowhead=onormal]
-1 [label=<>,shape=point]
-1 -> 0
-1 -> 1
0 [label=<0>]
0 -> 0 [label=]
0 -> -1.1 [label=, style=bold, color="#F17CB0", $style]
-1.1 [label=<>,shape=point]
-1.1 -> 0 [style=bold, color="#F17CB0"]
-1.1 -> 1 [style=bold, color="#F17CB0"]
0 -> -1.2 [label=, style=bold, color="#FAA43A", $style]
-1.2 [label=<>,shape=point]
-1.2 -> 0 [style=bold, color="#FAA43A"]
-1.2 -> 1 [style=bold, color="#FAA43A"]
1 [label=<1>]
1 -> 1 [label=]
}
EOF
diff ex6.dot expect6.dot
cat >ex7< ex7.dot
color='⓿'
cat >expect7.dot<❶) & Fin($color)>
labelloc="t"
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]
I [label="", style=invis, width=0]
I -> 0
subgraph cluster_0 {
color=green
label=""
4 [label="t"]
4 -> 4 [label=<1>]
}
subgraph cluster_1 {
color=green
label=""
1 [label="G(a & b)"]
1 -> 1 [label=]
}
subgraph cluster_2 {
color=red
label=""
2 [label="F!a"]
2 -> 4 [label=]
2 -> 2 [label=❶>]
}
subgraph cluster_3 {
color=red
label=""
3 [label="F!b"]
3 -> 4 [label=]
3 -> 3 [label=⓿>]
}
subgraph cluster_4 {
color=green
label=""
0 [label="c R (c | G(a & b) | (F!b & F!a))"]
0 -> 4 [label=]
0 -> 0 [label=]
0 -> -1.4 [label=, arrowhead=onormal]
-1.4 [label=<>,shape=point]
-1.4 -> 0
-1.4 -> 1
0 -> -4.4 [label=, arrowhead=onormal]
-4.4 [label=<>,shape=point]
-4.4 -> 0
-4.4 -> 2
0 -> -7.4 [label=, arrowhead=onormal]
-7.4 [label=<>,shape=point]
-7.4 -> 0
-7.4 -> 3
0 -> -10.4 [label=, arrowhead=onormal]
-10.4 [label=<>,shape=point]
-10.4 -> 0
-10.4 -> 2
-10.4 -> 3
}
}
EOF
diff ex7.dot expect7.dot
cat >ex8< ex8.dot
cat >expect8.dot<❶) & Fin($color)>
labelloc="t"
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]
I [label="", style=invis, width=0]
I -> 0
subgraph cluster_0 {
color=green
label=""
4 [label="t"]
4 -> 4 [label=<1>]
}
subgraph cluster_1 {
color=red
label=""
2 [label="F!a"]
2 -> 4 [label=]
2 -> 2 [label=❶>]
}
subgraph cluster_2 {
color=red
label=""
3 [label="F!b"]
3 -> 4 [label=]
3 -> 3 [label=⓿>]
}
subgraph cluster_3 {
color=green
label=""
0 [label="c R (c | G(a & b) | (F!b & F!a))"]
0 -> 4 [label=]
0 -> 0 [label=]
0 -> -1.3 [label=, arrowhead=onormal]
-1.3 [label=<>,shape=point]
-1.3 -> 0
-1.3 -> 1
0 -> -4.3 [label=, arrowhead=onormal]
-4.3 [label=<>,shape=point]
-4.3 -> 0
-4.3 -> 2
0 -> -7.3 [label=, arrowhead=onormal]
-7.3 [label=<>,shape=point]
-7.3 -> 0
-7.3 -> 3
1 [label="G(a & b)"]
1 -> 1 [label=]
1 -> -10.3 [label=, arrowhead=onormal]
-10.3 [label=<>,shape=point]
-10.3 -> 0
-10.3 -> 2
-10.3 -> 3
}
}
EOF
diff ex8.dot expect8.dot
cat >ex9 < ex9.dot
cat >expect9.dot <⓿)>
labelloc="t"
node [shape="circle"]
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]
I [label="", style=invis, width=0]
I -> 0
0 [label=<0>]
0 -> -1.1 [label=, style=bold, color="#F17CB0", arrowhead=onormal]
-1.1 [label=<>,shape=point]
-1.1 -> 1 [style=bold, color="#F17CB0"]
-1.1 -> 2 [style=bold, color="#F17CB0"]
1 [label=<1>]
1 -> -1.1 [label=, style=bold, color="#F17CB0", arrowhead=onormal]
2 [label=<2>]
2 -> -1.2 [label=, style=bold, color="#FAA43A", $style]
-1.2 [label=<>,shape=point]
-1.2 -> 1 [style=bold, color="#FAA43A"]
-1.2 -> 2 [style=bold, color="#FAA43A"]
}
EOF
diff ex9.dot expect9.dot
cat >ex10 < ex10.dot
cat >expect10.dot <⓿)>
labelloc="t"
node [shape="circle"]
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]
I [label="", style=invis, width=0]
I -> 0
0 [label=<0>]
0 -> -1.1 [label=, style=bold, color="#F17CB0", arrowhead=onormal]
-1.1 [label=<>,shape=point]
-1.1 -> 1 [style=bold, color="#F17CB0"]
-1.1 -> 2 [style=bold, color="#F17CB0"]
1 [label=<1>]
1 -> -1.3 [label=, style=bold, color="#B276B2", arrowhead=onormal]
-1.3 [label=<>,shape=point]
-1.3 -> 1 [style=bold, color="#B276B2"]
-1.3 -> 2 [style=bold, color="#B276B2"]
2 [label=<2>]
2 -> -1.2 [label=, style=bold, color="#FAA43A", $style]
-1.2 [label=<>,shape=point]
-1.2 -> 1 [style=bold, color="#FAA43A"]
-1.2 -> 2 [style=bold, color="#FAA43A"]
}
EOF
diff ex10.dot expect10.dot
cat >ex11 < ex11.dot
cat >expect11.dot <⓿)>
labelloc="t"
fontname="Lato"
node [fontname="Lato"]
edge [fontname="Lato"]
I [label="", style=invis, width=0]
I -> 0
subgraph cluster_0 {
color=green
label=""
3 [label="t"]
3 -> 3 [label=<1>]
}
subgraph cluster_1 {
color=green
label=""
1 [label="Fa"]
1 -> 3 [label=]
1 -> 1 [label=]
}
subgraph cluster_2 {
color=green
label=""
2 [label="G!a"]
2 -> 2 [label=]
}
subgraph cluster_3 {
color=green
label=""
0 [label="G((b & Fa) | (!b & G!a))"]
0 -> 0 [label=]
0 -> -1.3 [label=, arrowhead=onormal]
-1.3 [label=<>,shape=point]
-1.3 -> 0
-1.3 -> 1
0 -> -4.3 [label=, arrowhead=onormal]
-4.3 [label=<>,shape=point]
-4.3 -> 0
-4.3 -> 2
}
}
EOF
diff ex11.dot expect11.dot
# Detect cases where alternation-removal cannot work.
cat >in <out && exit 1
grep 'autfilt.*weak.*alternating' out
cat >in <out && exit 1
grep 'autfilt.*weak.*alternating' out