-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgrammar.go
More file actions
68 lines (58 loc) · 2.06 KB
/
grammar.go
File metadata and controls
68 lines (58 loc) · 2.06 KB
1
2
3
4
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
Citili, a program for generating CTL formulas for the model checking contest
Copyright (C) 2020 Loïg Jezequel
This program 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.
This program 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 https://www.gnu.org/licenses/.
*/
package main
type operator struct {
name string
minArity int
maxArity int
isOverBooleans bool
}
var atom operator = operator{"atom", 0, 0, false}
var isfireable operator = operator{name: "is-fireable"}
var tokencount operator = operator{name: "tokens-count"}
var leqOperator operator = operator{"leq", 2, 2, false}
var integerconstant operator = operator{"integer-constant", 1, 1, false}
var allPathsOperator operator = operator{"A", 1, 1, false}
var existsPathOperator operator = operator{"E", 1, 1, false}
var globallyOperator operator = operator{"G", 1, 1, false}
var finallyOperator operator = operator{"F", 1, 1, false}
var nextOperator operator = operator{"X", 1, 1, false}
var untilOperator operator = operator{"U", 2, 2, false}
var booleanOperators []operator
var pathOperators []operator = []operator{
globallyOperator,
finallyOperator,
nextOperator,
untilOperator,
}
var stateOperators []operator
func initBooleanOperators() {
booleanOperators = []operator{
atom,
allPathsOperator,
existsPathOperator,
{"not", 1, 1, true},
{"and", 2, globalConfiguration.MaxArity, true},
{"or", 2, globalConfiguration.MaxArity, true},
}
}
func initStateOperators() {
stateOperators = []operator{
atom,
{"not", 1, 1, true},
{"and", 2, globalConfiguration.MaxArity, true},
{"or", 2, globalConfiguration.MaxArity, true},
}
}