monitor.test 2.15 KB
Newer Older
1
2
#!/bin/sh
# -*- coding: utf-8 -*-
3
4
# Copyright (C) 2014-2017 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# 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

expect()
{
   cat >output.exp
   run 0 "$@" > output.out
   cat output.out
   diff output.out output.exp
}

34
expect ltl2tgba -d --monitor a <<EOF
35
digraph G {
36
  rankdir=LR
37
  node [shape="circle"]
38
39
  I [label="", style=invis, width=0]
  I -> 1
40
  0 [label="0"]
41
  0 -> 0 [label="1"]
42
  1 [label="1"]
43
  1 -> 0 [label="a"]
44
45
46
}
EOF

47
expect ltl2tgba --monitor a GFa Ga --hoa<<EOF
48
49
50
HOA: v1
name: "a"
States: 2
51
Start: 1
52
53
54
55
AP: 1 "a"
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc deterministic
56
properties: stutter-invariant terminal
57
58
--BODY--
State: 0
59
[t] 0
60
State: 1
61
[0] 0
62
63
64
65
66
67
68
69
--END--
HOA: v1
name: "GFa"
States: 1
Start: 0
AP: 0
acc-name: all
Acceptance: 0 t
70
properties: trans-labels explicit-labels state-acc complete
71
properties: deterministic stutter-invariant terminal
72
73
74
75
--BODY--
State: 0
[t] 0
--END--
76
77
78
79
80
81
82
83
84
85
86
87
88
HOA: v1
name: "Ga"
States: 1
Start: 0
AP: 1 "a"
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc deterministic
properties: stutter-invariant weak
--BODY--
State: 0
[0] 0
--END--
89
EOF
90
91
92
93
94
95
96
97
98
99
100

# Completing a monitor can produce a Büchi automaton.
expect ltl2tgba --any -C -M Ga <<EOF
HOA: v1
name: "Ga"
States: 2
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc complete
101
properties: deterministic stutter-invariant weak
102
103
104
105
106
107
108
109
--BODY--
State: 0 {0}
[0] 0
[!0] 1
State: 1
[t] 1
--END--
EOF