LAR made smarter with symmetry-based degeneralization

* spot/twaalgos/toparity.cc: here
* spot/twa/acc.hh, spot/twa/acc.cc: compute symmetries of an acceptance
  condition
* tests/python/accparse2.py, tests/python/toparity.py: test it
This commit is contained in:
Maximilien Colange 2018-07-25 18:49:01 +02:00
parent 3303b86a89
commit 516e9536df
5 changed files with 173 additions and 23 deletions

View file

@ -1,5 +1,5 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2015, 2017 Laboratoire de Recherche et Développement
# Copyright (C) 2015, 2017-2018 Laboratoire de Recherche et Développement
# de l'Epita
#
# This file is part of Spot, a model checking library.
@ -107,3 +107,10 @@ assert(a.is_streett() == -1)
a.set_acceptance('(Fin(0)|Inf(1))&(Inf(1)|Fin(0))&(Inf(3)|Fin(2))')
assert(a.is_rabin() == -1)
assert(a.is_streett() == 2)
a = spot.acc_code('Inf(0)&Inf(1)&Inf(3) | Fin(0)&(Fin(1)|Fin(3))')
u = a.symmetries()
assert u[0] == 0
assert u[1] == 1
assert u[2] == 2
assert u[3] == 1

View file

@ -20,6 +20,21 @@
import spot
a = spot.automaton("""HOA: v1
States: 1
Start: 0
AP: 2 "a" "b"
Acceptance: 2 Inf(0)|Inf(1)
--BODY--
State: 0
[0&1] 0 {0 1}
[0&!1] 0 {0}
[!0&1] 0 {1}
[!0&!1] 0
--END--""")
p = spot.to_parity(a)
assert spot.are_equivalent(a, p)
for f in spot.randltl(4, 400):
d = spot.translate(f, "det", "G")
p = spot.to_parity(d)