-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathalpha142.txt
320 lines (233 loc) · 7.32 KB
/
alpha142.txt
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
Alpha 142 release notes
========================
Bug fixes
==========
(1) A bug where the tokens generated-by and gb were not recognized as terminating
a token bubble when following a period. Illustrated by:
fmod FOO is
eq 5 = 1 .
generated-by NAT .
endfm
(2) A bug where orphaned view instantiations (i.e. nothing depended on them)
were not being deleted from the view cache. Visible in the following example:
fmod FOO is
inc LIST{Set{Nat}} .
endfm
show modules .
show views .
fmod FOO is
endfm
show modules .
show views .
Here the view instantiation
view Set{Nat}
has be orphaned by the replacement of the first version of FOO in the module
database but persists in the view cache. Furthermore becaue of this, the
otherwise orphaned module instantiation
fmod SET{Nat}
cannot be deleted from the module cache.
(3) A related bug where a constructed module orphaned by a view replacing a
view that depended on the module was not immediately purged from the module
cache.
view V from TRIV + TRIV * (sort Elt to Elt2) to NAT + FLOAT is
sort Elt to Nat .
sort Elt2 to Float .
endv
show modules .
view V from TRIV to NAT is
sort Elt to Nat .
endv
show modules .
Here the 2 theories and 1 module
fth TRIV * (sort Elt to Elt2)
fth TRIV + TRIV * (sort Elt to Elt2)
fmod NAT + FLOAT
constructed for the first version of V are orphaned when it is replaced
by the second version but are not immediately purged from the module cache.
However, with this bug, the orphans will be purged after the next module
is entered
fmod FOO is endfm
show modules .
(4) A bug in the printing of parameterized constants. It's possible to
declare multiple parameterized constants with an ops declaration by
using parentheses:
fmod FOO is
sort Bar .
ops (m{X}) (n{X}) (p{X,X}) : -> Bar .
endfm
But then printing out the unprocessesed module with:
show mod .
results in:
fmod FOO is
sorts Bar .
ops m{X} n{X} p{X,X} : -> Bar .
endfm
which doesn't parse as intended. The resolution is to put parentheses
around parameterized constants when printing an ops declaration. An
alternative resolution would be to allow unparenthesized parameterized
constants in an ops declaration but this is a rare use case and would change
the meaning of existing syntax.
New features
=============
(1) There is a new command
show path states <state-number> .
This works exactly like the show path command except that only
states are shown and not rules. Requested by Carolyn.
(2) In the case that a runaway mixfix statement hits an unexpected end-of-file,
Maude will try to guess where the statement should have ended and produce a
more detail explanation of why the end of statement wasn't recognized. This
analysis is purely heuristic, but it should be helpful in many common cases.
For example with these examples from Paco:
fmod FOO is
sort Foo .
op f : Foo -> Foo .
op f : -> Foo .
rl f(f = f .
endfm
Warning: "eof-1.maude", line 5 (fmod FOO): runaway rule:
rl f(f = f .
End of rule not recognized because of open parenthesis.
Advisory: "eof-1.maude", line 1 (fmod FOO): discarding incomplete module FOO.
Advisory: closing open files.
fmod FOO is
sort Foo .
op f : Foo -> Foo .
op f : -> Foo .
ceq f(f) = f .
eq f(f) = f .
endfm
Warning: "eof-2.maude", line 5 (fmod FOO): runaway conditional equation:
ceq f(f) = f .
End of conditional equation not recognized because of missing if token.
Advisory: "eof-2.maude", line 1 (fmod FOO): discarding incomplete module FOO.
Advisory: closing open files.
Minor changes
==============
(1) Class declarations are overparsed.
(a) Missing period after bare class name:
oth FOO is
class Foo
endoth
(b) Missing space between bare class name and period:
oth FOO is
class Foo.
endoth
(c) Missing period after final attribute sort:
omod FOO is
class Foo | a : Bool
endom
omod FOO is
class Foo | a : Bool, b : Bool
endom
(d) Missing space between final attribute sort and period:
omod FOO is
class Foo | a : Bool.
endom
omod FOO is
class Foo | a : Bool, b : Bool.
endom
(2) Existing overparsing for sorts, subsorts and subclasses now handles
more cases.
(a) While
fmod FOO is
sort Foo Bar.
endfm
was already overparsed, having a single sort with a missing space
fmod FOO is
sort Bar.
endfm
was not but now is.
(b) While
fmod FOO is
sorts Foo Bar Baz .
subsort Foo < Bar Baz.
endfm
was already overparsed, having a single sort with a missing space
fmod FOO is
sorts Foo Bar .
subsort Foo < Bar.
endfm
was not but now is.
(c) Symmterically, while
omod FOO is
class Foo .
class Bar .
class Baz .
subclasses Foo < Bar Baz.
endom
was already overparsed, having a single class with a missing space
omod FOO is
class Foo .
class Bar .
subclasses Foo < Bar.
endom
was not but now is.
(3) Missing module expressions in an import are overparsed:
fmod FOO is
generated-by .
endfm
fmod FOO is
pr NAT + .
endfm
fmod FOO is
pr NAT + FLOAT + .
endfm
(4) In addition to underscores, attribute names are now prohibited from
containing parentheses, brackets, braces, or commas. This is to prevent to
formation of illegal operator names.
(5) Strategy names are stated in the manual as allowing any single
token, but in fact many single tokens such as
special sort object
produced syntax errors if used. Strategy names are now any single
token (which always excludes paretheses) except for
: @
which would cause ambiguity in strategy declarations.
(6) The tokens
:= strategy @
which stopped being valid module/view/parameter/variable names and
single token operator names when smods were introduced are once again valid:
fmod strategy is
ops := strategy @ : Bool -> Bool .
vars := strategy @ : Bool .
endfm
(7) Missing -> tokens in constant mappings in views and renamings are
overparsed:
view FOO from DEFAULT to NAT is
sort Elt to Nat .
op 0 : Nat to 0 .
endv
fmod FOO is
inc NAT * (op 0 : Nat to zero) .
endfm
Naming summary
===============
Because of the number of syntactic entities, each with its own
restrictions on allowed names, here is a summary.
( ) as single tokens are never valid names for anything and are not
considered to be single tokens in the following definitions.
Modules: any single token
Views: any single token; avoid containing underscores for instantiating omods
Parameters: any single token; avoid containing underscores for parameterizing
classes
Unparameterized sorts: any single token except
< -> ~> @
and may not contain parentheses, brackets, braces, commas, periods or
colons which excludes the special tokens
[ ] { } , . : :: := id: identity:
General sorts: tokens constructed from the following grammar
<ps> ::= <unparameterized sort> | <ps> `{ <sl> `}
<sl> ::= <ps> | <sl> `, <ps>
In this construction, the backquotes can be omitted and thus the sort name need
not be a single token.
Operators: if : is used as a single token, it must be parenthesized in the
declaration; the number of underscores must match number of arguments;
Occurrences of parentheses (backquoted or not) must balance, with no closing
paraenthesis if the number of open parentheses at that point in the name is 0.
Variable aliases: any single single token except
:
Strategies: any single token except
: @
Classes: any general sort name that does not contain underscores
Attributes: any single token that does not contain parentheses, brackets,
braces, commas or underscores
Messages: same as operators