translate, postproc: improve parity output

* spot/twaalgos/translate.cc: When producing Parity output, split LTL
as we do in the Generic case.
* spot/twaalgos/postproc.hh, spot/twaalgos/postproc.cc: Use
acd_transform() and add an "acd" option to disable this.
* bin/spot-x.cc, NEWS: Document this.
* tests/core/genltl.test, tests/core/minusx.test,
tests/core/parity2.test: Adjust test cases for improved outputs.
This commit is contained in:
Alexandre Duret-Lutz 2022-10-05 11:08:19 +02:00
parent e867242cf6
commit 344e01d4e2
8 changed files with 189 additions and 241 deletions

View file

@ -190,29 +190,29 @@ cat >exp<<EOF
"ms-example=4,2",10,10
"ms-example=4,3",11,11
"ms-example=4,4",12,12
"ms-phi-r=0",1,2
"ms-phi-r=1",1,12
"ms-phi-r=2",1,28
"ms-phi-s=0",1,3
"ms-phi-s=1",1,7
"ms-phi-s=2",1,484
"ms-phi-r=0",1,1
"ms-phi-r=1",1,2
"ms-phi-r=2",1,5
"ms-phi-s=0",1,1
"ms-phi-s=1",1,2
"ms-phi-s=2",1,5
"ms-phi-h=0",1,1
"ms-phi-h=1",2,3
"ms-phi-h=2",4,7
"ms-phi-h=3",8,15
"ms-phi-h=4",16,31
"gf-equiv=0",1,1
"gf-equiv=1",1,3
"gf-equiv=2",1,7
"gf-equiv=3",1,20
"gf-equiv=4",1,80
"gf-equiv=5",1,430
"gf-equiv=1",1,2
"gf-equiv=2",1,5
"gf-equiv=3",1,10
"gf-equiv=4",1,17
"gf-equiv=5",1,26
"gf-implies=0",1,1
"gf-implies=1",1,4
"gf-implies=2",1,11
"gf-implies=3",1,33
"gf-implies=4",1,131
"gf-implies=5",1,653
"gf-implies=1",1,1
"gf-implies=2",1,2
"gf-implies=3",1,3
"gf-implies=4",1,4
"gf-implies=5",1,5
"gf-equiv-xn=1",2,2
"gf-equiv-xn=2",4,4
"gf-equiv-xn=3",8,8

View file

@ -1,7 +1,7 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2016, 2020, 2021 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
# Copyright (C) 2016, 2020-2022 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
@ -41,9 +41,9 @@ test 4,1 = `ltl2tgba --stats=%s,%d "$f"`
test 6,0 = `ltl2tgba -x wdba-det-max=4 --stats=%s,%d "$f"`
# Make sure simul-max has an effect
f=`genltl --ms-phi-s=2`
test 484 -eq `ltl2tgba -P -D --stats=%s "$f"`
test 484 -lt `ltl2tgba -P -D -x simul-max=512 --stats=%s "$f"`
f=`genltl --ms-phi-h=8`
test 511 -eq `ltl2tgba -P -D --stats=%s "$f"`
test 511 -lt `ltl2tgba -P -D -x simul-max=512 --stats=%s "$f"`
# Illustrate issue #455: the simulation-based reduction applied before
# tba-det can cause the creation of a DBA that is harder to reduce.

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2019, 2021 Laboratoire de Recherche et
# Copyright (C) 2018-2019, 2021, 2022 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -65,30 +65,24 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc
acc-name: Rabin 1
Acceptance: 2 Fin(0) & Inf(1)
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[0] 0
[0&!1&2] 0
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1
[0&1&2] 2
State: 1
[t] 3
[1&2] 4
[t] 2
State: 2
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {0}
State: 3
[0] 3
[0&1&2] 4
State: 4
[0&!1&2] 4
[0&1&2] 4 {0}
[0&!2] 2 {0}
[0&1&2] 2 {1}
--END--
HOA: v1
name: "FGa"
@ -124,30 +118,24 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Rabin 1
Acceptance: 2 Fin(0) & Inf(1)
properties: trans-labels explicit-labels trans-acc
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[0] 0
[0&!1&2] 0
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1
[0&1&2] 2
State: 1
[t] 3
[1&2] 4
[t] 2
State: 2
[!0] 1
[0&!1&2] 2
[0&!2] 2 {0}
[0&1&2] 2 {1}
State: 3
[0] 3
[0&1&2] 4
State: 4
[0&!1&2] 4
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -183,30 +171,24 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc
acc-name: parity max even 2
Acceptance: 2 Fin(1) & Inf(0)
properties: trans-labels explicit-labels trans-acc deterministic
--BODY--
State: 0
[0] 0
[0&!1&2] 0
[0&1&2] 0 {0}
[0&!2] 0 {1}
[!0] 1
[0&1&2] 2
State: 1
[t] 3
[1&2] 4
[t] 2
State: 2
[!0] 1
[0&!1&2] 2
[0&1&2] 2 {0}
State: 3
[0] 3
[0&1&2] 4
State: 4
[0&!1&2] 4
[0&1&2] 4 {0}
[0&!2] 2 {1}
--END--
HOA: v1
name: "FGa"
@ -242,30 +224,25 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Streett 1
Acceptance: 2 Fin(0) | Inf(1)
acc-name: parity min odd 3
Acceptance: 3 Fin(0) & (Inf(1) | Fin(2))
properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0] 0 {0}
[!0] 1 {0}
[0&1&2] 2 {0}
[0&!1&2] 0 {2}
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1 {2}
State: 1
[t] 3 {0}
[1&2] 4 {0}
[t] 2 {2}
State: 2
[!0] 1 {0}
[0&!1&2] 2 {0}
[0&!1&2] 2 {2}
[0&!2] 2 {0}
[0&1&2] 2 {1}
State: 3
[0] 3 {0}
[0&1&2] 4 {0}
State: 4
[0&!1&2] 4 {0}
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -301,30 +278,25 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity min odd 3
Acceptance: 3 Fin(0) & (Inf(1) | Fin(2))
properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0] 0 {2}
[0&!1&2] 0 {2}
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1 {2}
[0&1&2] 2 {2}
State: 1
[t] 3 {2}
[1&2] 4 {2}
[t] 2 {2}
State: 2
[!0] 1 {2}
[0&!1&2] 2 {2}
[0&!2] 2 {0}
[0&1&2] 2 {1}
State: 3
[0] 3 {2}
[0&1&2] 4 {2}
State: 4
[0&!1&2] 4 {2}
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -360,30 +332,25 @@ State: 1
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity max even 3
Acceptance: 3 Inf(2) | (Fin(1) & Inf(0))
acc-name: parity max even 4
Acceptance: 4 Fin(3) & (Inf(2) | (Fin(1) & Inf(0)))
properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0] 0 {1}
[0&!1&2] 0 {1}
[0&1&2] 0 {2}
[0&!2] 0 {3}
[!0] 1 {1}
[0&1&2] 2 {1}
State: 1
[t] 3 {1}
[1&2] 4 {1}
[t] 2 {1}
State: 2
[!0] 1 {1}
[0&!1&2] 2 {1}
[0&1&2] 2 {2}
State: 3
[0] 3 {1}
[0&1&2] 4 {1}
State: 4
[0&!1&2] 4 {1}
[0&1&2] 4 {2}
[0&!2] 2 {3}
--END--
EOF
@ -777,7 +744,7 @@ State: 0
HOA: v1
name: "G(Fa & Fb)"
States: 2
Start: 1
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
@ -786,15 +753,15 @@ properties: deterministic stutter-invariant
--BODY--
State: 0
[!1] 0
[1] 1 {0}
[0&1] 0 {0}
[!0&1] 1
State: 1
[0&!1] 0
[0] 0 {0}
[!0] 1
[0&1] 1 {0}
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Rabin 1
@ -802,24 +769,16 @@ 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&2] 2
State: 1
[!1 | !2] 3
[1&2] 4
State: 2
[0&!1&2] 0
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1
State: 1
[t] 2
State: 2
[0&!1&2] 2
[0&!2] 2 {0}
[0&1&2] 2 {1}
State: 3
[0&!1 | 0&!2] 3
[0&1&2] 4
State: 4
[0&!2] 3 {0}
[0&!1&2] 4
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -838,7 +797,7 @@ State: 0
HOA: v1
name: "G(Fa & Fb)"
States: 2
Start: 1
Start: 0
AP: 2 "a" "b"
acc-name: Rabin 1
Acceptance: 2 Fin(0) & Inf(1)
@ -847,15 +806,15 @@ properties: deterministic stutter-invariant
--BODY--
State: 0
[!1] 0
[1] 1 {1}
[0&1] 0 {1}
[!0&1] 1
State: 1
[0&!1] 0
[0] 0 {1}
[!0] 1
[0&1] 1 {1}
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: Rabin 1
@ -863,24 +822,16 @@ 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&2] 2
State: 1
[!1 | !2] 3
[1&2] 4
State: 2
[0&!1&2] 0
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1
State: 1
[t] 2
State: 2
[0&!1&2] 2
[0&!2] 2 {0}
[0&1&2] 2 {1}
State: 3
[0&!1 | 0&!2] 3
[0&1&2] 4
State: 4
[0&!2] 3 {0}
[0&!1&2] 4
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -899,7 +850,7 @@ State: 0
HOA: v1
name: "G(Fa & Fb)"
States: 2
Start: 1
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
@ -908,15 +859,15 @@ properties: deterministic stutter-invariant
--BODY--
State: 0
[!1] 0
[1] 1 {0}
[0&1] 0 {0}
[!0&1] 1
State: 1
[0&!1] 0
[0] 0 {0}
[!0] 1
[0&1] 1 {0}
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity max even 2
@ -924,24 +875,16 @@ 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&2] 2
State: 1
[!1 | !2] 3
[1&2] 4
State: 2
[0&!1&2] 0
[0&1&2] 0 {0}
[0&!2] 0 {1}
[!0] 1
State: 1
[t] 2
State: 2
[0&!1&2] 2
[0&1&2] 2 {0}
State: 3
[0&!1 | 0&!2] 3
[0&1&2] 4
State: 4
[0&!2] 3 {1}
[0&!1&2] 4
[0&1&2] 4 {0}
[0&!2] 2 {1}
--END--
HOA: v1
name: "FGa"
@ -960,7 +903,7 @@ State: 0
HOA: v1
name: "G(Fa & Fb)"
States: 2
Start: 1
Start: 0
AP: 2 "a" "b"
acc-name: Streett 1
Acceptance: 2 Fin(0) | Inf(1)
@ -969,15 +912,15 @@ properties: deterministic stutter-invariant
--BODY--
State: 0
[!1] 0 {0}
[1] 1 {1}
[0&1] 0 {1}
[!0&1] 1 {0}
State: 1
[0&!1] 0 {0}
[0] 0 {1}
[!0] 1 {0}
[0&1] 1 {1}
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity min odd 3
@ -986,24 +929,16 @@ properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0 {2}
[!0] 1 {2}
[0&1&2] 2 {2}
State: 1
[!1 | !2] 3 {2}
[1&2] 4 {2}
State: 2
[0&!1&2] 0 {2}
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1 {2}
State: 1
[t] 2 {2}
State: 2
[0&!1&2] 2 {2}
[0&!2] 2 {0}
[0&1&2] 2 {1}
State: 3
[0&!1 | 0&!2] 3 {2}
[0&1&2] 4 {2}
State: 4
[0&!2] 3 {0}
[0&!1&2] 4 {2}
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -1022,7 +957,7 @@ State: 0
HOA: v1
name: "G(Fa & Fb)"
States: 2
Start: 1
Start: 0
AP: 2 "a" "b"
acc-name: parity min odd 3
Acceptance: 3 Fin(0) & (Inf(1) | Fin(2))
@ -1031,15 +966,15 @@ properties: deterministic stutter-invariant
--BODY--
State: 0
[!1] 0 {2}
[1] 1 {1}
[0&1] 0 {1}
[!0&1] 1 {2}
State: 1
[0&!1] 0 {2}
[0] 0 {1}
[!0] 1 {2}
[0&1] 1 {1}
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity min odd 3
@ -1048,24 +983,16 @@ properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0 {2}
[!0] 1 {2}
[0&1&2] 2 {2}
State: 1
[!1 | !2] 3 {2}
[1&2] 4 {2}
State: 2
[0&!1&2] 0 {2}
[0&!2] 0 {0}
[0&1&2] 0 {1}
[!0] 1 {2}
State: 1
[t] 2 {2}
State: 2
[0&!1&2] 2 {2}
[0&!2] 2 {0}
[0&1&2] 2 {1}
State: 3
[0&!1 | 0&!2] 3 {2}
[0&1&2] 4 {2}
State: 4
[0&!2] 3 {0}
[0&!1&2] 4 {2}
[0&1&2] 4 {1}
--END--
HOA: v1
name: "FGa"
@ -1084,7 +1011,7 @@ State: 0
HOA: v1
name: "G(Fa & Fb)"
States: 2
Start: 1
Start: 0
AP: 2 "a" "b"
acc-name: parity max even 3
Acceptance: 3 Inf(2) | (Fin(1) & Inf(0))
@ -1093,15 +1020,15 @@ properties: deterministic stutter-invariant
--BODY--
State: 0
[!1] 0 {1}
[1] 1 {2}
[0&1] 0 {2}
[!0&1] 1 {1}
State: 1
[0&!1] 0 {1}
[0] 0 {2}
[!0] 1 {1}
[0&1] 1 {2}
--END--
HOA: v1
name: "(p0 W XXGp0) & G(Fp1 & FGp2)"
States: 5
States: 3
Start: 0
AP: 3 "p0" "p1" "p2"
acc-name: parity max even 4
@ -1110,24 +1037,16 @@ properties: trans-labels explicit-labels trans-acc colored
properties: deterministic
--BODY--
State: 0
[0&!1 | 0&!2] 0 {1}
[!0] 1 {1}
[0&1&2] 2 {1}
State: 1
[!1 | !2] 3 {1}
[1&2] 4 {1}
State: 2
[0&!1&2] 0 {1}
[0&1&2] 0 {2}
[0&!2] 0 {3}
[!0] 1 {1}
State: 1
[t] 2 {1}
State: 2
[0&!1&2] 2 {1}
[0&1&2] 2 {2}
State: 3
[0&!1 | 0&!2] 3 {1}
[0&1&2] 4 {1}
State: 4
[0&!2] 3 {3}
[0&!1&2] 4 {1}
[0&1&2] 4 {2}
[0&!2] 2 {3}
--END--
EOF
diff expected3 res3