capdag 1.361.331 → 1.368.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/capdag.js +226 -45
- package/formal/index.d.ts +296 -6
- package/formal/index.js +887 -15
- package/formal/program.wasm +0 -0
- package/package.json +3 -3
package/formal/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by lungo 1.
|
|
1
|
+
// Generated by lungo 1.82.64 from Lean 4.34.1 for program capdagFormal. Do not edit.
|
|
2
2
|
import * as L from "lungo-ts";
|
|
3
3
|
|
|
4
4
|
async function programModule() {
|
|
@@ -12,10 +12,599 @@ async function programModule() {
|
|
|
12
12
|
return response.arrayBuffer();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/** Describes CapDAG.Bifaci.Credit.Gate for polymorphic functions. */
|
|
16
|
+
export function gateType() {
|
|
17
|
+
return new L.Type(
|
|
18
|
+
L.inductiveExpr(0),
|
|
19
|
+
(w, v) => {
|
|
20
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Credit.Gate");
|
|
21
|
+
w.u32(0);
|
|
22
|
+
L.NAT.encode(w, v.available);
|
|
23
|
+
L.option(L.STRING).encode(w, v.closed);
|
|
24
|
+
},
|
|
25
|
+
(r) => {
|
|
26
|
+
const c = r.u32();
|
|
27
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Credit.Gate`);
|
|
28
|
+
return ({ available: L.NAT.decode(r), closed: L.option(L.STRING).decode(r) });
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Describes CapDAG.Bifaci.Credit.Acquire for polymorphic functions. */
|
|
34
|
+
export function acquireType() {
|
|
35
|
+
return new L.Type(
|
|
36
|
+
L.inductiveExpr(1),
|
|
37
|
+
(w, v) => {
|
|
38
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Credit.Acquire");
|
|
39
|
+
switch (v.kind) {
|
|
40
|
+
case "acquired":
|
|
41
|
+
w.u32(0);
|
|
42
|
+
gateType().encode(w, v.gate);
|
|
43
|
+
return;
|
|
44
|
+
case "wait":
|
|
45
|
+
w.u32(1);
|
|
46
|
+
return;
|
|
47
|
+
case "closed":
|
|
48
|
+
w.u32(2);
|
|
49
|
+
L.STRING.encode(w, v.reason);
|
|
50
|
+
return;
|
|
51
|
+
default:
|
|
52
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Credit.Acquire`);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
(r) => {
|
|
56
|
+
const c = r.u32();
|
|
57
|
+
switch (c) {
|
|
58
|
+
case 0: return ({ kind: "acquired", gate: gateType().decode(r) });
|
|
59
|
+
case 1: return ({ kind: "wait" });
|
|
60
|
+
case 2: return ({ kind: "closed", reason: L.STRING.decode(r) });
|
|
61
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Credit.Acquire`);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Describes CapDAG.Bifaci.Credit.Window for polymorphic functions. */
|
|
68
|
+
export function windowType() {
|
|
69
|
+
return new L.Type(
|
|
70
|
+
L.inductiveExpr(2),
|
|
71
|
+
(w, v) => {
|
|
72
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Credit.Window");
|
|
73
|
+
w.u32(0);
|
|
74
|
+
L.NAT.encode(w, v.remaining);
|
|
75
|
+
L.NAT.encode(w, v.pending);
|
|
76
|
+
L.NAT.encode(w, v.batch);
|
|
77
|
+
},
|
|
78
|
+
(r) => {
|
|
79
|
+
const c = r.u32();
|
|
80
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Credit.Window`);
|
|
81
|
+
return ({ remaining: L.NAT.decode(r), pending: L.NAT.decode(r), batch: L.NAT.decode(r) });
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Describes CapDAG.Bifaci.Credit.Arrival for polymorphic functions. */
|
|
87
|
+
export function creditArrivalType() {
|
|
88
|
+
return new L.Type(
|
|
89
|
+
L.inductiveExpr(3),
|
|
90
|
+
(w, v) => {
|
|
91
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Credit.Arrival");
|
|
92
|
+
switch (v.kind) {
|
|
93
|
+
case "accepted":
|
|
94
|
+
w.u32(0);
|
|
95
|
+
windowType().encode(w, v.window);
|
|
96
|
+
return;
|
|
97
|
+
case "violation":
|
|
98
|
+
w.u32(1);
|
|
99
|
+
return;
|
|
100
|
+
default:
|
|
101
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Credit.Arrival`);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
(r) => {
|
|
105
|
+
const c = r.u32();
|
|
106
|
+
switch (c) {
|
|
107
|
+
case 0: return ({ kind: "accepted", window: windowType().decode(r) });
|
|
108
|
+
case 1: return ({ kind: "violation" });
|
|
109
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Credit.Arrival`);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Describes CapDAG.Bifaci.Credit.Granted for polymorphic functions. */
|
|
116
|
+
export function grantedType() {
|
|
117
|
+
return new L.Type(
|
|
118
|
+
L.inductiveExpr(4),
|
|
119
|
+
(w, v) => {
|
|
120
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Credit.Granted");
|
|
121
|
+
w.u32(0);
|
|
122
|
+
windowType().encode(w, v.window);
|
|
123
|
+
L.NAT.encode(w, v.grant);
|
|
124
|
+
},
|
|
125
|
+
(r) => {
|
|
126
|
+
const c = r.u32();
|
|
127
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Credit.Granted`);
|
|
128
|
+
return ({ window: windowType().decode(r), grant: L.NAT.decode(r) });
|
|
129
|
+
},
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Describes CapDAG.Bifaci.Flow.FrameType for polymorphic functions. */
|
|
134
|
+
export function frameTypeType() {
|
|
135
|
+
return new L.Type(
|
|
136
|
+
L.inductiveExpr(5),
|
|
137
|
+
(w, v) => {
|
|
138
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Flow.FrameType");
|
|
139
|
+
switch (v.kind) {
|
|
140
|
+
case "hello":
|
|
141
|
+
w.u32(0);
|
|
142
|
+
return;
|
|
143
|
+
case "req":
|
|
144
|
+
w.u32(1);
|
|
145
|
+
return;
|
|
146
|
+
case "chunk":
|
|
147
|
+
w.u32(2);
|
|
148
|
+
return;
|
|
149
|
+
case "fin":
|
|
150
|
+
w.u32(3);
|
|
151
|
+
return;
|
|
152
|
+
case "log":
|
|
153
|
+
w.u32(4);
|
|
154
|
+
return;
|
|
155
|
+
case "err":
|
|
156
|
+
w.u32(5);
|
|
157
|
+
return;
|
|
158
|
+
case "heartbeat":
|
|
159
|
+
w.u32(6);
|
|
160
|
+
return;
|
|
161
|
+
case "streamStart":
|
|
162
|
+
w.u32(7);
|
|
163
|
+
return;
|
|
164
|
+
case "streamEnd":
|
|
165
|
+
w.u32(8);
|
|
166
|
+
return;
|
|
167
|
+
case "relayNotify":
|
|
168
|
+
w.u32(9);
|
|
169
|
+
return;
|
|
170
|
+
case "relayState":
|
|
171
|
+
w.u32(10);
|
|
172
|
+
return;
|
|
173
|
+
case "cancel":
|
|
174
|
+
w.u32(11);
|
|
175
|
+
return;
|
|
176
|
+
case "credit":
|
|
177
|
+
w.u32(12);
|
|
178
|
+
return;
|
|
179
|
+
case "closeStream":
|
|
180
|
+
w.u32(13);
|
|
181
|
+
return;
|
|
182
|
+
default:
|
|
183
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Flow.FrameType`);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
(r) => {
|
|
187
|
+
const c = r.u32();
|
|
188
|
+
switch (c) {
|
|
189
|
+
case 0: return ({ kind: "hello" });
|
|
190
|
+
case 1: return ({ kind: "req" });
|
|
191
|
+
case 2: return ({ kind: "chunk" });
|
|
192
|
+
case 3: return ({ kind: "fin" });
|
|
193
|
+
case 4: return ({ kind: "log" });
|
|
194
|
+
case 5: return ({ kind: "err" });
|
|
195
|
+
case 6: return ({ kind: "heartbeat" });
|
|
196
|
+
case 7: return ({ kind: "streamStart" });
|
|
197
|
+
case 8: return ({ kind: "streamEnd" });
|
|
198
|
+
case 9: return ({ kind: "relayNotify" });
|
|
199
|
+
case 10: return ({ kind: "relayState" });
|
|
200
|
+
case 11: return ({ kind: "cancel" });
|
|
201
|
+
case 12: return ({ kind: "credit" });
|
|
202
|
+
case 13: return ({ kind: "closeStream" });
|
|
203
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Flow.FrameType`);
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Describes CapDAG.Bifaci.Flow.Reorder for polymorphic functions. */
|
|
210
|
+
export function reorderType() {
|
|
211
|
+
return new L.Type(
|
|
212
|
+
L.inductiveExpr(6),
|
|
213
|
+
(w, v) => {
|
|
214
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Flow.Reorder");
|
|
215
|
+
w.u32(0);
|
|
216
|
+
L.NAT.encode(w, v.expected);
|
|
217
|
+
L.list(L.NAT).encode(w, v.held);
|
|
218
|
+
},
|
|
219
|
+
(r) => {
|
|
220
|
+
const c = r.u32();
|
|
221
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Flow.Reorder`);
|
|
222
|
+
return ({ expected: L.NAT.decode(r), held: L.list(L.NAT).decode(r) });
|
|
223
|
+
},
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** Describes CapDAG.Bifaci.Flow.Accepted for polymorphic functions. */
|
|
228
|
+
export function acceptedType() {
|
|
229
|
+
return new L.Type(
|
|
230
|
+
L.inductiveExpr(7),
|
|
231
|
+
(w, v) => {
|
|
232
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Flow.Accepted");
|
|
233
|
+
switch (v.kind) {
|
|
234
|
+
case "deliver":
|
|
235
|
+
w.u32(0);
|
|
236
|
+
reorderType().encode(w, v.flow);
|
|
237
|
+
L.list(L.NAT).encode(w, v.seqs);
|
|
238
|
+
return;
|
|
239
|
+
case "hold":
|
|
240
|
+
w.u32(1);
|
|
241
|
+
reorderType().encode(w, v.flow);
|
|
242
|
+
return;
|
|
243
|
+
case "stale":
|
|
244
|
+
w.u32(2);
|
|
245
|
+
return;
|
|
246
|
+
case "duplicate":
|
|
247
|
+
w.u32(3);
|
|
248
|
+
return;
|
|
249
|
+
case "overflow":
|
|
250
|
+
w.u32(4);
|
|
251
|
+
return;
|
|
252
|
+
default:
|
|
253
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Flow.Accepted`);
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
(r) => {
|
|
257
|
+
const c = r.u32();
|
|
258
|
+
switch (c) {
|
|
259
|
+
case 0: return ({ kind: "deliver", flow: reorderType().decode(r), seqs: L.list(L.NAT).decode(r) });
|
|
260
|
+
case 1: return ({ kind: "hold", flow: reorderType().decode(r) });
|
|
261
|
+
case 2: return ({ kind: "stale" });
|
|
262
|
+
case 3: return ({ kind: "duplicate" });
|
|
263
|
+
case 4: return ({ kind: "overflow" });
|
|
264
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Flow.Accepted`);
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** Describes CapDAG.Bifaci.Pools.State for polymorphic functions. */
|
|
271
|
+
export function stateType() {
|
|
272
|
+
return new L.Type(
|
|
273
|
+
L.inductiveExpr(8),
|
|
274
|
+
(w, v) => {
|
|
275
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Pools.State");
|
|
276
|
+
w.u32(0);
|
|
277
|
+
L.list(poolType()).encode(w, v.pools);
|
|
278
|
+
L.list(waiterType()).encode(w, v.queue);
|
|
279
|
+
L.NAT.encode(w, v.next);
|
|
280
|
+
},
|
|
281
|
+
(r) => {
|
|
282
|
+
const c = r.u32();
|
|
283
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Pools.State`);
|
|
284
|
+
return ({ pools: L.list(poolType()).decode(r), queue: L.list(waiterType()).decode(r), next: L.NAT.decode(r) });
|
|
285
|
+
},
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** Describes CapDAG.Bifaci.Pools.Waiter for polymorphic functions. */
|
|
290
|
+
export function waiterType() {
|
|
291
|
+
return new L.Type(
|
|
292
|
+
L.inductiveExpr(9),
|
|
293
|
+
(w, v) => {
|
|
294
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Pools.Waiter");
|
|
295
|
+
w.u32(0);
|
|
296
|
+
L.NAT.encode(w, v.ticket);
|
|
297
|
+
L.list(L.STRING).encode(w, v.chain);
|
|
298
|
+
},
|
|
299
|
+
(r) => {
|
|
300
|
+
const c = r.u32();
|
|
301
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Pools.Waiter`);
|
|
302
|
+
return ({ ticket: L.NAT.decode(r), chain: L.list(L.STRING).decode(r) });
|
|
303
|
+
},
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/** Describes CapDAG.Bifaci.Pools.Arrival for polymorphic functions. */
|
|
308
|
+
export function poolsArrivalType() {
|
|
309
|
+
return new L.Type(
|
|
310
|
+
L.inductiveExpr(10),
|
|
311
|
+
(w, v) => {
|
|
312
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Pools.Arrival");
|
|
313
|
+
switch (v.kind) {
|
|
314
|
+
case "admitted":
|
|
315
|
+
w.u32(0);
|
|
316
|
+
stateType().encode(w, v.state);
|
|
317
|
+
return;
|
|
318
|
+
case "queued":
|
|
319
|
+
w.u32(1);
|
|
320
|
+
stateType().encode(w, v.state);
|
|
321
|
+
L.NAT.encode(w, v.ticket);
|
|
322
|
+
L.NAT.encode(w, v.position);
|
|
323
|
+
return;
|
|
324
|
+
case "unknownPool":
|
|
325
|
+
w.u32(2);
|
|
326
|
+
L.STRING.encode(w, v.name);
|
|
327
|
+
return;
|
|
328
|
+
default:
|
|
329
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Pools.Arrival`);
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
(r) => {
|
|
333
|
+
const c = r.u32();
|
|
334
|
+
switch (c) {
|
|
335
|
+
case 0: return ({ kind: "admitted", state: stateType().decode(r) });
|
|
336
|
+
case 1: return ({ kind: "queued", state: stateType().decode(r), ticket: L.NAT.decode(r), position: L.NAT.decode(r) });
|
|
337
|
+
case 2: return ({ kind: "unknownPool", name: L.STRING.decode(r) });
|
|
338
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Pools.Arrival`);
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/** Describes CapDAG.Bifaci.Pools.Patience for polymorphic functions. */
|
|
345
|
+
export function patienceType() {
|
|
346
|
+
return new L.Type(
|
|
347
|
+
L.inductiveExpr(11),
|
|
348
|
+
(w, v) => {
|
|
349
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Pools.Patience");
|
|
350
|
+
switch (v.kind) {
|
|
351
|
+
case "unbounded":
|
|
352
|
+
w.u32(0);
|
|
353
|
+
return;
|
|
354
|
+
case "atMost":
|
|
355
|
+
w.u32(1);
|
|
356
|
+
L.NAT.encode(w, v.remaining);
|
|
357
|
+
return;
|
|
358
|
+
case "exhausted":
|
|
359
|
+
w.u32(2);
|
|
360
|
+
return;
|
|
361
|
+
default:
|
|
362
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Pools.Patience`);
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
(r) => {
|
|
366
|
+
const c = r.u32();
|
|
367
|
+
switch (c) {
|
|
368
|
+
case 0: return ({ kind: "unbounded" });
|
|
369
|
+
case 1: return ({ kind: "atMost", remaining: L.NAT.decode(r) });
|
|
370
|
+
case 2: return ({ kind: "exhausted" });
|
|
371
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Pools.Patience`);
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** Describes CapDAG.Bifaci.Request.Phase for polymorphic functions. */
|
|
378
|
+
export function phaseType() {
|
|
379
|
+
return new L.Type(
|
|
380
|
+
L.inductiveExpr(12),
|
|
381
|
+
(w, v) => {
|
|
382
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Request.Phase");
|
|
383
|
+
switch (v.kind) {
|
|
384
|
+
case "created":
|
|
385
|
+
w.u32(0);
|
|
386
|
+
return;
|
|
387
|
+
case "streaming":
|
|
388
|
+
w.u32(1);
|
|
389
|
+
return;
|
|
390
|
+
default:
|
|
391
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Request.Phase`);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
(r) => {
|
|
395
|
+
const c = r.u32();
|
|
396
|
+
switch (c) {
|
|
397
|
+
case 0: return ({ kind: "created" });
|
|
398
|
+
case 1: return ({ kind: "streaming" });
|
|
399
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Request.Phase`);
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/** Describes CapDAG.Bifaci.Request.Emitted for polymorphic functions. */
|
|
406
|
+
export function emittedType() {
|
|
407
|
+
return new L.Type(
|
|
408
|
+
L.inductiveExpr(13),
|
|
409
|
+
(w, v) => {
|
|
410
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Request.Emitted");
|
|
411
|
+
switch (v.kind) {
|
|
412
|
+
case "streamStart":
|
|
413
|
+
w.u32(0);
|
|
414
|
+
L.STRING.encode(w, v.stream);
|
|
415
|
+
return;
|
|
416
|
+
case "chunk":
|
|
417
|
+
w.u32(1);
|
|
418
|
+
L.STRING.encode(w, v.stream);
|
|
419
|
+
L.NAT.encode(w, v.index);
|
|
420
|
+
return;
|
|
421
|
+
case "streamEnd":
|
|
422
|
+
w.u32(2);
|
|
423
|
+
L.STRING.encode(w, v.stream);
|
|
424
|
+
L.option(L.NAT).encode(w, v.count);
|
|
425
|
+
return;
|
|
426
|
+
case "fin":
|
|
427
|
+
w.u32(3);
|
|
428
|
+
return;
|
|
429
|
+
case "err":
|
|
430
|
+
w.u32(4);
|
|
431
|
+
return;
|
|
432
|
+
case "other":
|
|
433
|
+
w.u32(5);
|
|
434
|
+
return;
|
|
435
|
+
default:
|
|
436
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Request.Emitted`);
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
(r) => {
|
|
440
|
+
const c = r.u32();
|
|
441
|
+
switch (c) {
|
|
442
|
+
case 0: return ({ kind: "streamStart", stream: L.STRING.decode(r) });
|
|
443
|
+
case 1: return ({ kind: "chunk", stream: L.STRING.decode(r), index: L.NAT.decode(r) });
|
|
444
|
+
case 2: return ({ kind: "streamEnd", stream: L.STRING.decode(r), count: L.option(L.NAT).decode(r) });
|
|
445
|
+
case 3: return ({ kind: "fin" });
|
|
446
|
+
case 4: return ({ kind: "err" });
|
|
447
|
+
case 5: return ({ kind: "other" });
|
|
448
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Request.Emitted`);
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** Describes CapDAG.Bifaci.Request.Violation for polymorphic functions. */
|
|
455
|
+
export function violationType() {
|
|
456
|
+
return new L.Type(
|
|
457
|
+
L.inductiveExpr(14),
|
|
458
|
+
(w, v) => {
|
|
459
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Request.Violation");
|
|
460
|
+
switch (v.kind) {
|
|
461
|
+
case "afterEnd":
|
|
462
|
+
w.u32(0);
|
|
463
|
+
return;
|
|
464
|
+
case "streamRestarted":
|
|
465
|
+
w.u32(1);
|
|
466
|
+
L.STRING.encode(w, v.stream);
|
|
467
|
+
return;
|
|
468
|
+
case "streamNotOpen":
|
|
469
|
+
w.u32(2);
|
|
470
|
+
L.STRING.encode(w, v.stream);
|
|
471
|
+
return;
|
|
472
|
+
case "chunkOutOfPlace":
|
|
473
|
+
w.u32(3);
|
|
474
|
+
L.STRING.encode(w, v.stream);
|
|
475
|
+
L.NAT.encode(w, v.expected);
|
|
476
|
+
L.NAT.encode(w, v.got);
|
|
477
|
+
return;
|
|
478
|
+
case "chunkCountWrong":
|
|
479
|
+
w.u32(4);
|
|
480
|
+
L.STRING.encode(w, v.stream);
|
|
481
|
+
L.NAT.encode(w, v.sent);
|
|
482
|
+
L.NAT.encode(w, v.said);
|
|
483
|
+
return;
|
|
484
|
+
case "endWithOpenStream":
|
|
485
|
+
w.u32(5);
|
|
486
|
+
L.STRING.encode(w, v.stream);
|
|
487
|
+
return;
|
|
488
|
+
default:
|
|
489
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Request.Violation`);
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
(r) => {
|
|
493
|
+
const c = r.u32();
|
|
494
|
+
switch (c) {
|
|
495
|
+
case 0: return ({ kind: "afterEnd" });
|
|
496
|
+
case 1: return ({ kind: "streamRestarted", stream: L.STRING.decode(r) });
|
|
497
|
+
case 2: return ({ kind: "streamNotOpen", stream: L.STRING.decode(r) });
|
|
498
|
+
case 3: return ({ kind: "chunkOutOfPlace", stream: L.STRING.decode(r), expected: L.NAT.decode(r), got: L.NAT.decode(r) });
|
|
499
|
+
case 4: return ({ kind: "chunkCountWrong", stream: L.STRING.decode(r), sent: L.NAT.decode(r), said: L.NAT.decode(r) });
|
|
500
|
+
case 5: return ({ kind: "endWithOpenStream", stream: L.STRING.decode(r) });
|
|
501
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Request.Violation`);
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** Describes CapDAG.Bifaci.Request.Disposition for polymorphic functions. */
|
|
508
|
+
export function dispositionType() {
|
|
509
|
+
return new L.Type(
|
|
510
|
+
L.inductiveExpr(15),
|
|
511
|
+
(w, v) => {
|
|
512
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Request.Disposition");
|
|
513
|
+
switch (v.kind) {
|
|
514
|
+
case "route":
|
|
515
|
+
w.u32(0);
|
|
516
|
+
return;
|
|
517
|
+
case "straggler":
|
|
518
|
+
w.u32(1);
|
|
519
|
+
return;
|
|
520
|
+
case "noRoute":
|
|
521
|
+
w.u32(2);
|
|
522
|
+
return;
|
|
523
|
+
default:
|
|
524
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Request.Disposition`);
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
(r) => {
|
|
528
|
+
const c = r.u32();
|
|
529
|
+
switch (c) {
|
|
530
|
+
case 0: return ({ kind: "route" });
|
|
531
|
+
case 1: return ({ kind: "straggler" });
|
|
532
|
+
case 2: return ({ kind: "noRoute" });
|
|
533
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Request.Disposition`);
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/** Describes CapDAG.Bifaci.Request.Terminal for polymorphic functions. */
|
|
540
|
+
export function terminalType() {
|
|
541
|
+
return new L.Type(
|
|
542
|
+
L.inductiveExpr(16),
|
|
543
|
+
(w, v) => {
|
|
544
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Request.Terminal");
|
|
545
|
+
switch (v.kind) {
|
|
546
|
+
case "finished":
|
|
547
|
+
w.u32(0);
|
|
548
|
+
return;
|
|
549
|
+
case "failed":
|
|
550
|
+
w.u32(1);
|
|
551
|
+
return;
|
|
552
|
+
case "cancelled":
|
|
553
|
+
w.u32(2);
|
|
554
|
+
return;
|
|
555
|
+
case "masterDied":
|
|
556
|
+
w.u32(3);
|
|
557
|
+
return;
|
|
558
|
+
default:
|
|
559
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Request.Terminal`);
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
(r) => {
|
|
563
|
+
const c = r.u32();
|
|
564
|
+
switch (c) {
|
|
565
|
+
case 0: return ({ kind: "finished" });
|
|
566
|
+
case 1: return ({ kind: "failed" });
|
|
567
|
+
case 2: return ({ kind: "cancelled" });
|
|
568
|
+
case 3: return ({ kind: "masterDied" });
|
|
569
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Request.Terminal`);
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/** Describes CapDAG.Bifaci.Request.Write for polymorphic functions. */
|
|
576
|
+
export function writeType() {
|
|
577
|
+
return new L.Type(
|
|
578
|
+
L.inductiveExpr(17),
|
|
579
|
+
(w, v) => {
|
|
580
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Request.Write");
|
|
581
|
+
switch (v.kind) {
|
|
582
|
+
case "send":
|
|
583
|
+
w.u32(0);
|
|
584
|
+
L.BOOL.encode(w, v.ends);
|
|
585
|
+
return;
|
|
586
|
+
case "suppress":
|
|
587
|
+
w.u32(1);
|
|
588
|
+
return;
|
|
589
|
+
default:
|
|
590
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Bifaci.Request.Write`);
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
(r) => {
|
|
594
|
+
const c = r.u32();
|
|
595
|
+
switch (c) {
|
|
596
|
+
case 0: return ({ kind: "send", ends: L.BOOL.decode(r) });
|
|
597
|
+
case 1: return ({ kind: "suppress" });
|
|
598
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Request.Write`);
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
|
|
15
604
|
/** Describes CapDAG.Exec.WfCap for polymorphic functions. */
|
|
16
605
|
export function wfCapType() {
|
|
17
606
|
return new L.Type(
|
|
18
|
-
L.inductiveExpr(
|
|
607
|
+
L.inductiveExpr(18),
|
|
19
608
|
(w, v) => {
|
|
20
609
|
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Exec.WfCap");
|
|
21
610
|
w.u32(0);
|
|
@@ -35,7 +624,7 @@ export function wfCapType() {
|
|
|
35
624
|
/** Describes CapDAG.Effect for polymorphic functions. */
|
|
36
625
|
export function effectType() {
|
|
37
626
|
return new L.Type(
|
|
38
|
-
L.inductiveExpr(
|
|
627
|
+
L.inductiveExpr(19),
|
|
39
628
|
(w, v) => {
|
|
40
629
|
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Effect");
|
|
41
630
|
switch (v.kind) {
|
|
@@ -68,10 +657,81 @@ export function effectType() {
|
|
|
68
657
|
);
|
|
69
658
|
}
|
|
70
659
|
|
|
660
|
+
/** Describes CapDAG.Exec.WfQuery for polymorphic functions. */
|
|
661
|
+
export function wfQueryType() {
|
|
662
|
+
return new L.Type(
|
|
663
|
+
L.inductiveExpr(20),
|
|
664
|
+
(w, v) => {
|
|
665
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Exec.WfQuery");
|
|
666
|
+
w.u32(0);
|
|
667
|
+
wfAskType().encode(w, v.input);
|
|
668
|
+
wfAskType().encode(w, v.output);
|
|
669
|
+
wfType().encode(w, v.tags);
|
|
670
|
+
effectType().encode(w, v.effect);
|
|
671
|
+
},
|
|
672
|
+
(r) => {
|
|
673
|
+
const c = r.u32();
|
|
674
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Exec.WfQuery`);
|
|
675
|
+
return ({ input: wfAskType().decode(r), output: wfAskType().decode(r), tags: wfType().decode(r), effect: effectType().decode(r) });
|
|
676
|
+
},
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/** Lean's TaggedUrn.Exec.Wf, held by handle: only the program's functions make and read its values. */
|
|
681
|
+
export class Wf extends L.Opaque {}
|
|
682
|
+
|
|
683
|
+
/** Describes TaggedUrn.Exec.Wf for polymorphic functions. */
|
|
684
|
+
export function wfType() {
|
|
685
|
+
return new L.Type(
|
|
686
|
+
L.inductiveExpr(21),
|
|
687
|
+
(w, v) => {
|
|
688
|
+
if (!(v instanceof Wf)) throw new L.MalformedError("not a TaggedUrn.Exec.Wf");
|
|
689
|
+
L.OPAQUE.encode(w, v);
|
|
690
|
+
},
|
|
691
|
+
(r) => new Wf(r.program, r.u64()),
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/** Describes CapDAG.Grade for polymorphic functions. */
|
|
696
|
+
export function gradeType() {
|
|
697
|
+
return new L.Type(
|
|
698
|
+
L.inductiveExpr(22),
|
|
699
|
+
(w, v) => {
|
|
700
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Grade");
|
|
701
|
+
switch (v.kind) {
|
|
702
|
+
case "exact":
|
|
703
|
+
w.u32(0);
|
|
704
|
+
return;
|
|
705
|
+
case "guaranteed":
|
|
706
|
+
w.u32(1);
|
|
707
|
+
return;
|
|
708
|
+
case "possible":
|
|
709
|
+
w.u32(2);
|
|
710
|
+
return;
|
|
711
|
+
case "none":
|
|
712
|
+
w.u32(3);
|
|
713
|
+
return;
|
|
714
|
+
default:
|
|
715
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Grade`);
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
(r) => {
|
|
719
|
+
const c = r.u32();
|
|
720
|
+
switch (c) {
|
|
721
|
+
case 0: return ({ kind: "exact" });
|
|
722
|
+
case 1: return ({ kind: "guaranteed" });
|
|
723
|
+
case 2: return ({ kind: "possible" });
|
|
724
|
+
case 3: return ({ kind: "none" });
|
|
725
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Grade`);
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
|
|
71
731
|
/** Describes TaggedUrn.Constraint for polymorphic functions. */
|
|
72
732
|
export function constraintType() {
|
|
73
733
|
return new L.Type(
|
|
74
|
-
L.inductiveExpr(
|
|
734
|
+
L.inductiveExpr(23),
|
|
75
735
|
(w, v) => {
|
|
76
736
|
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a TaggedUrn.Constraint");
|
|
77
737
|
switch (v.kind) {
|
|
@@ -119,27 +779,92 @@ export function constraintType() {
|
|
|
119
779
|
);
|
|
120
780
|
}
|
|
121
781
|
|
|
122
|
-
/**
|
|
123
|
-
export
|
|
782
|
+
/** Describes CapDAG.Bifaci.Pools.Pool for polymorphic functions. */
|
|
783
|
+
export function poolType() {
|
|
784
|
+
return new L.Type(
|
|
785
|
+
L.inductiveExpr(24),
|
|
786
|
+
(w, v) => {
|
|
787
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Bifaci.Pools.Pool");
|
|
788
|
+
w.u32(0);
|
|
789
|
+
L.STRING.encode(w, v.name);
|
|
790
|
+
L.NAT.encode(w, v.capacity);
|
|
791
|
+
L.NAT.encode(w, v.active);
|
|
792
|
+
},
|
|
793
|
+
(r) => {
|
|
794
|
+
const c = r.u32();
|
|
795
|
+
if (c !== 0) throw new L.MalformedError(`constructor index ${c} of CapDAG.Bifaci.Pools.Pool`);
|
|
796
|
+
return ({ name: L.STRING.decode(r), capacity: L.NAT.decode(r), active: L.NAT.decode(r) });
|
|
797
|
+
},
|
|
798
|
+
);
|
|
799
|
+
}
|
|
124
800
|
|
|
125
|
-
/** Describes
|
|
126
|
-
export function
|
|
801
|
+
/** Describes CapDAG.Exec.WfAsk for polymorphic functions. */
|
|
802
|
+
export function wfAskType() {
|
|
127
803
|
return new L.Type(
|
|
128
|
-
L.inductiveExpr(
|
|
804
|
+
L.inductiveExpr(25),
|
|
129
805
|
(w, v) => {
|
|
130
|
-
if (
|
|
131
|
-
|
|
806
|
+
if (typeof v !== "object" || v === null) throw new L.MalformedError("not a CapDAG.Exec.WfAsk");
|
|
807
|
+
switch (v.kind) {
|
|
808
|
+
case "unknown":
|
|
809
|
+
w.u32(0);
|
|
810
|
+
return;
|
|
811
|
+
case "within":
|
|
812
|
+
w.u32(1);
|
|
813
|
+
wfType().encode(w, v.u);
|
|
814
|
+
return;
|
|
815
|
+
case "covers":
|
|
816
|
+
w.u32(2);
|
|
817
|
+
wfType().encode(w, v.u);
|
|
818
|
+
return;
|
|
819
|
+
case "same":
|
|
820
|
+
w.u32(3);
|
|
821
|
+
wfType().encode(w, v.u);
|
|
822
|
+
return;
|
|
823
|
+
default:
|
|
824
|
+
throw new L.MalformedError(`${String(v.kind)} is not a constructor of CapDAG.Exec.WfAsk`);
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
(r) => {
|
|
828
|
+
const c = r.u32();
|
|
829
|
+
switch (c) {
|
|
830
|
+
case 0: return ({ kind: "unknown" });
|
|
831
|
+
case 1: return ({ kind: "within", u: wfType().decode(r) });
|
|
832
|
+
case 2: return ({ kind: "covers", u: wfType().decode(r) });
|
|
833
|
+
case 3: return ({ kind: "same", u: wfType().decode(r) });
|
|
834
|
+
default: throw new L.MalformedError(`constructor index ${c} of CapDAG.Exec.WfAsk`);
|
|
835
|
+
}
|
|
132
836
|
},
|
|
133
|
-
(r) => new Wf(r.program, r.u64()),
|
|
134
837
|
);
|
|
135
838
|
}
|
|
136
839
|
|
|
137
840
|
/** The layout fingerprint and descriptor of each type, by Lean name, for modules using them. */
|
|
138
841
|
export const leanTypes = Object.freeze({
|
|
842
|
+
"CapDAG.Bifaci.Credit.Gate": Object.freeze({ fingerprint: "b10dc9a4cff1977f4f6a2c415147f497f98740255d0158fb2b3a2a99d4d1b135", type: gateType }),
|
|
843
|
+
"CapDAG.Bifaci.Credit.Acquire": Object.freeze({ fingerprint: "0dabbf62c4dad8c3f81811acc80f5c789d25191897bb2621de51b5f94e54a4c9", type: acquireType }),
|
|
844
|
+
"CapDAG.Bifaci.Credit.Window": Object.freeze({ fingerprint: "28df89763b22214ef57dfd7f1a3c0da786ff78af9768fe453cd451870749b6fe", type: windowType }),
|
|
845
|
+
"CapDAG.Bifaci.Credit.Arrival": Object.freeze({ fingerprint: "940f01cf50eb8b763b9f44cc84753fcdbc65fbc0f816ab279408e74208649797", type: creditArrivalType }),
|
|
846
|
+
"CapDAG.Bifaci.Credit.Granted": Object.freeze({ fingerprint: "47f8d3e63e9aaf7c4b602f781afce57fc832e3d4d645c6adabd25c461abed233", type: grantedType }),
|
|
847
|
+
"CapDAG.Bifaci.Flow.FrameType": Object.freeze({ fingerprint: "3d6742b864aeb68cf6add586acfcd1a9663a3816d718f8d8aadc3c5e3dab3e2f", type: frameTypeType }),
|
|
848
|
+
"CapDAG.Bifaci.Flow.Reorder": Object.freeze({ fingerprint: "d1e8b655f24db5e8b2348d6d41084a5c454346eb0a81fcf11b671432e72291bf", type: reorderType }),
|
|
849
|
+
"CapDAG.Bifaci.Flow.Accepted": Object.freeze({ fingerprint: "a821d7a044f52a71dfd932fff60d2f3560ce5197658283853a56fb54aa96b69b", type: acceptedType }),
|
|
850
|
+
"CapDAG.Bifaci.Pools.State": Object.freeze({ fingerprint: "20f7299c188d09234cda39e9cc356242e2b5bc56a09cf819d12d7f50fa24989b", type: stateType }),
|
|
851
|
+
"CapDAG.Bifaci.Pools.Waiter": Object.freeze({ fingerprint: "48d81c7e41df114e88751bb5c1f4a84c16bac3ad28d8eacba141d45f92c79da0", type: waiterType }),
|
|
852
|
+
"CapDAG.Bifaci.Pools.Arrival": Object.freeze({ fingerprint: "6bee196c56c330c4ef348f4dd5a68558b2d19105592969cc64a0e7150bd22451", type: poolsArrivalType }),
|
|
853
|
+
"CapDAG.Bifaci.Pools.Patience": Object.freeze({ fingerprint: "d32e3427e590ca6002e38cface52d020c7df74603f952bf568401f7291d5648c", type: patienceType }),
|
|
854
|
+
"CapDAG.Bifaci.Request.Phase": Object.freeze({ fingerprint: "7407437b58ce033618bf82341b13aaa9661d29a5a9b0f1bf1547ea0bfcfd8374", type: phaseType }),
|
|
855
|
+
"CapDAG.Bifaci.Request.Emitted": Object.freeze({ fingerprint: "97a274be14c5baecf9c50243d3651da838c5de4375366d4102cbcff85fb211c8", type: emittedType }),
|
|
856
|
+
"CapDAG.Bifaci.Request.Violation": Object.freeze({ fingerprint: "203fb2fc4f8ff3c79b70871b4274852e742adf97c3cc4e6631439ec66d838f09", type: violationType }),
|
|
857
|
+
"CapDAG.Bifaci.Request.Disposition": Object.freeze({ fingerprint: "540307dfb6e509ccde4b894c69566edd1f3f9c3223b9325e97ee91b20d0fb82f", type: dispositionType }),
|
|
858
|
+
"CapDAG.Bifaci.Request.Terminal": Object.freeze({ fingerprint: "3597c3196cef5e4468b5449eb0da09af414bb8c3aa40d92b027089f6ae81c870", type: terminalType }),
|
|
859
|
+
"CapDAG.Bifaci.Request.Write": Object.freeze({ fingerprint: "9ae21282903c8131c25ca1cc527e51fd1fa5137aa77c9ef4f3d091e9415a109a", type: writeType }),
|
|
139
860
|
"CapDAG.Exec.WfCap": Object.freeze({ fingerprint: "2b8d6466d218f4ae6bc98d95bba55d98f21cac4a49446ae170993773cefdb830", type: wfCapType }),
|
|
140
861
|
"CapDAG.Effect": Object.freeze({ fingerprint: "38c7bd3c0527cda156713cd441c9b6b92bd5df8a39108fa101449a789abcb477", type: effectType }),
|
|
141
|
-
"
|
|
862
|
+
"CapDAG.Exec.WfQuery": Object.freeze({ fingerprint: "e734861d70e3177f6563c4492990bb65131f0450b8dfc62071eb61b6c5f08b8e", type: wfQueryType }),
|
|
142
863
|
"TaggedUrn.Exec.Wf": Object.freeze({ fingerprint: "20e9f81ad195b2f4a481e7a5dcae2b3d0de6efe7b3dc720db0e2aa3b52527785", type: wfType }),
|
|
864
|
+
"CapDAG.Grade": Object.freeze({ fingerprint: "0a2a20a14d9ecca6121343df2d8a7f2478b3e837710ed522ed385d35efdf46f2", type: gradeType }),
|
|
865
|
+
"TaggedUrn.Constraint": Object.freeze({ fingerprint: "481fc09e23c6415a7c3f05887577ec940a6ecc84b005e63476c1060b59edcac7", type: constraintType }),
|
|
866
|
+
"CapDAG.Bifaci.Pools.Pool": Object.freeze({ fingerprint: "60bca9d670886c7830c76779ad692b4fbb6e4e30c0ce6b3e9d5a91a9b5b7b1e6", type: poolType }),
|
|
867
|
+
"CapDAG.Exec.WfAsk": Object.freeze({ fingerprint: "d286477c7abc4e6bc6ee2d06889372b71a5bb06605b592ebabb6ad3eaf71b952", type: wfAskType }),
|
|
143
868
|
});
|
|
144
869
|
|
|
145
870
|
/** The Lean program capdagFormal. */
|
|
@@ -148,8 +873,122 @@ export class CapdagFormal {
|
|
|
148
873
|
constructor(program) {
|
|
149
874
|
this.#program = program;
|
|
150
875
|
}
|
|
151
|
-
|
|
152
|
-
return this.#program.invoke("
|
|
876
|
+
acquire(g, n) {
|
|
877
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dGate_dacquire", [], [[gateType(), g], [L.NAT, n]], L.value(acquireType()));
|
|
878
|
+
}
|
|
879
|
+
close(g, reason) {
|
|
880
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dGate_dclose", [], [[gateType(), g], [L.STRING, reason]], L.value(gateType()));
|
|
881
|
+
}
|
|
882
|
+
grant(g, n) {
|
|
883
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dGate_dgrant", [], [[gateType(), g], [L.NAT, n]], L.value(gateType()));
|
|
884
|
+
}
|
|
885
|
+
gateOpened(window) {
|
|
886
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dGate_dopened", [], [[L.NAT, window]], L.value(gateType()));
|
|
887
|
+
}
|
|
888
|
+
windowArrive(w_) {
|
|
889
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dWindow_darrive", [], [[windowType(), w_]], L.value(creditArrivalType()));
|
|
890
|
+
}
|
|
891
|
+
consume(w_) {
|
|
892
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dWindow_dconsume", [], [[windowType(), w_]], L.value(grantedType()));
|
|
893
|
+
}
|
|
894
|
+
continued(w_) {
|
|
895
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dWindow_dcontinued", [], [[windowType(), w_]], L.value(grantedType()));
|
|
896
|
+
}
|
|
897
|
+
flush(w_) {
|
|
898
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dWindow_dflush", [], [[windowType(), w_]], L.value(grantedType()));
|
|
899
|
+
}
|
|
900
|
+
windowOpened(window) {
|
|
901
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dWindow_dopened", [], [[L.NAT, window]], L.value(windowType()));
|
|
902
|
+
}
|
|
903
|
+
grantTarget(streams, named) {
|
|
904
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dgrantTarget", [], [[L.list(L.option(L.STRING)), streams], [L.option(L.STRING), named]], L.value(L.option(L.option(L.STRING))));
|
|
905
|
+
}
|
|
906
|
+
negotiate(ours, theirs) {
|
|
907
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dCredit_dnegotiate", [], [[L.NAT, ours], [L.NAT, theirs]], L.value(L.option(L.NAT)));
|
|
908
|
+
}
|
|
909
|
+
code(a) {
|
|
910
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dFlow_dFrameType_dcode", [], [[frameTypeType(), a]], L.value(L.NAT));
|
|
911
|
+
}
|
|
912
|
+
isFlow(a) {
|
|
913
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dFlow_dFrameType_disFlow", [], [[frameTypeType(), a]], L.value(L.BOOL));
|
|
914
|
+
}
|
|
915
|
+
isTerminal(a) {
|
|
916
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dFlow_dFrameType_disTerminal", [], [[frameTypeType(), a]], L.value(L.BOOL));
|
|
917
|
+
}
|
|
918
|
+
ofCode(a) {
|
|
919
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dFlow_dFrameType_dofCode", [], [[L.NAT, a]], L.value(L.option(frameTypeType())));
|
|
920
|
+
}
|
|
921
|
+
accept(r_, seq, limit) {
|
|
922
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dFlow_dReorder_daccept", [], [[reorderType(), r_], [L.NAT, seq], [L.NAT, limit]], L.value(acceptedType()));
|
|
923
|
+
}
|
|
924
|
+
start() {
|
|
925
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dFlow_dReorder_dstart", [], [], L.value(reorderType()));
|
|
926
|
+
}
|
|
927
|
+
admit(s, ticket) {
|
|
928
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dadmit", [], [[stateType(), s], [L.NAT, ticket]], L.value(L.option(stateType())));
|
|
929
|
+
}
|
|
930
|
+
admitNext(s) {
|
|
931
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dadmitNext", [], [[stateType(), s]], L.value(L.option(L.pair(waiterType(), stateType()))));
|
|
932
|
+
}
|
|
933
|
+
stateArrive(s, chain) {
|
|
934
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_darrive", [], [[stateType(), s], [L.list(L.STRING), chain]], L.value(poolsArrivalType()));
|
|
935
|
+
}
|
|
936
|
+
empty() {
|
|
937
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dempty", [], [], L.value(stateType()));
|
|
938
|
+
}
|
|
939
|
+
hasRoom(s, chain) {
|
|
940
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dhasRoom", [], [[stateType(), s], [L.list(L.STRING), chain]], L.value(L.BOOL));
|
|
941
|
+
}
|
|
942
|
+
heldBack(s, name) {
|
|
943
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dheldBack", [], [[stateType(), s], [L.STRING, name]], L.value(L.NAT));
|
|
944
|
+
}
|
|
945
|
+
join(s, chain) {
|
|
946
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_djoin", [], [[stateType(), s], [L.list(L.STRING), chain]], L.value(poolsArrivalType()));
|
|
947
|
+
}
|
|
948
|
+
leave(s, ticket) {
|
|
949
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dleave", [], [[stateType(), s], [L.NAT, ticket]], L.value(stateType()));
|
|
950
|
+
}
|
|
951
|
+
position(s, ticket) {
|
|
952
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dposition", [], [[stateType(), s], [L.NAT, ticket]], L.value(L.NAT));
|
|
953
|
+
}
|
|
954
|
+
release(s, chain) {
|
|
955
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_drelease", [], [[stateType(), s], [L.list(L.STRING), chain]], L.value(stateType()));
|
|
956
|
+
}
|
|
957
|
+
setCapacity(s, name, capacity) {
|
|
958
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dState_dsetCapacity", [], [[stateType(), s], [L.STRING, name], [L.NAT, capacity]], L.value(stateType()));
|
|
959
|
+
}
|
|
960
|
+
advertised(running, pool, configured, available) {
|
|
961
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dadvertised", [], [[L.BOOL, running], [L.STRING, pool], [L.NAT, configured], [L.option(L.NAT), available]], L.value(L.NAT));
|
|
962
|
+
}
|
|
963
|
+
chain(cap, shared) {
|
|
964
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dchain", [], [[L.STRING, cap], [L.list(L.pair(L.STRING, L.list(L.STRING))), shared]], L.value(L.list(L.STRING)));
|
|
965
|
+
}
|
|
966
|
+
effective(configured, available) {
|
|
967
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_deffective", [], [[L.NAT, configured], [L.option(L.NAT), available]], L.value(L.NAT));
|
|
968
|
+
}
|
|
969
|
+
patience(unavailableFor, grace) {
|
|
970
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dPools_dpatience", [], [[L.option(L.NAT), unavailableFor], [L.NAT, grace]], L.value(patienceType()));
|
|
971
|
+
}
|
|
972
|
+
after(p, frame) {
|
|
973
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dRequest_dPhase_dafter", [], [[phaseType(), p], [frameTypeType(), frame]], L.value(phaseType()));
|
|
974
|
+
}
|
|
975
|
+
check(frames) {
|
|
976
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dRequest_dcheck", [], [[L.list(emittedType()), frames]], L.value(L.option(violationType())));
|
|
977
|
+
}
|
|
978
|
+
dispose(live, endedLately) {
|
|
979
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dRequest_ddispose", [], [[L.BOOL, live], [L.BOOL, endedLately]], L.value(dispositionType()));
|
|
980
|
+
}
|
|
981
|
+
ledger(remaining, frame, granted) {
|
|
982
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dRequest_dledger", [], [[L.INT, remaining], [frameTypeType(), frame], [L.NAT, granted]], L.value(L.INT));
|
|
983
|
+
}
|
|
984
|
+
terminalOf(a) {
|
|
985
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dRequest_dterminalOf", [], [[frameTypeType(), a]], L.value(L.option(terminalType())));
|
|
986
|
+
}
|
|
987
|
+
write(over, frame) {
|
|
988
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dBifaci_dRequest_dwrite", [], [[L.BOOL, over], [frameTypeType(), frame]], L.value(writeType()));
|
|
989
|
+
}
|
|
990
|
+
accepts(pattern, cap) {
|
|
991
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_daccepts", [], [[wfCapType(), pattern], [wfCapType(), cap]], L.value(L.BOOL));
|
|
153
992
|
}
|
|
154
993
|
comparable(a, b) {
|
|
155
994
|
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dcomparable", [], [[wfCapType(), a], [wfCapType(), b]], L.value(L.BOOL));
|
|
@@ -163,6 +1002,39 @@ export class CapdagFormal {
|
|
|
163
1002
|
equivalent(a, b) {
|
|
164
1003
|
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dequivalent", [], [[wfCapType(), a], [wfCapType(), b]], L.value(L.BOOL));
|
|
165
1004
|
}
|
|
1005
|
+
flows(a, b) {
|
|
1006
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dflows", [], [[wfCapType(), a], [wfCapType(), b]], L.value(L.BOOL));
|
|
1007
|
+
}
|
|
1008
|
+
mayDispatch(candidate, request) {
|
|
1009
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dmayDispatch", [], [[wfCapType(), candidate], [wfCapType(), request]], L.value(L.BOOL));
|
|
1010
|
+
}
|
|
1011
|
+
mayFlow(a, b) {
|
|
1012
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dmayFlow", [], [[wfCapType(), a], [wfCapType(), b]], L.value(L.BOOL));
|
|
1013
|
+
}
|
|
1014
|
+
queryAdmits(q, c) {
|
|
1015
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryAdmits", [], [[wfQueryType(), q], [wfCapType(), c]], L.value(L.BOOL));
|
|
1016
|
+
}
|
|
1017
|
+
queryBetween(input, output, tags) {
|
|
1018
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryBetween", [], [[wfType(), input], [wfType(), output], [wfType(), tags]], L.value(wfQueryType()));
|
|
1019
|
+
}
|
|
1020
|
+
queryConsuming(input, tags) {
|
|
1021
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryConsuming", [], [[wfType(), input], [wfType(), tags]], L.value(wfQueryType()));
|
|
1022
|
+
}
|
|
1023
|
+
queryGrade(q, c) {
|
|
1024
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryGrade", [], [[wfQueryType(), q], [wfCapType(), c]], L.value(gradeType()));
|
|
1025
|
+
}
|
|
1026
|
+
queryMayAdmit(q, c) {
|
|
1027
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryMayAdmit", [], [[wfQueryType(), q], [wfCapType(), c]], L.value(L.BOOL));
|
|
1028
|
+
}
|
|
1029
|
+
queryOfPattern(p) {
|
|
1030
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryOfPattern", [], [[wfCapType(), p]], L.value(wfQueryType()));
|
|
1031
|
+
}
|
|
1032
|
+
queryOfRequest(r_) {
|
|
1033
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryOfRequest", [], [[wfCapType(), r_]], L.value(wfQueryType()));
|
|
1034
|
+
}
|
|
1035
|
+
queryProducing(output, tags) {
|
|
1036
|
+
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_dqueryProducing", [], [[wfType(), output], [wfType(), tags]], L.value(wfQueryType()));
|
|
1037
|
+
}
|
|
166
1038
|
rankingKey(candidate, request) {
|
|
167
1039
|
return this.#program.invoke("capdagFormal__call_l_CapDAG_dExec_drankingKey", [], [[wfCapType(), candidate], [wfCapType(), request]], L.value(L.pair(L.NAT, L.NAT)));
|
|
168
1040
|
}
|