translate: enable a restricted form of ltl-split for TGBA/BA

Fixes #267

* spot/twaalgos/gfguarantee.cc: Fix a typo when comparing automata
sizes.
* spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Use
ltl-split even for BA/TGBA, but only of conjunctions with GF(..)
in those cases.
* tests/core/ltl2tgba2.test: Adjust and add the example of #267.
* tests/core/degenid.test, tests/core/parity2.test,
tests/core/stutter-tgba.test, tests/python/automata.ipynb,
tests/python/highlighting.ipynb, tests/python/stutter-inv.ipynb,
bin/spot-x.cc: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2018-06-28 23:02:26 +02:00
parent 4235b007f3
commit f5f5daec9a
11 changed files with 1338 additions and 1494 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2011, 2013, 2014, 2015, 2017 Laboratoire de Recherche
# et Développement de l'Epita (LRDE).
# Copyright (C) 2011, 2013, 2014, 2015, 2017, 2018 Laboratoire de
# Recherche et Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
@ -239,7 +239,9 @@ properties: trans-labels explicit-labels state-acc deterministic
properties: stutter-invariant
--BODY--
State: 0
[0] 1
[0&1&2] 1
[0&!2] 2
[0&!1&2] 3
State: 1 {0}
[1&2] 1
[!2] 2

View file

@ -362,12 +362,14 @@ EOF
diff output expected
# These four formulas appear in a NEWS entry for Spot 2.6
# The first four formulas appear in a NEWS entry for Spot 2.6
# The 5th one is from issue #267.
cat >formulas <<EOF
GF((a & XXa) | (!a & XX!a)), 4,8, 4,8, 6,14, 7,14
GF((a & XXXa) | (!a & XXX!a)), 7,14, 8,16, 8,18, 15,30
GF(((a & Xb) | XXc) & Xd), 4,60, 4,64, 4,68, 5,80
GF(((a & Xb) | XXc) & Xd), 4,64, 4,64, 5,80, 5,80
GF((b | Fa) & (b R Xb)), 2,4, 2,4, 3,6, 3,12
G(F(a & Xa) & F(a & X!a)), 2,4, 2,4, 4,8, 4,8
EOF
ltl2tgba -Fformulas/1 --stats='%f, %s,%t' |

View file

@ -426,7 +426,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 6
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Buchi
@ -435,23 +435,21 @@ properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0
[t] 2
[0&1&2] 3
[!0] 1
[0&1&2] 2
State: 1
[2] 4
State: 2
[t] 3
[1&2] 4
[t] 5
State: 2
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {0}
State: 3
[2] 1
[0&!1&2] 3
[0&1&2] 3 {0}
[0] 3
[0&1&2] 4
State: 4
[0&!1&2] 4
[0&1&2] 4 {0}
State: 5
[0&1&2] 4
[0] 5
--END--
HOA: v1
name: "FGa"
@ -489,7 +487,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 6
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Rabin 1
@ -498,23 +496,21 @@ properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0
[t] 2
[0&1&2] 3
[!0] 1
[0&1&2] 2
State: 1
[2] 4
State: 2
[t] 3
[1&2] 4
[t] 5
State: 2
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {1}
State: 3
[2] 1
[0&!1&2] 3
[0&1&2] 3 {1}
[0] 3
[0&1&2] 4
State: 4
[0&!1&2] 4
[0&1&2] 4 {1}
State: 5
[0&1&2] 4
[0] 5
--END--
HOA: v1
name: "FGa"
@ -552,7 +548,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 6
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Buchi
@ -561,23 +557,21 @@ properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 0
[t] 2
[0&1&2] 3
[!0] 1
[0&1&2] 2
State: 1
[2] 4
State: 2
[t] 3
[1&2] 4
[t] 5
State: 2
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {0}
State: 3
[2] 1
[0&!1&2] 3
[0&1&2] 3 {0}
[0] 3
[0&1&2] 4
State: 4
[0&!1&2] 4
[0&1&2] 4 {0}
State: 5
[0&1&2] 4
[0] 5
--END--
HOA: v1
name: "FGa"
@ -615,7 +609,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 6
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Streett 1
@ -624,23 +618,21 @@ properties: trans-labels explicit-labels trans-acc colored
--BODY--
State: 0
[0] 0 {0}
[t] 2 {0}
[0&1&2] 3 {0}
[!0] 1 {0}
[0&1&2] 2 {0}
State: 1
[2] 4 {0}
State: 2
[t] 3 {0}
[1&2] 4 {0}
[t] 5 {0}
State: 2
[!0] 1 {0}
[0&!1&2] 2 {0}
[0&1&2] 2 {1}
State: 3
[2] 1 {0}
[0&!1&2] 3 {0}
[0&1&2] 3 {1}
[0] 3 {0}
[0&1&2] 4 {0}
State: 4
[0&!1&2] 4 {0}
[0&1&2] 4 {1}
State: 5
[0&1&2] 4 {0}
[0] 5 {0}
--END--
HOA: v1
name: "FGa"
@ -678,7 +670,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 6
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity min odd 3
@ -687,23 +679,21 @@ properties: trans-labels explicit-labels trans-acc colored
--BODY--
State: 0
[0] 0 {2}
[t] 2 {2}
[0&1&2] 3 {2}
[!0] 1 {2}
[0&1&2] 2 {2}
State: 1
[2] 4 {2}
State: 2
[t] 3 {2}
[1&2] 4 {2}
[t] 5 {2}
State: 2
[!0] 1 {2}
[0&!1&2] 2 {2}
[0&1&2] 2 {1}
State: 3
[2] 1 {2}
[0&!1&2] 3 {2}
[0&1&2] 3 {1}
[0] 3 {2}
[0&1&2] 4 {2}
State: 4
[0&!1&2] 4 {2}
[0&1&2] 4 {1}
State: 5
[0&1&2] 4 {2}
[0] 5 {2}
--END--
HOA: v1
name: "FGa"
@ -741,7 +731,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 6
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity max even 3
@ -750,23 +740,21 @@ properties: trans-labels explicit-labels trans-acc colored
--BODY--
State: 0
[0] 0 {1}
[t] 2 {1}
[0&1&2] 3 {1}
[!0] 1 {1}
[0&1&2] 2 {1}
State: 1
[2] 4 {1}
State: 2
[t] 3 {1}
[1&2] 4 {1}
[t] 5 {1}
State: 2
[!0] 1 {1}
[0&!1&2] 2 {1}
[0&1&2] 2 {2}
State: 3
[2] 1 {1}
[0&!1&2] 3 {1}
[0&1&2] 3 {2}
[0] 3 {1}
[0&1&2] 4 {1}
State: 4
[0&!1&2] 4 {1}
[0&1&2] 4 {2}
State: 5
[0&1&2] 4 {1}
[0] 5 {1}
--END--
EOF
diff expected2 res2
@ -1182,7 +1170,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 10
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Rabin 1
@ -1190,46 +1178,24 @@ Acceptance: 2 Fin(0) & Inf(1)
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0
[!0] 1
[0&!1 | 0&!2] 2
[0&1&2] 3
[0&1&2] 2
State: 1
[!1 | !2] 4
[1&2] 5
[!1 | !2] 3
[1&2] 4
State: 2
[!0&!1 | !0&!2] 1
[0&!1 | 0&!2] 2
[0&1&2] 3
[!0&1&2] 6
[0&!2] 0 {0}
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {1}
State: 3
[!0&!2] 1
[0&!2] 2 {0}
[!0&!1&2] 7
[!0&1&2] 8
[0&!1&2] 9
[0&1&2] 9 {1}
[0&!1 | 0&!2] 3
[0&1&2] 4
State: 4
[0&!1 | 0&!2] 4
[0&1&2] 5
State: 5
[0&!2] 4 {0}
[0&!1&2] 5
[0&1&2] 5 {1}
State: 6
[!0&!1 | !2] 4
[0&2 | 1&2] 5
State: 7
[!2] 4
[2] 5
State: 8
[!2] 4
[2] 5
State: 9
[!0&!2] 1
[0&!2] 2 {0}
[!0&2] 8
[0&!1&2] 9
[0&1&2] 9 {1}
[0&!2] 3 {0}
[0&!1&2] 4
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -1268,7 +1234,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 10
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Rabin 1
@ -1276,46 +1242,24 @@ Acceptance: 2 Fin(0) & Inf(1)
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0
[!0] 1
[0&!1 | 0&!2] 2
[0&1&2] 3
[0&1&2] 2
State: 1
[!1 | !2] 4
[1&2] 5
[!1 | !2] 3
[1&2] 4
State: 2
[!0&!1 | !0&!2] 1
[0&!1 | 0&!2] 2
[0&1&2] 3
[!0&1&2] 6
[0&!2] 0 {0}
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {1}
State: 3
[!0&!2] 1
[0&!2] 2 {0}
[!0&!1&2] 7
[!0&1&2] 8
[0&!1&2] 9
[0&1&2] 9 {1}
[0&!1 | 0&!2] 3
[0&1&2] 4
State: 4
[0&!1 | 0&!2] 4
[0&1&2] 5
State: 5
[0&!2] 4 {0}
[0&!1&2] 5
[0&1&2] 5 {1}
State: 6
[!0&!1 | !2] 4
[0&2 | 1&2] 5
State: 7
[!2] 4
[2] 5
State: 8
[!2] 4
[2] 5
State: 9
[!0&!2] 1
[0&!2] 2 {0}
[!0&2] 8
[0&!1&2] 9
[0&1&2] 9 {1}
[0&!2] 3 {0}
[0&!1&2] 4
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -1354,7 +1298,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 10
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity max even 2
@ -1362,46 +1306,24 @@ Acceptance: 2 Fin(1) & Inf(0)
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0
[!0] 1
[0&!1 | 0&!2] 2
[0&1&2] 3
[0&1&2] 2
State: 1
[!1 | !2] 4
[1&2] 5
[!1 | !2] 3
[1&2] 4
State: 2
[!0&!1 | !0&!2] 1
[0&!1 | 0&!2] 2
[0&1&2] 3
[!0&1&2] 6
[0&!2] 0 {1}
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {0}
State: 3
[!0&!2] 1
[0&!2] 2 {1}
[!0&!1&2] 7
[!0&1&2] 8
[0&!1&2] 9
[0&1&2] 9 {0}
[0&!1 | 0&!2] 3
[0&1&2] 4
State: 4
[0&!1 | 0&!2] 4
[0&1&2] 5
State: 5
[0&!2] 4 {1}
[0&!1&2] 5
[0&1&2] 5 {0}
State: 6
[!0&!1 | !2] 4
[0&2 | 1&2] 5
State: 7
[!2] 4
[2] 5
State: 8
[!2] 4
[2] 5
State: 9
[!0&!2] 1
[0&!2] 2 {1}
[!0&2] 8
[0&!1&2] 9
[0&1&2] 9 {0}
[0&!2] 3 {1}
[0&!1&2] 4
[0&1&2] 4 {0}
--END--
HOA: v1
name: "FGa"
@ -1440,7 +1362,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 10
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity min odd 3
@ -1449,46 +1371,24 @@ properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0 {2}
[!0] 1 {2}
[0&!1 | 0&!2] 2 {2}
[0&1&2] 3 {2}
[0&1&2] 2 {2}
State: 1
[!1 | !2] 4 {2}
[1&2] 5 {2}
[!1 | !2] 3 {2}
[1&2] 4 {2}
State: 2
[!0&!1 | !0&!2] 1 {2}
[0&!1 | 0&!2] 2 {2}
[0&1&2] 3 {2}
[!0&1&2] 6 {2}
[0&!2] 0 {0}
[!0] 1 {2}
[0&!1&2] 2 {2}
[0&1&2] 2 {1}
State: 3
[!0&!2] 1 {2}
[0&!2] 2 {0}
[!0&!1&2] 7 {2}
[!0&1&2] 8 {2}
[0&!1&2] 9 {2}
[0&1&2] 9 {1}
[0&!1 | 0&!2] 3 {2}
[0&1&2] 4 {2}
State: 4
[0&!1 | 0&!2] 4 {2}
[0&1&2] 5 {2}
State: 5
[0&!2] 4 {0}
[0&!1&2] 5 {2}
[0&1&2] 5 {1}
State: 6
[!0&!1 | !2] 4 {2}
[0&2 | 1&2] 5 {2}
State: 7
[!2] 4 {2}
[2] 5 {2}
State: 8
[!2] 4 {2}
[2] 5 {2}
State: 9
[!0&!2] 1 {2}
[0&!2] 2 {0}
[!0&2] 8 {2}
[0&!1&2] 9 {2}
[0&1&2] 9 {1}
[0&!2] 3 {0}
[0&!1&2] 4 {2}
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -1527,7 +1427,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 10
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity min odd 3
@ -1536,46 +1436,24 @@ properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0 {2}
[!0] 1 {2}
[0&!1 | 0&!2] 2 {2}
[0&1&2] 3 {2}
[0&1&2] 2 {2}
State: 1
[!1 | !2] 4 {2}
[1&2] 5 {2}
[!1 | !2] 3 {2}
[1&2] 4 {2}
State: 2
[!0&!1 | !0&!2] 1 {2}
[0&!1 | 0&!2] 2 {2}
[0&1&2] 3 {2}
[!0&1&2] 6 {2}
[0&!2] 0 {0}
[!0] 1 {2}
[0&!1&2] 2 {2}
[0&1&2] 2 {1}
State: 3
[!0&!2] 1 {2}
[0&!2] 2 {0}
[!0&!1&2] 7 {2}
[!0&1&2] 8 {2}
[0&!1&2] 9 {2}
[0&1&2] 9 {1}
[0&!1 | 0&!2] 3 {2}
[0&1&2] 4 {2}
State: 4
[0&!1 | 0&!2] 4 {2}
[0&1&2] 5 {2}
State: 5
[0&!2] 4 {0}
[0&!1&2] 5 {2}
[0&1&2] 5 {1}
State: 6
[!0&!1 | !2] 4 {2}
[0&2 | 1&2] 5 {2}
State: 7
[!2] 4 {2}
[2] 5 {2}
State: 8
[!2] 4 {2}
[2] 5 {2}
State: 9
[!0&!2] 1 {2}
[0&!2] 2 {0}
[!0&2] 8 {2}
[0&!1&2] 9 {2}
[0&1&2] 9 {1}
[0&!2] 3 {0}
[0&!1&2] 4 {2}
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -1614,7 +1492,7 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 10
States: 5
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity max even 4
@ -1623,46 +1501,24 @@ properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0 {1}
[!0] 1 {1}
[0&!1 | 0&!2] 2 {1}
[0&1&2] 3 {1}
[0&1&2] 2 {1}
State: 1
[!1 | !2] 4 {1}
[1&2] 5 {1}
[!1 | !2] 3 {1}
[1&2] 4 {1}
State: 2
[!0&!1 | !0&!2] 1 {1}
[0&!1 | 0&!2] 2 {1}
[0&1&2] 3 {1}
[!0&1&2] 6 {1}
[0&!2] 0 {3}
[!0] 1 {1}
[0&!1&2] 2 {1}
[0&1&2] 2 {2}
State: 3
[!0&!2] 1 {1}
[0&!2] 2 {3}
[!0&!1&2] 7 {1}
[!0&1&2] 8 {1}
[0&!1&2] 9 {1}
[0&1&2] 9 {2}
[0&!1 | 0&!2] 3 {1}
[0&1&2] 4 {1}
State: 4
[0&!1 | 0&!2] 4 {1}
[0&1&2] 5 {1}
State: 5
[0&!2] 4 {3}
[0&!1&2] 5 {1}
[0&1&2] 5 {2}
State: 6
[!0&!1 | !2] 4 {1}
[0&2 | 1&2] 5 {1}
State: 7
[!2] 4 {1}
[2] 5 {1}
State: 8
[!2] 4 {1}
[2] 5 {1}
State: 9
[!0&!2] 1 {1}
[0&!2] 2 {3}
[!0&2] 8 {1}
[0&!1&2] 9 {1}
[0&1&2] 9 {2}
[0&!2] 3 {3}
[0&!1&2] 4 {1}
[0&1&2] 4 {2}
--END--
EOF
diff expected4 res4

View file

@ -26,13 +26,13 @@ ltl2tgba '!FG(a | Xa | G!a)' -H | autfilt -H --destut > pos.hoa
ltl2tgba 'FG(a | Xa | G!a)' -H | autfilt -H --destut > neg.hoa
autfilt pos.hoa --product neg.hoa -H > prod.hoa
autfilt --is-empty prod.hoa -q && exit 1
autfilt --states=7 prod.hoa -q
autfilt --states=5 prod.hoa -q
ltl2tgba '!FG(a | Xa | G!a)' -H | autfilt -H --instut > pos.hoa
ltl2tgba 'FG(a | Xa | G!a)' -H | autfilt -H --instut > neg.hoa
autfilt pos.hoa --product neg.hoa -H > prod.hoa
autfilt --is-empty prod.hoa -q && exit 1
autfilt --states=9 prod.hoa -q
autfilt --states=6 prod.hoa -q
# Check for issue #7.