-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgg-packages.scm
427 lines (391 loc) · 9.05 KB
/
pgg-packages.scm
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
;;; pgg-packages.scm
;;; copyright © 1996-2000 by Peter Thiemann
;;; non-commercial use is free as long as the original copright notice
;;; remains intact
(define-interface cogen-abssyn-interface
(export annMakeDef
annMakeDefMutable
annMakeDefWithoutMemoization
annIsDef?
annIsDefMutable?
annDefFetchProcName
annDefFetchProcFormals
annDefFetchProcBody
annDefSetProcBody
annDefSetProcBTVar!
annDefFetchProcBTVar
annDefFetchProcEVar
annDefSetProcEVar!
annDefFetchProcAutoMemo
annDefSetProcAutoMemo!
annDefLookup
annExprFetchType
annExprSetType!
annExprFetchMemo
annExprSetMemo!
annExprFetchEffect
annExprSetEffect!
annExprFetchLevel
annExprSetLevel!
annMakeVar
annIsVar?
annFetchVar
annFetchVarGlobal
annSetVarGlobal!
annFetchVarCall
annSetVarCall!
annMakeConst
annIsConst?
annFetchConst
annMakeCond
annIsCond?
annFetchCondTest
annFetchCondThen
annFetchCondElse
INTERNAL-IDENTITY
annMakeOp
annMakePureOp
annMakeFullOp
annMakeOp1
annMakeOpCoerce
annIsOp?
annFetchOpName
annFetchOpArgs
annFetchOpDiscardability
annFetchOpProperty
annFetchOpPostprocessor
annFetchOpType
annMakeCall
annIsCall?
annFetchCallName
annFetchCallArgs
annMakeLet
annIsLet?
annFetchLetVar
annFetchLetHeader
annFetchLetBody
annFetchLetUnfoldability
annSetLetUnfoldability!
annFetchLetUseCount
annSetLetUseCount!
annMakeBegin
annIsBegin?
annFetchBeginHeader
annFetchBeginBody
annFetchBeginUnfoldability
annSetBeginUnfoldability!
annMakeVLambda
annIsVLambda?
annFetchVLambdaFixedVars
annFetchVLambdaVar
annFetchVLambdaBody
annSetVLambdaBody!
annFetchVLambdaLabel
annFetchVLambdaBTVars
annSetVLambdaBTVars!
annMakeLambda
annIsLambda?
annFetchLambdaVars
annFetchLambdaBody
annSetLambdaBody!
annFetchLambdaLabel
annFetchLambdaBTVars
annSetLambdaBTVars!
annFetchLambdaPoly
annSetLambdaPoly!
annMakeApp
annIsApp?
annFetchAppRator
annFetchAppRands
annMakeCtor
annIsCtor?
annFetchCtorName
annFetchCtorDesc
annFetchCtorArgs
annFetchCtorLabel
annMakeSel
annMakeSel1
annIsSel?
annFetchSelName
annFetchSelCtor
annFetchSelDesc
annFetchSelComp
annFetchSelArg
annMakeTest
annMakeTest1
annIsTest?
annFetchTestName
annFetchTestDesc
annFetchTestArg
annMakeRef
annIsRef?
annFetchRefArg
annFetchRefLabel
annMakeDeref
annIsDeref?
annFetchDerefArg
annMakeAssign
annIsAssign?
annFetchAssignRef
annFetchAssignArg
annFetchAssignLabel
annMakeCellEq
annIsCellEq?
annFetchCellEqArgs
annMakeVector
annIsVector?
annFetchVectorLabel
annFetchVectorSize
annFetchVectorArg
annMakeVref
annIsVref?
annFetchVrefArg
annFetchVrefIndex
annMakeVlen
annIsVlen?
annFetchVlenVec
annMakeVset
annIsVset?
annFetchVsetLabel
annFetchVsetVec
annFetchVsetIndex
annFetchVsetArg
annMakeVfill
annIsVfill?
annFetchVfillLabel
annFetchVfillVec
annFetchVfillArg
annMakeEval
annIsEval?
annFetchEvalBody
annFetchEvalDiff
annSetEvalDiff!
annFetchEvalQuoted
annSetEvalQuoted!
annIntroduceLift
annMakeLift
annIsLift?
annSetLiftDiff!
annFetchLiftDiff
annFetchLiftBody
annIntroduceMemo
annIntroduceMemo1
annMakeMemo
annIsMemo?
annSetMemoVars!
annFetchMemoVars
annFetchMemoBody
annFetchMemoLevel
annFetchMemoSpecial
ann-replace
ann-maybe-coerce
annFreeVars
annExprTerminates?
ann-dsp-e ann-dsp-d*))
(define-interface cogen-construct-genext-interface
(export make-ge-var
make-ge-freevar
make-ge-const
make-ge-cond
with-primitive-op?
make-ge-op
make-ge-op-pure
make-ge-call
make-ge-let
make-ge-begin
make-ge-lambda-memo
make-ge-vlambda-memo
make-ge-app-memo
make-ge-lambda
make-ge-vlambda
make-ge-app
make-ge-ctor-memo
make-ge-sel-memo
make-ge-test-memo
make-ge-ctor
make-ge-sel
make-ge-test
make-ge-lift
make-ge-eval
make-ge-run
make-ge-make-vector-memo
make-ge-vector-ref-memo
make-ge-vector-length-memo
make-ge-vector-set!-memo
make-ge-vector-fill!-memo
make-ge-make-cell-memo
make-ge-cell-ref-memo
make-ge-cell-set!-memo
make-ge-cell-eq?-memo))
(define-structure cogen-construct-genext cogen-construct-genext-interface
(open scheme
fluids
cogen-residual cogen-globals)
(files cogen-construct-genext))
(define-interface cogen-directives-interface
(export ((define-without-memoization
define-memo
define-primitive)
:syntax)))
(define-structure cogen-directives cogen-directives-interface
(open scheme)
(files cogen-directives))
(define-interface cogen-terminate-interface
(export perform-termination-analysis))
(define-interface cogen-driver-interface
(export cogen-driver))
(define-interface cogen-env-interface
(export the-empty-env
extend-env
extend-env*
apply-env
map-env
for-each-env!
empty-boxed-env
extend-boxed-env
extend-boxed-env*
fresh-boxed-env*
apply-boxed-env
shrink-boxed-env
make-boxed-env
unbox-env))
(define-structure cogen-env cogen-env-interface
(open scheme signals cogen-record)
(files cogen-env))
(define-interface cogen-bta-interface
(export
bta-run
node-fetch-type
ann->bt
full-ecr
wft-make-memo-property
wft-property-table
bta-make-memo-postprocessor
type->memo
ctor-function ctor-reference ctor-top))
(define-interface cogen-effect-interface
(export *effect-display-level*
effect-analysis
effect-label->type
effect-for-each
effect->labset))
(define-interface cogen-oca-interface
(export oca-d))
(define-structure cogen-oca cogen-oca-interface
(open scheme signals
auxiliary
cogen-abssyn)
(files cogen-oca))
(define-interface cogen-typesig-interface
(export process-type-declarations parse-type
desc-type desc-ctor desc-np desc-nc desc-nt desc-hidden
type-var? type-var->tvar
type-all? type-all->tvar type-all->type
type-rec? type-rec->tvar type-rec->type
type-app? type-app->tcon type-app->types))
(define-structures ((cogen-bta cogen-bta-interface)
(cogen-typesig cogen-typesig-interface))
(open scheme signals auxiliary
cogen-scheme cogen-gensym cogen-globals pp cogen-env
cogen-abssyn cogen-record cogen-labset)
(files cogen-eq-flow
cogen-effect
cogen-typesig))
(define-interface cogen-macro-interface
(export syntax-make-pop-mark
syntax-make-env-mark
syntax-marked-exp
syntax-marked-env
syntax-pop-mark?
syntax-null?
syntax-pair?
syntax-car
syntax-cdr
syntax-map
syntax-depth
syntax-strip
syntax-strip-recursively
syntax-eq?
syntax-eq-symbol?
parse-syntax-rules
syntax-rules-transformer))
(define-structure cogen-macro cogen-macro-interface
(open scheme signals auxiliary
cogen-env)
(files cogen-macro))
(define-interface scheme-desugar-interface
(export desugar))
(define-structure scheme-desugar scheme-desugar-interface
(open scheme filenames source-file-names auxiliary
cogen-scheme)
(files scheme-desugar))
(define-interface cogen-scheme-interface
(export scheme->abssyn-d
scheme->abssyn-make-call
scheme->abssyn-make-ctor1
scheme-desugar))
(define-structure cogen-scheme cogen-scheme-interface
(open scheme auxiliary signals
cogen-gensym cogen-globals cogen-macro
cogen-abssyn cogen-env cogen-record)
(files cogen-scheme))
(define-interface cogen-skeleton-interface
(export generate-d
*generating-extension*))
(define-structure cogen-skeleton cogen-skeleton-interface
(open scheme auxiliary signals
cogen-gensym
cogen-globals
cogen-abssyn
cogen-oca
cogen-bta
cogen-typesig
cogen-construct-genext)
(files cogen-skeleton))
(define-interface cogen-labset-interface
(export empty-labset
labset-empty?
labset-singleton
labset-intersection
labset-remove
labset-add
labset-union
labset-union*
labset-subtract
labset-subset?
labset-elem?
labset-equal?
labset-for-each
labset->list
set-labset-size!))
(define-interface pgg-interface
(export cogen-driver))
(define-structure cogen-terminate cogen-terminate-interface
(open scheme auxiliary signals
cogen-globals cogen-abssyn cogen-env cogen-record)
(files cogen-terminate))
(define-structure cogen-abssyn cogen-abssyn-interface
(open scheme signals auxiliary cogen-globals)
(files cogen-abssyn))
(define-structure cogen-labset cogen-labset-interface
(open scheme signals)
(files cogen-labset-bylist))
(define-structure cogen-labset-bylist cogen-labset-interface
(open scheme signals)
(files cogen-labset-bylist))
(define-structure pgg pgg-interface
(open scheme filenames source-file-names auxiliary signals
pp
cogen-scheme
cogen-typesig
cogen-bta
cogen-skeleton
cogen-terminate)
(files cogen-driver))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-structure reaching-definitions pgg-interface
(open scheme signals auxiliary pp
cogen-abssyn cogen-env cogen-globals cogen-labset cogen-record
cogen-typesig
cogen-scheme)
(files cogen-reach))