specialized translation for GF(guarantee) and FG(safety)
This is adapted from a proposition in a paper by J. Esparza, J. Křentínský, and S. Sickert, submitted to LICS'18. We should add proper references to the code and documentation once that paper is accepted. * spot/twaalgos/gfguarantee.cc, spot/twaalgos/gfguarantee.hh: New files. * spot/twaalgos/Makefile.am, python/spot/impl.i: Add them. * spot/twa/fwd.hh: Add a forward declaration of bdd_dict_ptr. * spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Make it possible to call finalize() from the translator subclass. Constify all the do_* functions while we are there. * spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Add a "gf-guarantee" option to decide whether to use the new translation. * bin/spot-x.cc: Document it. * tests/core/dca2.test, tests/core/genltl.test, tests/core/ltl2tgba2.test, tests/core/parity2.test, tests/core/satmin.test, tests/python/automata.ipynb, tests/python/sbacc.py: Adjust test cases. * tests/python/except.py: Add a couple more tests.
This commit is contained in:
parent
89f7047925
commit
7a65bdf6bc
19 changed files with 3140 additions and 1932 deletions
|
|
@ -53,7 +53,8 @@ EOF
|
|||
|
||||
while read l_f; do
|
||||
ltl2tgba --parity='max odd' "$l_f" > l.hoa
|
||||
autfilt -q --acceptance-is='Fin(0) | Inf(1)' l.hoa
|
||||
autfilt -q --acceptance-is='Fin(0) | Inf(1)' l.hoa ||
|
||||
autfilt -q --acceptance-is='Fin(0)' l.hoa
|
||||
while read r_f; do
|
||||
# Dualizing a deterministic transition-based parity automaton
|
||||
# to obtain a transition-based deterministic streett
|
||||
|
|
@ -63,10 +64,10 @@ while read l_f; do
|
|||
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
|
||||
autfilt -q --acceptance-is=Streett-like 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
|
||||
autfilt -q -v --acceptance-is=Streett-like or.hoa
|
||||
|
||||
autcross --language-preserved --verbose -F or.hoa -F and.hoa \
|
||||
'autfilt %H --stats=%M | ltl2tgba >%O' \
|
||||
|
|
|
|||
|
|
@ -150,11 +150,11 @@ ms-phi-r=2,29
|
|||
ms-phi-s=0,5
|
||||
ms-phi-s=1,8
|
||||
ms-phi-s=2,497
|
||||
ms-phi-h=0,2
|
||||
ms-phi-h=1,4
|
||||
ms-phi-h=2,21
|
||||
ms-phi-h=3,170
|
||||
ms-phi-h=4,1816
|
||||
ms-phi-h=0,1
|
||||
ms-phi-h=1,3
|
||||
ms-phi-h=2,7
|
||||
ms-phi-h=3,15
|
||||
ms-phi-h=4,31
|
||||
gf-equiv=0,1
|
||||
gf-equiv=1,4
|
||||
gf-equiv=2,8
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2009-2017 Laboratoire de Recherche et Développement de
|
||||
# Copyright (C) 2009-2018 Laboratoire de Recherche et Développement de
|
||||
# l'Epita (LRDE).
|
||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
|
|
@ -132,8 +132,8 @@ sb-patterns,26, 1,1, 1,1, 1,1, 1,1
|
|||
sb-patterns,27, 2,7, 2,7, 2,7, 2,7
|
||||
hkrss-patterns,1, 1,2, 1,2, 3,6, 3,6
|
||||
hkrss-patterns,2, 1,2, 1,2, 3,6, 3,6
|
||||
hkrss-patterns,3, 5,36, 5,36, 5,36, 5,36
|
||||
hkrss-patterns,4, 9,400, 9,400, 9,400, 9,400
|
||||
hkrss-patterns,3, 5,20, 5,20, 5,20, 5,20
|
||||
hkrss-patterns,4, 9,400, 17,272, 9,400, 17,272
|
||||
hkrss-patterns,6, 1,2, 1,2, 3,6, 3,6
|
||||
hkrss-patterns,7, 2,8, 2,8, 2,8, 2,8
|
||||
hkrss-patterns,8, 1,1, 1,1, 1,1, 1,1
|
||||
|
|
|
|||
|
|
@ -33,6 +33,203 @@ done
|
|||
cat >expected<<EOF
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: co-Buchi
|
||||
Acceptance: 1 Fin(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 0
|
||||
[!0] 0 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0&1] 0 {0}
|
||||
[!1] 0
|
||||
[!0&1] 1
|
||||
State: 1
|
||||
[0] 0 {0}
|
||||
[!0] 1
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: co-Buchi
|
||||
Acceptance: 1 Fin(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 0
|
||||
[!0] 0 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Rabin 1
|
||||
Acceptance: 2 Fin(0) & Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0&1] 0 {1}
|
||||
[!1] 0
|
||||
[!0&1] 1
|
||||
State: 1
|
||||
[0] 0 {1}
|
||||
[!0] 1
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: parity max even 2
|
||||
Acceptance: 2 Fin(1) & Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 0 {0}
|
||||
[!0] 0 {1}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0&1] 0 {0}
|
||||
[!1] 0
|
||||
[!0&1] 1
|
||||
State: 1
|
||||
[0] 0 {0}
|
||||
[!0] 1
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: parity max even 2
|
||||
Acceptance: 2 Fin(1) & Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 0 {0}
|
||||
[!0] 0 {1}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Streett 1
|
||||
Acceptance: 2 Fin(0) | Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0&1] 0 {1}
|
||||
[!1] 0 {0}
|
||||
[!0&1] 1 {0}
|
||||
State: 1
|
||||
[0] 0 {1}
|
||||
[!0] 1 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: Rabin 1
|
||||
Acceptance: 2 Fin(0) & Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 0 {1}
|
||||
[!0] 0 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity min odd 3
|
||||
Acceptance: 3 Fin(0) & (Inf(1) | Fin(2))
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0&1] 0 {1}
|
||||
[!1] 0 {2}
|
||||
[!0&1] 1 {2}
|
||||
State: 1
|
||||
[0] 0 {1}
|
||||
[!0] 1 {2}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: parity max even 2
|
||||
Acceptance: 2 Fin(1) & Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0] 0 {0}
|
||||
[!0] 0 {1}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity max even 3
|
||||
Acceptance: 3 Inf(2) | (Fin(1) & Inf(0))
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[0&1] 0 {2}
|
||||
[!1] 0 {1}
|
||||
[!0&1] 1 {1}
|
||||
State: 1
|
||||
[0] 0 {2}
|
||||
[!0] 1 {1}
|
||||
--END--
|
||||
EOF
|
||||
|
||||
diff expected res
|
||||
|
||||
cat >expected2<<EOF
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
|
|
@ -236,11 +433,205 @@ State: 1
|
|||
[!0] 1 {1}
|
||||
--END--
|
||||
EOF
|
||||
diff expected2 res2
|
||||
|
||||
diff expected res
|
||||
diff expected res2
|
||||
cat >expected3<<EOF
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: co-Buchi
|
||||
Acceptance: 1 Fin(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0] 0 {0}
|
||||
[0] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 1
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0
|
||||
[1] 1 {0}
|
||||
State: 1
|
||||
[0&!1] 0
|
||||
[!0] 1
|
||||
[0&1] 1 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: co-Buchi
|
||||
Acceptance: 1 Fin(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0] 0 {0}
|
||||
[0] 0
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 1
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Rabin 1
|
||||
Acceptance: 2 Fin(0) & Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0
|
||||
[1] 1 {1}
|
||||
State: 1
|
||||
[0&!1] 0
|
||||
[!0] 1
|
||||
[0&1] 1 {1}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: parity max even 2
|
||||
Acceptance: 2 Fin(1) & Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0] 0 {1}
|
||||
[0] 0 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 1
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0
|
||||
[1] 1 {0}
|
||||
State: 1
|
||||
[0&!1] 0
|
||||
[!0] 1
|
||||
[0&1] 1 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: parity max even 2
|
||||
Acceptance: 2 Fin(1) & Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0] 0 {1}
|
||||
[0] 0 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 1
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Streett 1
|
||||
Acceptance: 2 Fin(0) | Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0 {0}
|
||||
[1] 1 {1}
|
||||
State: 1
|
||||
[0&!1] 0 {0}
|
||||
[!0] 1 {0}
|
||||
[0&1] 1 {1}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: Rabin 1
|
||||
Acceptance: 2 Fin(0) & Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0] 0 {0}
|
||||
[0] 0 {1}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 1
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity min odd 3
|
||||
Acceptance: 3 Fin(0) & (Inf(1) | Fin(2))
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0 {2}
|
||||
[1] 1 {1}
|
||||
State: 1
|
||||
[0&!1] 0 {2}
|
||||
[!0] 1 {2}
|
||||
[0&1] 1 {1}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
acc-name: parity max even 2
|
||||
Acceptance: 2 Fin(1) & Inf(0)
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0] 0 {1}
|
||||
[0] 0 {0}
|
||||
--END--
|
||||
HOA: v1
|
||||
name: "G(Fa & Fb)"
|
||||
States: 2
|
||||
Start: 1
|
||||
AP: 2 "a" "b"
|
||||
acc-name: parity max even 3
|
||||
Acceptance: 3 Inf(2) | (Fin(1) & Inf(0))
|
||||
properties: trans-labels explicit-labels trans-acc colored complete
|
||||
properties: deterministic stutter-invariant
|
||||
--BODY--
|
||||
State: 0
|
||||
[!1] 0 {1}
|
||||
[1] 1 {2}
|
||||
State: 1
|
||||
[0&!1] 0 {1}
|
||||
[!0] 1 {1}
|
||||
[0&1] 1 {2}
|
||||
--END--
|
||||
EOF
|
||||
diff expected3 res3
|
||||
|
||||
cat >expected2<<EOF
|
||||
cat >expected4<<EOF
|
||||
HOA: v1
|
||||
name: "FGa"
|
||||
States: 2
|
||||
|
|
@ -452,8 +843,7 @@ State: 1
|
|||
[!0] 1 {1}
|
||||
--END--
|
||||
EOF
|
||||
diff expected2 res3
|
||||
diff expected2 res4
|
||||
diff expected4 res4
|
||||
|
||||
ltlcross 'ltl2tgba -P' 'ltl2tgba -P"odd max"' 'ltl2tgba -P"even min"' \
|
||||
'ltl2tgba -p' 'ltl2tgba -p"odd max"' 'ltl2tgba -p"even min"' \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2013, 2017 Laboratoire de Recherche et Développement
|
||||
# Copyright (C) 2013, 2017, 2018 Laboratoire de Recherche et Développement
|
||||
# de l'Epita (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -660,7 +660,7 @@ cat >expected <<'EOF'
|
|||
"!(G((p0) -> ((p1) U (p2))))","15",3
|
||||
"!(G((p0) -> ((p1) U (p2))))","16",3
|
||||
"!(G((p0) -> ((p1) U (p2))))","17",3
|
||||
"G(F((p0) <-> (X(X(p1)))))","1",9
|
||||
"G(F((p0) <-> (X(X(p1)))))","1",7
|
||||
"G(F((p0) <-> (X(X(p1)))))","2",7
|
||||
"G(F((p0) <-> (X(X(p1)))))","3",4
|
||||
"G(F((p0) <-> (X(X(p1)))))","4",4
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -75,3 +75,15 @@ try:
|
|||
a = r.reduce()
|
||||
except RuntimeError as e:
|
||||
assert "empty cycle" in str(e)
|
||||
|
||||
f = spot.formula('GF(a | Gb)')
|
||||
try:
|
||||
spot.gf_guarantee_to_ba(f, spot._bdd_dict)
|
||||
except RuntimeError as e:
|
||||
assert "guarantee" in str(e)
|
||||
|
||||
f = spot.formula('FG(a | Fb)')
|
||||
try:
|
||||
spot.fg_safety_to_dca(f, spot._bdd_dict)
|
||||
except RuntimeError as e:
|
||||
assert "safety" in str(e)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2017 Laboratoire de Recherche et Développement de l'Epita
|
||||
# Copyright (C) 2017, 2018 Laboratoire de Recherche et Développement de l'Epita
|
||||
# (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -50,12 +50,12 @@ h = s.to_str('hoa')
|
|||
assert h == """HOA: v1
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "b" "a"
|
||||
AP: 2 "a" "b"
|
||||
Acceptance: 2 Inf(0) | Inf(1)
|
||||
properties: trans-labels explicit-labels state-acc deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[1] 1
|
||||
[0] 1
|
||||
State: 1 {1}
|
||||
[t] 1
|
||||
--END--"""
|
||||
|
|
@ -84,13 +84,13 @@ h = d.to_str('hoa')
|
|||
assert h == """HOA: v1
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 2 "b" "a"
|
||||
AP: 2 "a" "b"
|
||||
acc-name: Buchi
|
||||
Acceptance: 1 Inf(0)
|
||||
properties: trans-labels explicit-labels state-acc deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[1] 1
|
||||
[0] 1
|
||||
State: 1 {0}
|
||||
[t] 1
|
||||
--END--"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue