gf_guarantee_to_ba: save states using histories

This improves gf_guarantee_to_ba() on formulas GF(φ) where the
automaton for F(φ) as several leading transiant SCCs.  E.g.,
GF(a <-> XXXa) where we know get results that are as good as
those of delag without loosing on the cases where delag's technique
would actually produce two big automata.

* spot/twaalgos/gfguarantee.cc: Implement this.
* spot/twaalgos/gfguarantee.hh, NEWS: Document it.
* tests/core/ltl2tgba2.test, tests/core/ltl3ba.test: Add test cases.
This commit is contained in:
Alexandre Duret-Lutz 2018-06-08 15:09:10 +02:00
parent 730c6bbca2
commit 7e9325866f
5 changed files with 221 additions and 26 deletions

View file

@ -360,3 +360,19 @@ p-patterns,20, 1,8, 1,8, 3,24, 3,24
EOF
diff output expected
# These four formulas appear in a NEWS entry for Spot 2.6
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((b | Fa) & (b R Xb)), 2,4, 2,4, 3,6, 3,12
EOF
ltl2tgba -Fformulas/1 --stats='%f, %s,%t' |
ltl2tgba -D -F-/1 --stats='%f,%>, %s,%t' |
ltl2tgba -B -F-/1 --stats='%f,%>, %s,%t' |
ltl2tgba -BD -F-/1 --stats='%f,%>, %s,%t' > output
diff formulas output

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2016, 2017 Laboratoire de Recherche et Développement
# Copyright (C) 2016, 2017, 2018 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -39,8 +39,15 @@ export SPOT_HOA_TOLERANT
# compatible with Spin's syntax.
(
echo _x
# Some formula used by Spot's GF(guarantee) translation.
cat <<EOF
GF((a & XXa) | (!a & XX!a))
GF((a & XXXa) | (!a & XXX!a))
GF(((a & Xb) | XXc) & Xd)
GF((b | Fa) & (b R Xb))
EOF
randltl -n 30 2
) | ltlcross 'ltl3ba -H1' 'ltl3ba -H2' 'ltl3ba -H3' \
) | ltlcross -D 'ltl3ba -H1' 'ltl3ba -H2' 'ltl3ba -H3' ltl2tgba \
--ambiguous --strength --csv=output.csv
grep _x output.csv && exit 1