twaalgos/cobuchi: Add nsa_to_nca()
* NEWS: Update. * spot/twaalgos/cobuchi.hh: Declare to_dca() and nsa_to_nca(). * spot/twaalgos/cobuchi.cc: Implement them. * python/spot/impl.i: Include new file for python bindings. * spot/twaalgos/Makefile.am: Add new file. * bin/autfilt.cc: Add --dca command line option. This option does not return a deterministic automaton yet, but it will. * tests/core/dca.test: Add tests for Büchi automata. * tests/python/dca.py: Add a python script that builds a nondet. Streett automaton. * tests/python/dca.test: Add tests for Streett automata. * tests/Makefile.am: Add all tests.
This commit is contained in:
parent
37c1a19b39
commit
cf18c06940
10 changed files with 678 additions and 1 deletions
37
tests/python/dca.py
Executable file
37
tests/python/dca.py
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2017 Laboratoire de Recherche et Développement de
|
||||
# l'EPITA.
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
#
|
||||
# Spot is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Spot is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
# License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
import spot
|
||||
|
||||
|
||||
def gen_streett(formula):
|
||||
aut = spot.translate(formula, 'BA')
|
||||
aut.set_acceptance(2, 'Fin(0) | Inf(1)')
|
||||
for e in aut.edges():
|
||||
if (e.acc):
|
||||
e.acc = spot.mark_t([0,1])
|
||||
else:
|
||||
e.acc = spot.mark_t([0])
|
||||
return aut
|
||||
|
||||
|
||||
aut = gen_streett(sys.argv[1])
|
||||
print(aut.to_str('hoa'))
|
||||
58
tests/python/dca.test
Executable file
58
tests/python/dca.test
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2017 Laboratoire de Recherche et
|
||||
# Développement de l'EPITA.
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
#
|
||||
# Spot is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Spot is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
# License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set -e
|
||||
|
||||
# Skip this test if ltl2dstar is not installed.
|
||||
(ltl2dstar --version) || exit 77
|
||||
|
||||
cat >ba_formulas << 'EOF'
|
||||
FG((Xc & XXa) <-> !(b xor (c M b)))
|
||||
F!FGFb
|
||||
XF(b & Ga)
|
||||
FG(F(b R Fc) R Gc)
|
||||
(!c M F(b M Ga)) W (b U a)
|
||||
(c xor Gb) M 1
|
||||
X!Gc M ((Fb R a) M 1)
|
||||
!a | F(b W 0)
|
||||
F(!a -> Gb)
|
||||
(Gb <-> X(b W Xb)) M (b xor !c)
|
||||
(c R (X!c W Fb)) M 1
|
||||
!a -> (FX!(0 R F(b | c)) W c)
|
||||
XF((!c R a) W !Fb)
|
||||
(!a <-> !(c <-> Gb)) M 1
|
||||
((0 R a) M c) M ((b xor Fb) M F(b -> a))
|
||||
EOF
|
||||
cat >dsa_formulas <<'EOF'
|
||||
(!b U b) U X(!a -> Fb)
|
||||
1 U (a xor b)
|
||||
X(!(!b | (a M b)) -> XXa)
|
||||
!Gb
|
||||
F(XF!a & (Fb U !a))
|
||||
EOF
|
||||
while read ba_f; do
|
||||
$srcdir/../run "$srcdir/dca.py" "$ba_f" > ba
|
||||
while read dsa_f; do
|
||||
ltldo -f "$dsa_f" "ltl2dstar --automata=streett\
|
||||
--ltl2nba=spin:ltl2tgba@-Ds" -H | autfilt --product=ba > input.hoa
|
||||
autfilt --dca input.hoa > res.hoa
|
||||
autfilt input.hoa --equivalent-to res.hoa
|
||||
done <dsa_formulas
|
||||
done <ba_formulas
|
||||
Loading…
Add table
Add a link
Reference in a new issue