Adding function to test if two büchi automata are isomorphic.
And add the corresponding --isomorphic=FILENAME option to autfilt. * src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/are_isomorphic.hh: New. * src/tgbaalgos/Makefile.am: Add it. * src/bin/autfilt.cc: Add --isomorphic option. * src/tgbatest/isomorph.test: Test it. * src/tgbatest/Makefile.am: Add it.
This commit is contained in:
parent
61edf7f41d
commit
97fdea9d71
6 changed files with 434 additions and 1 deletions
|
|
@ -118,6 +118,7 @@ TESTS = \
|
|||
ltl2ta2.test \
|
||||
randaut.test \
|
||||
randtgba.test \
|
||||
isomorph.test \
|
||||
emptchk.test \
|
||||
emptchke.test \
|
||||
dfs.test \
|
||||
|
|
|
|||
136
src/tgbatest/isomorph.test
Executable file
136
src/tgbatest/isomorph.test
Executable file
|
|
@ -0,0 +1,136 @@
|
|||
#!/bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014 Laboratoire de Recherche et Développement de
|
||||
# l'Epita (LRDE).
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
|
||||
. ./defs
|
||||
|
||||
set -e
|
||||
|
||||
../../bin/randaut a b -S10 --hoa >filt
|
||||
|
||||
randomize()
|
||||
{
|
||||
for i in `seq 1 5`
|
||||
do
|
||||
../../bin/autfilt --seed=$i --randomize=$1 -F filt --hoa >> autiso
|
||||
done
|
||||
}
|
||||
|
||||
randomize s
|
||||
randomize t
|
||||
randomize
|
||||
|
||||
run 0 ../../bin/autfilt -F autiso --isomorph filt --hoa >out
|
||||
test `grep HOA out | wc -l` -eq 15
|
||||
|
||||
cat >notiso <<EOF
|
||||
HOA: v1
|
||||
States: 10
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: all
|
||||
Acceptance: 0 t
|
||||
properties: trans-labels explicit-labels state-acc
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&1] 1
|
||||
[0&1] 2
|
||||
State: 1
|
||||
[!0&!1] 2
|
||||
[0&!1] 3
|
||||
[!0&1] 4
|
||||
State: 2
|
||||
[0&1] 5
|
||||
[0&!1] 1
|
||||
State: 3
|
||||
[!0&!1] 5
|
||||
[!0&!1] 1
|
||||
[!0&1] 0
|
||||
[0&!1] 6
|
||||
State: 4
|
||||
[0&1] 5
|
||||
[0&1] 0
|
||||
[!0&1] 7
|
||||
State: 5
|
||||
[0&1] 5
|
||||
[!0&1] 8
|
||||
State: 6
|
||||
[0&1] 9
|
||||
State: 7
|
||||
[0&!1] 9
|
||||
[0&1] 1
|
||||
State: 8
|
||||
[!0&1] 8
|
||||
[0&!1] 5
|
||||
State: 9
|
||||
[!0&!1] 5
|
||||
[!0&1] 8
|
||||
--END--
|
||||
EOF
|
||||
|
||||
cat >>notiso <<EOF
|
||||
HOA: v1
|
||||
States: 10
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: all
|
||||
Acceptance: 0 t
|
||||
properties: trans-labels explicit-labels state-acc
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&1] 1
|
||||
State: 1
|
||||
[!0&1] 2
|
||||
[!0&1] 3
|
||||
[!0&1] 4
|
||||
[!0&1] 5
|
||||
[!0&1] 6
|
||||
State: 2
|
||||
[0&1] 7
|
||||
[!0&1] 0
|
||||
State: 3
|
||||
[!0&!1] 0
|
||||
[!0&1] 6
|
||||
[0&!1] 8
|
||||
State: 4
|
||||
[!0&1] 3
|
||||
[!0&!1] 9
|
||||
[!0&!1] 0
|
||||
State: 5
|
||||
[0&1] 0
|
||||
State: 6
|
||||
[!0&!1] 9
|
||||
State: 7
|
||||
[0&!1] 0
|
||||
[!0&1] 7
|
||||
[!0&!1] 6
|
||||
State: 8
|
||||
[0&1] 6
|
||||
[!0&!1] 1
|
||||
[!0&!1] 0
|
||||
State: 9
|
||||
[0&!1] 7
|
||||
[!0&1] 2
|
||||
[0&1] 1
|
||||
--END--
|
||||
EOF
|
||||
|
||||
run 0 ../../bin/autfilt -F notiso --isomorph filt --hoa >out
|
||||
test `grep HOA out | wc -l` -eq 0 || exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue