complementation.test 1.73 KB
Newer Older
1
#!/bin/sh
2 3
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2011, 2014, 2015 Laboratoire de Recherche et
4
# Développement de l'Epita (LRDE).
5 6 7 8 9
#
# 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
10
# the Free Software Foundation; either version 3 of the License, or
11 12 13 14 15 16 17 18
# (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
19
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 21 22 23 24

. ./defs

set -e

25
while read f; do
26
    run 0 ../complement -f "$f"
27 28 29
done <<EOF
GFa
FGa
30 31
<>p1->p0
<>p1->(p0 U p1)
32
[](p0-><>p3)
33
a U b
34 35 36 37 38
GFa&&FGa
[] ((p2 && ! p1) -> (p0 U (p1 || [] p0)))
[] (p2 -> ((! p0 && ! p1) U (p1 || ((p0 && ! p1) U (p1 || ((! p0 && ! p1) \
 U (p1 || ((p0 && ! p1) U ((p1 || (! p0 U (p1 || [] ! p0))) || [] p0)))))))))
EOF
39 40 41

# The following test-case was supplied by Martin Dieguez Lodeiro to
# demonstrate a bug in our Safra implementation.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
cat >x.hoa <<EOF
HOA: v1
States: 3
Start: 0
AP: 1 "p"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc complete
--BODY--
State: 0
[t] 0
[0] 1
State: 1
[t] 1
[0] 2 {0}
State: 2
[t] 1
[0] 2 {0}
--END--
61 62
EOF
# x.tgba accepts some run
63
run 0 ../ikwiad -XH -e x.hoa
64
# so does its complement
65
run 0 ../complement -H -a x.hoa > nx.hoa
66
run 0 ../ikwiad -XH -e nx.hoa
67 68
# however the intersection of both should not
# accept any run.
69
run 1 autfilt -q nx.hoa --intersect x.hoa