implement maximum cardinality search
* spot/twaalgos/mcs.cc, spot/twaalgos/mcs.hh: New files. * spot/twaalgos/Makefile.am: Add them. * python/spot/impl.i: Include mcs.hh. * bin/autfilt.cc: Add --mcs option. * NEWS: Mention it. * doc/spot.bib: Add reference. * tests/core/mcs.test: New file. * tests/Makefile.am: Add it.
This commit is contained in:
parent
77a17881a3
commit
7b0e15a7fb
9 changed files with 501 additions and 5 deletions
|
|
@ -280,6 +280,7 @@ TESTS_twa = \
|
|||
core/randomize.test \
|
||||
core/lbttparse.test \
|
||||
core/ltlf.test \
|
||||
core/mcs.test \
|
||||
core/scc.test \
|
||||
core/sccdot.test \
|
||||
core/sccif.test \
|
||||
|
|
|
|||
180
tests/core/mcs.test
Executable file
180
tests/core/mcs.test
Executable file
|
|
@ -0,0 +1,180 @@
|
|||
#!/bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
|
||||
#
|
||||
# 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
|
||||
|
||||
cat >in.hoa <<EOF
|
||||
HOA: v1
|
||||
name: "G(FGb & F((c & Xd) | (!c & X!d))) | X(Ga & Fd)"
|
||||
States: 6
|
||||
Start: 3
|
||||
AP: 4 "b" "c" "a" "d"
|
||||
acc-name: Rabin 1
|
||||
Acceptance: 2 Fin(0) & Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&1&2&!3] 0 {0}
|
||||
[1&!2] 1
|
||||
[0&1&2&!3] 0
|
||||
[!1&!2] 2
|
||||
[2&3] 5
|
||||
[0&!1&2&!3] 4
|
||||
[!0&!1&2&!3] 4 {0}
|
||||
State: 1
|
||||
[!0&1] 1 {0}
|
||||
[0&1&3] 1 {1}
|
||||
[0&1&!3] 1
|
||||
[0&!1&!3] 2
|
||||
[0&!1&3] 2 {1}
|
||||
[!0&!1] 2 {0}
|
||||
State: 2
|
||||
[!0&1] 1 {0}
|
||||
[0&!1&3] 2
|
||||
[0&!1&!3] 2 {1}
|
||||
[0&1&!3] 1 {1}
|
||||
[0&1&3] 1
|
||||
[!0&!1] 2 {0}
|
||||
State: 3
|
||||
[1] 0
|
||||
[!1] 4
|
||||
State: 4
|
||||
[1&!2] 1
|
||||
[!1&!2] 2
|
||||
[!0&!1&2&!3] 4 {0}
|
||||
[!0&1&2&!3] 0 {0}
|
||||
[0&!1&2&!3] 4 {1}
|
||||
[0&1&2&!3] 0 {1}
|
||||
[2&3] 5
|
||||
State: 5
|
||||
[1&!2] 1
|
||||
[!1&!2] 2
|
||||
[2] 5 {1}
|
||||
--END--
|
||||
EOF
|
||||
|
||||
autfilt --mcs in.hoa > out1.hoa
|
||||
autfilt --mcs=scc in.hoa > out2.hoa
|
||||
|
||||
cat >expected1.hoa <<EOF
|
||||
HOA: v1
|
||||
name: "G(FGb & F((c & Xd) | (!c & X!d))) | X(Ga & Fd)"
|
||||
States: 6
|
||||
Start: 0
|
||||
AP: 4 "b" "c" "a" "d"
|
||||
acc-name: Rabin 1
|
||||
Acceptance: 2 Fin(0) & Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[1] 1
|
||||
[!1] 2
|
||||
State: 1
|
||||
[!0&1&2&!3] 1 {0}
|
||||
[1&!2] 3
|
||||
[0&1&2&!3] 1
|
||||
[!1&!2] 4
|
||||
[2&3] 5
|
||||
[0&!1&2&!3] 2
|
||||
[!0&!1&2&!3] 2 {0}
|
||||
State: 2
|
||||
[1&!2] 3
|
||||
[!1&!2] 4
|
||||
[!0&!1&2&!3] 2 {0}
|
||||
[!0&1&2&!3] 1 {0}
|
||||
[0&!1&2&!3] 2 {1}
|
||||
[0&1&2&!3] 1 {1}
|
||||
[2&3] 5
|
||||
State: 3
|
||||
[!0&1] 3 {0}
|
||||
[0&1&3] 3 {1}
|
||||
[0&1&!3] 3
|
||||
[0&!1&!3] 4
|
||||
[0&!1&3] 4 {1}
|
||||
[!0&!1] 4 {0}
|
||||
State: 4
|
||||
[!0&1] 3 {0}
|
||||
[0&!1&3] 4
|
||||
[0&!1&!3] 4 {1}
|
||||
[0&1&!3] 3 {1}
|
||||
[0&1&3] 3
|
||||
[!0&!1] 4 {0}
|
||||
State: 5
|
||||
[1&!2] 3
|
||||
[!1&!2] 4
|
||||
[2] 5 {1}
|
||||
--END--
|
||||
EOF
|
||||
|
||||
cat >expected2.hoa <<EOF
|
||||
HOA: v1
|
||||
name: "G(FGb & F((c & Xd) | (!c & X!d))) | X(Ga & Fd)"
|
||||
States: 6
|
||||
Start: 0
|
||||
AP: 4 "b" "c" "a" "d"
|
||||
acc-name: Rabin 1
|
||||
Acceptance: 2 Fin(0) & Inf(1)
|
||||
properties: trans-labels explicit-labels trans-acc complete
|
||||
properties: deterministic
|
||||
--BODY--
|
||||
State: 0
|
||||
[1] 1
|
||||
[!1] 2
|
||||
State: 1
|
||||
[!0&1&2&!3] 1 {0}
|
||||
[1&!2] 4
|
||||
[0&1&2&!3] 1
|
||||
[!1&!2] 5
|
||||
[2&3] 3
|
||||
[0&!1&2&!3] 2
|
||||
[!0&!1&2&!3] 2 {0}
|
||||
State: 2
|
||||
[1&!2] 4
|
||||
[!1&!2] 5
|
||||
[!0&!1&2&!3] 2 {0}
|
||||
[!0&1&2&!3] 1 {0}
|
||||
[0&!1&2&!3] 2 {1}
|
||||
[0&1&2&!3] 1 {1}
|
||||
[2&3] 3
|
||||
State: 3
|
||||
[1&!2] 4
|
||||
[!1&!2] 5
|
||||
[2] 3 {1}
|
||||
State: 4
|
||||
[!0&1] 4 {0}
|
||||
[0&1&3] 4 {1}
|
||||
[0&1&!3] 4
|
||||
[0&!1&!3] 5
|
||||
[0&!1&3] 5 {1}
|
||||
[!0&!1] 5 {0}
|
||||
State: 5
|
||||
[!0&1] 4 {0}
|
||||
[0&!1&3] 5
|
||||
[0&!1&!3] 5 {1}
|
||||
[0&1&!3] 4 {1}
|
||||
[0&1&3] 4
|
||||
[!0&!1] 5 {0}
|
||||
--END--
|
||||
EOF
|
||||
|
||||
diff expected1.hoa out1.hoa
|
||||
diff expected2.hoa out2.hoa
|
||||
Loading…
Add table
Add a link
Reference in a new issue