-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathHead.hs
112 lines (95 loc) · 2.24 KB
/
Head.hs
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
module Head where
type Identifier = String
type Parameter = Identifier
type Constant = Identifier
type Variable = Identifier
type Documentation = [String]
type ElixirCode = String
type Init = Definition
type Next = Definition
type Context = [(Identifier, String)]
data Spec =
Spec Module Identifier Identifier [Definition]
deriving (Show, Eq)
data Module =
Module Identifier Documentation
deriving (Show, Eq)
data Definition
= ActionDefinition Identifier [Parameter] Documentation Action
| ValueDefinition Identifier [Parameter] Value
| Constants [Identifier]
| Variables [Identifier]
| Comment String
deriving (Show, Eq)
data Lit
= Str String
| Boolean Bool
| Num Integer
| FullSet String
| Tuple [Lit]
deriving (Show, Eq)
data Key
= Key Lit
| All Identifier Value
deriving (Show, Eq)
data CaseMatch
= Match Value Value
| DefaultMatch Value
deriving (Show, Eq)
data Action
= Condition Value
| Primed Identifier Value
| Unchanged [Identifier]
| ActionNot Action
| ActionAnd [Action]
| ActionOr [Action]
| ActionCall Identifier [Value]
| ActionIf Value Action Action
| ActionLet [Definition] Action
| Exists Identifier Value Action
| ForAll Identifier Value Action
deriving (Show, Eq)
data Value
= Equality Value Value
| Inequality Value Value
| Gt Value Value
| Lt Value Value
| Gte Value Value
| Lte Value Value
| RecordBelonging Value Value
| RecordNotBelonging Value Value
| And [Value]
| Or [Value]
| Not Value
| If Value Value Value
| ConditionCall Identifier [Value]
| PExists Identifier Value Value
| PForAll Identifier Value Value
| Let [Definition] Value
| Set [Value]
| TupleVal [Value]
| FunSet Value Value
| FunGen Identifier Value Value
| SetTimes Value Value
| SetIn Value Value
| SetMinus Value Value
| Union Value Value
| Filtered Identifier Value Value
| Cardinality Value
| Fold Value Value Value
| Record [(Key, Value)]
| RecordSet [(Key, Value)]
| Except Identifier [(Value, Value)]
| Case [CaseMatch]
| Domain Value
| Index Value Value
| Range Value Value
| Ref String
| Neg Value
| Add Value Value
| Sub Value Value
| Mul Value Value
| Div Value Value
| Mod Value Value
| Lit Lit
deriving (Show, Eq)