tslaws 1.1.0 → 1.3.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 +177 -187
- package/dist/api.d.ts +86 -0
- package/dist/api.js +78 -0
- package/dist/badge.d.ts +58 -11
- package/dist/badge.js +194 -27
- package/dist/browser.d.ts +5 -2
- package/dist/browser.js +403 -173
- package/dist/browserApi.d.ts +305 -0
- package/dist/browserApi.js +456 -0
- package/dist/browserServer.d.ts +13 -0
- package/dist/browserServer.js +406 -0
- package/dist/certificates.js +50 -28
- package/dist/chc.js +30 -7
- package/dist/check.js +55 -30
- package/dist/cli.js +12 -2
- package/dist/compile.js +41 -4
- package/dist/coverage.d.ts +17 -0
- package/dist/coverage.js +269 -18
- package/dist/derived.d.ts +2 -0
- package/dist/derived.js +9 -4
- package/dist/generators.d.ts +5 -1
- package/dist/generators.js +50 -4
- package/dist/githubCli.js +67 -7
- package/dist/lawHost.d.ts +2 -0
- package/dist/lawHost.js +31 -18
- package/dist/lock.d.ts +1 -0
- package/dist/lock.js +7 -4
- package/dist/nativeZ3.d.ts +11 -0
- package/dist/nativeZ3.js +162 -0
- package/dist/plan.d.ts +7 -0
- package/dist/plan.js +11 -0
- package/dist/proofCache.d.ts +24 -0
- package/dist/proofCache.js +135 -0
- package/dist/property.d.ts +2 -2
- package/dist/property.js +33 -8
- package/dist/propertyWorker.js +13 -5
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +48 -8
- package/dist/seal.js +47 -8
- package/dist/smt.d.ts +7 -1
- package/dist/smt.js +202 -26
- package/dist/symbolic.d.ts +38 -3
- package/dist/symbolic.js +504 -47
- package/dist/types.d.ts +4 -0
- package/package.json +6 -6
package/dist/symbolic.d.ts
CHANGED
|
@@ -65,16 +65,29 @@ interface FileIndex {
|
|
|
65
65
|
imports: Map<string, string>;
|
|
66
66
|
/** Module-level `const NAME = ...` and `exports.NAME = ...` initializers, evaluated on demand. */
|
|
67
67
|
constants: Map<string, ts.Expression>;
|
|
68
|
+
/** Re-exported bindings (`Object.defineProperty(exports, "X", { get: () => mod_1.Y })` or `exports.X = mod_1.Y`). */
|
|
69
|
+
reexports: Map<string, {
|
|
70
|
+
file: string;
|
|
71
|
+
name: string;
|
|
72
|
+
}>;
|
|
73
|
+
/** Star re-exports (`__exportStar(require("./sub"), exports)`). */
|
|
74
|
+
stars: string[];
|
|
68
75
|
}
|
|
76
|
+
/** Resolves a relative CommonJS specifier the way Node does: `base.js`, else `base/index.js`. */
|
|
77
|
+
export declare function resolveRelativeJs(fromFile: string, specifier: string): string;
|
|
78
|
+
/** Reads and parses a compiled `.js` file, reusing the AST while its size and modification time are unchanged. */
|
|
79
|
+
export declare function readParsedJs(file: string): ts.SourceFile;
|
|
69
80
|
declare class Frame {
|
|
70
81
|
env: Map<string, Value>;
|
|
71
82
|
done: string;
|
|
72
83
|
brk: string;
|
|
73
84
|
cnt: string;
|
|
74
85
|
ret: Value | undefined;
|
|
86
|
+
fnKey: string | undefined;
|
|
87
|
+
decreases: Int | Big | undefined;
|
|
75
88
|
readonly file: string;
|
|
76
89
|
readonly depth: number;
|
|
77
|
-
constructor(file: string, depth: number);
|
|
90
|
+
constructor(file: string, depth: number, fnKey?: string);
|
|
78
91
|
fork(): Frame;
|
|
79
92
|
}
|
|
80
93
|
export declare const bool: (t: string) => Bool;
|
|
@@ -93,6 +106,17 @@ export declare class Executor {
|
|
|
93
106
|
private havocked;
|
|
94
107
|
readonly assumptions: string[];
|
|
95
108
|
readonly obligations: string[];
|
|
109
|
+
/** Intermediate proof steps from `lemma(...)` / `calc(...)` / `induct(...)`: each is proved under prior assumptions. */
|
|
110
|
+
readonly subgoals: {
|
|
111
|
+
assumptions: string[];
|
|
112
|
+
goal: string;
|
|
113
|
+
}[];
|
|
114
|
+
/** Assumptions introduced by `lemma(...)` / `calc(...)` (omitted when sending the whole query to an independent certifier). */
|
|
115
|
+
readonly lemmaAssumptions: Set<string>;
|
|
116
|
+
/** True when `induct()` discharged the claim via base + inductive step subgoals. */
|
|
117
|
+
usedInduction: boolean;
|
|
118
|
+
/** Active call frames for checking recursive `decreases(...)` termination measures. */
|
|
119
|
+
private readonly callFrames;
|
|
96
120
|
readonly bounded: string[];
|
|
97
121
|
/** Advice for the reader when a proof fails on an obligation (a divisor that may be 0). */
|
|
98
122
|
readonly hints: string[];
|
|
@@ -116,7 +140,7 @@ export declare class Executor {
|
|
|
116
140
|
readonly bound: number;
|
|
117
141
|
constructor(bound: number);
|
|
118
142
|
index(file: string): FileIndex;
|
|
119
|
-
/** `exports.NAME = value` assigned exactly once, at the top level, is a constant;
|
|
143
|
+
/** `exports.NAME = value` assigned exactly once, at the top level, is a constant; also records CommonJS re-exports. */
|
|
120
144
|
private indexExports;
|
|
121
145
|
private readonly constantValues;
|
|
122
146
|
private readonly resolving;
|
|
@@ -151,7 +175,7 @@ export declare class Executor {
|
|
|
151
175
|
private branch;
|
|
152
176
|
private forStatement;
|
|
153
177
|
private loop;
|
|
154
|
-
/** The `invariant(...)` calls leading a loop body, and the statements after them. */
|
|
178
|
+
/** The `invariant(...)` and `decreases(...)` calls leading a loop body, and the statements after them. */
|
|
155
179
|
private invariantsOf;
|
|
156
180
|
private calleeOf;
|
|
157
181
|
/** The names a piece of code assigns, increments or mutates. */
|
|
@@ -246,6 +270,17 @@ export declare class Executor {
|
|
|
246
270
|
/** `forall(xs, p)` / `exists(xs, p)` over the slots of the array model, so a claim about them is bounded like the array. */
|
|
247
271
|
private quantifier;
|
|
248
272
|
private assumeCall;
|
|
273
|
+
private lemmaCall;
|
|
274
|
+
private requiresCall;
|
|
275
|
+
private impliesCall;
|
|
276
|
+
private iffCall;
|
|
277
|
+
private distinctCall;
|
|
278
|
+
private unreachableCall;
|
|
279
|
+
private calcCall;
|
|
280
|
+
private inductCall;
|
|
281
|
+
private ensuresCall;
|
|
282
|
+
private decreasesCall;
|
|
283
|
+
private resolveFunction;
|
|
249
284
|
private callProject;
|
|
250
285
|
private math;
|
|
251
286
|
private mathRaw;
|