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:
Alexandre Duret-Lutz 2018-03-28 10:32:38 +02:00
parent 89f7047925
commit 7a65bdf6bc
19 changed files with 3140 additions and 1932 deletions

View file

@ -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"' \