-
Notifications
You must be signed in to change notification settings - Fork 13
/
app1.tex
510 lines (492 loc) · 22.8 KB
/
app1.tex
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
\section{Appendix: Derived Forms}
\label{derived-forms-app}
Several derived\index{66.1} grammatical forms are provided in the Core; they are presented
in Figures~\ref{der-exp}, \ref{der-pat} and \ref{der-dec}. Each derived form is
given with its equivalent form. Thus, each row of the tables should be
considered as a rewriting rule
\[ \mbox{Derived form \ $\Longrightarrow$\ Equivalent form} \]
and these rules may be applied repeatedly to a phrase until it is transformed
into a phrase of the bare language.
See Appendix~\ref{core-gram-app} for the full Core grammar, including all the
derived forms.
In the derived forms for tuples, in terms of records, we use $\overline{n}$ to
mean the ML numeral which stands for the natural number $n$.
Note that a new phrase class ~FvalBind~ of function-value bindings is introduced,
accompanied by a new declaration form ~\FUN\ \insertion{\theexplicittyvars}{\tyvarseq\ }\fvalbind~. The mixed forms
~\VAL\ \insertion{\theexplicittyvars}{\tyvarseq\ }\REC\ \fvalbind~, ~\VAL\ \insertion{\theexplicittyvars}{\tyvarseq\ }\fvalbind~ and ~\FUN\ \insertion{\theexplicittyvars}{\tyvarseq\ }\valbind~ are not
allowed -- though the first form arises during translation into the bare
language.
The following notes refer to Figure~\ref{der-dec}:
\begin{itemize}
%\item In the equivalent form for a function-value binding, the
% variables ~$\var_1$, $\cdots$, $\var_n$~ must be chosen not to
% occur in the derived form. The condition $m,n\geq 1$ applies.
\item There is a version of the derived form for function-value binding
which allows the function identifier to be infixed;
see Figure~\ref{dec-gram} in Appendix~\ref{core-gram-app}.
\item In the two forms involving ~\WITHTYPE~, the identifiers bound
by ~\datbind~ and by ~\typbind~ must be distinct. Then the
transformed binding ~\datbind$\/'$~ in the equivalent form is
obtained from ~\datbind~ by expanding out all the definitions
made by ~\typbind. More precisely, if ~\typbind~ is
\[ \tyvarseq_1\ \tycon_1\ \mbox{\ml{=}} \ty_1\ \ \AND
\ \cdots\ \AND
\ \ \tyvarseq_n\ \tycon_n\ \mbox{\ml{=}} \ty_n\ \]
then $\hbox{\datbind}'$ is the result of simultaneous replacement
(in ~\datbind) of every type expression ~$\tyseq_i\ \tycon_i$~
($1\leq i\leq n$)
by the corresponding defining expression
\[ \ty_i\{\tyseq_i/\tyvarseq_i\}\]
%\item The abbreviation of ~\VAL\ {\tt it =} \exp~ to ~\exp~ is only
% permitted at top-level, i.e. as a ~\program~.
\end{itemize}
Figure~\ref{functor-der-forms-fig} shows derived forms for functors.
They allow functors to take, say, a single type or value as a parameter,
in cases where it would seem clumsy to ``wrap up'' the argument as a
structure expression.
\deletion{\thenostrsharing}{
These forms are currently more experimental than the bare syntax of modules,
but we recommend implementers to include them so that they can be
tested in practice.
In the derived forms for functor bindings and functor signature expressions,
$\strid$ is a new structure identifier and
the form of $\sigexp'$ depends
on the form of $\sigexp$ as follows.
If $\sigexp$ is simply a signature identifier
$\sigid$, then $\sigexp'$ is also $\sigid$; otherwise $\sigexp$ must take
the form ~$\SIG\ \spec_1\ \END$~,
and then $\sigexp'$ is
$\mbox{\SIG\ \LOCAL\ \OPEN\ \strid\ \IN\ $\spec_1$\ \END\ \END}$.
%(where $\strid$ is new).
}
\insertion{\thenostrsharing}{
Finally, Figure~\ref{spec-der-forms-fig} shows the derived forms for specifications and signature expressions.
The last derived form for specifications allows sharing between structure
identifiers as a shorthand for type sharing specifications.
%Standard ML no
%longer has a semantic notion of structure sharing;
%however, for compatability with Standard ML '90, a weaker form
%of structure sharing specification is provided.
The phrase
\[
\boxml{$\spec$ sharing $\longstrid_1$ = $\cdots$ = $\longstrid_k$}
\]
is a derived form whose equivalent form is
\pagebreak
%\medskip
\halign{\qquad\ignore{#}&#\hfil\cr
\boxml{$\spec$ sharing $\longstrid_1$ = $\cdots$} & \boxml{$\spec$}\cr
\boxml{\ \ \qquad\qquad\qquad\qquad\qquad = $\longstrid_k$} & \boxml{\ sharing type $\longtycon_{1}$ = $\longtycon_{1}'$}\cr
& \boxml{\ $\cdots$}\cr
& \boxml{\ sharing type $\longtycon_{m}$ = $\longtycon_{m}'$}\cr}
\medskip
\noindent
determined as follows.
First, note that $\spec$ specifies a set of
(possibly long) type constructors and structure identifiers, either
directly or via signature identifiers and $\INCLUDE$ specifications.
Then the equivalent form contains all type-sharing constraints
of the form
\[\boxml{sharing type $\longstrid_i.\longtycon$ = $\longstrid_j.longtycon$}\]
$(1\leq i<j\leq k)$, such that both sides of the equation are long type
constructors specified by $\spec$.
The meaning of the derived form does not depend on the order of the
type-sharing constraints in the equivalent form.
}
\begin{figure}
\adhocreplacementl{\theidstatus}{0cm}{\begin{tabular}{|l|l|l}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form} &
\multicolumn{1}{c}{}\\
\multicolumn{3}{c}{}\\
\multicolumn{2}{l}{{\bf Expressions} \exp}\\
%\multicolumn{2}{l}{EXPRESSIONS \exp}\\
\cline{1-2}
\ml{()} & \ml{\lttbrace\ \rttbrace} \\
\cline{1-2}
\ml{(}$\exp_1$ \ml{,} $\cdots$ \ml{,} $\exp_\n$\ml{)}
& \ml{\lttbrace 1=}$\exp_1$\ml{,}\ $\cdots$\ml{,}\
$\overline{n}$\ml{=}$\exp_\n$\ml{\rttbrace}
& $(\n\geq 2)$\\
\cline{1-2}
\ml{\#}\ \lab & \FN\ \ml{\lttbrace}\lab\ml{=}\var\ml{,...\rttbrace\ => }\var
& (\var\ new)\\
%\cline{1-2}
%\RAISE\ \longexn & \RAISE\ \longexn\ \WITH\ \ml{()} \\
\cline{1-2}
\CASE\ \exp\ \OF\ \match
& \ml{(}\FN\ \match\ml{)(}\exp\ml{)} \\
\cline{1-2}
\IF\ $\exp_1$\ \THEN\ $\exp_2$\ \ELSE\ $\exp_3$
& \CASE\ $\exp_1$\ \OF\ \TRUE\ \ml{=>}\ \exp$_2$\\
& \ \ \qquad\qquad\ml{|}\ \FALSE\ \ml{=>}\ \exp$_3$ \\
\cline{1-2}
\exp$_1$\ \ORELSE\ \exp$_2$
& \IF\ \exp$_1$\ \THEN\ \TRUE\ \ELSE\ \exp$_2$ \\
\cline{1-2}
\exp$_1$\ \ANDALSO\ \exp$_2$
& \IF\ \exp$_1$\ \THEN\ \exp$_2$\ \ELSE\ \FALSE \\
\cline{1-2}
\ml{(}$\exp_1$ \ml{;} $\cdots$ \ml{;} $\exp_\n$ \ml{;} \exp\ml{)}\
& \CASE\ \exp$_1$\ \OF\ \ml{(\_) =>}
& $(\n\geq 1)$ \\
& \qquad$\cdots$ \\
& \CASE\ \exp$_n$\ \OF\ \ml{(\_) =>}\ \exp \\
\cline{1-2}
\LET\ \dec\ \IN
& \LET\ \dec\ \IN & $(\n\geq 2)$ \\
\qquad$\exp_1$ \ml{;} $\cdots$ \ml{;} $\exp_\n$ \END
& \ \ \ml{(}$\exp_1$ \ml{;} $\cdots$ \ml{;} $\exp_\n$\ml{)}\
\END\\
\cline{1-2}
\WHILE\ \exp$_1$\ \DO\ \exp$_2$
& \LET\ \VAL\ \REC\ \var\ \ml{=}\ \FN\ \ml{() =>}
& (\var\ new)\\
& \ \ \IF\ \exp$_1$\ \THEN\
\ml{(}\exp$_2$\ml{;}\var\ml{())}\ \ELSE\ \ml{()} \\
& \ \ \IN\ \var\ml{()}\ \END\\
\cline{1-2}
\ml{[}$\exp_1$ \ml{,} $\cdots$ \ml{,} $\exp_\n$\ml{]}
& \exp$_1$\ \ml{::}\ $\cdots$\ \ml{::}\ \exp$_n$\
\ml{::}\ \NIL & $(n\geq 0)$ \\
\cline{1-2}
\multicolumn{3}{c}{}\\
\end{tabular}}{\begin{tabular}{|l|l|l}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form} &
\multicolumn{1}{c}{}\\
\multicolumn{3}{c}{}\\
\multicolumn{2}{l}{{\bf Expressions} \exp}\\
%\multicolumn{2}{l}{EXPRESSIONS \exp}\\
\cline{1-2}
\ml{()} & \ml{\lttbrace\ \rttbrace} \\
\cline{1-2}
\ml{(}$\exp_1$ \ml{,} $\cdots$ \ml{,} $\exp_\n$\ml{)}
& \ml{\lttbrace 1=}$\exp_1$\ml{,}\ $\cdots$\ml{,}\
$\overline{n}$\ml{=}$\exp_\n$\ml{\rttbrace}
& $(\n\geq 2)$\\
\cline{1-2}
\ml{\#}\ \lab & \FN\ \ml{\lttbrace}\lab\ml{=}\vid\ml{,...\rttbrace\ => }\vid
& (\vid\ new)\\
%\cline{1-2}
%\RAISE\ \longexn & \RAISE\ \longexn\ \WITH\ \ml{()} \\
\cline{1-2}
\CASE\ \exp\ \OF\ \match
& \ml{(}\FN\ \match\ml{)(}\exp\ml{)} \\
\cline{1-2}
\IF\ $\exp_1$\ \THEN\ $\exp_2$\ \ELSE\ $\exp_3$
& \CASE\ $\exp_1$\ \OF\ \TRUE\ \ml{=>}\ \exp$_2$\\
& \ \ \qquad\qquad\ml{|}\ \FALSE\ \ml{=>}\ \exp$_3$ \\
\cline{1-2}
\exp$_1$\ \ORELSE\ \exp$_2$
& \IF\ \exp$_1$\ \THEN\ \TRUE\ \ELSE\ \exp$_2$ \\
\cline{1-2}
\exp$_1$\ \ANDALSO\ \exp$_2$
& \IF\ \exp$_1$\ \THEN\ \exp$_2$\ \ELSE\ \FALSE \\
\cline{1-2}
\ml{(}$\exp_1$ \ml{;} $\cdots$ \ml{;} $\exp_\n$ \ml{;} \exp\ml{)}\
& \CASE\ \exp$_1$\ \OF\ \ml{(\_) =>}
& $(\n\geq 1)$ \\
& \qquad$\cdots$ \\
& \CASE\ \exp$_n$\ \OF\ \ml{(\_) =>}\ \exp \\
\cline{1-2}
\LET\ \dec\ \IN
& \LET\ \dec\ \IN & $(\n\geq 2)$ \\
\qquad$\exp_1$ \ml{;} $\cdots$ \ml{;} $\exp_\n$ \END
& \ \ \ml{(}$\exp_1$ \ml{;} $\cdots$ \ml{;} $\exp_\n$\ml{)}\
\END\\
\cline{1-2}
\WHILE\ \exp$_1$\ \DO\ \exp$_2$
& \LET\ \VAL\ \REC\ \vid\ \ml{=}\ \FN\ \ml{() =>}
& (\vid\ new)\\
& \ \ \IF\ \exp$_1$\ \THEN\
\ml{(}\exp$_2$\ml{;}\vid\ml{())}\ \ELSE\ \ml{()} \\
& \ \ \IN\ \vid\ml{()}\ \END\\
\cline{1-2}
\ml{[}$\exp_1$ \ml{,} $\cdots$ \ml{,} $\exp_\n$\ml{]}
& \exp$_1$\ \ml{::}\ $\cdots$\ \ml{::}\ \exp$_n$\
\ml{::}\ \NIL & $(n\geq 0)$ \\
\cline{1-2}
\multicolumn{3}{c}{}\\
\end{tabular}}
\caption{Derived forms of Expressions\index{67.1}}
\label{der-exp}
\end{figure}
\begin{figure}
\begin{tabular}{|l|l|l}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form} &
\multicolumn{1}{c}{}\\
\multicolumn{3}{c}{}\\
\multicolumn{2}{l}{{\bf Patterns} \pat}\\
%\multicolumn{2}{l}{PATTERNS \pat}\\
\cline{1-2}
\ml{()} & \ml{\lttbrace\ \rttbrace} \\
\cline{1-2}
\ml{(}$\pat_1$ \ml{,} $\cdots$ \ml{,} $\pat_\n$\ml{)}
& \ml{\lttbrace 1=}$\pat_1$\ml{,}\ $\cdots$ \ml{,}\
$\overline{n}$\ml{=}$\pat_\n$\ml{\rttbrace}
& $(\n\geq 2)$ \\
\cline{1-2}
\ml{[}$\pat_1$ \ml{,} $\cdots$ \ml{,} $\pat_\n$\ml{]}
& \pat$_1$\ \ml{::}\ $\cdots$\ \ml{::}\ \pat$_n$\
\ml{::}\ \NIL & $(n\geq 0)$ \\
\cline{1-2}
\multicolumn{3}{c}{}\\
\multicolumn{2}{l}{{\bf Pattern Rows} \labpats}\\
%\multicolumn{2}{l}{PATTERN ROWS \labpats}\\
\cline{1-2}
\adhocreplacementl{\theidstatus}{1cm}{
\id$\langle$\ml{:}\ty$\rangle
\ \langle\AS\ \pat\rangle
\ \langle$\ml{,} \labpats$\rangle$
}{\vid$\langle$\ml{:}\ty$\rangle
\ \langle\AS\ \pat\rangle
\ \langle$\ml{,} \labpats$\rangle$}& \adhocreplacementl{\theidstatus}{-9cm}{\id\ml{ = }\id$\langle$\ml{:}\ty$\rangle
\ \langle\AS\ \pat\rangle
\ \langle$\ml{,} \labpats$\rangle$}{\vid\ml{ = }\vid$\langle$\ml{:}\ty$\rangle
\ \langle\AS\ \pat\rangle
\ \langle$\ml{,} \labpats$\rangle$} \\
\cline{1-2}
\multicolumn{3}{c}{}\\
\multicolumn{2}{l}{{\bf Type Expressions} \ty}\\
%\multicolumn{2}{l}{TYPE EXPRESSIONS \ty}\\
\cline{1-2}
$\ty_1$ \ml{*} $\cdots$ \ml{*} $\ty_\n$
& \ml{\lttbrace 1:}$\ty_1$\ml{,}\ $\cdots$ \ml{,}\
$\overline{n}$\ml{:}$\ty_\n$\ml{\rttbrace}
& $(\n\geq 2)$ \\
\cline{1-2}
\multicolumn{3}{c}{}\\
\end{tabular}
\caption{Derived forms of Patterns and Type Expressions\index{67.2}}
\label{der-pat}
\end{figure}
\begin{figure}
\adhocreplacementl{\theidstatus}{0cm}{
\begin{tabular}{|l|l|}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Function-value Bindings} \fvalbind}\\
%\multicolumn{2}{l}{FUNCTION-VALUE BINDINGS \fvalbind}\\
\hline
& $\langle\OP\rangle$\var\ \ml{=} \FN\ \var$_1$\ml{=>} $\cdots$
\FN\ \var$_n$\ml{=>} \\
& \CASE\
\ml{(}\var$_1$\ml{,} $\cdots$ \ml{,} \var$_n$\ml{)} \OF \\
\ \ $\langle\OP\rangle\var\ \atpat_{11}\cdots\atpat_{1n}
\langle$\ml{:}\ty$\rangle$
\ml{=} \exp$_1$
& \ \ \ml{(}\atpat$_{11}$\ml{,}$\cdots$\ml{,}\atpat$_{1n}$
\ml{)=>}\exp$_1\langle$\ml{:}\ty$\rangle$\\
\ml{|}$\langle\OP\rangle\var\ \atpat_{21}\cdots\atpat_{2n}
\langle$\ml{:}\ty$\rangle$
\ml{=} \exp$_2$
& \ml{|(}\atpat$_{21}$\ml{,}$\cdots$\ml{,}\atpat$_{2n}$
\ml{)=>}\exp$_2\langle$\ml{:}\ty$\rangle$\\
\ml{|}\qquad$\cdots\qquad\cdots$
& \ml{|}\qquad$\cdots\qquad\cdots$\\
\ml{|}$\langle\OP\rangle\var\ \atpat_{m1}\cdots\atpat_{mn}
\langle$\ml{:}\ty$\rangle$
\ml{=} \exp$_m$
& \ml{|(}\atpat$_{m1}$\ml{,}$\cdots$\ml{,}\atpat$_{mn}$
\ml{)=>}\exp$_m\langle$\ml{:}\ty$\rangle$\\
\qquad\qquad\qquad$\langle\AND\ \fvalbind\rangle$
& \qquad\qquad\qquad$\langle\AND\ \fvalbind\rangle$\\
\hline
\multicolumn{2}{r}{($m,n\geq1$; $\var_1,\cdots,\var_n$ distinct and new)}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Declarations} \dec}\\
%\multicolumn{2}{l}{DECLARATIONS \dec}\\
\hline
\FUN\ \fvalbind
& \VAL\ \REC\ \fvalbind \\
\hline
\DATATYPE\ \datbind\ \WITHTYPE\ \typbind
& \DATATYPE\ \datbind$\/'$\ \ml{;}\ \TYPE\ \typbind \\
\hline
\ABSTYPE\ \datbind\ \WITHTYPE\ \typbind
& \ABSTYPE\ \datbind$\/'$ \\
\qquad\qquad\WITH\ \dec\ \END
& \qquad\WITH\ \TYPE\ \typbind\ \ml{;}\ \dec\ \END\\
\hline
\multicolumn{2}{r}{(see note in text concerning \datbind$\/'$)}\\
\multicolumn{2}{c}{}\\
\end{tabular}}{\begin{tabular}{|l|l|}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Function-value Bindings} \fvalbind}\\
%\multicolumn{2}{l}{FUNCTION-VALUE BINDINGS \fvalbind}\\
\hline
& $\langle\OP\rangle$\vid\ \ml{=} \FN\ \vid$_1$\ml{=>} $\cdots$
\FN\ \vid$_n$\ml{=>} \\
& \CASE\
\ml{(}\vid$_1$\ml{,} $\cdots$ \ml{,} \vid$_n$\ml{)} \OF \\
\ \ $\langle\OP\rangle\vid\ \atpat_{11}\cdots\atpat_{1n}
\langle$\ml{:}\ty$\rangle$
\ml{=} \exp$_1$
& \ \ \ml{(}\atpat$_{11}$\ml{,}$\cdots$\ml{,}\atpat$_{1n}$
\ml{)=>}\exp$_1\langle$\ml{:}\ty$\rangle$\\
\ml{|}$\langle\OP\rangle\vid\ \atpat_{21}\cdots\atpat_{2n}
\langle$\ml{:}\ty$\rangle$
\ml{=} \exp$_2$
& \ml{|(}\atpat$_{21}$\ml{,}$\cdots$\ml{,}\atpat$_{2n}$
\ml{)=>}\exp$_2\langle$\ml{:}\ty$\rangle$\\
\ml{|}\qquad$\cdots\qquad\cdots$
& \ml{|}\qquad$\cdots\qquad\cdots$\\
\ml{|}$\langle\OP\rangle\vid\ \atpat_{m1}\cdots\atpat_{mn}
\langle$\ml{:}\ty$\rangle$
\ml{=} \exp$_m$
& \ml{|(}\atpat$_{m1}$\ml{,}$\cdots$\ml{,}\atpat$_{mn}$
\ml{)=>}\exp$_m\langle$\ml{:}\ty$\rangle$\\
\qquad\qquad\qquad$\langle\AND\ \fvalbind\rangle$
& \qquad\qquad\qquad$\langle\AND\ \fvalbind\rangle$\\
\hline
\multicolumn{2}{r}{($m,n\geq1$; $\vid_1,\cdots,\vid_n$ distinct and new)}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Declarations} \dec}\\
%\multicolumn{2}{l}{DECLARATIONS \dec}\\
\hline
\FUN\ \tyvarseq\ \fvalbind
& \VAL\ \tyvarseq\ \REC\ \fvalbind \\
\hline
\DATATYPE\ \datbind\ \WITHTYPE\ \typbind
& \DATATYPE\ \datbind$\/'$\ \ml{;}\ \TYPE\ \typbind \\
\hline
\ABSTYPE\ \datbind\ \WITHTYPE\ \typbind
& \ABSTYPE\ \datbind$\/'$ \\
\qquad\qquad\WITH\ \dec\ \END
& \qquad\WITH\ \TYPE\ \typbind\ \ml{;}\ \dec\ \END\\
\hline
\multicolumn{2}{r}{(see note in text concerning \datbind$\/'$)}\\
\multicolumn{2}{c}{}\\
\end{tabular}}
\caption{Derived forms of Function-value Bindings and Declarations\index{68.1}}
\label{der-dec}
\end{figure}
% Derived forms of functors:
\begin{figure}\adhocreplacementl{\thenostrsharing}{0mm}{
\begin{tabular}{|l|l|}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form} \\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Structure Expressions} \strexp}\\
%\multicolumn{2}{l}{STRUCTURE EXPRESSIONS \strexp}\\
\cline{1-2}
\funappdec & \mbox{\funid\ \ml{(} \STRUCT\ \strdec\ \END\ \ml{)}}\\
\cline{1-2}
\multicolumn{2}{c}{}\\
%\multicolumn{2}{l}{FUNCTOR BINDINGS \funbind}\\
\multicolumn{2}{l}{{\bf Functor Bindings} \funbind}\\
\cline{1-2}
\mbox{\funid\ \ml{(}\ \spec\ \ml{)}\ $\langle$\ml{:}\ \sigexp$\rangle$\ \ml{=}}&
\mbox{\funid\ \ml{(}\ \strid\ \ml{:} \SIG\ \spec\ \END\ \ml{)}
$\langle$\ml{:}\ $\sigexp'\rangle$\ \ml{=}}\\
\mbox{\ \ \strexp\ $\langle$\AND\ \funbind$\rangle$} &
\mbox{\ \ \LET\ \OPEN\ \strid\ \IN\ \strexp\ \END\ $\langle$\AND\ \funbind$\rangle$} \\
\cline{1-2}
\multicolumn{2}{r}{($\strid$ new; see note in text concerning $\sigexp'$)}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Functor Signature Expressions} \funsigexp}\\
%\multicolumn{2}{l}{FUNCTOR SIGNATURES \funsigexp}\\
\cline{1-2}
\longfunsigexp & \mbox{\ml{(} \strid\ \ml{:}\ \SIG\ \spec\ \END\ \ml{)}
\ml{:}\ \sigexp$'$} \\
\cline{1-2}
\multicolumn{2}{r}{($\strid$ new; see note in text concerning $\sigexp'$)}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Top-level Declarations} \topdec}\\
\cline{1-2}
\exp & \VAL\ \ml{it =} \exp \\
\cline{1-2}
\multicolumn{2}{c}{}\\
\end{tabular}}{
\begin{tabular}{|l|l|}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form} \\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Structure Bindings} \strbind}\\
\cline{1-2}
\derivedstrbinder & \equivalentstrbinder\\
\cline{1-2}
\derivedabststrbinder & \equivalentabststrbinder\\
\cline{1-2}
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Structure Expressions} \strexp}\\
\cline{1-2}
\funappdec & \mbox{\funid\ \ml{(} \STRUCT\ \strdec\ \END\ \ml{)}}\\
\cline{1-2}
\multicolumn{2}{c}{}\\
%\multicolumn{2}{l}{FUNCTOR BINDINGS \funbind}\\
\multicolumn{2}{l}{{\bf Functor Bindings} \funbind}\\
\cline{1-2}
\mbox{\funid\ \ml{(}\strid\ml{:}\sigexp\ml{)}\ml{:} $\sigexp'$ \ml{=}}&
\mbox{\funid\ \ml{(}\strid\ \ml{:} \sigexp\ml{)} \ \ml{=}}\\
\mbox{\ \ \strexp\ $\langle$\AND\ \funbind$\rangle$} &
\mbox{\ \ \strexp\ml{:}$\sigexp'$\ $\langle$\AND\ \funbind$\rangle$} \\
\cline{1-2}
\mbox{\funid\ \ml{(}\strid\ml{:}\sigexp\ml{)}\ABSTRACT $\sigexp'$ \ml{=}}&
\mbox{\funid\ \ml{(}\strid\ \ml{:} \sigexp\ml{)} \ \ml{=}}\\
\mbox{\ \ \strexp\ $\langle$\AND\ \funbind$\rangle$} &
\mbox{\ \ \strexp\ABSTRACT$\sigexp'$\ $\langle$\AND\ \funbind$\rangle$} \\
\cline{1-2}
\mbox{\funid\ \ml{(}\ \spec\ \ml{)}\ $\langle$\ml{:}\ \sigexp$\rangle$\ \ml{=}}&
\mbox{\funid\ \ml{(}\ $\strid_\nu$\ \ml{:} \SIG\ \spec\ \END\ \ml{)}
\ \ml{=}}\\
\mbox{\ \ \strexp\ $\langle$\AND\ \funbind$\rangle$} &
\mbox{\ \ \LET\ \OPEN\ $\strid_\nu$ \IN\ \strexp$\langle$\ml{:}\ $\sigexp\rangle$}\\
& \mbox{\ \ \END\ $\langle$\AND\ \funbind$\rangle$} \\
\cline{1-2}
\mbox{\funid\ \ml{(}\ \spec\ \ml{)}\ $\langle$\ABSTRACT\ \sigexp$\rangle$\ \ml{=}}&
\mbox{\funid\ \ml{(}\ $\strid_\nu$\ \ml{:} \SIG\ \spec\ \END\ \ml{)}
\ \ml{=}}\\
\mbox{\ \ \strexp\ $\langle$\AND\ \funbind$\rangle$} &
\mbox{\ \ \LET\ \OPEN\ $\strid_\nu$ \IN\ \strexp$\langle$\ABSTRACT $\sigexp\rangle$}\\
& \mbox{\ \ \END\ $\langle$\AND\ \funbind$\rangle$} \\
\cline{1-2}
\multicolumn{2}{r}{($\strid_\nu$ new)}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Programs} \program}\\
\cline{1-2}
$\exp\boxml{;}\langle\program\rangle$ & $\VAL\ \boxml{it =}\; \exp\boxml{;}\langle\program\rangle$\\
\cline{1-2}
\multicolumn{2}{c}{}\\
\end{tabular}}
\caption{Derived forms of Functors, Structure Bindings and Programs\index{68.2}}
\label{functor-der-forms-fig}
\end{figure}
\begin{figure}
\adhocinsertion{\thetypabbr}{-10mm}{
\begin{tabular}{|l|l|}
\multicolumn{1}{c}{Derived Form} & \multicolumn{1}{c}{Equivalent Form} \\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Specifications} \spec}\\
\cline{1-2}
$\TYPE\;\tyvarseq\;\tycon\,\boxml{=}\,\ty$ & \boxml{include}\\
&\boxml{\ sig $\TYPE\;\tyvarseq\;\tycon$}\\
&\boxml{\ end where type $\tyvarseq\;\tycon\,\boxml{=}\,\ty$} \\
\cline{1-2}
\boxml{type $\tyvarseq_1\;\tycon_1$ = $\ty_1$} & \boxml{type $\tyvarseq_1\;\tycon_1$ = $\ty_1$}\\
\boxml{ and $\cdots$} & \boxml{type $\cdots$}\\
\boxml{ $\cdots$} & \boxml{ $\cdots$}\\
\boxml{ and $\tyvarseq_n\;\tycon_n$ = $\ty_n$} & \boxml{type $\tyvarseq_n\;\tycon_n$ = $\ty_n$}\\
\cline{1-2}
$\inclspec$ & $\INCLUDE\,\sigid_1; \cdots\, ; \INCLUDE \,sigid_n$\\
\cline{1-2}
\boxml{$\spec$ sharing $\longstrid_1$ = $\cdots$} & \boxml{$\spec$}\\
\boxml{\ \ \qquad\qquad\qquad\qquad\qquad = $\longstrid_k$} & \boxml{\ sharing type $\longtycon_{1}$ = }\\
& \boxml{\ \ \ \ \ \qquad\qquad\qquad\qquad $\longtycon_{1}'$}\\
& \boxml{\ $\cdots$}\\
& \boxml{\ sharing type $\longtycon_{m}$ = }\\
& \boxml{\ \ \ \ \ \qquad\qquad\qquad\qquad $\longtycon_{m}'$}\\
\cline{1-2}
\multicolumn{2}{r}{\vrule height14pt depth0pt width0pt(see note in text concerning $\longtycon_{1},\ldots,\longtycon_{m}'$)}\\
%\multicolumn{2}{r}{($n\geq 1$)}\\
\multicolumn{2}{c}{}\\
\multicolumn{2}{l}{{\bf Signature Expressions} \sigexp}\\
\cline{1-2}
\boxml{$\sigexp$} & \boxml{$\sigexp$}\\
\boxml{where type $\tyvarseq_1\; \longtycon_1$ = $\ty_1$} & \boxml{\ where type $\tyvarseq_1\; \longtycon_1$ = $\ty_1$}\\
\boxml{\ \ and\ type $\cdots$} & \boxml{\ where type $\cdots$}\\
\boxml{\ \ $\cdots$} & \boxml{\ $\cdots$}\\
\boxml{\ \ and\ type $\tyvarseq_n\;\longtycon_n$ = $\ty_n$} & \boxml{\ where type $\tyvarseq_n\;\longtycon_n$ = $\ty_n$}\\
\cline{1-2}
\end{tabular}}
\caption{Derived forms of Specifications and Signature Expressions}
\label{spec-der-forms-fig}
\end{figure}