gdp-wired 0.45.0 → 0.47.0
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 +61 -8
- package/dist/core/bitsets.d.ts +2 -0
- package/dist/core/bitsets.js +23 -0
- package/dist/core/bmc.js +6 -2
- package/dist/core/c/reader.d.ts +9 -1
- package/dist/core/c/reader.js +423 -31
- package/dist/core/calendar.d.ts +29 -0
- package/dist/core/calendar.js +82 -0
- package/dist/core/cli.d.ts +4 -0
- package/dist/core/cli.js +206 -40
- package/dist/core/compose.js +3 -1
- package/dist/core/counts.d.ts +4 -1
- package/dist/core/counts.js +314 -85
- package/dist/core/cycles.js +8 -1
- package/dist/core/cyclic.d.ts +1 -0
- package/dist/core/cyclic.js +13 -7
- package/dist/core/data-synth.d.ts +3 -0
- package/dist/core/data-synth.js +252 -0
- package/dist/core/data.d.ts +2 -1
- package/dist/core/data.js +223 -24
- package/dist/core/discover.js +3 -1
- package/dist/core/draft.d.ts +19 -0
- package/dist/core/draft.js +53 -0
- package/dist/core/dsl.d.ts +37 -3
- package/dist/core/dsl.js +167 -26
- package/dist/core/effect-schema.d.ts +90 -0
- package/dist/core/effect-schema.js +500 -0
- package/dist/core/effect.d.ts +4 -11
- package/dist/core/effect.js +3 -79
- package/dist/core/exists.d.ts +1 -0
- package/dist/core/exists.js +191 -16
- package/dist/core/extract-c.d.ts +2 -0
- package/dist/core/extract-c.js +169 -22
- package/dist/core/extract-check.d.ts +1 -0
- package/dist/core/extract-check.js +97 -6
- package/dist/core/extract-go-check.d.ts +1 -1
- package/dist/core/extract-go-check.js +26 -5
- package/dist/core/extract-go.d.ts +8 -0
- package/dist/core/extract-go.js +67 -6
- package/dist/core/extract-ir.d.ts +1 -0
- package/dist/core/extract-ir.js +15 -0
- package/dist/core/extract-jvm.d.ts +1 -1
- package/dist/core/extract-jvm.js +2 -0
- package/dist/core/extract-orm.d.ts +12 -0
- package/dist/core/extract-orm.js +244 -0
- package/dist/core/extract-print.js +20 -1
- package/dist/core/extract-py.d.ts +1 -0
- package/dist/core/extract-py.js +1 -1
- package/dist/core/extract-read.d.ts +26 -1
- package/dist/core/extract-read.js +14 -7
- package/dist/core/extract-rs.js +63 -15
- package/dist/core/extract-shapes.d.ts +1 -0
- package/dist/core/extract-shapes.js +84 -0
- package/dist/core/extract-sol.d.ts +10 -1
- package/dist/core/extract-sol.js +70 -22
- package/dist/core/extract-standalone.d.ts +3 -0
- package/dist/core/extract-standalone.js +221 -0
- package/dist/core/extract-step.d.ts +151 -1
- package/dist/core/extract-step.js +1232 -60
- package/dist/core/extract-swift.js +6 -2
- package/dist/core/extract.d.ts +9 -0
- package/dist/core/extract.js +77 -7
- package/dist/core/fiber-run.d.ts +5 -0
- package/dist/core/fiber-run.js +18 -0
- package/dist/core/infer.d.ts +4 -1
- package/dist/core/infer.js +918 -217
- package/dist/core/jvm/JavaReader.java +23 -6
- package/dist/core/jvm/Jvm.java +3 -0
- package/dist/core/jvm/KtReader.java +6 -5
- package/dist/core/laws.d.ts +10 -3
- package/dist/core/laws.js +226 -23
- package/dist/core/machine.d.ts +15 -1
- package/dist/core/machine.js +187 -15
- package/dist/core/nonterm.js +14 -1
- package/dist/core/orm/harness.js +61 -0
- package/dist/core/orm-fixtures/schema.prisma +5 -0
- package/dist/core/py/harness.py +183 -10
- package/dist/core/py/reader.py +234 -40
- package/dist/core/reader-fixtures/README.md +28 -0
- package/dist/core/reader-fixtures/c-693042.cpp +8 -0
- package/dist/core/reader-fixtures/go-685506.go +14 -0
- package/dist/core/reader-fixtures/jvm-724362.kt +8 -0
- package/dist/core/reader-fixtures/jvm-737430.kt +7 -0
- package/dist/core/reader-fixtures/jvm-765282.kt +3 -0
- package/dist/core/reader-fixtures/swift-735726.swift +15 -0
- package/dist/core/reader-fixtures/swift-735990.swift +15 -0
- package/dist/core/reader-fixtures/swift-739158.swift +4 -0
- package/dist/core/reader-fixtures/swift-744834.swift +15 -0
- package/dist/core/reader-fixtures/swift-746946.swift +31 -0
- package/dist/core/reader-fixtures/typescript-673062.ts.txt +2 -0
- package/dist/core/relation.d.ts +1 -1
- package/dist/core/relation.js +29 -2
- package/dist/core/relational.js +4 -2
- package/dist/core/rs/Cargo.toml +1 -1
- package/dist/core/rs/src/main.rs +466 -11
- package/dist/core/sample-cache.d.ts +8 -0
- package/dist/core/sample-cache.js +46 -0
- package/dist/core/security.d.ts +38 -0
- package/dist/core/security.js +88 -0
- package/dist/core/sol/harness.py +57 -4
- package/dist/core/sol-concrete.d.ts +23 -0
- package/dist/core/sol-concrete.js +195 -0
- package/dist/core/solver.js +3 -1
- package/dist/core/swift/Sources/gdp-swiftreader/main.swift +50 -7
- package/dist/core/system.js +1 -1
- package/dist/core/transfer.js +22 -9
- package/dist/core/translate.js +39 -10
- package/dist/core/watch.js +50 -5
- package/dist/interchange/format.js +11 -1
- package/dist/kernel/cdcl.d.ts +5 -0
- package/dist/kernel/cdcl.js +56 -9
- package/dist/kernel/epr.js +108 -26
- package/dist/kernel/kernel.d.ts +29 -1
- package/dist/kernel/kernel.js +325 -62
- package/dist/kernel/model-sequence.d.ts +3 -0
- package/dist/kernel/model-sequence.js +34 -0
- package/dist/kernel/prove.d.ts +10 -3
- package/dist/kernel/prove.js +332 -71
- package/dist/kernel/reader.d.ts +3 -0
- package/dist/kernel/reader.js +101 -14
- package/dist/kernel/share.d.ts +1 -0
- package/dist/kernel/share.js +27 -0
- package/dist/lean-kernel/emit.js +30 -37
- package/dist/lean-kernel/lean-terms.js +5 -0
- package/dist/lean-kernel/library.js +10 -10
- package/package.json +6 -1
package/dist/core/relation.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
// A loop's turn as its relation: the linear paths of one turn (kernel.ts's Loop), for a search that reads the relation
|
|
2
|
+
// rather than runs (core/cycles.ts's ranks found from the relation's counterexamples). Untrusted: what is found here is
|
|
3
|
+
// a candidate, and the kernel proves whatever is kept from it.
|
|
4
|
+
//
|
|
5
|
+
// A path is a conjunction of linear rows over the state, the params and the turn's inputs (each a natural), with the
|
|
6
|
+
// state after the turn linear in them: `while`, `assume` and the laws are put in disjunctive form, each `if` of the body
|
|
7
|
+
// decided by the values the path pins (pc = 3, t = 1: an equation of one variable) or split, each truncated difference
|
|
8
|
+
// a ∸ b split on a ≥ b (a − b, or 0 below it), min and max alike. A product of two variables stands for a natural of
|
|
9
|
+
// its own (the path is then larger than the turn: a search must check what it finds against the turn itself).
|
|
10
|
+
//
|
|
11
|
+
// Integers: two naturals that every row and every value reads only as their difference (u − w, as an integer slot is
|
|
12
|
+
// written: kernel.ts's pairs, the DSL's x and x$neg, compare/term's s and s$n), and whose values after the turn are a
|
|
13
|
+
// difference split both ways (u := P ∸ N, w := N ∸ P) or linear, are one integer, u − w: the path then needs no split
|
|
14
|
+
// for them (u − w becomes P − N exactly), and a rank over them is over the integer. Each is named by its first part.
|
|
15
|
+
import { cpair, cunpair } from "./machine.js";
|
|
1
16
|
import { clock } from "../kernel/prove.js";
|
|
2
17
|
import { canon, konst, plus, solve, subst, times, vars, work } from "./solver.js";
|
|
3
18
|
import { bgcd } from "./q.js";
|
|
@@ -45,6 +60,8 @@ function alts(e, p, n) {
|
|
|
45
60
|
}));
|
|
46
61
|
case 'if': return chain(e, p, n, alts);
|
|
47
62
|
case 'get': throw new Refused('a map');
|
|
63
|
+
case 'tup':
|
|
64
|
+
case 'proj': throw new Refused('a tuple key');
|
|
48
65
|
}
|
|
49
66
|
}
|
|
50
67
|
// A row lin <= 0 added (none where the pins decide it: kept or dropped); an equation of one variable pins it.
|
|
@@ -152,6 +169,14 @@ function valueAt(e, pins) {
|
|
|
152
169
|
return undefined;
|
|
153
170
|
return e.op === 'add' ? a + b : e.op === 'sub' ? Math.max(0, a - b) : e.op === 'min' ? Math.min(a, b) : e.op === 'max' ? Math.max(a, b) : a * b;
|
|
154
171
|
}
|
|
172
|
+
case 'tup': {
|
|
173
|
+
const a = valueAt(e.a, pins), b = a === undefined ? undefined : valueAt(e.b, pins);
|
|
174
|
+
return a === undefined || b === undefined ? undefined : cpair(a, b);
|
|
175
|
+
}
|
|
176
|
+
case 'proj': {
|
|
177
|
+
const a = valueAt(e.a, pins);
|
|
178
|
+
return a === undefined ? undefined : cunpair(a)[e.k];
|
|
179
|
+
}
|
|
155
180
|
case 'get': return undefined;
|
|
156
181
|
}
|
|
157
182
|
}
|
|
@@ -384,8 +409,10 @@ const renameE = (e, names, f) => {
|
|
|
384
409
|
case 'sub':
|
|
385
410
|
case 'min':
|
|
386
411
|
case 'max':
|
|
387
|
-
case 'prod':
|
|
388
|
-
case '
|
|
412
|
+
case 'prod':
|
|
413
|
+
case 'tup': return { ...e, a: renameE(e.a, names, f), b: renameE(e.b, names, f) };
|
|
414
|
+
case 'mul':
|
|
415
|
+
case 'proj': return { ...e, a: renameE(e.a, names, f) };
|
|
389
416
|
case 'if': return { op: 'if', c: renameC(e.c, names, f), then: renameE(e.then, names, f), else: renameE(e.else, names, f) };
|
|
390
417
|
case 'get': return { ...e, key: renameE(e.key, names, f) };
|
|
391
418
|
}
|
package/dist/core/relational.js
CHANGED
|
@@ -261,14 +261,16 @@ export function lift(l, r, prefix, shared) {
|
|
|
261
261
|
switch (x.op) {
|
|
262
262
|
case 'var': return { op: 'var', name: n(x.name) };
|
|
263
263
|
case 'const': return x;
|
|
264
|
-
case 'mul':
|
|
264
|
+
case 'mul':
|
|
265
|
+
case 'proj': return { ...x, a: e(x.a) };
|
|
265
266
|
case 'if': return { op: 'if', c: c(x.c), then: e(x.then), else: e(x.else) };
|
|
266
267
|
case 'get': return { op: 'get', map: n(x.map), key: e(x.key) };
|
|
267
268
|
case 'add':
|
|
268
269
|
case 'sub':
|
|
269
270
|
case 'min':
|
|
270
271
|
case 'max':
|
|
271
|
-
case 'prod':
|
|
272
|
+
case 'prod':
|
|
273
|
+
case 'tup': return { ...x, a: e(x.a), b: e(x.b) };
|
|
272
274
|
}
|
|
273
275
|
};
|
|
274
276
|
const c = (x) => {
|
package/dist/core/rs/Cargo.toml
CHANGED