postproc: add support for co-Büchi output

* spot/twaalgos/cobuchi.cc, spot/twaalgos/cobuchi.hh (to_nca): New
function.
(weak_to_cobuchi): New internal function, used in to_nca and to_dca
when appropriate.
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Implement
the CoBuchi option.
* python/spot/__init__.py: Support it in Python.
* bin/common_post.cc: Add support for --buchi.
* bin/autfilt.cc: Remove the --dca option.
* tests/core/dca.test, tests/python/automata.ipynb: Adjust and add
more tests.  In particular, add more complex persistence and
recurrence formulas to the list of dca.test.
* tests/python/dca.test: Adjust and rename to...
* tests/core/dca2.test: ... this.  Add more tests, to the point
that this is now failing, as described in issue #317.
* tests/python/dca.py: Remove.
* tests/Makefile.am: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2018-01-12 20:53:53 +01:00
parent 9464043d39
commit 61b0a542f1
14 changed files with 618 additions and 531 deletions

View file

@ -309,11 +309,15 @@ TESTS_twa = \
core/cycles.test \
core/acc_word.test \
core/dca.test \
core/dca2.test \
core/dnfstreett.test \
core/parity.test \
core/parity2.test \
core/ltlsynt.test
# Issue #317.
XFAIL_TESTS = core/dca2.test
############################## PYTHON ##############################
if USE_PYTHON
@ -356,7 +360,6 @@ TESTS_python = \
python/bdditer.py \
python/bddnqueen.py \
python/bugdet.py \
python/dca.test \
python/declenv.py \
python/decompose_scc.py \
python/dualize.py \
@ -410,7 +413,6 @@ nb-html: $(TESTS_ipython:.ipynb=.html)
EXTRA_DIST = \
$(TESTS) \
python/ltl2tgba.py \
python/dca.py \
python/ipnbdoctest.py

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Laboratoire de Recherche et Développement
# Copyright (C) 2017, 2018 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -118,7 +118,6 @@ Xb -> Gb
(b | X!b) W a
b W (!b xor (!a M FXb))
((b M 1) M 1) xor (a xor Ga)
b <-> (a M 1)
a xor F(!X!Fa xor (b U Xa))
@ -149,6 +148,36 @@ a M (G!b R Xb)
(!a R a) | (Fa xor XFb)
XF(b | Gb) M ((b R a) R !a)
!a xor (0 R ((b -> a) -> Gb))
b & X(b U (F(!b | X(!b M !a)) W a))
G(Fb & ((Gb & (a R F!a)) | (F!b & (!a U Ga))))
G((G!b & (G(!a & b) | (F!b & Fa))) | (Fb&((F!b&G!a) | (Fa&Gb))))
GF(a | b | (!a & XFb))
GF((a & (!b | X(!b R XX!a))) | (!a & b & X(b U XXa)))
F!b | G(a M Fb)
G(a | (!b M (G!a | GFa)))
Ga | (!a & G(b | X(b M Fa)))
GF(Fa R (a | F!b))
G(((b & Fa) | (!b & G!a)) M Fa)
XG!a | G(a M Fb)
G(b | X(b M Fa))
G(b | G(((!a & FG!b) | (a & GFb)) U !a))
G(!a | F((!a & (a W b)) | (a & (!a M !b))))
G((Fa & ((b & Ga) | (!b & F!a))) | (G!a & ((b & F!a) | (!b & Ga))))
G(b | G(!a & !b) | F(!a & Fa))
(b | Ga) & G(Fa & F(!a & b))
G(F!a & Fa)
G(b M Fa)
G(G(a & b) | (F!b & F!a))
Ga R XF((Xa & (!a | Fb)) | (a & G!b & X!a))
G(Fb & ((G!a & XXGb) | (Fa & XXF!b)))
G((b & G(!a | Ga)) | (!b & F(a & F!a)))
G(b & (X!a M Fa))
G(Fa & (X((!a & G!b) | (a & Fb)) M Fb))
G(Fa | G(!b M F!a))
G((Ga & F(!a W b)) | (F!a & G(a M !b)))
G(Fb U a)
G(F!b & Fb)
F(b & F!b) R (!a M Fa)
(Ga | Fb) M 1
!G(F(b & Fa) W b)
@ -180,248 +209,118 @@ Fa -> XXG(1 U Gb)
XXFa U Ga
a & F!X(a | XFa)
F(a | Gb)
F((XXb&G(!a|(Gb&XG!a)|(F!b&XFa)))|(XX!b&F(a&((Gb&XFa)|(XG!a&F!b)))))
F((!a & F(a W (a R b))) | (a & G(!a M (!a U !b))))
XFb R F((b & F!a) | (!b & Ga))
F((G!b & XX!a) | (Fb & XXa)) W (!a | Ga)
F((a & FG(Ga M b)) | (!a & GF(F!a W !b)))
XF(!a | GF(!b W F!a))
(b & X(b W a)) M (Xb R (Fb & Fa))
F(b | (G!b & FGa) | G(Fb & F!a))
FG(((a & !b) | (!a & b)) & F((F!a & Xb) | (Ga & X!b)))
X(!b | XF((a & F((F!b & G!a) | (Gb & Fa))) | (!a & G(G(!a & b) | (F!b & Fa)))))
F((a & !b & G((b | Fa) U b)) | ((!a | b) & F((!b & G!a) R !b)))
XF(b | GF((b & Fa) | (!b & G!a)))
(FGa R (!b M F!a)) R (!b | FGb)
F(!b | (FGa & F(Gb & X!a)) | G(F!a & (F!b | Xa)))
Xb R (F!b U ((b & XF!a) | (!b & XGa)))
(Fa U ((b & Ga) | (!b & F!a))) W X((a & F!b) | (!a & Gb))
X!a R F(Fb R !a)
Ga | F((a & b & G((!a | F!b) U !a)) | ((!a | !b) & F((a & Gb) R a)))
F(a W Fb) W ((!a & G!b) | (a & Fb))
F((b&G(F((a&b)|(!a&!b))|(G!b U!a)))|(!b&F(G((a&!b)|(!a&b))&(Fb R a))))
F((Fa & G(a | b)) | (G!a & F(!a & !b))) W G!a
F(Fa & G(a | b)) W G!a
F(!b | GF((!b & Fa) | (b & G!a)))
Fa R XF(Xb | (!b M G!a))
F((b & G(F!b & Fa)) | (!b & F(Gb | G!a)))
XX(FGb R (b U ((a & F!b) | (!a & Gb))))
F((a & F(!a W G!b)) | (!a & G(a M Fb)))
Fa R (((a & F!b) | (!a & Gb)) R F(Xb W Fa))
F((b & F(G!b | G!a)) | (!b & G(Fb & Fa)))
F((Fb & G!a) | (G!b & Fa)) W (a | Xb)
EOF
cat formulas | ltlcross \
ltlcross --grind=bugs -F formulas \
--timeout=60 \
'{1} ltl2tgba %f >%T' \
'{2} case `ltlfilt -f %f --format=%%[w]h` in *P*) ltl2tgba -B %f | autfilt\
--dca ;; *) ltl2tgba -B %f;; esac >%O'
-D --cobuchi ;; *) ltl2tgba -B %f;; esac >%O' \
'{3} case `ltlfilt -f %f --format=%%[w]h` in *P*) ltl2tgba --cobuchi %f;; \
*) ltl2tgba -B %f;; esac >%O'
for i in 4 5 6 7 8 9 10
do
for acc in "min even" "min odd" "max even" "max odd";
do
randaut -A "parity $acc $i" a b c > input.hoa
autfilt --dca input.hoa > res.hoa
autfilt input.hoa --included-in=res.hoa
autfilt -D --cobuchi input.hoa > res.hoa
autfilt -q input.hoa --included-in=res.hoa
autfilt -q --deterministic --acceptance-is=coBuchi res.hoa
done
done
cat formulas | ltlcross \
ltlcross -F formulas \
--timeout=60 \
'{1} ltl2tgba %f | autfilt --gra >%T' \
'{2} case `ltlfilt -f %f --format=%\[w]h` in *P*) ltl2tgba -B %f | autfilt\
--gra | autfilt --dca ;; *) ltl2tgba -B %f;; esac >%O'
'{2} case `ltlfilt -f %f --format=%%[w]h` in *P*) ltl2tgba -B %f | autfilt\
--gra | autfilt --cobuchi;; *) ltl2tgba -B %f;; esac >%O' \
'{3} case `ltlfilt -f %f --format=%%[w]h` in *P*) ltl2tgba -B %f | autfilt\
--gra | autfilt --cobuchi -D;; *) ltl2tgba -B %f;; esac >%O'
cat > bigtest.hoa << EOF
HOA: v1
States: 29
Start: 7
AP: 3 "a" "b" "c"
Acceptance: 5 Fin(0) & (Inf(1) | Fin(2)) & (Inf(3) | Fin(4))
properties: trans-labels explicit-labels state-acc complete
properties: deterministic
--BODY--
State: 0 {3}
[0&!1&!2] 0
[0&1&!2] 1
[0&!1&2] 4
[!0&1&2] 13
[!0&!1&2] 15
[!0&1&!2] 20
[!0&!1&!2] 21
[0&1&2] 22
State: 1 {3}
[0&!1&!2] 0
[0&1&!2] 1
[!0&2] 13
[!0&1&!2] 20
[!0&!1&!2] 21
[0&2] 22
State: 2 {3}
[0&!1&2] 2
[0&!1&!2] 3
[0&1&!2] 12
[!0&1] 13
[0&1&2] 14
[!0&!1] 15
State: 3 {3}
[0&!1&2] 2
[0&!1&!2] 3
[0&1&!2] 12
[!0&1&2] 13
[0&1&2] 14
[!0&!1&2] 15
[!0&!1&!2] 16
[!0&1&!2] 20
State: 4 {3}
[0&!1&!2] 3
[0&!1&2] 4
[0&1&!2] 12
[!0&1] 13
[!0&!1] 15
[0&1&2] 22
State: 5 {3}
[0&!1&2] 5
[0&1&!2] 12
[!0&1] 13
[0&1&2] 14
[!0&!1] 15
[0&!1&!2] 17
State: 6 {3}
[0&!1&2] 5
[0&!1&!2] 6
[!0&1&2] 13
[0&1&2] 14
[!0&!1&2] 15
[0&1&!2] 18
[!0&1&!2] 20
[!0&!1&!2] 28
State: 7 {1 3}
[!0 | 2] 13
[0&1&!2] 18
[0&!1&!2] 19
State: 8 {1 3}
[0&1&!2] 1
[0&!1&2] 8
[0&!1&!2] 9
[!0&1] 13
[0&1&2] 22
[!0&!1] 23
State: 9 {1 3}
[0&1&!2] 1
[0&!1&2] 8
[0&!1&!2] 9
[!0&1&2] 13
[!0&1&!2] 20
[0&1&2] 22
[!0&!1&2] 23
[!0&!1&!2] 24
State: 10 {1 3}
[0&1&!2] 10
[0&!1&!2] 11
[!0&2] 13
[0&2] 22
[!0&1&!2] 25
[!0&!1&!2] 26
State: 11 {1 3}
[0&!1&2] 8
[0&1&!2] 10
[0&!1&!2] 11
[!0&1&2] 13
[0&1&2] 22
[!0&!1&2] 23
[!0&1&!2] 25
[!0&!1&!2] 26
State: 12 {0 1 3}
[0&!1&!2] 0
[0&1&!2] 1
[!0&2] 13
[!0&1&!2] 20
[!0&!1&!2] 21
[0&2] 22
State: 13 {0 1 3}
[0&1&!2] 10
[0&!1&!2] 11
[!0 | 2] 13
State: 14 {0 1 3}
[!0] 13
[0&1&!2] 18
[0&!1&!2] 19
[0&2] 22
State: 15 {0 1 3}
[0&!1&!2] 6
[!0&1 | 1&2] 13
[0&1&!2] 18
[!0&!1 | !1&2] 23
State: 16 {0 1 3}
[0&!1&!2] 6
[1&2] 13
[0&1&!2] 18
[!0&1&!2] 20
[!1&2] 23
[!0&!1&!2] 24
State: 17 {0 1 3}
[0&1&!2] 1
[0&!1&2] 8
[0&!1&!2] 9
[!0&1&2] 13
[!0&1&!2] 20
[0&1&2] 22
[!0&!1&2] 23
[!0&!1&!2] 24
State: 18 {0 1 3}
[0&1&!2] 10
[0&!1&!2] 11
[!0&2] 13
[0&2] 22
[!0&1&!2] 25
[!0&!1&!2] 26
State: 19 {0 1 3}
[0&!1&2] 8
[0&1&!2] 10
[0&!1&!2] 11
[!0&1&2] 13
[0&1&2] 22
[!0&!1&2] 23
[!0&1&!2] 25
[!0&!1&!2] 26
State: 20 {0 1 3}
[2] 13
[0&1&!2] 18
[0&!1&!2] 19
[!0&1&!2] 25
[!0&!1&!2] 26
State: 21 {0 1 3}
[1&2] 13
[0&1&!2] 18
[0&!1&!2] 19
[!1&2] 23
[!0&1&!2] 25
[!0&!1&!2] 26
State: 22 {2 3}
[!0] 13
[0&1&!2] 18
[0&!1&!2] 19
[0&2] 22
State: 23 {2 3}
[0&!1&!2] 6
[!0&1 | 1&2] 13
[0&1&!2] 18
[!0&!1 | !1&2] 23
State: 24 {2 3}
[0&!1&!2] 6
[1&2] 13
[0&1&!2] 18
[!0&1&!2] 20
[!1&2] 23
[!0&!1&!2] 24
State: 25 {2 3}
[2] 13
[0&1&!2] 18
[0&!1&!2] 19
[!0&1&!2] 25
[!0&!1&!2] 26
State: 26 {2 3}
[1&2] 13
[0&1&!2] 18
[0&!1&!2] 19
[!1&2] 23
[!0&1&!2] 25
[!0&!1&!2] 26
State: 27 {2 3}
[0&!1&2] 5
[0&!1&!2] 6
[!0&1&2] 13
[0&1&2] 14
[!0&!1&2] 15
[0&1&!2] 18
[!0&1&!2] 20
[!0&!1&!2] 28
State: 28 {4}
[1&2] 13
[!1&2] 15
[0&1&!2] 18
[!0&1&!2] 20
[0&!1&!2] 27
[!0&!1&!2] 28
--END--
testeq()
{
cat >test.hoa
autfilt test.hoa --coBuchi -D > res.hoa
autfilt -q res.hoa --is-det --acceptance-is=coBuchi --equivalent-to=test.hoa
autfilt test.hoa --coBuchi > res.hoa
autfilt -q res.hoa --acceptance-is=coBuchi --equivalent-to=test.hoa
}
testeq << EOF
HOA: v1 States: 29 Start: 7 AP: 3 "a" "b" "c" Acceptance: 5 Fin(0)
& (Inf(1) | Fin(2)) & (Inf(3) | Fin(4)) properties: trans-labels
explicit-labels state-acc complete properties: deterministic --BODY--
State: 0 {3} [0&!1&!2] 0 [0&1&!2] 1 [0&!1&2] 4 [!0&1&2] 13 [!0&!1&2] 15
[!0&1&!2] 20 [!0&!1&!2] 21 [0&1&2] 22 State: 1 {3} [0&!1&!2] 0 [0&1&!2]
1 [!0&2] 13 [!0&1&!2] 20 [!0&!1&!2] 21 [0&2] 22 State: 2 {3} [0&!1&2]
2 [0&!1&!2] 3 [0&1&!2] 12 [!0&1] 13 [0&1&2] 14 [!0&!1] 15 State: 3 {3}
[0&!1&2] 2 [0&!1&!2] 3 [0&1&!2] 12 [!0&1&2] 13 [0&1&2] 14 [!0&!1&2] 15
[!0&!1&!2] 16 [!0&1&!2] 20 State: 4 {3} [0&!1&!2] 3 [0&!1&2] 4 [0&1&!2]
12 [!0&1] 13 [!0&!1] 15 [0&1&2] 22 State: 5 {3} [0&!1&2] 5 [0&1&!2] 12
[!0&1] 13 [0&1&2] 14 [!0&!1] 15 [0&!1&!2] 17 State: 6 {3} [0&!1&2] 5
[0&!1&!2] 6 [!0&1&2] 13 [0&1&2] 14 [!0&!1&2] 15 [0&1&!2] 18 [!0&1&!2]
20 [!0&!1&!2] 28 State: 7 {1 3} [!0 | 2] 13 [0&1&!2] 18 [0&!1&!2] 19
State: 8 {1 3} [0&1&!2] 1 [0&!1&2] 8 [0&!1&!2] 9 [!0&1] 13 [0&1&2] 22
[!0&!1] 23 State: 9 {1 3} [0&1&!2] 1 [0&!1&2] 8 [0&!1&!2] 9 [!0&1&2]
13 [!0&1&!2] 20 [0&1&2] 22 [!0&!1&2] 23 [!0&!1&!2] 24 State: 10 {1 3}
[0&1&!2] 10 [0&!1&!2] 11 [!0&2] 13 [0&2] 22 [!0&1&!2] 25 [!0&!1&!2] 26
State: 11 {1 3} [0&!1&2] 8 [0&1&!2] 10 [0&!1&!2] 11 [!0&1&2] 13 [0&1&2]
22 [!0&!1&2] 23 [!0&1&!2] 25 [!0&!1&!2] 26 State: 12 {0 1 3} [0&!1&!2] 0
[0&1&!2] 1 [!0&2] 13 [!0&1&!2] 20 [!0&!1&!2] 21 [0&2] 22 State: 13 {0 1 3}
[0&1&!2] 10 [0&!1&!2] 11 [!0 | 2] 13 State: 14 {0 1 3} [!0] 13 [0&1&!2]
18 [0&!1&!2] 19 [0&2] 22 State: 15 {0 1 3} [0&!1&!2] 6 [!0&1 | 1&2]
13 [0&1&!2] 18 [!0&!1 | !1&2] 23 State: 16 {0 1 3} [0&!1&!2] 6 [1&2]
13 [0&1&!2] 18 [!0&1&!2] 20 [!1&2] 23 [!0&!1&!2] 24 State: 17 {0 1 3}
[0&1&!2] 1 [0&!1&2] 8 [0&!1&!2] 9 [!0&1&2] 13 [!0&1&!2] 20 [0&1&2] 22
[!0&!1&2] 23 [!0&!1&!2] 24 State: 18 {0 1 3} [0&1&!2] 10 [0&!1&!2]
11 [!0&2] 13 [0&2] 22 [!0&1&!2] 25 [!0&!1&!2] 26 State: 19 {0 1 3}
[0&!1&2] 8 [0&1&!2] 10 [0&!1&!2] 11 [!0&1&2] 13 [0&1&2] 22 [!0&!1&2] 23
[!0&1&!2] 25 [!0&!1&!2] 26 State: 20 {0 1 3} [2] 13 [0&1&!2] 18 [0&!1&!2]
19 [!0&1&!2] 25 [!0&!1&!2] 26 State: 21 {0 1 3} [1&2] 13 [0&1&!2] 18
[0&!1&!2] 19 [!1&2] 23 [!0&1&!2] 25 [!0&!1&!2] 26 State: 22 {2 3} [!0]
13 [0&1&!2] 18 [0&!1&!2] 19 [0&2] 22 State: 23 {2 3} [0&!1&!2] 6 [!0&1 |
1&2] 13 [0&1&!2] 18 [!0&!1 | !1&2] 23 State: 24 {2 3} [0&!1&!2] 6 [1&2]
13 [0&1&!2] 18 [!0&1&!2] 20 [!1&2] 23 [!0&!1&!2] 24 State: 25 {2 3} [2]
13 [0&1&!2] 18 [0&!1&!2] 19 [!0&1&!2] 25 [!0&!1&!2] 26 State: 26 {2 3}
[1&2] 13 [0&1&!2] 18 [0&!1&!2] 19 [!1&2] 23 [!0&1&!2] 25 [!0&!1&!2] 26
State: 27 {2 3} [0&!1&2] 5 [0&!1&!2] 6 [!0&1&2] 13 [0&1&2] 14 [!0&!1&2]
15 [0&1&!2] 18 [!0&1&!2] 20 [!0&!1&!2] 28 State: 28 {4} [1&2] 13 [!1&2]
15 [0&1&!2] 18 [!0&1&!2] 20 [0&!1&!2] 27 [!0&!1&!2] 28 --END--
EOF
autfilt bigtest.hoa --dca > res.hoa
autfilt bigtest.hoa --equivalent-to='res.hoa'
cat >empty.hoa<<EOF
testeq <<EOF
HOA: v1 States: 10 Start: 0 AP: 2 "a" "b" acc-name: Rabin 3 Acceptance:
6 (Fin(0) & Inf(1)) | (Fin(2) & Inf(3)) | (Fin(4) & Inf(5)) properties:
trans-labels explicit-labels trans-acc --BODY-- State: 0 [0&!1] 8 {0}
@ -431,10 +330,8 @@ trans-labels explicit-labels trans-acc --BODY-- State: 0 [0&!1] 8 {0}
6 [!0&1] 1 {2 3 4} State: 7 [0&!1] 5 {0} [0&!1] 7 State: 8 [!0&1] 4 {0 2}
State: 9 [0&1] 3 {4} [!0&1] 5 {4} --END--
EOF
autfilt empty.hoa --dca > res.hoa
autfilt empty.hoa --equivalent-to='res.hoa'
cat >empty.hoa<<EOF
testeq<<EOF
HOA: v1 States: 11 Start: 0 AP: 3 "a" "b" "c" Acceptance: 5 (Fin(0)
| Inf(1)) & (Fin(2) | Inf(3)) & Fin(4) properties: trans-labels
explicit-labels trans-acc --BODY-- State: 0 [0&!1&!2] 1 {1} [0&!1&!2]
@ -449,10 +346,8 @@ State: 4 [0&!1&!2] 1 {1 2} [!0&!2] 3 {1 2} [0&1&!2] 4 {1 2} State: 5
8 {1 2 4} State: 9 [0&!1] 9 {0 2} [!0 | 1] 3 {0 2} State: 10 [0&!1]
10 {0 2} [!0 | 1] 8 {0 2 4} --END--
EOF
autfilt empty.hoa --dca > res.hoa
autfilt empty.hoa --equivalent-to='res.hoa'
cat >empty.hoa<<EOF
testeq<<EOF
HOA: v1 States: 10 Start: 0 AP: 2 "a" "b" acc-name: Streett 3 Acceptance:
6 (Fin(0) | Inf(1)) & (Fin(2) | Inf(3)) & (Fin(4) | Inf(5)) properties:
trans-labels explicit-labels trans-acc deterministic --BODY-- State: 0
@ -461,5 +356,3 @@ trans-labels explicit-labels trans-acc deterministic --BODY-- State: 0
4 State: 7 [!0&!1] 3 {2 5} State: 8 [0&!1] 1 {2} [!0&!1] 2 {2} State:
9 [!0&1] 6 {2 4} --END--
EOF
autfilt empty.hoa --dca > res.hoa
autfilt empty.hoa --equivalent-to='res.hoa'

75
tests/core/dca2.test Executable file
View file

@ -0,0 +1,75 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2017, 2018 Laboratoire de Recherche et
# Développement de l'EPITA.
#
# 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/>.
. ./defs
set -e
cat >l_formulas <<'EOF'
FG!b
FGc
F(a | Gb)
XF(b & Ga)
a | c | FG(!b & !c)
!a | FGb
F((!a & ((c & F!b) | (!c & Gb))) | (a & ((c & Gb) | (!c & F!b))))
F((c & F!b) | (!c & Gb))
F((!c R a) W G!b)
FG(((!b | (c M b)) & X(c & Xa)) | (b & (!c W !b) & X(!c | X!a)))
(Ga M c) M ((!b & Fb) M F(a | !b))
(Gb | X(!b M X!b)) M ((b & c) | (!b & !c))
F(c R (X!c W Fb))
XF!c & F(Fb R a)
(!c M F(b & Ga)) W (b U a)
EOF
cat >r_formulas <<'EOF'
GF(b | GF!c)
!b & G(G!c | XFc)
GF(b | c | (!c & XFb))
GFc | G(!b | !c)
G(Gb | Fc)
G(c | (c R Xc) | XF(b & !c))
Gc R XFb
G(c | (!b M (GFc | G!c)))
F(((c W Xb) & F(b R !c)) | ((!c M X!b) & G(!b U c)))
EOF
while read l_f; do
ltl2tgba --parity='max odd' "$l_f" > l.hoa
autfilt -q --acceptance-is='Fin(0) | Inf(1)' l.hoa
while read r_f; do
# Dualizing a deterministic transition-based parity automaton
# to obtain a transition-based deterministic streett
# automaton. What we want to avoid as much as possible is
# weak automata, because l.hoa is already weak and that would
# make the sum/product weak as well.
ltl2tgba "$r_f" -D --parity='min odd' | autfilt --dualize --gsa > r.hoa
# Streett & Streett
autfilt r.hoa --name="($l_f)&!($r_f)" --product=l.hoa -S > and.hoa
autfilt -q --acceptance-is=Streett and.hoa
# Streett | Streett
autfilt r.hoa --name="($l_f)|!($r_f)" --product-or=l.hoa -S > or.hoa
autfilt -q -v --acceptance-is=Streett or.hoa
autcross --language-preserved --verbose -F or.hoa -F and.hoa \
'autfilt %H --stats=%M | ltl2tgba >%O' \
'autfilt --cobuchi' 'autfilt --cobuchi -D'
done <r_formulas
done <l_formulas

View file

@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import display\n",
@ -23,9 +21,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -149,7 +145,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1043b73f0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d08673930> >"
]
},
"execution_count": 2,
@ -171,9 +167,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -312,9 +306,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -468,9 +460,7 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -493,9 +483,7 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -550,7 +538,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042bc900> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0857cbd0> >"
]
},
"execution_count": 6,
@ -565,9 +553,7 @@
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -622,7 +608,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce7b0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d08673960> >"
]
},
"execution_count": 7,
@ -644,9 +630,7 @@
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -700,7 +684,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1043b7390> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d08673b40> >"
]
},
"execution_count": 8,
@ -722,9 +706,7 @@
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -747,9 +729,7 @@
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -842,9 +822,7 @@
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -1041,9 +1019,7 @@
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -1168,7 +1144,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce870> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0858c360> >"
]
},
"execution_count": 12,
@ -1190,9 +1166,7 @@
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -1271,7 +1245,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042bc660> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0857c450> >"
]
},
"execution_count": 13,
@ -1293,9 +1267,7 @@
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -1391,7 +1363,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce6c0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0857c420> >"
]
},
"execution_count": 14,
@ -1413,9 +1385,7 @@
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -1492,7 +1462,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1043dd600> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0857c480> >"
]
},
"execution_count": 15,
@ -1507,9 +1477,7 @@
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -1964,7 +1932,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce600> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0b183ae0> >"
]
},
"execution_count": 16,
@ -1979,9 +1947,7 @@
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -2008,9 +1974,7 @@
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
@ -2047,9 +2011,7 @@
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -2588,7 +2550,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042bc8d0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0858c600> >"
]
},
"metadata": {},
@ -2606,9 +2568,7 @@
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"!rm example1.aut"
@ -2617,9 +2577,7 @@
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -2749,7 +2707,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce780> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0858c450> >"
]
},
"execution_count": 21,
@ -2764,9 +2722,7 @@
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -2821,7 +2777,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce8a0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0858c390> >"
]
},
"execution_count": 22,
@ -2836,9 +2792,7 @@
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -3204,9 +3158,7 @@
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -3261,7 +3213,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce810> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0858c1b0> >"
]
},
"metadata": {},
@ -3286,9 +3238,7 @@
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
@ -3372,72 +3322,69 @@
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n",
" -->\n",
"<!-- Title: G Pages: 1 -->\n",
"<svg width=\"170pt\" height=\"104pt\"\n",
" viewBox=\"0.00 0.00 170.00 104.47\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 100.465)\">\n",
"<svg height=\"140pt\" viewBox=\"0.00 0.00 170.00 140.47\" width=\"170pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 136.465)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-100.465 166,-100.465 166,4 -4,4\"/>\n",
"<polygon fill=\"white\" points=\"-4,4 -4,-136.465 166,-136.465 166,4 -4,4\" stroke=\"none\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"29\" y=\"-118.265\">Fin(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"54\" y=\"-118.265\">⓿</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"70\" y=\"-118.265\">) &amp; Inf(</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"113\" y=\"-118.265\">❶</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"129\" y=\"-118.265\">)</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"52\" y=\"-104.265\">[Rabin 1]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g id=\"node2\" class=\"node\"><title>0</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"56\" cy=\"-30.4654\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"56\" y=\"-26.7654\" font-family=\"Lato\" font-size=\"14.00\">0</text>\n",
"<g class=\"node\" id=\"node2\"><title>0</title>\n",
"<ellipse cx=\"56\" cy=\"-30.4654\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56\" y=\"-26.7654\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g id=\"edge1\" class=\"edge\"><title>I&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M1.15491,-30.4654C2.79388,-30.4654 17.1543,-30.4654 30.6317,-30.4654\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"37.9419,-30.4654 30.9419,-33.6155 34.4419,-30.4655 30.9419,-30.4655 30.9419,-30.4655 30.9419,-30.4655 34.4419,-30.4655 30.9418,-27.3155 37.9419,-30.4654 37.9419,-30.4654\"/>\n",
"<g class=\"edge\" id=\"edge1\"><title>I-&gt;0</title>\n",
"<path d=\"M1.15491,-30.4654C2.79388,-30.4654 17.1543,-30.4654 30.6317,-30.4654\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"37.9419,-30.4654 30.9419,-33.6155 34.4419,-30.4655 30.9419,-30.4655 30.9419,-30.4655 30.9419,-30.4655 34.4419,-30.4655 30.9418,-27.3155 37.9419,-30.4654 37.9419,-30.4654\" stroke=\"black\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M49.6208,-47.5027C48.3189,-57.3234 50.4453,-66.4654 56,-66.4654 60.166,-66.4654 62.4036,-61.323 62.7128,-54.6087\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"62.3792,-47.5027 65.8541,-54.3473 62.5434,-50.9989 62.7076,-54.495 62.7076,-54.495 62.7076,-54.495 62.5434,-50.9989 59.561,-54.6428 62.3792,-47.5027 62.3792,-47.5027\"/>\n",
"<text text-anchor=\"start\" x=\"50.5\" y=\"-70.2654\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"<g class=\"edge\" id=\"edge2\"><title>0-&gt;0</title>\n",
"<path d=\"M49.6208,-47.5027C48.3189,-57.3234 50.4453,-66.4654 56,-66.4654 60.166,-66.4654 62.4036,-61.323 62.7128,-54.6087\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"62.3792,-47.5027 65.8541,-54.3473 62.5434,-50.9989 62.7076,-54.495 62.7076,-54.495 62.7076,-54.495 62.5434,-50.9989 59.561,-54.6428 62.3792,-47.5027 62.3792,-47.5027\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"50.5\" y=\"-70.2654\">!a</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g id=\"node3\" class=\"node\"><title>1</title>\n",
"<ellipse fill=\"#ffffaa\" stroke=\"black\" cx=\"144\" cy=\"-30.4654\" rx=\"18\" ry=\"18\"/>\n",
"<text text-anchor=\"middle\" x=\"144\" y=\"-26.7654\" font-family=\"Lato\" font-size=\"14.00\">1</text>\n",
"<g class=\"node\" id=\"node3\"><title>1</title>\n",
"<ellipse cx=\"144\" cy=\"-30.4654\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"144\" y=\"-26.7654\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g id=\"edge3\" class=\"edge\"><title>0&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M74.0378,-33.3939C79.731,-34.2402 86.1223,-35.0477 92,-35.4654 99.0932,-35.9695 100.907,-35.9695 108,-35.4654 111.49,-35.2174 115.161,-34.832 118.759,-34.3826\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"125.962,-33.3939 119.456,-37.4666 122.495,-33.8699 119.027,-34.3459 119.027,-34.3459 119.027,-34.3459 122.495,-33.8699 118.599,-31.2251 125.962,-33.3939 125.962,-33.3939\"/>\n",
"<text text-anchor=\"start\" x=\"96.5\" y=\"-54.2654\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"<text text-anchor=\"start\" x=\"92\" y=\"-39.2654\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
"<g class=\"edge\" id=\"edge3\"><title>0-&gt;1</title>\n",
"<path d=\"M74.0378,-33.3939C79.731,-34.2402 86.1223,-35.0477 92,-35.4654 99.0932,-35.9695 100.907,-35.9695 108,-35.4654 111.49,-35.2174 115.161,-34.832 118.759,-34.3826\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"125.962,-33.3939 119.456,-37.4666 122.495,-33.8699 119.027,-34.3459 119.027,-34.3459 119.027,-34.3459 122.495,-33.8699 118.599,-31.2251 125.962,-33.3939 125.962,-33.3939\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"96.5\" y=\"-54.2654\">a</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"92\" y=\"-39.2654\">❶</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g id=\"edge4\" class=\"edge\"><title>1&#45;&gt;0</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M131.404,-17.3266C125.156,-11.2493 116.908,-4.67653 108,-1.46544 95.985,2.86544 83.5046,-4.00369 73.8973,-12.1402\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"68.5978,-17.0022 71.6264,-9.94872 71.1769,-14.636 73.7559,-12.2699 73.7559,-12.2699 73.7559,-12.2699 71.1769,-14.636 75.8855,-14.591 68.5978,-17.0022 68.5978,-17.0022\"/>\n",
"<text text-anchor=\"start\" x=\"94.5\" y=\"-20.2654\" font-family=\"Lato\" font-size=\"14.00\">!a</text>\n",
"<text text-anchor=\"start\" x=\"92\" y=\"-5.26544\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#1f78b4\">⓿</text>\n",
"<g class=\"edge\" id=\"edge4\"><title>1-&gt;0</title>\n",
"<path d=\"M131.404,-17.3266C125.156,-11.2493 116.908,-4.67653 108,-1.46544 95.985,2.86544 83.5046,-4.00369 73.8973,-12.1402\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"68.5978,-17.0022 71.6264,-9.94872 71.1769,-14.636 73.7559,-12.2699 73.7559,-12.2699 73.7559,-12.2699 71.1769,-14.636 75.8855,-14.591 68.5978,-17.0022 68.5978,-17.0022\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"94.5\" y=\"-20.2654\">!a</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"92\" y=\"-5.26544\">⓿</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g id=\"edge5\" class=\"edge\"><title>1&#45;&gt;1</title>\n",
"<path fill=\"none\" stroke=\"black\" d=\"M136.332,-46.7557C134.483,-56.8546 137.039,-66.4654 144,-66.4654 149.221,-66.4654 151.964,-61.0593 152.229,-54.0958\"/>\n",
"<polygon fill=\"black\" stroke=\"black\" points=\"151.668,-46.7557 155.342,-53.4954 151.935,-50.2455 152.201,-53.7354 152.201,-53.7354 152.201,-53.7354 151.935,-50.2455 149.06,-53.9754 151.668,-46.7557 151.668,-46.7557\"/>\n",
"<text text-anchor=\"start\" x=\"140.5\" y=\"-85.2654\" font-family=\"Lato\" font-size=\"14.00\">a</text>\n",
"<text text-anchor=\"start\" x=\"136\" y=\"-70.2654\" font-family=\"Lato\" font-size=\"14.00\" fill=\"#ff4da0\">❶</text>\n",
"<g class=\"edge\" id=\"edge5\"><title>1-&gt;1</title>\n",
"<path d=\"M136.332,-46.7557C134.483,-56.8546 137.039,-66.4654 144,-66.4654 149.221,-66.4654 151.964,-61.0593 152.229,-54.0958\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"151.668,-46.7557 155.342,-53.4954 151.935,-50.2455 152.201,-53.7354 152.201,-53.7354 152.201,-53.7354 151.935,-50.2455 149.06,-53.9754 151.668,-46.7557 151.668,-46.7557\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"140.5\" y=\"-85.2654\">a</text>\n",
"<text fill=\"#ff4da0\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"136\" y=\"-70.2654\">❶</text>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
"</svg>"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce7e0> >"
"<IPython.core.display.SVG object>"
]
},
"execution_count": 26,
@ -3446,7 +3393,155 @@
}
],
"source": [
"aut = spot.translate('FGa', 'generic', 'deterministic'); aut"
"aut = spot.translate('FGa', 'generic', 'deterministic'); aut.show('.ba')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Translation to co-Büchi automaton"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<svg height=\"131pt\" viewBox=\"0.00 0.00 178.74 130.74\" width=\"179pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 126.74)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" points=\"-4,4 -4,-126.74 174.74,-126.74 174.74,4 -4,4\" stroke=\"none\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"62.8701\" y=\"-108.54\">Fin(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"87.8701\" y=\"-108.54\">⓿</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"103.87\" y=\"-108.54\">)</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"52.8701\" y=\"-94.5401\">[co-Büchi]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\"><title>0</title>\n",
"<ellipse cx=\"64.8701\" cy=\"-26.8701\" fill=\"#ffffaa\" rx=\"26.7407\" ry=\"26.7407\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"60.3701\" y=\"-30.6701\">0</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"56.8701\" y=\"-15.6701\">⓿</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\"><title>I-&gt;0</title>\n",
"<path d=\"M1.04557,-26.8701C1.94668,-26.8701 16.0699,-26.8701 30.6965,-26.8701\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"37.8616,-26.8701 30.8617,-30.0202 34.3616,-26.8701 30.8616,-26.8702 30.8616,-26.8702 30.8616,-26.8702 34.3616,-26.8701 30.8616,-23.7202 37.8616,-26.8701 37.8616,-26.8701\" stroke=\"black\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\"><title>0-&gt;0</title>\n",
"<path d=\"M56.6704,-52.6914C56.2072,-63.0476 58.9404,-71.7401 64.8701,-71.7401 69.3173,-71.7401 71.9666,-66.8506 72.8178,-60.0368\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"73.0697,-52.6914 75.9779,-59.7953 72.9497,-56.1893 72.8297,-59.6873 72.8297,-59.6873 72.8297,-59.6873 72.9497,-56.1893 69.6816,-59.5793 73.0697,-52.6914 73.0697,-52.6914\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"60.3701\" y=\"-75.5401\">1</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\"><title>1</title>\n",
"<ellipse cx=\"152.74\" cy=\"-26.8701\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"148.24\" y=\"-23.1701\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\"><title>0-&gt;1</title>\n",
"<path d=\"M92.1005,-26.8701C103.321,-26.8701 116.345,-26.8701 127.355,-26.8701\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"134.608,-26.8701 127.608,-30.0202 131.108,-26.8701 127.608,-26.8702 127.608,-26.8702 127.608,-26.8702 131.108,-26.8701 127.608,-23.7202 134.608,-26.8701 134.608,-26.8701\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"109.74\" y=\"-30.6701\">a</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge4\"><title>1-&gt;1</title>\n",
"<path d=\"M146.007,-43.9074C144.632,-53.728 146.877,-62.8701 152.74,-62.8701 157.138,-62.8701 159.499,-57.7276 159.826,-51.0134\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"159.474,-43.9074 162.966,-50.7428 159.647,-47.4031 159.82,-50.8988 159.82,-50.8988 159.82,-50.8988 159.647,-47.4031 156.674,-51.0547 159.474,-43.9074 159.474,-43.9074\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"149.24\" y=\"-66.6701\">a</text>\n",
"</g>\n",
"</g>\n",
"</svg>"
],
"text/plain": [
"<IPython.core.display.SVG object>"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"spot.translate('FGa', 'coBuchi').show('.ba')"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<svg height=\"131pt\" viewBox=\"0.00 0.00 170.00 130.75\" width=\"170pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 126.75)\">\n",
"<title>G</title>\n",
"<polygon fill=\"white\" points=\"-4,4 -4,-126.75 166,-126.75 166,4 -4,4\" stroke=\"none\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"58.5\" y=\"-108.55\">Fin(</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"83.5\" y=\"-108.55\">⓿</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"99.5\" y=\"-108.55\">)</text>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"48.5\" y=\"-94.5502\">[co-Büchi]</text>\n",
"<!-- I -->\n",
"<!-- 0 -->\n",
"<g class=\"node\" id=\"node2\"><title>0</title>\n",
"<ellipse cx=\"56\" cy=\"-20.7502\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56\" y=\"-17.0502\">0</text>\n",
"</g>\n",
"<!-- I&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge1\"><title>I-&gt;0</title>\n",
"<path d=\"M1.15491,-20.7502C2.79388,-20.7502 17.1543,-20.7502 30.6317,-20.7502\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"37.9419,-20.7502 30.9419,-23.9003 34.4419,-20.7502 30.9419,-20.7503 30.9419,-20.7503 30.9419,-20.7503 34.4419,-20.7502 30.9418,-17.6003 37.9419,-20.7502 37.9419,-20.7502\" stroke=\"black\"/>\n",
"</g>\n",
"<!-- 0&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge2\"><title>0-&gt;0</title>\n",
"<path d=\"M49.6208,-37.7875C48.3189,-47.6081 50.4453,-56.7502 56,-56.7502 60.166,-56.7502 62.4036,-51.6077 62.7128,-44.8935\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"62.3792,-37.7875 65.8541,-44.632 62.5434,-41.2836 62.7076,-44.7798 62.7076,-44.7798 62.7076,-44.7798 62.5434,-41.2836 59.561,-44.9275 62.3792,-37.7875 62.3792,-37.7875\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"50.5\" y=\"-75.5502\">!a</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"48\" y=\"-60.5502\">⓿</text>\n",
"</g>\n",
"<!-- 1 -->\n",
"<g class=\"node\" id=\"node3\"><title>1</title>\n",
"<ellipse cx=\"144\" cy=\"-20.7502\" fill=\"#ffffaa\" rx=\"18\" ry=\"18\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"middle\" x=\"144\" y=\"-17.0502\">1</text>\n",
"</g>\n",
"<!-- 0&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge3\"><title>0-&gt;1</title>\n",
"<path d=\"M74.4034,-20.7502C87.1928,-20.7502 104.732,-20.7502 118.874,-20.7502\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"125.916,-20.7502 118.916,-23.9003 122.416,-20.7502 118.916,-20.7503 118.916,-20.7503 118.916,-20.7503 122.416,-20.7502 118.916,-17.6003 125.916,-20.7502 125.916,-20.7502\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"96.5\" y=\"-39.5502\">a</text>\n",
"<text fill=\"#1f78b4\" font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"92\" y=\"-24.5502\">⓿</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;0 -->\n",
"<g class=\"edge\" id=\"edge4\"><title>1-&gt;0</title>\n",
"<path d=\"M128.689,-10.8844C122.598,-7.25669 115.237,-3.58794 108,-1.75016 101.108,-0 98.8924,-0 92,-1.75016 87.1374,-2.98492 82.2193,-5.0462 77.668,-7.36626\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"71.3113,-10.8844 75.9105,-4.73864 74.3736,-9.18956 77.4359,-7.49469 77.4359,-7.49469 77.4359,-7.49469 74.3736,-9.18956 78.9613,-10.2507 71.3113,-10.8844 71.3113,-10.8844\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"94.5\" y=\"-5.55016\">!a</text>\n",
"</g>\n",
"<!-- 1&#45;&gt;1 -->\n",
"<g class=\"edge\" id=\"edge5\"><title>1-&gt;1</title>\n",
"<path d=\"M136.332,-37.0404C134.483,-47.1393 137.039,-56.7502 144,-56.7502 149.221,-56.7502 151.964,-51.3441 152.229,-44.3805\" fill=\"none\" stroke=\"black\"/>\n",
"<polygon fill=\"black\" points=\"151.668,-37.0404 155.342,-43.7801 151.935,-40.5303 152.201,-44.0201 152.201,-44.0201 152.201,-44.0201 151.935,-40.5303 149.06,-44.2601 151.668,-37.0404 151.668,-37.0404\" stroke=\"black\"/>\n",
"<text font-family=\"Lato\" font-size=\"14.00\" text-anchor=\"start\" x=\"140.5\" y=\"-60.5502\">a</text>\n",
"</g>\n",
"</g>\n",
"</svg>"
],
"text/plain": [
"<IPython.core.display.SVG object>"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"spot.translate('FGa', 'coBuchi', 'deterministic').show('.ba')"
]
},
{
@ -3458,10 +3553,8 @@
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
@ -3524,10 +3617,10 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce7e0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0858c570> >"
]
},
"execution_count": 27,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
@ -3549,10 +3642,8 @@
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
@ -3615,10 +3706,10 @@
"</svg>\n"
],
"text/plain": [
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fb1042ce7e0> >"
"<spot.impl.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f9d0858c570> >"
]
},
"execution_count": 28,
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
@ -3648,7 +3739,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.6.4"
}
},
"nbformat": 4,

View file

@ -1,37 +0,0 @@
#!/usr/bin/python3
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2017 Laboratoire de Recherche et Développement de
# l'EPITA.
#
# 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/>.
import sys
import spot
def gen_streett(formula):
aut = spot.translate(formula, 'BA')
aut.set_acceptance(2, 'Fin(0) | Inf(1)')
for e in aut.edges():
if (e.acc):
e.acc = spot.mark_t([0,1])
else:
e.acc = spot.mark_t([0])
return aut
aut = gen_streett(sys.argv[1])
print(aut.to_str('hoa'))

View file

@ -1,62 +0,0 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Laboratoire de Recherche et
# Développement de l'EPITA.
#
# 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/>.
set -e
# Skip this test if ltl2dstar is not installed.
(ltl2dstar --version) || exit 77
DIR=dca.dir
mkdir -p $DIR
cat >$DIR/ba_formulas << 'EOF'
FG((Xc & XXa) <-> !(b xor (c M b)))
F!FGFb
XF(b & Ga)
FG(F(b R Fc) R Gc)
(!c M F(b M Ga)) W (b U a)
(c xor Gb) M 1
X!Gc M ((Fb R a) M 1)
!a | F(b W 0)
F(!a -> Gb)
(Gb <-> X(b W Xb)) M (b xor !c)
(c R (X!c W Fb)) M 1
!a -> (FX!(0 R F(b | c)) W c)
XF((!c R a) W !Fb)
(!a <-> !(c <-> Gb)) M 1
((0 R a) M c) M ((b xor Fb) M F(b -> a))
EOF
cat >$DIR/dsa_formulas <<'EOF'
(!b U b) U X(!a -> Fb)
1 U (a xor b)
X(!(!b | (a M b)) -> XXa)
!Gb
F(XF!a & (Fb U !a))
EOF
while read ba_f; do
../run "$srcdir/dca.py" "$ba_f" > $DIR/ba
while read dsa_f; do
ltldo -f "$dsa_f" "ltl2dstar --automata=streett\
--ltl2nba=spin:ltl2tgba@-Ds" -H |
autfilt --product=$DIR/ba > $DIR/input.hoa
autfilt --dca $DIR/input.hoa > $DIR/res.hoa
autfilt $DIR/input.hoa --equivalent-to $DIR/res.hoa
done <$DIR/dsa_formulas
done <$DIR/ba_formulas