@ohtaman/washi 0.4.0 → 0.5.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.ja.md +100 -107
- package/README.md +98 -105
- package/README.zh-CN.md +101 -108
- package/dist/browser/highs-worker.js +21 -3
- package/dist/browser/loader-CtaDHef_.js +273 -0
- package/dist/browser/solvers/glpk.js +433 -286
- package/dist/browser/solvers/glpk.min.js +1 -1
- package/dist/browser/solvers/z3.js +1002 -981
- package/dist/browser/solvers/z3.min.js +2 -2
- package/dist/browser/washi.js +2129 -676
- package/dist/browser/washi.min.js +4 -4
- package/dist/lib/highs-worker.js +21 -3
- package/dist/lib/loader-DmNC_UNk.js +279 -0
- package/dist/lib/registry-BEfvpZW3.js +951 -0
- package/dist/lib/solvers/glpk.js +201 -90
- package/dist/lib/solvers/z3.js +399 -259
- package/dist/lib/washi.js +1627 -988
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modeler/big-m.d.ts +75 -0
- package/dist/types/modeler/big-m.d.ts.map +1 -0
- package/dist/types/modeler/boolean-expr.d.ts +103 -14
- package/dist/types/modeler/boolean-expr.d.ts.map +1 -1
- package/dist/types/modeler/constraint.d.ts +36 -9
- package/dist/types/modeler/constraint.d.ts.map +1 -1
- package/dist/types/modeler/expression.d.ts +113 -28
- package/dist/types/modeler/expression.d.ts.map +1 -1
- package/dist/types/modeler/index.d.ts +10 -6
- package/dist/types/modeler/index.d.ts.map +1 -1
- package/dist/types/modeler/lp-writer.d.ts +27 -2
- package/dist/types/modeler/lp-writer.d.ts.map +1 -1
- package/dist/types/modeler/model.d.ts +478 -131
- package/dist/types/modeler/model.d.ts.map +1 -1
- package/dist/types/modeler/objective.d.ts +59 -0
- package/dist/types/modeler/objective.d.ts.map +1 -0
- package/dist/types/modeler/parser.d.ts +34 -10
- package/dist/types/modeler/parser.d.ts.map +1 -1
- package/dist/types/modeler/quad-expr.d.ts +26 -7
- package/dist/types/modeler/quad-expr.d.ts.map +1 -1
- package/dist/types/modeler/solution-validator.d.ts +93 -0
- package/dist/types/modeler/solution-validator.d.ts.map +1 -0
- package/dist/types/modeler/solvers/glpk/solver.d.ts +26 -2
- package/dist/types/modeler/solvers/glpk/solver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/loader.d.ts +36 -11
- package/dist/types/modeler/solvers/highs/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/solver.d.ts +11 -4
- package/dist/types/modeler/solvers/highs/solver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/worker-client.d.ts.map +1 -1
- package/dist/types/modeler/solvers/mock.d.ts +14 -5
- package/dist/types/modeler/solvers/mock.d.ts.map +1 -1
- package/dist/types/modeler/solvers/types.d.ts +71 -11
- package/dist/types/modeler/solvers/types.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/loader.d.ts +2 -3
- package/dist/types/modeler/solvers/z3/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/solver.d.ts +15 -5
- package/dist/types/modeler/solvers/z3/solver.d.ts.map +1 -1
- package/dist/types/modeler/types.d.ts +59 -1
- package/dist/types/modeler/types.d.ts.map +1 -1
- package/dist/types/modeler/validation.d.ts +56 -0
- package/dist/types/modeler/validation.d.ts.map +1 -0
- package/dist/types/modeler/variable.d.ts +48 -14
- package/dist/types/modeler/variable.d.ts.map +1 -1
- package/docs/examples/diet-sensitivity.md +90 -0
- package/docs/examples/ecommerce-coupons.md +106 -0
- package/docs/examples/index.md +53 -0
- package/docs/examples/knapsack.md +60 -0
- package/docs/examples/portfolio-qp.md +83 -0
- package/docs/examples/production.md +51 -0
- package/docs/examples/shift-scheduling.md +175 -0
- package/docs/examples/smt-security.md +74 -0
- package/docs/examples/transportation.md +90 -0
- package/docs/examples/unsat-core.md +64 -0
- package/docs/getting-started/ai-agents.md +267 -0
- package/docs/getting-started/cross-origin.md +87 -0
- package/docs/getting-started/index.md +116 -0
- package/docs/getting-started/runtimes.md +227 -0
- package/docs/guide/constraints.md +177 -0
- package/docs/guide/expressions.md +204 -0
- package/docs/guide/objectives.md +170 -0
- package/docs/guide/unsat-core.md +147 -0
- package/docs/guide/variables.md +188 -0
- package/docs/ja/getting-started/ai-agents.md +266 -0
- package/docs/solvers/custom-solver.md +525 -0
- package/docs/solvers/glpk.md +66 -0
- package/docs/solvers/highs.md +93 -0
- package/docs/solvers/index.md +42 -0
- package/docs/solvers/z3.md +78 -0
- package/docs/zh/getting-started/ai-agents.md +266 -0
- package/llms-full.txt +3249 -0
- package/llms.txt +197 -0
- package/package.json +18 -5
- package/skills/washi/SKILL.md +197 -0
- package/dist/browser/loader-CVt4CloI.js +0 -58
- package/dist/lib/async-mutex-Duo4jwzn.js +0 -195
- package/dist/lib/constraint-BRuB3ooC.js +0 -90
- package/dist/lib/loader-Dti0v9yC.js +0 -50
- package/dist/lib/registry-DksqCSjI.js +0 -32
|
@@ -22,355 +22,231 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
22
22
|
}, u = (n, r, o) => (o = n == null ? {} : e(i(n)), l(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
23
23
|
value: n,
|
|
24
24
|
enumerable: !0
|
|
25
|
-
}) : o, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e), f = 0, p = class {
|
|
25
|
+
}) : o, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e), f = 0, p = class e {
|
|
26
|
+
kind = "constraint";
|
|
27
|
+
id;
|
|
28
|
+
_lhs;
|
|
29
|
+
_sense;
|
|
30
|
+
_rhs;
|
|
31
|
+
_name;
|
|
32
|
+
hasExplicitName;
|
|
33
|
+
ownerModel = null;
|
|
34
|
+
slack = null;
|
|
35
|
+
dual = null;
|
|
36
|
+
constructor(e, t, n, r) {
|
|
37
|
+
this.id = ++f, this._lhs = e, this._sense = t, this._rhs = n;
|
|
38
|
+
let i = typeof r == "string" ? r.trim() : void 0;
|
|
39
|
+
i && i.length > 0 ? (this._name = i, this.hasExplicitName = !0) : (this._name = `c_${this.id}`, this.hasExplicitName = !1);
|
|
40
|
+
}
|
|
41
|
+
get lhs() {
|
|
42
|
+
return this._lhs;
|
|
43
|
+
}
|
|
44
|
+
set lhs(e) {
|
|
45
|
+
this._lhs !== e && (this._lhs = e, this.ownerModel?.notifyMutation?.());
|
|
46
|
+
}
|
|
47
|
+
get sense() {
|
|
48
|
+
return this._sense;
|
|
49
|
+
}
|
|
50
|
+
set sense(e) {
|
|
51
|
+
this._sense !== e && (this._sense = e, this.ownerModel?.notifyMutation?.());
|
|
52
|
+
}
|
|
53
|
+
get rhs() {
|
|
54
|
+
return this._rhs;
|
|
55
|
+
}
|
|
56
|
+
set rhs(e) {
|
|
57
|
+
Object.is(this._rhs, e) || (this._rhs = e, this.ownerModel?.notifyMutation?.());
|
|
58
|
+
}
|
|
59
|
+
get name() {
|
|
60
|
+
return this._name;
|
|
61
|
+
}
|
|
62
|
+
set name(e) {
|
|
63
|
+
this._name !== e && (this._name = e, this.ownerModel?.notifyMutation?.()), this.hasExplicitName = !0;
|
|
64
|
+
}
|
|
65
|
+
_assignModelName(e, t) {
|
|
66
|
+
this._name = e, this.hasExplicitName = t;
|
|
67
|
+
}
|
|
26
68
|
and(e) {
|
|
27
|
-
return new
|
|
69
|
+
return new v("and", [this, e]);
|
|
28
70
|
}
|
|
29
71
|
or(e) {
|
|
30
|
-
return new
|
|
72
|
+
return new v("or", [this, e]);
|
|
31
73
|
}
|
|
32
74
|
implies(e) {
|
|
33
|
-
return new
|
|
75
|
+
return new v("implies", [this, e]);
|
|
34
76
|
}
|
|
35
77
|
xor(e) {
|
|
36
|
-
return new
|
|
78
|
+
return new v("xor", [this, e]);
|
|
37
79
|
}
|
|
38
80
|
not() {
|
|
39
|
-
return new
|
|
81
|
+
return new v("not", [this]);
|
|
40
82
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
name;
|
|
44
|
-
value = null;
|
|
45
|
-
constructor(e) {
|
|
46
|
-
super(), this.id = ++f, this.name = e || `p_${this.id}`;
|
|
83
|
+
add(e) {
|
|
84
|
+
throw Error("Cannot perform arithmetic on a Constraint: expected a number, Var, LinExpr, or QuadExpr.");
|
|
47
85
|
}
|
|
48
|
-
|
|
49
|
-
|
|
86
|
+
sub(e) {
|
|
87
|
+
throw Error("Cannot perform arithmetic on a Constraint: expected a number, Var, LinExpr, or QuadExpr.");
|
|
50
88
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
children;
|
|
54
|
-
constructor(e, t) {
|
|
55
|
-
super(), this.op = e, this.children = t;
|
|
89
|
+
mul(e) {
|
|
90
|
+
throw Error("Cannot perform arithmetic on a Constraint: expected a number, Var, LinExpr, or QuadExpr.");
|
|
56
91
|
}
|
|
57
|
-
|
|
58
|
-
|
|
92
|
+
div(e) {
|
|
93
|
+
throw Error("Cannot perform arithmetic on a Constraint: expected a number, Var, LinExpr, or QuadExpr.");
|
|
59
94
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
95
|
+
neg() {
|
|
96
|
+
throw Error("Cannot perform arithmetic on a Constraint: expected a number, Var, LinExpr, or QuadExpr.");
|
|
97
|
+
}
|
|
98
|
+
le(e, t) {
|
|
99
|
+
throw Error("Cannot compare a Constraint in (<=): expected a number, Var, or LinExpr.");
|
|
100
|
+
}
|
|
101
|
+
ge(e, t) {
|
|
102
|
+
throw Error("Cannot compare a Constraint in (>=): expected a number, Var, or LinExpr.");
|
|
103
|
+
}
|
|
104
|
+
eq(e, t) {
|
|
105
|
+
throw Error("Cannot compare a Constraint in (==): expected a number, Var, or LinExpr.");
|
|
106
|
+
}
|
|
107
|
+
get value() {
|
|
108
|
+
throw Error("Cannot read numeric value of a Constraint: expected a Var, LinExpr, or QuadExpr.");
|
|
109
|
+
}
|
|
110
|
+
get constant() {
|
|
111
|
+
throw Error("Cannot read numeric constant of a Constraint: expected a LinExpr or QuadExpr.");
|
|
112
|
+
}
|
|
113
|
+
clone() {
|
|
114
|
+
return new e(this._lhs.clone(), this._sense, this._rhs, this.hasExplicitName ? this._name : void 0);
|
|
70
115
|
}
|
|
116
|
+
toString() {
|
|
117
|
+
let e = this.sense === "==" ? "=" : this.sense;
|
|
118
|
+
return `${this.name}: ${this.lhs.toString()} ${e} ${this.rhs}`;
|
|
119
|
+
}
|
|
120
|
+
}, m = 0;
|
|
121
|
+
function h(e, t) {
|
|
122
|
+
if (e instanceof g || e instanceof p) return e;
|
|
123
|
+
throw typeof e == "object" && e && ("terms" in e || "quadTerms" in e) ? Error(`Cannot use an arithmetic expression without a comparison operator (<=, >=, ==) in logical operator "${t}". Use a comparison constraint such as expr\`\${x} <= 10\` or a BoolVar/BoolExpr.`) : Error(`Invalid operand passed to logical operator "${t}": expected a BoolVar, BoolExpr, or Constraint.`);
|
|
124
|
+
}
|
|
125
|
+
var g = class {
|
|
71
126
|
and(e) {
|
|
72
|
-
return new
|
|
127
|
+
return new v("and", [this, h(e, "and")]);
|
|
73
128
|
}
|
|
74
129
|
or(e) {
|
|
75
|
-
return new
|
|
130
|
+
return new v("or", [this, h(e, "or")]);
|
|
76
131
|
}
|
|
77
132
|
implies(e) {
|
|
78
|
-
return new
|
|
133
|
+
return new v("implies", [this, h(e, "implies")]);
|
|
79
134
|
}
|
|
80
135
|
xor(e) {
|
|
81
|
-
return new
|
|
136
|
+
return new v("xor", [this, h(e, "xor")]);
|
|
82
137
|
}
|
|
83
138
|
not() {
|
|
84
|
-
return new
|
|
139
|
+
return new v("not", [this]);
|
|
140
|
+
}
|
|
141
|
+
}, _ = class extends g {
|
|
142
|
+
id;
|
|
143
|
+
name;
|
|
144
|
+
value = null;
|
|
145
|
+
constructor(e) {
|
|
146
|
+
super(), this.id = ++m, this.name = e || `p_${this.id}`;
|
|
85
147
|
}
|
|
86
148
|
toString() {
|
|
87
|
-
|
|
88
|
-
|
|
149
|
+
return this.name;
|
|
150
|
+
}
|
|
151
|
+
}, v = class extends g {
|
|
152
|
+
op;
|
|
153
|
+
children;
|
|
154
|
+
constructor(e, t) {
|
|
155
|
+
super(), this.op = e, this.children = t.map((t) => h(t, e));
|
|
156
|
+
}
|
|
157
|
+
toString() {
|
|
158
|
+
return this.op === "not" ? `not(${this.children[0].toString()})` : `(${this.children.map((e) => e.toString()).join(` ${this.op} `)})`;
|
|
89
159
|
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
function
|
|
94
|
-
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/modeler/lp-writer.ts
|
|
163
|
+
function y(e) {
|
|
164
|
+
return typeof e == "object" && !!e && typeof e.lpString == "string" && e.nameToVar instanceof Map && e.nameToConstraint instanceof Map;
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/modeler/solvers/registry.ts
|
|
168
|
+
var ee = Symbol.for("washi.solverRegistry"), te = globalThis;
|
|
169
|
+
te[ee] || (te[ee] = /* @__PURE__ */ new Map());
|
|
170
|
+
var b = te[ee];
|
|
171
|
+
function x(e, t) {
|
|
172
|
+
b.set(e.toLowerCase(), t);
|
|
95
173
|
}
|
|
96
174
|
//#endregion
|
|
97
175
|
//#region \0washi-browser-z3-assets
|
|
98
|
-
var
|
|
99
|
-
function
|
|
100
|
-
if (!
|
|
101
|
-
return new URL(e,
|
|
176
|
+
var ne = import.meta.url;
|
|
177
|
+
function re(e) {
|
|
178
|
+
if (!ne) throw Error("[WaSHI] Load the browser IIFE using an external script src, or use the browser ESM build.");
|
|
179
|
+
return new URL(e, ne).href;
|
|
102
180
|
}
|
|
103
|
-
function
|
|
181
|
+
function ie() {
|
|
104
182
|
return {
|
|
105
|
-
jsUrl:
|
|
106
|
-
wasmUrl:
|
|
183
|
+
jsUrl: re("z3-built.js"),
|
|
184
|
+
wasmUrl: re("z3-built.wasm")
|
|
107
185
|
};
|
|
108
186
|
}
|
|
109
187
|
//#endregion
|
|
110
|
-
//#region node_modules/
|
|
111
|
-
var
|
|
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
|
-
e.release();
|
|
146
|
-
},
|
|
147
|
-
cancel() {
|
|
148
|
-
return e.cancel();
|
|
149
|
-
},
|
|
150
|
-
waitForUnlock: () => e.waitForUnlock(),
|
|
151
|
-
isLocked: () => e.isLocked()
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function oe(e, t = ce) {
|
|
155
|
-
return ae(e, 0, t);
|
|
156
|
-
}
|
|
157
|
-
var se, ce, le, ue, x, de, S, C, w = o((() => {
|
|
158
|
-
se = /* @__PURE__ */ Error("timeout while waiting for mutex to become available"), ce = /* @__PURE__ */ Error("mutex already locked"), le = /* @__PURE__ */ Error("request for lock canceled"), ue = function(e, t, n, r) {
|
|
159
|
-
function i(e) {
|
|
160
|
-
return e instanceof n ? e : new n(function(t) {
|
|
161
|
-
t(e);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
return new (n ||= Promise)(function(n, a) {
|
|
165
|
-
function o(e) {
|
|
166
|
-
try {
|
|
167
|
-
c(r.next(e));
|
|
168
|
-
} catch (e) {
|
|
169
|
-
a(e);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function s(e) {
|
|
173
|
-
try {
|
|
174
|
-
c(r.throw(e));
|
|
175
|
-
} catch (e) {
|
|
176
|
-
a(e);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function c(e) {
|
|
180
|
-
e.done ? n(e.value) : i(e.value).then(o, s);
|
|
181
|
-
}
|
|
182
|
-
c((r = r.apply(e, t || [])).next());
|
|
183
|
-
});
|
|
184
|
-
}, x = class {
|
|
185
|
-
constructor(e, t = le) {
|
|
186
|
-
if (this._maxConcurrency = e, this._cancelError = t, this._queue = [], this._waiters = [], e <= 0) throw Error("semaphore must be initialized to a positive value");
|
|
187
|
-
this._value = e;
|
|
188
|
-
}
|
|
189
|
-
acquire() {
|
|
190
|
-
let e = this.isLocked(), t = new Promise((e, t) => this._queue.push({
|
|
191
|
-
resolve: e,
|
|
192
|
-
reject: t
|
|
193
|
-
}));
|
|
194
|
-
return e || this._dispatch(), t;
|
|
195
|
-
}
|
|
196
|
-
runExclusive(e) {
|
|
197
|
-
return ue(this, void 0, void 0, function* () {
|
|
198
|
-
let [t, n] = yield this.acquire();
|
|
199
|
-
try {
|
|
200
|
-
return yield e(t);
|
|
201
|
-
} finally {
|
|
202
|
-
n();
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
waitForUnlock() {
|
|
207
|
-
return ue(this, void 0, void 0, function* () {
|
|
208
|
-
return this.isLocked() ? new Promise((e) => this._waiters.push({ resolve: e })) : Promise.resolve();
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
isLocked() {
|
|
212
|
-
return this._value <= 0;
|
|
213
|
-
}
|
|
214
|
-
release() {
|
|
215
|
-
if (this._maxConcurrency > 1) throw Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead");
|
|
216
|
-
if (this._currentReleaser) {
|
|
217
|
-
let e = this._currentReleaser;
|
|
218
|
-
this._currentReleaser = void 0, e();
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
cancel() {
|
|
222
|
-
this._queue.forEach((e) => e.reject(this._cancelError)), this._queue = [];
|
|
223
|
-
}
|
|
224
|
-
_dispatch() {
|
|
225
|
-
let e = this._queue.shift();
|
|
226
|
-
if (!e) return;
|
|
227
|
-
let t = !1;
|
|
228
|
-
this._currentReleaser = () => {
|
|
229
|
-
t || (t = !0, this._value++, this._resolveWaiters(), this._dispatch());
|
|
230
|
-
}, e.resolve([this._value--, this._currentReleaser]);
|
|
231
|
-
}
|
|
232
|
-
_resolveWaiters() {
|
|
233
|
-
this._waiters.forEach((e) => e.resolve()), this._waiters = [];
|
|
234
|
-
}
|
|
235
|
-
}, de = function(e, t, n, r) {
|
|
236
|
-
function i(e) {
|
|
237
|
-
return e instanceof n ? e : new n(function(t) {
|
|
238
|
-
t(e);
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
return new (n ||= Promise)(function(n, a) {
|
|
242
|
-
function o(e) {
|
|
243
|
-
try {
|
|
244
|
-
c(r.next(e));
|
|
245
|
-
} catch (e) {
|
|
246
|
-
a(e);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function s(e) {
|
|
250
|
-
try {
|
|
251
|
-
c(r.throw(e));
|
|
252
|
-
} catch (e) {
|
|
253
|
-
a(e);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
function c(e) {
|
|
257
|
-
e.done ? n(e.value) : i(e.value).then(o, s);
|
|
258
|
-
}
|
|
259
|
-
c((r = r.apply(e, t || [])).next());
|
|
260
|
-
});
|
|
261
|
-
}, S = class {
|
|
262
|
-
constructor(e) {
|
|
263
|
-
this._semaphore = new x(1, e);
|
|
264
|
-
}
|
|
265
|
-
acquire() {
|
|
266
|
-
return de(this, void 0, void 0, function* () {
|
|
267
|
-
let [, e] = yield this._semaphore.acquire();
|
|
268
|
-
return e;
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
runExclusive(e) {
|
|
272
|
-
return this._semaphore.runExclusive(() => e());
|
|
273
|
-
}
|
|
274
|
-
isLocked() {
|
|
275
|
-
return this._semaphore.isLocked();
|
|
276
|
-
}
|
|
277
|
-
waitForUnlock() {
|
|
278
|
-
return this._semaphore.waitForUnlock();
|
|
279
|
-
}
|
|
280
|
-
release() {
|
|
281
|
-
this._semaphore.release();
|
|
282
|
-
}
|
|
283
|
-
cancel() {
|
|
284
|
-
return this._semaphore.cancel();
|
|
285
|
-
}
|
|
286
|
-
}, C = function(e, t, n, r) {
|
|
287
|
-
function i(e) {
|
|
288
|
-
return e instanceof n ? e : new n(function(t) {
|
|
289
|
-
t(e);
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
return new (n ||= Promise)(function(n, a) {
|
|
293
|
-
function o(e) {
|
|
294
|
-
try {
|
|
295
|
-
c(r.next(e));
|
|
296
|
-
} catch (e) {
|
|
297
|
-
a(e);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
function s(e) {
|
|
301
|
-
try {
|
|
302
|
-
c(r.throw(e));
|
|
303
|
-
} catch (e) {
|
|
304
|
-
a(e);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
function c(e) {
|
|
308
|
-
e.done ? n(e.value) : i(e.value).then(o, s);
|
|
309
|
-
}
|
|
310
|
-
c((r = r.apply(e, t || [])).next());
|
|
311
|
-
});
|
|
312
|
-
};
|
|
313
|
-
})), fe = /* @__PURE__ */ c({
|
|
314
|
-
__addDisposableResource: () => Le,
|
|
315
|
-
__assign: () => Be,
|
|
316
|
-
__asyncDelegator: () => ke,
|
|
317
|
-
__asyncGenerator: () => Oe,
|
|
318
|
-
__asyncValues: () => Ae,
|
|
319
|
-
__await: () => De,
|
|
320
|
-
__awaiter: () => be,
|
|
321
|
-
__classPrivateFieldGet: () => Pe,
|
|
322
|
-
__classPrivateFieldIn: () => Ie,
|
|
323
|
-
__classPrivateFieldSet: () => Fe,
|
|
324
|
-
__createBinding: () => k,
|
|
325
|
-
__decorate: () => pe,
|
|
326
|
-
__disposeResources: () => Re,
|
|
327
|
-
__esDecorate: () => he,
|
|
328
|
-
__exportStar: () => D,
|
|
329
|
-
__extends: () => T,
|
|
330
|
-
__generator: () => xe,
|
|
331
|
-
__importDefault: () => Ne,
|
|
332
|
-
__importStar: () => Me,
|
|
333
|
-
__makeTemplateObject: () => je,
|
|
334
|
-
__metadata: () => ye,
|
|
335
|
-
__param: () => me,
|
|
336
|
-
__propKey: () => _e,
|
|
337
|
-
__read: () => Ce,
|
|
338
|
-
__rest: () => E,
|
|
339
|
-
__rewriteRelativeImportExtension: () => O,
|
|
340
|
-
__runInitializers: () => ge,
|
|
341
|
-
__setFunctionName: () => ve,
|
|
342
|
-
__spread: () => we,
|
|
343
|
-
__spreadArray: () => Ee,
|
|
344
|
-
__spreadArrays: () => Te,
|
|
345
|
-
__values: () => Se,
|
|
346
|
-
default: () => We
|
|
188
|
+
//#region node_modules/tslib/tslib.es6.mjs
|
|
189
|
+
var ae = /* @__PURE__ */ c({
|
|
190
|
+
__addDisposableResource: () => Oe,
|
|
191
|
+
__assign: () => Me,
|
|
192
|
+
__asyncDelegator: () => xe,
|
|
193
|
+
__asyncGenerator: () => be,
|
|
194
|
+
__asyncValues: () => Se,
|
|
195
|
+
__await: () => ye,
|
|
196
|
+
__awaiter: () => fe,
|
|
197
|
+
__classPrivateFieldGet: () => Te,
|
|
198
|
+
__classPrivateFieldIn: () => De,
|
|
199
|
+
__classPrivateFieldSet: () => Ee,
|
|
200
|
+
__createBinding: () => Ne,
|
|
201
|
+
__decorate: () => ce,
|
|
202
|
+
__disposeResources: () => ke,
|
|
203
|
+
__esDecorate: () => ue,
|
|
204
|
+
__exportStar: () => pe,
|
|
205
|
+
__extends: () => oe,
|
|
206
|
+
__generator: () => T,
|
|
207
|
+
__importDefault: () => we,
|
|
208
|
+
__importStar: () => Ce,
|
|
209
|
+
__makeTemplateObject: () => E,
|
|
210
|
+
__metadata: () => w,
|
|
211
|
+
__param: () => le,
|
|
212
|
+
__propKey: () => S,
|
|
213
|
+
__read: () => he,
|
|
214
|
+
__rest: () => se,
|
|
215
|
+
__rewriteRelativeImportExtension: () => Ae,
|
|
216
|
+
__runInitializers: () => de,
|
|
217
|
+
__setFunctionName: () => C,
|
|
218
|
+
__spread: () => ge,
|
|
219
|
+
__spreadArray: () => ve,
|
|
220
|
+
__spreadArrays: () => _e,
|
|
221
|
+
__values: () => me,
|
|
222
|
+
default: () => Le
|
|
347
223
|
});
|
|
348
|
-
function
|
|
224
|
+
function oe(e, t) {
|
|
349
225
|
if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
350
|
-
|
|
226
|
+
je(e, t);
|
|
351
227
|
function n() {
|
|
352
228
|
this.constructor = e;
|
|
353
229
|
}
|
|
354
230
|
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
355
231
|
}
|
|
356
|
-
function
|
|
232
|
+
function se(e, t) {
|
|
357
233
|
var n = {};
|
|
358
234
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
359
235
|
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
360
236
|
return n;
|
|
361
237
|
}
|
|
362
|
-
function
|
|
238
|
+
function ce(e, t, n, r) {
|
|
363
239
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
364
240
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
365
241
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
366
242
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
367
243
|
}
|
|
368
|
-
function
|
|
244
|
+
function le(e, t) {
|
|
369
245
|
return function(n, r) {
|
|
370
246
|
t(n, r, e);
|
|
371
247
|
};
|
|
372
248
|
}
|
|
373
|
-
function
|
|
249
|
+
function ue(e, t, n, r, i, a) {
|
|
374
250
|
function o(e) {
|
|
375
251
|
if (e !== void 0 && typeof e != "function") throw TypeError("Function expected");
|
|
376
252
|
return e;
|
|
@@ -395,23 +271,23 @@ function he(e, t, n, r, i, a) {
|
|
|
395
271
|
}
|
|
396
272
|
l && Object.defineProperty(l, r.name, u), f = !0;
|
|
397
273
|
}
|
|
398
|
-
function
|
|
274
|
+
function de(e, t, n) {
|
|
399
275
|
for (var r = arguments.length > 2, i = 0; i < t.length; i++) n = r ? t[i].call(e, n) : t[i].call(e);
|
|
400
276
|
return r ? n : void 0;
|
|
401
277
|
}
|
|
402
|
-
function
|
|
278
|
+
function S(e) {
|
|
403
279
|
return typeof e == "symbol" ? e : `${e}`;
|
|
404
280
|
}
|
|
405
|
-
function
|
|
281
|
+
function C(e, t, n) {
|
|
406
282
|
return typeof t == "symbol" && (t = t.description ? `[${t.description}]` : ""), Object.defineProperty(e, "name", {
|
|
407
283
|
configurable: !0,
|
|
408
284
|
value: n ? `${n} ${t}` : t
|
|
409
285
|
});
|
|
410
286
|
}
|
|
411
|
-
function
|
|
287
|
+
function w(e, t) {
|
|
412
288
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
413
289
|
}
|
|
414
|
-
function
|
|
290
|
+
function fe(e, t, n, r) {
|
|
415
291
|
function i(e) {
|
|
416
292
|
return e instanceof n ? e : new n(function(t) {
|
|
417
293
|
t(e);
|
|
@@ -438,7 +314,7 @@ function be(e, t, n, r) {
|
|
|
438
314
|
c((r = r.apply(e, t || [])).next());
|
|
439
315
|
});
|
|
440
316
|
}
|
|
441
|
-
function
|
|
317
|
+
function T(e, t) {
|
|
442
318
|
var n = {
|
|
443
319
|
label: 0,
|
|
444
320
|
sent: function() {
|
|
@@ -508,10 +384,10 @@ function xe(e, t) {
|
|
|
508
384
|
};
|
|
509
385
|
}
|
|
510
386
|
}
|
|
511
|
-
function
|
|
512
|
-
for (var n in e) n !== "default" && !Object.prototype.hasOwnProperty.call(t, n) &&
|
|
387
|
+
function pe(e, t) {
|
|
388
|
+
for (var n in e) n !== "default" && !Object.prototype.hasOwnProperty.call(t, n) && Ne(t, e, n);
|
|
513
389
|
}
|
|
514
|
-
function
|
|
390
|
+
function me(e) {
|
|
515
391
|
var t = typeof Symbol == "function" && Symbol.iterator, n = t && e[t], r = 0;
|
|
516
392
|
if (n) return n.call(e);
|
|
517
393
|
if (e && typeof e.length == "number") return { next: function() {
|
|
@@ -522,7 +398,7 @@ function Se(e) {
|
|
|
522
398
|
} };
|
|
523
399
|
throw TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
524
400
|
}
|
|
525
|
-
function
|
|
401
|
+
function he(e, t) {
|
|
526
402
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
527
403
|
if (!n) return e;
|
|
528
404
|
var r = n.call(e), i, a = [], o;
|
|
@@ -539,23 +415,23 @@ function Ce(e, t) {
|
|
|
539
415
|
}
|
|
540
416
|
return a;
|
|
541
417
|
}
|
|
542
|
-
function
|
|
543
|
-
for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(
|
|
418
|
+
function ge() {
|
|
419
|
+
for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(he(arguments[t]));
|
|
544
420
|
return e;
|
|
545
421
|
}
|
|
546
|
-
function
|
|
422
|
+
function _e() {
|
|
547
423
|
for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
|
|
548
424
|
for (var r = Array(e), i = 0, t = 0; t < n; t++) for (var a = arguments[t], o = 0, s = a.length; o < s; o++, i++) r[i] = a[o];
|
|
549
425
|
return r;
|
|
550
426
|
}
|
|
551
|
-
function
|
|
427
|
+
function ve(e, t, n) {
|
|
552
428
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
553
429
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
554
430
|
}
|
|
555
|
-
function
|
|
556
|
-
return this instanceof
|
|
431
|
+
function ye(e) {
|
|
432
|
+
return this instanceof ye ? (this.v = e, this) : new ye(e);
|
|
557
433
|
}
|
|
558
|
-
function
|
|
434
|
+
function be(e, t, n) {
|
|
559
435
|
if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
|
|
560
436
|
var r = n.apply(e, t || []), i, a = [];
|
|
561
437
|
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), s("next"), s("throw"), s("return", o), i[Symbol.asyncIterator] = function() {
|
|
@@ -586,7 +462,7 @@ function Oe(e, t, n) {
|
|
|
586
462
|
}
|
|
587
463
|
}
|
|
588
464
|
function l(e) {
|
|
589
|
-
e.value instanceof
|
|
465
|
+
e.value instanceof ye ? Promise.resolve(e.value.v).then(u, d) : f(a[0][2], e);
|
|
590
466
|
}
|
|
591
467
|
function u(e) {
|
|
592
468
|
c("next", e);
|
|
@@ -598,7 +474,7 @@ function Oe(e, t, n) {
|
|
|
598
474
|
e(t), a.shift(), a.length && c(a[0][0], a[0][1]);
|
|
599
475
|
}
|
|
600
476
|
}
|
|
601
|
-
function
|
|
477
|
+
function xe(e) {
|
|
602
478
|
var t = {}, n;
|
|
603
479
|
return r("next"), r("throw", function(e) {
|
|
604
480
|
throw e;
|
|
@@ -608,16 +484,16 @@ function ke(e) {
|
|
|
608
484
|
function r(r, i) {
|
|
609
485
|
t[r] = e[r] ? function(t) {
|
|
610
486
|
return (n = !n) ? {
|
|
611
|
-
value:
|
|
487
|
+
value: ye(e[r](t)),
|
|
612
488
|
done: !1
|
|
613
489
|
} : i ? i(t) : t;
|
|
614
490
|
} : i;
|
|
615
491
|
}
|
|
616
492
|
}
|
|
617
|
-
function
|
|
493
|
+
function Se(e) {
|
|
618
494
|
if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
|
|
619
495
|
var t = e[Symbol.asyncIterator], n;
|
|
620
|
-
return t ? t.call(e) : (e = typeof
|
|
496
|
+
return t ? t.call(e) : (e = typeof me == "function" ? me(e) : e[Symbol.iterator](), n = {}, r("next"), r("throw"), r("return"), n[Symbol.asyncIterator] = function() {
|
|
621
497
|
return this;
|
|
622
498
|
}, n);
|
|
623
499
|
function r(t) {
|
|
@@ -636,34 +512,34 @@ function Ae(e) {
|
|
|
636
512
|
}, t);
|
|
637
513
|
}
|
|
638
514
|
}
|
|
639
|
-
function
|
|
515
|
+
function E(e, t) {
|
|
640
516
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
641
517
|
}
|
|
642
|
-
function
|
|
518
|
+
function Ce(e) {
|
|
643
519
|
if (e && e.__esModule) return e;
|
|
644
520
|
var t = {};
|
|
645
|
-
if (e != null) for (var n =
|
|
646
|
-
return
|
|
521
|
+
if (e != null) for (var n = Fe(e), r = 0; r < n.length; r++) n[r] !== "default" && Ne(t, e, n[r]);
|
|
522
|
+
return Pe(t, e), t;
|
|
647
523
|
}
|
|
648
|
-
function
|
|
524
|
+
function we(e) {
|
|
649
525
|
return e && e.__esModule ? e : { default: e };
|
|
650
526
|
}
|
|
651
|
-
function
|
|
527
|
+
function Te(e, t, n, r) {
|
|
652
528
|
if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
|
|
653
529
|
if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
|
|
654
530
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
655
531
|
}
|
|
656
|
-
function
|
|
532
|
+
function Ee(e, t, n, r, i) {
|
|
657
533
|
if (r === "m") throw TypeError("Private method is not writable");
|
|
658
534
|
if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
|
|
659
535
|
if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw TypeError("Cannot write private member to an object whose class did not declare it");
|
|
660
536
|
return r === "a" ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
|
|
661
537
|
}
|
|
662
|
-
function
|
|
538
|
+
function De(e, t) {
|
|
663
539
|
if (t === null || typeof t != "object" && typeof t != "function") throw TypeError("Cannot use 'in' operator on non-object");
|
|
664
540
|
return typeof e == "function" ? t === e : e.has(t);
|
|
665
541
|
}
|
|
666
|
-
function
|
|
542
|
+
function Oe(e, t, n) {
|
|
667
543
|
if (t != null) {
|
|
668
544
|
if (typeof t != "object" && typeof t != "function") throw TypeError("Object expected.");
|
|
669
545
|
var r, i;
|
|
@@ -690,9 +566,9 @@ function Le(e, t, n) {
|
|
|
690
566
|
} else n && e.stack.push({ async: !0 });
|
|
691
567
|
return t;
|
|
692
568
|
}
|
|
693
|
-
function
|
|
569
|
+
function ke(e) {
|
|
694
570
|
function t(t) {
|
|
695
|
-
e.error = e.hasError ? new
|
|
571
|
+
e.error = e.hasError ? new Ie(t, e.error, "An error was suppressed during disposal.") : t, e.hasError = !0;
|
|
696
572
|
}
|
|
697
573
|
var n, r = 0;
|
|
698
574
|
function i() {
|
|
@@ -712,24 +588,24 @@ function Re(e) {
|
|
|
712
588
|
}
|
|
713
589
|
return i();
|
|
714
590
|
}
|
|
715
|
-
function
|
|
591
|
+
function Ae(e, t) {
|
|
716
592
|
return typeof e == "string" && /^\.\.?\//.test(e) ? e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(e, n, r, i, a) {
|
|
717
593
|
return n ? t ? ".jsx" : ".js" : r && (!i || !a) ? e : r + i + "." + a.toLowerCase() + "js";
|
|
718
594
|
}) : e;
|
|
719
595
|
}
|
|
720
|
-
var
|
|
721
|
-
|
|
722
|
-
return
|
|
596
|
+
var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
597
|
+
je = function(e, t) {
|
|
598
|
+
return je = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
|
|
723
599
|
e.__proto__ = t;
|
|
724
600
|
} || function(e, t) {
|
|
725
601
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
726
|
-
},
|
|
727
|
-
},
|
|
728
|
-
return
|
|
602
|
+
}, je(e, t);
|
|
603
|
+
}, Me = function() {
|
|
604
|
+
return Me = Object.assign || function(e) {
|
|
729
605
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
730
606
|
return e;
|
|
731
|
-
},
|
|
732
|
-
},
|
|
607
|
+
}, Me.apply(this, arguments);
|
|
608
|
+
}, Ne = Object.create ? (function(e, t, n, r) {
|
|
733
609
|
r === void 0 && (r = n);
|
|
734
610
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
735
611
|
(!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = {
|
|
@@ -740,61 +616,61 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
740
616
|
}), Object.defineProperty(e, r, i);
|
|
741
617
|
}) : (function(e, t, n, r) {
|
|
742
618
|
r === void 0 && (r = n), e[r] = t[n];
|
|
743
|
-
}),
|
|
619
|
+
}), Pe = Object.create ? (function(e, t) {
|
|
744
620
|
Object.defineProperty(e, "default", {
|
|
745
621
|
enumerable: !0,
|
|
746
622
|
value: t
|
|
747
623
|
});
|
|
748
624
|
}) : function(e, t) {
|
|
749
625
|
e.default = t;
|
|
750
|
-
},
|
|
751
|
-
return
|
|
626
|
+
}, Fe = function(e) {
|
|
627
|
+
return Fe = Object.getOwnPropertyNames || function(e) {
|
|
752
628
|
var t = [];
|
|
753
629
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[t.length] = n);
|
|
754
630
|
return t;
|
|
755
|
-
},
|
|
756
|
-
},
|
|
631
|
+
}, Fe(e);
|
|
632
|
+
}, Ie = typeof SuppressedError == "function" ? SuppressedError : function(e, t, n) {
|
|
757
633
|
var r = Error(n);
|
|
758
634
|
return r.name = "SuppressedError", r.error = e, r.suppressed = t, r;
|
|
759
|
-
},
|
|
760
|
-
__extends:
|
|
761
|
-
__assign:
|
|
762
|
-
__rest:
|
|
763
|
-
__decorate:
|
|
764
|
-
__param:
|
|
765
|
-
__esDecorate:
|
|
766
|
-
__runInitializers:
|
|
767
|
-
__propKey:
|
|
768
|
-
__setFunctionName:
|
|
769
|
-
__metadata:
|
|
770
|
-
__awaiter:
|
|
771
|
-
__generator:
|
|
772
|
-
__createBinding:
|
|
773
|
-
__exportStar:
|
|
774
|
-
__values:
|
|
775
|
-
__read:
|
|
776
|
-
__spread:
|
|
777
|
-
__spreadArrays:
|
|
778
|
-
__spreadArray:
|
|
779
|
-
__await:
|
|
780
|
-
__asyncGenerator:
|
|
781
|
-
__asyncDelegator:
|
|
782
|
-
__asyncValues:
|
|
783
|
-
__makeTemplateObject:
|
|
784
|
-
__importStar:
|
|
785
|
-
__importDefault:
|
|
786
|
-
__classPrivateFieldGet:
|
|
787
|
-
__classPrivateFieldSet:
|
|
788
|
-
__classPrivateFieldIn:
|
|
789
|
-
__addDisposableResource:
|
|
790
|
-
__disposeResources:
|
|
791
|
-
__rewriteRelativeImportExtension:
|
|
635
|
+
}, Le = {
|
|
636
|
+
__extends: oe,
|
|
637
|
+
__assign: Me,
|
|
638
|
+
__rest: se,
|
|
639
|
+
__decorate: ce,
|
|
640
|
+
__param: le,
|
|
641
|
+
__esDecorate: ue,
|
|
642
|
+
__runInitializers: de,
|
|
643
|
+
__propKey: S,
|
|
644
|
+
__setFunctionName: C,
|
|
645
|
+
__metadata: w,
|
|
646
|
+
__awaiter: fe,
|
|
647
|
+
__generator: T,
|
|
648
|
+
__createBinding: Ne,
|
|
649
|
+
__exportStar: pe,
|
|
650
|
+
__values: me,
|
|
651
|
+
__read: he,
|
|
652
|
+
__spread: ge,
|
|
653
|
+
__spreadArrays: _e,
|
|
654
|
+
__spreadArray: ve,
|
|
655
|
+
__await: ye,
|
|
656
|
+
__asyncGenerator: be,
|
|
657
|
+
__asyncDelegator: xe,
|
|
658
|
+
__asyncValues: Se,
|
|
659
|
+
__makeTemplateObject: E,
|
|
660
|
+
__importStar: Ce,
|
|
661
|
+
__importDefault: we,
|
|
662
|
+
__classPrivateFieldGet: Te,
|
|
663
|
+
__classPrivateFieldSet: Ee,
|
|
664
|
+
__classPrivateFieldIn: De,
|
|
665
|
+
__addDisposableResource: Oe,
|
|
666
|
+
__disposeResources: ke,
|
|
667
|
+
__rewriteRelativeImportExtension: Ae
|
|
792
668
|
};
|
|
793
|
-
})),
|
|
669
|
+
})), ze = /* @__PURE__ */ s(((e) => {
|
|
794
670
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.E_CANCELED = e.E_ALREADY_LOCKED = e.E_TIMEOUT = void 0, e.E_TIMEOUT = /* @__PURE__ */ Error("timeout while waiting for mutex to become available"), e.E_ALREADY_LOCKED = /* @__PURE__ */ Error("mutex already locked"), e.E_CANCELED = /* @__PURE__ */ Error("request for lock canceled");
|
|
795
|
-
})),
|
|
671
|
+
})), D = /* @__PURE__ */ s(((e) => {
|
|
796
672
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
797
|
-
var t = (
|
|
673
|
+
var t = (Re(), d(ae)), n = ze();
|
|
798
674
|
e.default = function() {
|
|
799
675
|
function e(e, t) {
|
|
800
676
|
if (t === void 0 && (t = n.E_CANCELED), this._maxConcurrency = e, this._cancelError = t, this._queue = [], this._waiters = [], e <= 0) throw Error("semaphore must be initialized to a positive value");
|
|
@@ -863,9 +739,9 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
863
739
|
}), this._waiters = [];
|
|
864
740
|
}, e;
|
|
865
741
|
}();
|
|
866
|
-
})),
|
|
742
|
+
})), Be = /* @__PURE__ */ s(((e) => {
|
|
867
743
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
868
|
-
var t = (
|
|
744
|
+
var t = (Re(), d(ae)), n = D();
|
|
869
745
|
e.default = function() {
|
|
870
746
|
function e(e) {
|
|
871
747
|
this._semaphore = new n.default(1, e);
|
|
@@ -894,9 +770,9 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
894
770
|
return this._semaphore.cancel();
|
|
895
771
|
}, e;
|
|
896
772
|
}();
|
|
897
|
-
})),
|
|
773
|
+
})), Ve = /* @__PURE__ */ s(((e) => {
|
|
898
774
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.withTimeout = void 0;
|
|
899
|
-
var t = (
|
|
775
|
+
var t = (Re(), d(ae)), n = ze();
|
|
900
776
|
function r(e, r, i) {
|
|
901
777
|
var a = this;
|
|
902
778
|
return i === void 0 && (i = n.E_TIMEOUT), {
|
|
@@ -961,44 +837,44 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
961
837
|
};
|
|
962
838
|
}
|
|
963
839
|
e.withTimeout = r;
|
|
964
|
-
})),
|
|
840
|
+
})), O = /* @__PURE__ */ s(((e) => {
|
|
965
841
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.tryAcquire = void 0;
|
|
966
|
-
var t =
|
|
842
|
+
var t = ze(), n = Ve();
|
|
967
843
|
function r(e, r) {
|
|
968
844
|
return r === void 0 && (r = t.E_ALREADY_LOCKED), (0, n.withTimeout)(e, 0, r);
|
|
969
845
|
}
|
|
970
846
|
e.tryAcquire = r;
|
|
971
|
-
})),
|
|
847
|
+
})), He = /* @__PURE__ */ s(((e) => {
|
|
972
848
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.tryAcquire = e.withTimeout = e.Semaphore = e.Mutex = void 0;
|
|
973
|
-
var t = (
|
|
849
|
+
var t = (Re(), d(ae)), n = Be();
|
|
974
850
|
Object.defineProperty(e, "Mutex", {
|
|
975
851
|
enumerable: !0,
|
|
976
852
|
get: function() {
|
|
977
853
|
return n.default;
|
|
978
854
|
}
|
|
979
855
|
});
|
|
980
|
-
var r =
|
|
856
|
+
var r = D();
|
|
981
857
|
Object.defineProperty(e, "Semaphore", {
|
|
982
858
|
enumerable: !0,
|
|
983
859
|
get: function() {
|
|
984
860
|
return r.default;
|
|
985
861
|
}
|
|
986
862
|
});
|
|
987
|
-
var i =
|
|
863
|
+
var i = Ve();
|
|
988
864
|
Object.defineProperty(e, "withTimeout", {
|
|
989
865
|
enumerable: !0,
|
|
990
866
|
get: function() {
|
|
991
867
|
return i.withTimeout;
|
|
992
868
|
}
|
|
993
869
|
});
|
|
994
|
-
var a =
|
|
870
|
+
var a = O();
|
|
995
871
|
Object.defineProperty(e, "tryAcquire", {
|
|
996
872
|
enumerable: !0,
|
|
997
873
|
get: function() {
|
|
998
874
|
return a.tryAcquire;
|
|
999
875
|
}
|
|
1000
|
-
}), (0, t.__exportStar)(
|
|
1001
|
-
})),
|
|
876
|
+
}), (0, t.__exportStar)(ze(), e);
|
|
877
|
+
})), Ue = /* @__PURE__ */ s(((e) => {
|
|
1002
878
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.Z3_goal_prec = e.Z3_error_code = e.Z3_ast_print_mode = e.Z3_param_kind = e.Z3_decl_kind = e.Z3_ast_kind = e.Z3_sort_kind = e.Z3_parameter_kind = e.Z3_symbol_kind = e.Z3_lbool = void 0;
|
|
1003
879
|
var t;
|
|
1004
880
|
(function(e) {
|
|
@@ -1040,7 +916,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
1040
916
|
(function(e) {
|
|
1041
917
|
e[e.Z3_GOAL_PRECISE = 0] = "Z3_GOAL_PRECISE", e[e.Z3_GOAL_UNDER = 1] = "Z3_GOAL_UNDER", e[e.Z3_GOAL_OVER = 2] = "Z3_GOAL_OVER", e[e.Z3_GOAL_UNDER_OVER = 3] = "Z3_GOAL_UNDER_OVER";
|
|
1042
918
|
})(u || (e.Z3_goal_prec = u = {}));
|
|
1043
|
-
})),
|
|
919
|
+
})), We = /* @__PURE__ */ s(((e) => {
|
|
1044
920
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.init = t;
|
|
1045
921
|
async function t(e, t = {}) {
|
|
1046
922
|
let n = await e(t);
|
|
@@ -3977,7 +3853,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
3977
3853
|
}
|
|
3978
3854
|
};
|
|
3979
3855
|
}
|
|
3980
|
-
})),
|
|
3856
|
+
})), Ge = /* @__PURE__ */ s(((e) => {
|
|
3981
3857
|
var t = e && e.__createBinding || (Object.create ? (function(e, t, n, r) {
|
|
3982
3858
|
r === void 0 && (r = n);
|
|
3983
3859
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
@@ -3992,14 +3868,14 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
3992
3868
|
})), n = e && e.__exportStar || function(e, n) {
|
|
3993
3869
|
for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(n, r) && t(n, e, r);
|
|
3994
3870
|
};
|
|
3995
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), n(
|
|
3996
|
-
})),
|
|
3871
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), n(Ue(), e), n(We(), e);
|
|
3872
|
+
})), Ke = /* @__PURE__ */ s(((e) => {
|
|
3997
3873
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.Z3AssertionError = e.Z3Error = void 0;
|
|
3998
3874
|
var t = class extends Error {};
|
|
3999
3875
|
e.Z3Error = t, e.Z3AssertionError = class extends t {};
|
|
4000
|
-
})),
|
|
3876
|
+
})), qe = /* @__PURE__ */ s(((e) => {
|
|
4001
3877
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.assertExhaustive = n, e.assert = r, e.allSatisfy = i;
|
|
4002
|
-
var t =
|
|
3878
|
+
var t = Ke();
|
|
4003
3879
|
function n(e) {
|
|
4004
3880
|
throw Error("Unexpected code execution detected, should be caught at compile time");
|
|
4005
3881
|
}
|
|
@@ -4011,9 +3887,9 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4011
3887
|
for (let r of e) if (n = !0, !t(r)) return !1;
|
|
4012
3888
|
return n === !0 || null;
|
|
4013
3889
|
}
|
|
4014
|
-
})),
|
|
3890
|
+
})), Je = /* @__PURE__ */ s(((e) => {
|
|
4015
3891
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.createApi = c;
|
|
4016
|
-
var t =
|
|
3892
|
+
var t = He(), n = Ge(), r = Ke(), i = qe(), a = 17, o = new t.Mutex();
|
|
4017
3893
|
function s(e) {
|
|
4018
3894
|
let t = e !== null && (typeof e == "object" || typeof e == "function") && e.numerator !== null && (typeof e.numerator == "number" || typeof e.numerator == "bigint") && e.denominator !== null && (typeof e.denominator == "number" || typeof e.denominator == "bigint");
|
|
4019
3895
|
return t && (0, i.assert)((typeof e.numerator != "number" || Number.isSafeInteger(e.numerator)) && (typeof e.denominator != "number" || Number.isSafeInteger(e.denominator)), "Fraction numerator and denominator must be integers"), t;
|
|
@@ -4048,10 +3924,10 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4048
3924
|
function _() {
|
|
4049
3925
|
e.global_param_reset_all();
|
|
4050
3926
|
}
|
|
4051
|
-
function
|
|
3927
|
+
function v(t) {
|
|
4052
3928
|
return e.global_param_get(t);
|
|
4053
3929
|
}
|
|
4054
|
-
function
|
|
3930
|
+
function y(l, u) {
|
|
4055
3931
|
let d = e.mk_config();
|
|
4056
3932
|
u != null && Object.entries(u).forEach(([t, n]) => g(e.set_param_value(d, t, n.toString())));
|
|
4057
3933
|
let f = e.mk_context_rc(d);
|
|
@@ -4071,7 +3947,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4071
3947
|
function _(t) {
|
|
4072
3948
|
return g(typeof t == "number" ? e.mk_int_symbol(f, t) : e.mk_string_symbol(f, t));
|
|
4073
3949
|
}
|
|
4074
|
-
function
|
|
3950
|
+
function y(t) {
|
|
4075
3951
|
let r = g(e.get_symbol_kind(f, t));
|
|
4076
3952
|
switch (r) {
|
|
4077
3953
|
case n.Z3_symbol_kind.Z3_INT_SYMBOL: return e.get_symbol_int(f, t);
|
|
@@ -4079,18 +3955,18 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4079
3955
|
default: (0, i.assertExhaustive)(r);
|
|
4080
3956
|
}
|
|
4081
3957
|
}
|
|
4082
|
-
function
|
|
3958
|
+
function ee(t, n) {
|
|
4083
3959
|
let r = e.mk_params(f);
|
|
4084
3960
|
return e.params_inc_ref(f, r), typeof n == "boolean" ? e.params_set_bool(f, r, _(t), n) : typeof n == "number" ? g(Number.isInteger(n) ? e.params_set_uint(f, r, _(t), n) : e.params_set_double(f, r, _(t), n)) : typeof n == "string" && g(e.params_set_symbol(f, r, _(t), _(n))), r;
|
|
4085
3961
|
}
|
|
4086
|
-
function
|
|
3962
|
+
function te(t) {
|
|
4087
3963
|
switch (g(e.get_ast_kind(f, t))) {
|
|
4088
|
-
case n.Z3_ast_kind.Z3_SORT_AST: return
|
|
3964
|
+
case n.Z3_ast_kind.Z3_SORT_AST: return b(t);
|
|
4089
3965
|
case n.Z3_ast_kind.Z3_FUNC_DECL_AST: return new B(t);
|
|
4090
|
-
default: return
|
|
3966
|
+
default: return x(t);
|
|
4091
3967
|
}
|
|
4092
3968
|
}
|
|
4093
|
-
function
|
|
3969
|
+
function b(t) {
|
|
4094
3970
|
switch (g(e.get_sort_kind(f, t))) {
|
|
4095
3971
|
case n.Z3_sort_kind.Z3_BOOL_SORT: return new sr(t);
|
|
4096
3972
|
case n.Z3_sort_kind.Z3_INT_SORT:
|
|
@@ -4104,7 +3980,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4104
3980
|
default: return e.is_finite_set_sort(f, t) ? new Fr(t) : new z(t);
|
|
4105
3981
|
}
|
|
4106
3982
|
}
|
|
4107
|
-
function
|
|
3983
|
+
function x(t) {
|
|
4108
3984
|
let r = g(e.get_ast_kind(f, t));
|
|
4109
3985
|
if (r === n.Z3_ast_kind.Z3_QUANTIFIER_AST) return e.is_lambda(f, t) ? new Hr(t) : new Vr(t);
|
|
4110
3986
|
switch (g(e.get_sort_kind(f, e.get_sort(f, t)))) {
|
|
@@ -4120,39 +3996,39 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4120
3996
|
default: return e.is_finite_set_sort(f, e.get_sort(f, t)) ? new Z(t) : new V(t);
|
|
4121
3997
|
}
|
|
4122
3998
|
}
|
|
4123
|
-
function
|
|
3999
|
+
function ne(e) {
|
|
4124
4000
|
let t = [];
|
|
4125
|
-
for (let n of e)
|
|
4001
|
+
for (let n of e) Xe(n) ? t.push(...n.values()) : t.push(n);
|
|
4126
4002
|
return t;
|
|
4127
4003
|
}
|
|
4128
|
-
function
|
|
4129
|
-
return
|
|
4004
|
+
function re(e) {
|
|
4005
|
+
return qe(e) ? e : new cr(e);
|
|
4130
4006
|
}
|
|
4131
|
-
function
|
|
4007
|
+
function ie(e, t) {
|
|
4132
4008
|
(0, i.assert)(t.length > 0, "At least one argument expected");
|
|
4133
|
-
let n =
|
|
4134
|
-
for (let r = 1; r < t.length; r++) n = new cr(g(e(f, n.ptr,
|
|
4009
|
+
let n = re(t[0]);
|
|
4010
|
+
for (let r = 1; r < t.length; r++) n = new cr(g(e(f, n.ptr, re(t[r]).ptr)));
|
|
4135
4011
|
return n;
|
|
4136
4012
|
}
|
|
4137
|
-
function
|
|
4013
|
+
function ae() {
|
|
4138
4014
|
g(e.interrupt(f));
|
|
4139
4015
|
}
|
|
4140
|
-
function
|
|
4016
|
+
function oe(t) {
|
|
4141
4017
|
e.set_ast_print_mode(f, t);
|
|
4142
4018
|
}
|
|
4143
|
-
function
|
|
4019
|
+
function se(e) {
|
|
4144
4020
|
let t = e instanceof nr;
|
|
4145
4021
|
return t && p(e), t;
|
|
4146
4022
|
}
|
|
4147
|
-
function
|
|
4023
|
+
function ce(e) {
|
|
4148
4024
|
let t = e instanceof Qn;
|
|
4149
4025
|
return t && p(e), t;
|
|
4150
4026
|
}
|
|
4151
|
-
function
|
|
4027
|
+
function le(e) {
|
|
4152
4028
|
let t = e instanceof z;
|
|
4153
4029
|
return t && p(e), t;
|
|
4154
4030
|
}
|
|
4155
|
-
function
|
|
4031
|
+
function ue(e) {
|
|
4156
4032
|
let t = e instanceof B;
|
|
4157
4033
|
return t && p(e), t;
|
|
4158
4034
|
}
|
|
@@ -4178,182 +4054,182 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4178
4054
|
function T(e, t) {
|
|
4179
4055
|
return w(e) && S(e) && e.decl().kind() === t;
|
|
4180
4056
|
}
|
|
4181
|
-
function
|
|
4057
|
+
function pe(e) {
|
|
4182
4058
|
let t = e instanceof V && e.sort.kind() === n.Z3_sort_kind.Z3_BOOL_SORT;
|
|
4183
4059
|
return t && p(e), t;
|
|
4184
4060
|
}
|
|
4185
|
-
function
|
|
4061
|
+
function me(e) {
|
|
4186
4062
|
return T(e, n.Z3_decl_kind.Z3_OP_TRUE);
|
|
4187
4063
|
}
|
|
4188
|
-
function
|
|
4064
|
+
function he(e) {
|
|
4189
4065
|
return T(e, n.Z3_decl_kind.Z3_OP_FALSE);
|
|
4190
4066
|
}
|
|
4191
|
-
function
|
|
4067
|
+
function ge(e) {
|
|
4192
4068
|
return T(e, n.Z3_decl_kind.Z3_OP_AND);
|
|
4193
4069
|
}
|
|
4194
|
-
function
|
|
4070
|
+
function _e(e) {
|
|
4195
4071
|
return T(e, n.Z3_decl_kind.Z3_OP_OR);
|
|
4196
4072
|
}
|
|
4197
|
-
function
|
|
4073
|
+
function ve(e) {
|
|
4198
4074
|
return T(e, n.Z3_decl_kind.Z3_OP_IMPLIES);
|
|
4199
4075
|
}
|
|
4200
|
-
function
|
|
4076
|
+
function ye(e) {
|
|
4201
4077
|
return T(e, n.Z3_decl_kind.Z3_OP_NOT);
|
|
4202
4078
|
}
|
|
4203
|
-
function
|
|
4079
|
+
function be(e) {
|
|
4204
4080
|
return T(e, n.Z3_decl_kind.Z3_OP_EQ);
|
|
4205
4081
|
}
|
|
4206
|
-
function
|
|
4082
|
+
function xe(e) {
|
|
4207
4083
|
return T(e, n.Z3_decl_kind.Z3_OP_DISTINCT);
|
|
4208
4084
|
}
|
|
4209
|
-
function
|
|
4085
|
+
function Se(e) {
|
|
4210
4086
|
let t = e instanceof Br;
|
|
4211
4087
|
return t && p(e), t;
|
|
4212
4088
|
}
|
|
4213
|
-
function
|
|
4089
|
+
function E(e) {
|
|
4214
4090
|
let t = e instanceof W;
|
|
4215
4091
|
return t && p(e), t;
|
|
4216
4092
|
}
|
|
4217
|
-
function
|
|
4093
|
+
function Ce(e) {
|
|
4218
4094
|
let t = e instanceof hr;
|
|
4219
4095
|
return t && p(e), t;
|
|
4220
4096
|
}
|
|
4221
|
-
function Ce(e) {
|
|
4222
|
-
return D(e) && Te(e.sort);
|
|
4223
|
-
}
|
|
4224
4097
|
function we(e) {
|
|
4225
|
-
|
|
4226
|
-
return t && p(e), t;
|
|
4098
|
+
return E(e) && Ee(e.sort);
|
|
4227
4099
|
}
|
|
4228
4100
|
function Te(e) {
|
|
4229
|
-
|
|
4101
|
+
let t = e instanceof Cr;
|
|
4102
|
+
return t && p(e), t;
|
|
4230
4103
|
}
|
|
4231
4104
|
function Ee(e) {
|
|
4232
|
-
return
|
|
4105
|
+
return le(e) && e.kind() === n.Z3_sort_kind.Z3_INT_SORT;
|
|
4233
4106
|
}
|
|
4234
4107
|
function De(e) {
|
|
4235
|
-
|
|
4236
|
-
return t && p(e), t;
|
|
4108
|
+
return E(e) && ke(e.sort);
|
|
4237
4109
|
}
|
|
4238
4110
|
function Oe(e) {
|
|
4239
|
-
|
|
4111
|
+
let t = e instanceof wr;
|
|
4112
|
+
return t && p(e), t;
|
|
4240
4113
|
}
|
|
4241
4114
|
function ke(e) {
|
|
4115
|
+
return le(e) && e.kind() === n.Z3_sort_kind.Z3_REAL_SORT;
|
|
4116
|
+
}
|
|
4117
|
+
function Ae(e) {
|
|
4242
4118
|
let t = e instanceof G;
|
|
4243
4119
|
return t && p(e), t;
|
|
4244
4120
|
}
|
|
4245
|
-
function
|
|
4121
|
+
function je(e) {
|
|
4246
4122
|
let t = e instanceof Tr;
|
|
4247
4123
|
return t && p(e), t;
|
|
4248
4124
|
}
|
|
4249
|
-
function
|
|
4125
|
+
function Me(e) {
|
|
4250
4126
|
let t = e instanceof K;
|
|
4251
4127
|
return t && p(e), t;
|
|
4252
4128
|
}
|
|
4253
|
-
function
|
|
4129
|
+
function Ne(e) {
|
|
4254
4130
|
let t = e instanceof Er;
|
|
4255
4131
|
return t && p(e), t;
|
|
4256
4132
|
}
|
|
4257
|
-
function
|
|
4133
|
+
function Pe(e) {
|
|
4258
4134
|
let t = e instanceof Nr;
|
|
4259
4135
|
return t && p(e), t;
|
|
4260
4136
|
}
|
|
4261
|
-
function
|
|
4137
|
+
function Fe(e) {
|
|
4262
4138
|
let t = e instanceof Pr;
|
|
4263
4139
|
return t && p(e), t;
|
|
4264
4140
|
}
|
|
4265
|
-
function
|
|
4141
|
+
function Ie(e) {
|
|
4266
4142
|
return T(e, n.Z3_decl_kind.Z3_OP_CONST_ARRAY);
|
|
4267
4143
|
}
|
|
4268
|
-
function
|
|
4144
|
+
function Le(e) {
|
|
4269
4145
|
let t = e instanceof Dr;
|
|
4270
4146
|
return t && p(e), t;
|
|
4271
4147
|
}
|
|
4272
|
-
function
|
|
4148
|
+
function Re(e) {
|
|
4273
4149
|
let t = e instanceof Or;
|
|
4274
4150
|
return t && p(e), t;
|
|
4275
4151
|
}
|
|
4276
|
-
function
|
|
4152
|
+
function ze(e) {
|
|
4277
4153
|
let t = e instanceof kr;
|
|
4278
4154
|
return t && p(e), t;
|
|
4279
4155
|
}
|
|
4280
|
-
function
|
|
4156
|
+
function D(e) {
|
|
4281
4157
|
let t = e instanceof q;
|
|
4282
4158
|
return t && p(e), t;
|
|
4283
4159
|
}
|
|
4284
|
-
function
|
|
4160
|
+
function Be(e) {
|
|
4285
4161
|
let t = e instanceof Ar;
|
|
4286
4162
|
return t && p(e), t;
|
|
4287
4163
|
}
|
|
4288
|
-
function
|
|
4164
|
+
function Ve(e) {
|
|
4289
4165
|
let t = e instanceof jr;
|
|
4290
4166
|
return t && p(e), t;
|
|
4291
4167
|
}
|
|
4292
|
-
function
|
|
4168
|
+
function O(e) {
|
|
4293
4169
|
let t = e instanceof J;
|
|
4294
4170
|
return t && p(e), t;
|
|
4295
4171
|
}
|
|
4296
|
-
function
|
|
4172
|
+
function He(e) {
|
|
4297
4173
|
let t = e instanceof Y;
|
|
4298
4174
|
return t && p(e), t;
|
|
4299
4175
|
}
|
|
4300
|
-
function He(e) {
|
|
4301
|
-
return Be(e) && e.isString();
|
|
4302
|
-
}
|
|
4303
4176
|
function Ue(e) {
|
|
4304
|
-
return
|
|
4177
|
+
return Ve(e) && e.isString();
|
|
4305
4178
|
}
|
|
4306
4179
|
function We(e) {
|
|
4180
|
+
return O(e) && e.isString();
|
|
4181
|
+
}
|
|
4182
|
+
function Ge(e) {
|
|
4307
4183
|
let t = e instanceof Fr;
|
|
4308
4184
|
return t && p(e), t;
|
|
4309
4185
|
}
|
|
4310
|
-
function
|
|
4186
|
+
function Ke(e) {
|
|
4311
4187
|
let t = e instanceof Z;
|
|
4312
4188
|
return t && p(e), t;
|
|
4313
4189
|
}
|
|
4314
|
-
function
|
|
4190
|
+
function qe(e) {
|
|
4315
4191
|
let t = e instanceof cr;
|
|
4316
4192
|
return t && p(e), t;
|
|
4317
4193
|
}
|
|
4318
|
-
function
|
|
4194
|
+
function Je(e) {
|
|
4319
4195
|
let t = e instanceof U;
|
|
4320
4196
|
return t && p(e), t;
|
|
4321
4197
|
}
|
|
4322
|
-
function
|
|
4198
|
+
function Ye(e) {
|
|
4323
4199
|
let t = e instanceof lr;
|
|
4324
4200
|
return t && p(e), t;
|
|
4325
4201
|
}
|
|
4326
|
-
function
|
|
4202
|
+
function Xe(e) {
|
|
4327
4203
|
let t = e instanceof Q;
|
|
4328
4204
|
return t && p(e), t;
|
|
4329
4205
|
}
|
|
4330
|
-
function
|
|
4206
|
+
function Ze(e, t) {
|
|
4331
4207
|
return e.eqIdentity(t);
|
|
4332
4208
|
}
|
|
4333
|
-
function
|
|
4209
|
+
function Qe(t) {
|
|
4334
4210
|
return (0, i.assert)(fe(t), "Z3 bound variable expected"), e.get_index_value(f, t.ast);
|
|
4335
4211
|
}
|
|
4336
|
-
function
|
|
4337
|
-
if (typeof e == "boolean") return
|
|
4212
|
+
function k(e) {
|
|
4213
|
+
if (typeof e == "boolean") return j.val(e);
|
|
4338
4214
|
if (typeof e == "number") {
|
|
4339
4215
|
if (!Number.isFinite(e)) throw Error(`cannot represent infinity/NaN (got ${e})`);
|
|
4340
|
-
return Math.floor(e) === e ?
|
|
4216
|
+
return Math.floor(e) === e ? M.val(e) : N.val(e);
|
|
4341
4217
|
}
|
|
4342
|
-
if (s(e)) return
|
|
4343
|
-
if (typeof e == "bigint") return
|
|
4218
|
+
if (s(e)) return N.val(e);
|
|
4219
|
+
if (typeof e == "bigint") return M.val(e);
|
|
4344
4220
|
if (w(e)) return e;
|
|
4345
4221
|
(0, i.assert)(!1);
|
|
4346
4222
|
}
|
|
4347
|
-
async function
|
|
4223
|
+
async function $e(...e) {
|
|
4348
4224
|
let t = new $.Solver();
|
|
4349
4225
|
t.add(...e);
|
|
4350
4226
|
let n = await t.check();
|
|
4351
4227
|
return n === "sat" ? t.model() : n;
|
|
4352
4228
|
}
|
|
4353
|
-
async function
|
|
4354
|
-
return
|
|
4229
|
+
async function et(t) {
|
|
4230
|
+
return x(g(await e.simplify(f, t.ast)));
|
|
4355
4231
|
}
|
|
4356
|
-
let
|
|
4232
|
+
let A = { declare: (t) => new z(e.mk_uninterpreted_sort(f, _(t))) }, tt = {
|
|
4357
4233
|
declare: (t, ...n) => {
|
|
4358
4234
|
let r = n.length - 1, i = n[r];
|
|
4359
4235
|
p(i);
|
|
@@ -4368,7 +4244,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4368
4244
|
for (let e = 0; e < n; e++) p(t[e]), i.push(t[e].ptr);
|
|
4369
4245
|
return new B(e.mk_fresh_func_decl(f, "f", i, r.ptr));
|
|
4370
4246
|
}
|
|
4371
|
-
},
|
|
4247
|
+
}, nt = {
|
|
4372
4248
|
declare: (t, ...n) => {
|
|
4373
4249
|
let r = n.length - 1, i = n[r];
|
|
4374
4250
|
p(i);
|
|
@@ -4379,40 +4255,40 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4379
4255
|
addDefinition: (t, n, r) => {
|
|
4380
4256
|
p(t, ...n, r), g(e.add_rec_def(f, t.ptr, n.map((e) => e.ast), r.ast));
|
|
4381
4257
|
}
|
|
4382
|
-
},
|
|
4258
|
+
}, j = {
|
|
4383
4259
|
sort: () => new sr(e.mk_bool_sort(f)),
|
|
4384
|
-
const: (t) => new H(e.mk_const(f, _(t),
|
|
4385
|
-
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4260
|
+
const: (t) => new H(e.mk_const(f, _(t), j.sort().ptr)),
|
|
4261
|
+
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) => j.const(e))),
|
|
4386
4262
|
vector: (e, t) => {
|
|
4387
4263
|
let n = [];
|
|
4388
|
-
for (let r = 0; r < t; r++) n.push(
|
|
4264
|
+
for (let r = 0; r < t; r++) n.push(j.const(`${e}__${r}`));
|
|
4389
4265
|
return n;
|
|
4390
4266
|
},
|
|
4391
|
-
fresh: (t = "b") => new H(e.mk_fresh_const(f, t,
|
|
4267
|
+
fresh: (t = "b") => new H(e.mk_fresh_const(f, t, j.sort().ptr)),
|
|
4392
4268
|
val: (t) => t ? new H(e.mk_true(f)) : new H(e.mk_false(f))
|
|
4393
|
-
},
|
|
4269
|
+
}, M = {
|
|
4394
4270
|
sort: () => new hr(e.mk_int_sort(f)),
|
|
4395
|
-
const: (t) => new W(e.mk_const(f, _(t),
|
|
4396
|
-
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4271
|
+
const: (t) => new W(e.mk_const(f, _(t), M.sort().ptr)),
|
|
4272
|
+
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) => M.const(e))),
|
|
4397
4273
|
vector: (e, t) => {
|
|
4398
4274
|
let n = [];
|
|
4399
|
-
for (let r = 0; r < t; r++) n.push(
|
|
4275
|
+
for (let r = 0; r < t; r++) n.push(M.const(`${e}__${r}`));
|
|
4400
4276
|
return n;
|
|
4401
4277
|
},
|
|
4402
|
-
fresh: (t = "x") => new W(e.mk_fresh_const(f, t,
|
|
4403
|
-
val: (t) => ((0, i.assert)(typeof t == "bigint" || typeof t == "string" || Number.isSafeInteger(t)), new Cr(g(e.mk_numeral(f, t.toString(),
|
|
4404
|
-
},
|
|
4278
|
+
fresh: (t = "x") => new W(e.mk_fresh_const(f, t, M.sort().ptr)),
|
|
4279
|
+
val: (t) => ((0, i.assert)(typeof t == "bigint" || typeof t == "string" || Number.isSafeInteger(t)), new Cr(g(e.mk_numeral(f, t.toString(), M.sort().ptr))))
|
|
4280
|
+
}, N = {
|
|
4405
4281
|
sort: () => new hr(e.mk_real_sort(f)),
|
|
4406
|
-
const: (t) => new W(g(e.mk_const(f, _(t),
|
|
4407
|
-
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4282
|
+
const: (t) => new W(g(e.mk_const(f, _(t), N.sort().ptr))),
|
|
4283
|
+
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) => N.const(e))),
|
|
4408
4284
|
vector: (e, t) => {
|
|
4409
4285
|
let n = [];
|
|
4410
|
-
for (let r = 0; r < t; r++) n.push(
|
|
4286
|
+
for (let r = 0; r < t; r++) n.push(N.const(`${e}__${r}`));
|
|
4411
4287
|
return n;
|
|
4412
4288
|
},
|
|
4413
|
-
fresh: (t = "b") => new W(e.mk_fresh_const(f, t,
|
|
4414
|
-
val: (t) => (s(t) && (t = `${t.numerator}/${t.denominator}`), new wr(e.mk_numeral(f, t.toString(),
|
|
4415
|
-
},
|
|
4289
|
+
fresh: (t = "b") => new W(e.mk_fresh_const(f, t, N.sort().ptr)),
|
|
4290
|
+
val: (t) => (s(t) && (t = `${t.numerator}/${t.denominator}`), new wr(e.mk_numeral(f, t.toString(), N.sort().ptr)))
|
|
4291
|
+
}, rt = Object.assign((e) => new G(e), {
|
|
4416
4292
|
pi: () => new G(g(e.rcf_mk_pi(f))),
|
|
4417
4293
|
e: () => new G(g(e.rcf_mk_e(f))),
|
|
4418
4294
|
infinitesimal: () => new G(g(e.rcf_mk_infinitesimal(f))),
|
|
@@ -4422,20 +4298,20 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4422
4298
|
for (let e = 0; e < r; e++) o.push(new G(a[e]));
|
|
4423
4299
|
return o;
|
|
4424
4300
|
}
|
|
4425
|
-
}),
|
|
4301
|
+
}), P = {
|
|
4426
4302
|
sort(t) {
|
|
4427
4303
|
return (0, i.assert)(Number.isSafeInteger(t), "number of bits must be an integer"), new Tr(e.mk_bv_sort(f, t));
|
|
4428
4304
|
},
|
|
4429
4305
|
const(t, n) {
|
|
4430
|
-
return new K(g(e.mk_const(f, _(t),
|
|
4306
|
+
return new K(g(e.mk_const(f, _(t), je(n) ? n.ptr : P.sort(n).ptr)));
|
|
4431
4307
|
},
|
|
4432
4308
|
consts(e, t) {
|
|
4433
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4309
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => P.const(e, t));
|
|
4434
4310
|
},
|
|
4435
4311
|
val(t, n) {
|
|
4436
|
-
return t === !0 ?
|
|
4312
|
+
return t === !0 ? P.val(1, n) : t === !1 ? P.val(0, n) : new Er(g(e.mk_numeral(f, t.toString(), je(n) ? n.ptr : P.sort(n).ptr)));
|
|
4437
4313
|
}
|
|
4438
|
-
},
|
|
4314
|
+
}, F = {
|
|
4439
4315
|
sort(t, n) {
|
|
4440
4316
|
return (0, i.assert)(Number.isSafeInteger(t) && t > 0, "ebits must be a positive integer"), (0, i.assert)(Number.isSafeInteger(n) && n > 0, "sbits must be a positive integer"), new kr(e.mk_fpa_sort(f, t, n));
|
|
4441
4317
|
},
|
|
@@ -4455,7 +4331,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4455
4331
|
return new q(g(e.mk_const(f, _(t), n.ptr)));
|
|
4456
4332
|
},
|
|
4457
4333
|
consts(e, t) {
|
|
4458
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4334
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => F.const(e, t));
|
|
4459
4335
|
},
|
|
4460
4336
|
val(t, n) {
|
|
4461
4337
|
return new Ar(g(e.mk_fpa_numeral_double(f, t, n.ptr)));
|
|
@@ -4469,7 +4345,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4469
4345
|
zero(t, n = !1) {
|
|
4470
4346
|
return new Ar(g(e.mk_fpa_zero(f, t.ptr, n)));
|
|
4471
4347
|
}
|
|
4472
|
-
},
|
|
4348
|
+
}, it = {
|
|
4473
4349
|
sort() {
|
|
4474
4350
|
return new Dr(e.mk_fpa_rounding_mode_sort(f));
|
|
4475
4351
|
},
|
|
@@ -4488,46 +4364,46 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4488
4364
|
RTZ() {
|
|
4489
4365
|
return new Or(g(e.mk_fpa_rtz(f)));
|
|
4490
4366
|
}
|
|
4491
|
-
},
|
|
4367
|
+
}, I = {
|
|
4492
4368
|
sort() {
|
|
4493
4369
|
return new jr(e.mk_string_sort(f));
|
|
4494
4370
|
},
|
|
4495
4371
|
const(t) {
|
|
4496
|
-
return new J(g(e.mk_const(f, _(t),
|
|
4372
|
+
return new J(g(e.mk_const(f, _(t), I.sort().ptr)));
|
|
4497
4373
|
},
|
|
4498
4374
|
consts(e) {
|
|
4499
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4375
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => I.const(e));
|
|
4500
4376
|
},
|
|
4501
4377
|
val(t) {
|
|
4502
4378
|
return new J(g(e.mk_string(f, t)));
|
|
4503
4379
|
},
|
|
4504
4380
|
fromCode(t) {
|
|
4505
|
-
let n =
|
|
4381
|
+
let n = E(t) ? t : M.val(t);
|
|
4506
4382
|
return new J(g(e.mk_string_from_code(f, n.ast)));
|
|
4507
4383
|
},
|
|
4508
4384
|
fromInt(t) {
|
|
4509
|
-
let n =
|
|
4385
|
+
let n = E(t) ? t : M.val(t);
|
|
4510
4386
|
return new J(g(e.mk_int_to_str(f, n.ast)));
|
|
4511
4387
|
}
|
|
4512
|
-
},
|
|
4388
|
+
}, at = {
|
|
4513
4389
|
sort(t) {
|
|
4514
4390
|
return new jr(e.mk_seq_sort(f, t.ptr));
|
|
4515
4391
|
},
|
|
4516
4392
|
empty(t) {
|
|
4517
|
-
return new J(g(e.mk_seq_empty(f,
|
|
4393
|
+
return new J(g(e.mk_seq_empty(f, at.sort(t).ptr)));
|
|
4518
4394
|
},
|
|
4519
4395
|
unit(t) {
|
|
4520
4396
|
return new J(g(e.mk_seq_unit(f, t.ast)));
|
|
4521
4397
|
}
|
|
4522
|
-
},
|
|
4398
|
+
}, ot = {
|
|
4523
4399
|
sort(t) {
|
|
4524
4400
|
return new Mr(e.mk_re_sort(f, t.ptr));
|
|
4525
4401
|
},
|
|
4526
4402
|
toRe(t) {
|
|
4527
|
-
let n =
|
|
4403
|
+
let n = O(t) ? t : I.val(t);
|
|
4528
4404
|
return new Y(g(e.mk_seq_to_re(f, n.ast)));
|
|
4529
4405
|
}
|
|
4530
|
-
},
|
|
4406
|
+
}, L = {
|
|
4531
4407
|
sort(...t) {
|
|
4532
4408
|
let n = t.length - 1, r = t[n], i = t[0];
|
|
4533
4409
|
if (n === 1) return new Nr(e.mk_array_sort(f, i.ptr, r.ptr));
|
|
@@ -4535,10 +4411,10 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4535
4411
|
return new Nr(e.mk_array_sort_n(f, a.map((e) => e.ptr), r.ptr));
|
|
4536
4412
|
},
|
|
4537
4413
|
const(t, ...n) {
|
|
4538
|
-
return new Pr(g(e.mk_const(f, _(t),
|
|
4414
|
+
return new Pr(g(e.mk_const(f, _(t), L.sort(...n).ptr)));
|
|
4539
4415
|
},
|
|
4540
4416
|
consts(e, ...t) {
|
|
4541
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4417
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => L.const(e, ...t));
|
|
4542
4418
|
},
|
|
4543
4419
|
K(t, n) {
|
|
4544
4420
|
return new Pr(g(e.mk_const_array(f, t.ptr, n.ptr)));
|
|
@@ -4548,10 +4424,10 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4548
4424
|
}
|
|
4549
4425
|
}, st = {
|
|
4550
4426
|
sort(e) {
|
|
4551
|
-
return
|
|
4427
|
+
return L.sort(e, j.sort());
|
|
4552
4428
|
},
|
|
4553
4429
|
const(t, n) {
|
|
4554
|
-
return new X(g(e.mk_const(f, _(t),
|
|
4430
|
+
return new X(g(e.mk_const(f, _(t), L.sort(n, j.sort()).ptr)));
|
|
4555
4431
|
},
|
|
4556
4432
|
consts(e, t) {
|
|
4557
4433
|
return typeof e == "string" && (e = e.split(" ")), e.map((e) => st.const(e, t));
|
|
@@ -4595,49 +4471,49 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4595
4471
|
return new z(g(e.mk_type_variable(f, e.mk_string_symbol(f, t))));
|
|
4596
4472
|
}
|
|
4597
4473
|
function dt(t, n, r) {
|
|
4598
|
-
return
|
|
4474
|
+
return qe(t) && Je(n) && Je(r) ? Bt(t, n, r) : ((0, i.assert)(!qe(t) && !Je(n) && !Je(r), "Mixed expressions and goals"), typeof t == "boolean" && (t = j.val(t)), n = k(n), r = k(r), x(g(e.mk_ite(f, t.ptr, n.ast, r.ast))));
|
|
4599
4475
|
}
|
|
4600
4476
|
function ft(...t) {
|
|
4601
|
-
return (0, i.assert)(t.length > 0, "Can't make Distinct ouf of nothing"), new H(g(e.mk_distinct(f, t.map((e) => (e =
|
|
4477
|
+
return (0, i.assert)(t.length > 0, "Can't make Distinct ouf of nothing"), new H(g(e.mk_distinct(f, t.map((e) => (e = k(e), p(e), e.ast)))));
|
|
4602
4478
|
}
|
|
4603
4479
|
function pt(t, n) {
|
|
4604
|
-
return p(n),
|
|
4480
|
+
return p(n), x(g(e.mk_const(f, _(t), n.ptr)));
|
|
4605
4481
|
}
|
|
4606
4482
|
function mt(e, t) {
|
|
4607
4483
|
return p(t), typeof e == "string" && (e = e.split(" ")), e.map((e) => pt(e, t));
|
|
4608
4484
|
}
|
|
4609
4485
|
function ht(t, n = "c") {
|
|
4610
|
-
return p(t),
|
|
4486
|
+
return p(t), x(e.mk_fresh_const(t.ctx.ptr, n, t.ptr));
|
|
4611
4487
|
}
|
|
4612
4488
|
function gt(t, n) {
|
|
4613
|
-
return p(n),
|
|
4489
|
+
return p(n), x(e.mk_bound(n.ctx.ptr, t, n.ptr));
|
|
4614
4490
|
}
|
|
4615
4491
|
function _t(t, n) {
|
|
4616
|
-
return t =
|
|
4492
|
+
return t = k(t), n = k(n), p(t, n), new H(g(e.mk_implies(f, t.ptr, n.ptr)));
|
|
4617
4493
|
}
|
|
4618
4494
|
function vt(t, n) {
|
|
4619
|
-
return t =
|
|
4495
|
+
return t = k(t), n = k(n), p(t, n), new H(g(e.mk_iff(f, t.ptr, n.ptr)));
|
|
4620
4496
|
}
|
|
4621
4497
|
function yt(e, t) {
|
|
4622
|
-
return e =
|
|
4498
|
+
return e = k(e), t = k(t), p(e, t), e.eq(t);
|
|
4623
4499
|
}
|
|
4624
4500
|
function bt(t, n) {
|
|
4625
|
-
return t =
|
|
4501
|
+
return t = k(t), n = k(n), p(t, n), new H(g(e.mk_xor(f, t.ptr, n.ptr)));
|
|
4626
4502
|
}
|
|
4627
4503
|
function xt(t) {
|
|
4628
|
-
return typeof t == "boolean" && (t =
|
|
4504
|
+
return typeof t == "boolean" && (t = k(t)), p(t), qe(t) ? new cr(g(e.probe_not(f, t.ptr))) : new H(g(e.mk_not(f, t.ptr)));
|
|
4629
4505
|
}
|
|
4630
4506
|
function St(...t) {
|
|
4631
|
-
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t,
|
|
4507
|
+
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t, pe) ?? !0, "AstVector containing not bools")), (0, i.allSatisfy)(t, qe) ?? !1) return ie(e.probe_and, t);
|
|
4632
4508
|
{
|
|
4633
|
-
let n = t.map(
|
|
4509
|
+
let n = t.map(k);
|
|
4634
4510
|
return p(...n), new H(g(e.mk_and(f, n.map((e) => e.ptr))));
|
|
4635
4511
|
}
|
|
4636
4512
|
}
|
|
4637
4513
|
function Ct(...t) {
|
|
4638
|
-
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t,
|
|
4514
|
+
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t, pe) ?? !0, "AstVector containing not bools")), (0, i.allSatisfy)(t, qe) ?? !1) return ie(e.probe_or, t);
|
|
4639
4515
|
{
|
|
4640
|
-
let n = t.map(
|
|
4516
|
+
let n = t.map(k);
|
|
4641
4517
|
return p(...n), new H(g(e.mk_or(f, n.map((e) => e.ptr))));
|
|
4642
4518
|
}
|
|
4643
4519
|
}
|
|
@@ -4672,25 +4548,25 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4672
4548
|
return new Hr(g(e.mk_lambda_const(f, t.map((e) => e.ptr), n.ptr)));
|
|
4673
4549
|
}
|
|
4674
4550
|
function Mt(t) {
|
|
4675
|
-
return t =
|
|
4551
|
+
return t = k(t), p(t), (0, i.assert)(we(t), "Int expression expected"), new W(g(e.mk_int2real(f, t.ast)));
|
|
4676
4552
|
}
|
|
4677
4553
|
function Nt(t) {
|
|
4678
|
-
return w(t) || (t =
|
|
4554
|
+
return w(t) || (t = N.val(t)), p(t), (0, i.assert)(De(t), "Real expression expected"), new W(g(e.mk_real2int(f, t.ast)));
|
|
4679
4555
|
}
|
|
4680
4556
|
function Pt(t) {
|
|
4681
|
-
return w(t) || (t =
|
|
4557
|
+
return w(t) || (t = N.val(t)), p(t), (0, i.assert)(De(t), "Real expression expected"), new H(g(e.mk_is_int(f, t.ast)));
|
|
4682
4558
|
}
|
|
4683
4559
|
function Ft(e) {
|
|
4684
|
-
return w(e) || (e =
|
|
4560
|
+
return w(e) || (e = N.val(e)), e.pow("1/2");
|
|
4685
4561
|
}
|
|
4686
4562
|
function It(e) {
|
|
4687
|
-
return w(e) || (e =
|
|
4563
|
+
return w(e) || (e = N.val(e)), e.pow("1/3");
|
|
4688
4564
|
}
|
|
4689
4565
|
function Lt(t, n) {
|
|
4690
4566
|
return p(t), new W(g(e.mk_bv2int(f, t.ast, n)));
|
|
4691
4567
|
}
|
|
4692
4568
|
function Rt(t, n) {
|
|
4693
|
-
return
|
|
4569
|
+
return E(t) ? (0, i.assert)(we(t), "parameter must be an integer") : ((0, i.assert)(typeof t != "number" || Number.isSafeInteger(t), "parameter must not have decimal places"), t = M.val(t)), new K(g(e.mk_int2bv(f, n, t.ast)));
|
|
4694
4570
|
}
|
|
4695
4571
|
function zt(...t) {
|
|
4696
4572
|
return p(...t), t.reduce((t, n) => new K(g(e.mk_concat(f, t.ast, n.ast))));
|
|
@@ -4806,19 +4682,19 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4806
4682
|
}
|
|
4807
4683
|
function fn(t, ...n) {
|
|
4808
4684
|
let r = n.map((e, n) => t.domain_n(n).cast(e));
|
|
4809
|
-
if (r.length === 1) return
|
|
4685
|
+
if (r.length === 1) return x(g(e.mk_select(f, t.ast, r[0].ast)));
|
|
4810
4686
|
let i = r.map((e) => e.ast);
|
|
4811
|
-
return
|
|
4687
|
+
return x(g(e.mk_select_n(f, t.ast, i)));
|
|
4812
4688
|
}
|
|
4813
4689
|
function pn(t, ...n) {
|
|
4814
4690
|
let r = n.map((e, r) => r === n.length - 1 ? t.range().cast(e) : t.domain_n(r).cast(e));
|
|
4815
4691
|
if (r.length <= 1) throw Error("Array store requires both index and value arguments");
|
|
4816
|
-
if (r.length === 2) return
|
|
4692
|
+
if (r.length === 2) return x(g(e.mk_store(f, t.ast, r[0].ast, r[1].ast)));
|
|
4817
4693
|
let i = r.slice(0, r.length - 1).map((e) => e.ast);
|
|
4818
|
-
return
|
|
4694
|
+
return x(g(e.mk_store_n(f, t.ast, i, r[r.length - 1].ast)));
|
|
4819
4695
|
}
|
|
4820
4696
|
function mn(t, n) {
|
|
4821
|
-
return
|
|
4697
|
+
return x(g(e.mk_array_ext(f, t.ast, n.ast)));
|
|
4822
4698
|
}
|
|
4823
4699
|
function hn(...t) {
|
|
4824
4700
|
return new X(g(e.mk_set_union(f, t.map((e) => e.ast))));
|
|
@@ -4854,7 +4730,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4854
4730
|
return new H(g(e.mk_set_subset(f, t.ast, n.ast)));
|
|
4855
4731
|
}
|
|
4856
4732
|
function Tn(t, n) {
|
|
4857
|
-
let r =
|
|
4733
|
+
let r = O(t) ? t : I.val(t);
|
|
4858
4734
|
return new H(g(e.mk_seq_in_re(f, r.ast, n.ast)));
|
|
4859
4735
|
}
|
|
4860
4736
|
function En(...t) {
|
|
@@ -4885,7 +4761,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4885
4761
|
return new Y(g(e.mk_re_diff(f, t.ast, n.ast)));
|
|
4886
4762
|
}
|
|
4887
4763
|
function Pn(t, n) {
|
|
4888
|
-
let r =
|
|
4764
|
+
let r = O(t) ? t : I.val(t), i = O(n) ? n : I.val(n);
|
|
4889
4765
|
return new Y(g(e.mk_re_range(f, r.ast, i.ast)));
|
|
4890
4766
|
}
|
|
4891
4767
|
function Fn(t, n, r = 0) {
|
|
@@ -4982,7 +4858,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4982
4858
|
}, this);
|
|
4983
4859
|
}
|
|
4984
4860
|
set(t, n) {
|
|
4985
|
-
e.solver_set_params(f, this.ptr,
|
|
4861
|
+
e.solver_set_params(f, this.ptr, ee(t, n));
|
|
4986
4862
|
}
|
|
4987
4863
|
push() {
|
|
4988
4864
|
e.solver_push(f, this.ptr);
|
|
@@ -4997,12 +4873,12 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
4997
4873
|
e.solver_reset(f, this.ptr);
|
|
4998
4874
|
}
|
|
4999
4875
|
add(...t) {
|
|
5000
|
-
|
|
4876
|
+
ne(t).forEach((t) => {
|
|
5001
4877
|
p(t), g(e.solver_assert(f, this.ptr, t.ast));
|
|
5002
4878
|
});
|
|
5003
4879
|
}
|
|
5004
4880
|
addAndTrack(t, n) {
|
|
5005
|
-
typeof n == "string" && (n =
|
|
4881
|
+
typeof n == "string" && (n = j.const(n)), (0, i.assert)(C(n), "Provided expression that is not a constant to addAndTrack"), g(e.solver_assert_and_track(f, this.ptr, t.ast, n.ast));
|
|
5006
4882
|
}
|
|
5007
4883
|
addSimplifier(t) {
|
|
5008
4884
|
p(t), g(e.solver_add_simplifier(f, this.ptr, t.ptr));
|
|
@@ -5011,7 +4887,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5011
4887
|
return new Q(g(e.solver_get_assertions(f, this.ptr)));
|
|
5012
4888
|
}
|
|
5013
4889
|
async check(...t) {
|
|
5014
|
-
let r =
|
|
4890
|
+
let r = ne(t).map((e) => (p(e), e.ast)), a = await o.runExclusive(() => g(e.solver_check_assumptions(f, this.ptr, r)));
|
|
5015
4891
|
switch (a) {
|
|
5016
4892
|
case n.Z3_lbool.Z3_L_FALSE: return "unsat";
|
|
5017
4893
|
case n.Z3_lbool.Z3_L_TRUE: return "sat";
|
|
@@ -5052,7 +4928,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5052
4928
|
}
|
|
5053
4929
|
proof() {
|
|
5054
4930
|
let t = e.solver_get_proof(f, this.ptr);
|
|
5055
|
-
return h(), t ?
|
|
4931
|
+
return h(), t ? x(t) : null;
|
|
5056
4932
|
}
|
|
5057
4933
|
fromString(t) {
|
|
5058
4934
|
e.solver_from_string(f, this.ptr, t), h();
|
|
@@ -5076,7 +4952,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5076
4952
|
}
|
|
5077
4953
|
async getConsequences(t, r) {
|
|
5078
4954
|
let i = new Q(), a = new Q(), s = new Q();
|
|
5079
|
-
|
|
4955
|
+
ne(t).forEach((t) => {
|
|
5080
4956
|
p(t), e.ast_vector_push(f, i.ptr, t.ast);
|
|
5081
4957
|
}), r.forEach((t) => {
|
|
5082
4958
|
p(t), e.ast_vector_push(f, a.ptr, t.ast);
|
|
@@ -5107,13 +4983,13 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5107
4983
|
p(t), p(n), e.solver_set_initial_value(f, this.ptr, t.ast, n.ast), h();
|
|
5108
4984
|
}
|
|
5109
4985
|
congruenceRoot(t) {
|
|
5110
|
-
return p(t),
|
|
4986
|
+
return p(t), x(g(e.solver_congruence_root(f, this.ptr, t.ast)));
|
|
5111
4987
|
}
|
|
5112
4988
|
congruenceNext(t) {
|
|
5113
|
-
return p(t),
|
|
4989
|
+
return p(t), x(g(e.solver_congruence_next(f, this.ptr, t.ast)));
|
|
5114
4990
|
}
|
|
5115
4991
|
congruenceExplain(t, n) {
|
|
5116
|
-
return p(t), p(n),
|
|
4992
|
+
return p(t), p(n), x(g(e.solver_congruence_explain(f, this.ptr, t.ast, n.ast)));
|
|
5117
4993
|
}
|
|
5118
4994
|
fromFile(t) {
|
|
5119
4995
|
e.solver_from_file(f, this.ptr, t), h();
|
|
@@ -5125,7 +5001,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5125
5001
|
if (!t) throw Error("registerOnClause requires the Emscripten module; pass it to createApi");
|
|
5126
5002
|
this._onClauseCallbackIdx.value !== null && (t.removeFunction(this._onClauseCallbackIdx.value), this._onClauseCallbackIdx.value = null);
|
|
5127
5003
|
let n = t.addFunction((n, r, i, a, o) => {
|
|
5128
|
-
let s = r ?
|
|
5004
|
+
let s = r ? x(r) : null, c = [];
|
|
5129
5005
|
for (let e = 0; e < i; e++) c.push(t.HEAPU32[(a >> 2) + e]);
|
|
5130
5006
|
e(s, c, new Q(o));
|
|
5131
5007
|
}, "viiiii");
|
|
@@ -5142,7 +5018,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5142
5018
|
n = t, this._ptr = n, e.optimize_inc_ref(f, n), c.register(this, () => e.optimize_dec_ref(f, n), this);
|
|
5143
5019
|
}
|
|
5144
5020
|
set(t, n) {
|
|
5145
|
-
e.optimize_set_params(f, this.ptr,
|
|
5021
|
+
e.optimize_set_params(f, this.ptr, ee(t, n));
|
|
5146
5022
|
}
|
|
5147
5023
|
push() {
|
|
5148
5024
|
e.optimize_push(f, this.ptr);
|
|
@@ -5151,7 +5027,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5151
5027
|
e.optimize_pop(f, this.ptr);
|
|
5152
5028
|
}
|
|
5153
5029
|
add(...t) {
|
|
5154
|
-
|
|
5030
|
+
ne(t).forEach((t) => {
|
|
5155
5031
|
p(t), g(e.optimize_assert(f, this.ptr, t.ast));
|
|
5156
5032
|
});
|
|
5157
5033
|
}
|
|
@@ -5159,7 +5035,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5159
5035
|
s(n) && (n = `${n.numerator}/${n.denominator}`), g(e.optimize_assert_soft(f, this.ptr, t.ast, n.toString(), _(r)));
|
|
5160
5036
|
}
|
|
5161
5037
|
addAndTrack(t, n) {
|
|
5162
|
-
typeof n == "string" && (n =
|
|
5038
|
+
typeof n == "string" && (n = j.const(n)), (0, i.assert)(C(n), "Provided expression that is not a constant to addAndTrack"), g(e.optimize_assert_and_track(f, this.ptr, t.ast, n.ast));
|
|
5163
5039
|
}
|
|
5164
5040
|
assertions() {
|
|
5165
5041
|
return new Q(g(e.optimize_get_assertions(f, this.ptr)));
|
|
@@ -5171,10 +5047,10 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5171
5047
|
return g(e.optimize_minimize(f, this.ptr, t.ast));
|
|
5172
5048
|
}
|
|
5173
5049
|
getLower(t) {
|
|
5174
|
-
return
|
|
5050
|
+
return x(g(e.optimize_get_lower(f, this.ptr, t)));
|
|
5175
5051
|
}
|
|
5176
5052
|
getUpper(t) {
|
|
5177
|
-
return
|
|
5053
|
+
return x(g(e.optimize_get_upper(f, this.ptr, t)));
|
|
5178
5054
|
}
|
|
5179
5055
|
getLowerAsVector(t) {
|
|
5180
5056
|
return new Q(g(e.optimize_get_lower_as_vector(f, this.ptr, t)));
|
|
@@ -5199,7 +5075,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5199
5075
|
return new t.Optimize(n);
|
|
5200
5076
|
}
|
|
5201
5077
|
async check(...t) {
|
|
5202
|
-
let r =
|
|
5078
|
+
let r = ne(t).map((e) => (p(e), e.ast)), a = await o.runExclusive(() => g(e.optimize_check(f, this.ptr, r)));
|
|
5203
5079
|
switch (a) {
|
|
5204
5080
|
case n.Z3_lbool.Z3_L_FALSE: return "unsat";
|
|
5205
5081
|
case n.Z3_lbool.Z3_L_TRUE: return "sat";
|
|
@@ -5236,7 +5112,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5236
5112
|
n = t, this._ptr = n, e.fixedpoint_inc_ref(f, n), c.register(this, () => e.fixedpoint_dec_ref(f, n), this);
|
|
5237
5113
|
}
|
|
5238
5114
|
set(t, n) {
|
|
5239
|
-
e.fixedpoint_set_params(f, this.ptr,
|
|
5115
|
+
e.fixedpoint_set_params(f, this.ptr, ee(t, n));
|
|
5240
5116
|
}
|
|
5241
5117
|
help() {
|
|
5242
5118
|
return g(e.fixedpoint_get_help(f, this.ptr));
|
|
@@ -5284,7 +5160,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5284
5160
|
}
|
|
5285
5161
|
getAnswer() {
|
|
5286
5162
|
let t = g(e.fixedpoint_get_answer(f, this.ptr));
|
|
5287
|
-
return t ?
|
|
5163
|
+
return t ? x(t) : null;
|
|
5288
5164
|
}
|
|
5289
5165
|
getReasonUnknown() {
|
|
5290
5166
|
return g(e.fixedpoint_get_reason_unknown(f, this.ptr));
|
|
@@ -5295,7 +5171,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5295
5171
|
getCoverDelta(t, n) {
|
|
5296
5172
|
p(n);
|
|
5297
5173
|
let r = g(e.fixedpoint_get_cover_delta(f, this.ptr, t, n.ptr));
|
|
5298
|
-
return r ?
|
|
5174
|
+
return r ? x(r) : null;
|
|
5299
5175
|
}
|
|
5300
5176
|
addCover(t, n, r) {
|
|
5301
5177
|
p(n), p(r), g(e.fixedpoint_add_cover(f, this.ptr, t, n.ptr, r.ast));
|
|
@@ -5365,7 +5241,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5365
5241
|
p(t);
|
|
5366
5242
|
let i = g(e.model_eval(f, this.ptr, t.ast, n));
|
|
5367
5243
|
if (i === null) throw new r.Z3Error("Failed to evaluate expression in the model");
|
|
5368
|
-
return
|
|
5244
|
+
return x(i);
|
|
5369
5245
|
}
|
|
5370
5246
|
get(t, n) {
|
|
5371
5247
|
if ((0, i.assert)(n === void 0 || typeof t == "number"), typeof t == "number") {
|
|
@@ -5380,15 +5256,15 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5380
5256
|
for (let e = t; e < n; e++) i.push(this.get(e));
|
|
5381
5257
|
return i;
|
|
5382
5258
|
}
|
|
5383
|
-
if (
|
|
5259
|
+
if (ue(t) || w(t) && C(t)) {
|
|
5384
5260
|
let e = this.getInterp(t);
|
|
5385
5261
|
return (0, i.assert)(e !== null), e;
|
|
5386
5262
|
}
|
|
5387
|
-
if (
|
|
5263
|
+
if (le(t)) return this.getUniverse(t);
|
|
5388
5264
|
(0, i.assert)(!1, "Number, declaration or constant expected");
|
|
5389
5265
|
}
|
|
5390
5266
|
updateValue(t, n) {
|
|
5391
|
-
if (p(t), p(n), w(t) && (t = t.decl()),
|
|
5267
|
+
if (p(t), p(n), w(t) && (t = t.decl()), ue(t) && t.arity() !== 0 && de(n)) {
|
|
5392
5268
|
let e = this.addFuncInterp(t, n.elseValue());
|
|
5393
5269
|
for (let t = 0; t < n.numEntries(); t++) {
|
|
5394
5270
|
let r = n.entry(t), i = r.numArgs(), a = globalThis.Array.from({ length: i }, (e, t) => r.argValue(t));
|
|
@@ -5396,8 +5272,8 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5396
5272
|
}
|
|
5397
5273
|
return;
|
|
5398
5274
|
}
|
|
5399
|
-
if (!
|
|
5400
|
-
if (!
|
|
5275
|
+
if (!ue(t) || t.arity() !== 0) throw new r.Z3Error("Expecting 0-ary function or constant expression");
|
|
5276
|
+
if (!ce(n)) throw new r.Z3Error("Only func declarations can be assigned to func interpretations");
|
|
5401
5277
|
g(e.add_const_interp(f, this.ptr, t.ptr, n.ast));
|
|
5402
5278
|
}
|
|
5403
5279
|
addFuncInterp(t, n) {
|
|
@@ -5405,9 +5281,9 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5405
5281
|
return new ar(r);
|
|
5406
5282
|
}
|
|
5407
5283
|
getInterp(t) {
|
|
5408
|
-
if ((0, i.assert)(
|
|
5284
|
+
if ((0, i.assert)(ue(t) || C(t), "Declaration expected"), C(t) && ((0, i.assert)(w(t)), t = t.decl()), (0, i.assert)(ue(t)), t.arity() === 0) {
|
|
5409
5285
|
let n = g(e.model_get_const_interp(f, this.ptr, t.ptr));
|
|
5410
|
-
return n === null ? null :
|
|
5286
|
+
return n === null ? null : x(n);
|
|
5411
5287
|
}
|
|
5412
5288
|
{
|
|
5413
5289
|
let n = g(e.model_get_func_interp(f, this.ptr, t.ptr));
|
|
@@ -5421,7 +5297,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5421
5297
|
return g(e.model_get_num_sorts(f, this.ptr));
|
|
5422
5298
|
}
|
|
5423
5299
|
getSort(t) {
|
|
5424
|
-
return
|
|
5300
|
+
return b(g(e.model_get_sort(f, this.ptr, t)));
|
|
5425
5301
|
}
|
|
5426
5302
|
getSorts() {
|
|
5427
5303
|
let e = this.numSorts(), t = [];
|
|
@@ -5488,10 +5364,10 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5488
5364
|
return g(e.func_entry_get_num_args(f, this.ptr));
|
|
5489
5365
|
}
|
|
5490
5366
|
argValue(t) {
|
|
5491
|
-
return
|
|
5367
|
+
return x(g(e.func_entry_get_arg(f, this.ptr, t)));
|
|
5492
5368
|
}
|
|
5493
5369
|
value() {
|
|
5494
|
-
return
|
|
5370
|
+
return x(g(e.func_entry_get_value(f, this.ptr)));
|
|
5495
5371
|
}
|
|
5496
5372
|
}
|
|
5497
5373
|
class ar {
|
|
@@ -5499,7 +5375,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5499
5375
|
this.ptr = t, this.ctx = $, e.func_interp_inc_ref(f, t), c.register(this, () => e.func_interp_dec_ref(f, t), this);
|
|
5500
5376
|
}
|
|
5501
5377
|
elseValue() {
|
|
5502
|
-
return
|
|
5378
|
+
return x(g(e.func_interp_get_else(f, this.ptr)));
|
|
5503
5379
|
}
|
|
5504
5380
|
numEntries() {
|
|
5505
5381
|
return g(e.func_interp_get_num_entries(f, this.ptr));
|
|
@@ -5530,7 +5406,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5530
5406
|
return p(e), (0, i.assert)(e.sort.eqIdentity(e.sort), "Sort mismatch"), e;
|
|
5531
5407
|
}
|
|
5532
5408
|
name() {
|
|
5533
|
-
return
|
|
5409
|
+
return y(e.get_sort_name(f, this.ptr));
|
|
5534
5410
|
}
|
|
5535
5411
|
eqIdentity(t) {
|
|
5536
5412
|
return p(t), g(e.is_eq_sort(f, this.ptr, t.ptr));
|
|
@@ -5544,16 +5420,16 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5544
5420
|
return e.func_decl_to_ast(f, this.ptr);
|
|
5545
5421
|
}
|
|
5546
5422
|
name() {
|
|
5547
|
-
return
|
|
5423
|
+
return y(e.get_decl_name(f, this.ptr));
|
|
5548
5424
|
}
|
|
5549
5425
|
arity() {
|
|
5550
5426
|
return e.get_arity(f, this.ptr);
|
|
5551
5427
|
}
|
|
5552
5428
|
domain(t) {
|
|
5553
|
-
return (0, i.assert)(t < this.arity(), "Index out of bounds"),
|
|
5429
|
+
return (0, i.assert)(t < this.arity(), "Index out of bounds"), b(e.get_domain(f, this.ptr, t));
|
|
5554
5430
|
}
|
|
5555
5431
|
range() {
|
|
5556
|
-
return
|
|
5432
|
+
return b(e.get_range(f, this.ptr));
|
|
5557
5433
|
}
|
|
5558
5434
|
kind() {
|
|
5559
5435
|
return e.get_decl_kind(f, this.ptr);
|
|
@@ -5573,7 +5449,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5573
5449
|
r.push(g(e.get_decl_rational_parameter(f, this.ptr, a)));
|
|
5574
5450
|
break;
|
|
5575
5451
|
case n.Z3_parameter_kind.Z3_PARAMETER_SYMBOL:
|
|
5576
|
-
r.push(
|
|
5452
|
+
r.push(y(g(e.get_decl_symbol_parameter(f, this.ptr, a))));
|
|
5577
5453
|
break;
|
|
5578
5454
|
case n.Z3_parameter_kind.Z3_PARAMETER_SORT:
|
|
5579
5455
|
r.push(new z(g(e.get_decl_sort_parameter(f, this.ptr, a))));
|
|
@@ -5592,18 +5468,18 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5592
5468
|
return r;
|
|
5593
5469
|
}
|
|
5594
5470
|
call(...t) {
|
|
5595
|
-
return (0, i.assert)(t.length === this.arity(), `Incorrect number of arguments to ${this}`),
|
|
5471
|
+
return (0, i.assert)(t.length === this.arity(), `Incorrect number of arguments to ${this}`), x(g(e.mk_app(f, this.ptr, t.map((e, t) => this.domain(t).cast(e).ast))));
|
|
5596
5472
|
}
|
|
5597
5473
|
}
|
|
5598
5474
|
class V extends Qn {
|
|
5599
5475
|
get sort() {
|
|
5600
|
-
return
|
|
5476
|
+
return b(e.get_sort(f, this.ast));
|
|
5601
5477
|
}
|
|
5602
5478
|
eq(t) {
|
|
5603
|
-
return new H(g(e.mk_eq(f, this.ast,
|
|
5479
|
+
return new H(g(e.mk_eq(f, this.ast, k(t).ast)));
|
|
5604
5480
|
}
|
|
5605
5481
|
neq(t) {
|
|
5606
|
-
return new H(g(e.mk_distinct(f, [this, t].map((e) =>
|
|
5482
|
+
return new H(g(e.mk_distinct(f, [this, t].map((e) => k(e).ast))));
|
|
5607
5483
|
}
|
|
5608
5484
|
name() {
|
|
5609
5485
|
return this.decl().name();
|
|
@@ -5618,7 +5494,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5618
5494
|
return (0, i.assert)(S(this), "Z3 applicaiton expected"), g(e.get_app_num_args(f, g(e.to_app(f, this.ast))));
|
|
5619
5495
|
}
|
|
5620
5496
|
arg(t) {
|
|
5621
|
-
return (0, i.assert)(S(this), "Z3 applicaiton expected"), (0, i.assert)(t < this.numArgs(), `Invalid argument index - expected ${t} to be less than ${this.numArgs()}`),
|
|
5497
|
+
return (0, i.assert)(S(this), "Z3 applicaiton expected"), (0, i.assert)(t < this.numArgs(), `Invalid argument index - expected ${t} to be less than ${this.numArgs()}`), x(g(e.get_app_arg(f, g(e.to_app(f, this.ast)), t)));
|
|
5622
5498
|
}
|
|
5623
5499
|
children() {
|
|
5624
5500
|
let e = this.numArgs();
|
|
@@ -5637,7 +5513,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5637
5513
|
}
|
|
5638
5514
|
class sr extends z {
|
|
5639
5515
|
cast(e) {
|
|
5640
|
-
return typeof e == "boolean" && (e =
|
|
5516
|
+
return typeof e == "boolean" && (e = j.val(e)), (0, i.assert)(w(e), "true, false or Z3 Boolean expression expected."), (0, i.assert)(this.eqIdentity(e.sort), "Value cannot be converted into a Z3 Boolean value"), e;
|
|
5641
5517
|
}
|
|
5642
5518
|
subsort(e) {
|
|
5643
5519
|
return p(e.ctx), e instanceof hr;
|
|
@@ -5683,7 +5559,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5683
5559
|
}
|
|
5684
5560
|
add(...t) {
|
|
5685
5561
|
for (let n of t) {
|
|
5686
|
-
let t =
|
|
5562
|
+
let t = pe(n) ? n : j.val(n);
|
|
5687
5563
|
p(t), e.goal_assert(f, this.ptr, t.ast);
|
|
5688
5564
|
}
|
|
5689
5565
|
}
|
|
@@ -5723,7 +5599,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5723
5599
|
}
|
|
5724
5600
|
asExpr() {
|
|
5725
5601
|
let e = this.size();
|
|
5726
|
-
if (e === 0) return
|
|
5602
|
+
if (e === 0) return j.val(!0);
|
|
5727
5603
|
if (e === 1) return this.get(0);
|
|
5728
5604
|
{
|
|
5729
5605
|
let t = [];
|
|
@@ -5769,7 +5645,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5769
5645
|
}
|
|
5770
5646
|
async apply(t) {
|
|
5771
5647
|
let n;
|
|
5772
|
-
|
|
5648
|
+
pe(t) ? (n = new lr(), n.add(t)) : n = t, p(n);
|
|
5773
5649
|
let r = await e.tactic_apply(f, this.ptr, n.ptr), i = new ur(g(r));
|
|
5774
5650
|
return new Proxy(i, dr);
|
|
5775
5651
|
}
|
|
@@ -5813,7 +5689,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5813
5689
|
return e.param_descrs_size(f, this.ptr);
|
|
5814
5690
|
}
|
|
5815
5691
|
getName(t) {
|
|
5816
|
-
let n =
|
|
5692
|
+
let n = y(e.param_descrs_get_name(f, this.ptr, t));
|
|
5817
5693
|
return typeof n == "string" ? n : `${n}`;
|
|
5818
5694
|
}
|
|
5819
5695
|
getKind(t) {
|
|
@@ -5852,17 +5728,17 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5852
5728
|
}
|
|
5853
5729
|
class hr extends z {
|
|
5854
5730
|
cast(e) {
|
|
5855
|
-
let t =
|
|
5731
|
+
let t = Ee(this) ? "IntSort" : "RealSort";
|
|
5856
5732
|
if (w(e)) {
|
|
5857
5733
|
let n = e.sort;
|
|
5858
|
-
if (
|
|
5734
|
+
if (E(e)) {
|
|
5859
5735
|
if (this.eqIdentity(n)) return e;
|
|
5860
|
-
if (
|
|
5736
|
+
if (Ee(n) && ke(this)) return Mt(e);
|
|
5861
5737
|
(0, i.assert)(!1, "Can't cast Real to IntSort without loss");
|
|
5862
|
-
} else if (
|
|
5738
|
+
} else if (pe(e)) return Ee(this) ? dt(e, 1, 0) : Mt(dt(e, 1, 0));
|
|
5863
5739
|
(0, i.assert)(!1, `Can't cast expression to ${t}`);
|
|
5864
5740
|
} else {
|
|
5865
|
-
if (typeof e != "boolean") return
|
|
5741
|
+
if (typeof e != "boolean") return Ee(this) ? ((0, i.assert)(!s(e), "Can't cast fraction to IntSort"), M.val(e)) : N.val(e);
|
|
5866
5742
|
(0, i.assert)(!1, `Can't cast primitive to ${t}`);
|
|
5867
5743
|
}
|
|
5868
5744
|
}
|
|
@@ -5963,7 +5839,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
5963
5839
|
let { numerator: e, denominator: t } = this.value(), n = e / t;
|
|
5964
5840
|
return Number(n) + Number(e - n * t) / Number(t);
|
|
5965
5841
|
}
|
|
5966
|
-
asDecimal(t = Number.parseInt(
|
|
5842
|
+
asDecimal(t = Number.parseInt(v("precision") ?? a.toString())) {
|
|
5967
5843
|
return e.get_numeral_decimal_string(f, this.ast, t);
|
|
5968
5844
|
}
|
|
5969
5845
|
asString() {
|
|
@@ -6039,10 +5915,10 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6039
5915
|
return e.get_bv_sort_size(f, this.ptr);
|
|
6040
5916
|
}
|
|
6041
5917
|
subsort(e) {
|
|
6042
|
-
return
|
|
5918
|
+
return je(e) && this.size() < e.size();
|
|
6043
5919
|
}
|
|
6044
5920
|
cast(e) {
|
|
6045
|
-
return w(e) ? (p(e), e) : ((0, i.assert)(!s(e), "Can't convert rational to BitVec"),
|
|
5921
|
+
return w(e) ? (p(e), e) : ((0, i.assert)(!s(e), "Can't convert rational to BitVec"), P.val(e, this.size()));
|
|
6046
5922
|
}
|
|
6047
5923
|
}
|
|
6048
5924
|
class K extends V {
|
|
@@ -6193,7 +6069,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6193
6069
|
}
|
|
6194
6070
|
class Dr extends z {
|
|
6195
6071
|
cast(e) {
|
|
6196
|
-
if (
|
|
6072
|
+
if (Re(e)) return p(e), e;
|
|
6197
6073
|
throw Error("Can't cast to FPRMSort");
|
|
6198
6074
|
}
|
|
6199
6075
|
}
|
|
@@ -6207,25 +6083,25 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6207
6083
|
}
|
|
6208
6084
|
cast(e) {
|
|
6209
6085
|
if (w(e)) return p(e), e;
|
|
6210
|
-
if (typeof e == "number") return
|
|
6086
|
+
if (typeof e == "number") return F.val(e, this);
|
|
6211
6087
|
throw Error("Can't cast to FPSort");
|
|
6212
6088
|
}
|
|
6213
6089
|
}
|
|
6214
6090
|
class q extends V {
|
|
6215
6091
|
add(t, n) {
|
|
6216
|
-
let r =
|
|
6092
|
+
let r = D(n) ? n : F.val(n, this.sort);
|
|
6217
6093
|
return new q(g(e.mk_fpa_add(f, t.ast, this.ast, r.ast)));
|
|
6218
6094
|
}
|
|
6219
6095
|
sub(t, n) {
|
|
6220
|
-
let r =
|
|
6096
|
+
let r = D(n) ? n : F.val(n, this.sort);
|
|
6221
6097
|
return new q(g(e.mk_fpa_sub(f, t.ast, this.ast, r.ast)));
|
|
6222
6098
|
}
|
|
6223
6099
|
mul(t, n) {
|
|
6224
|
-
let r =
|
|
6100
|
+
let r = D(n) ? n : F.val(n, this.sort);
|
|
6225
6101
|
return new q(g(e.mk_fpa_mul(f, t.ast, this.ast, r.ast)));
|
|
6226
6102
|
}
|
|
6227
6103
|
div(t, n) {
|
|
6228
|
-
let r =
|
|
6104
|
+
let r = D(n) ? n : F.val(n, this.sort);
|
|
6229
6105
|
return new q(g(e.mk_fpa_div(f, t.ast, this.ast, r.ast)));
|
|
6230
6106
|
}
|
|
6231
6107
|
neg() {
|
|
@@ -6238,27 +6114,27 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6238
6114
|
return new q(g(e.mk_fpa_sqrt(f, t.ast, this.ast)));
|
|
6239
6115
|
}
|
|
6240
6116
|
rem(t) {
|
|
6241
|
-
let n =
|
|
6117
|
+
let n = D(t) ? t : F.val(t, this.sort);
|
|
6242
6118
|
return new q(g(e.mk_fpa_rem(f, this.ast, n.ast)));
|
|
6243
6119
|
}
|
|
6244
6120
|
fma(t, n, r) {
|
|
6245
|
-
let i =
|
|
6121
|
+
let i = D(n) ? n : F.val(n, this.sort), a = D(r) ? r : F.val(r, this.sort);
|
|
6246
6122
|
return new q(g(e.mk_fpa_fma(f, t.ast, this.ast, i.ast, a.ast)));
|
|
6247
6123
|
}
|
|
6248
6124
|
lt(t) {
|
|
6249
|
-
let n =
|
|
6125
|
+
let n = D(t) ? t : F.val(t, this.sort);
|
|
6250
6126
|
return new H(g(e.mk_fpa_lt(f, this.ast, n.ast)));
|
|
6251
6127
|
}
|
|
6252
6128
|
gt(t) {
|
|
6253
|
-
let n =
|
|
6129
|
+
let n = D(t) ? t : F.val(t, this.sort);
|
|
6254
6130
|
return new H(g(e.mk_fpa_gt(f, this.ast, n.ast)));
|
|
6255
6131
|
}
|
|
6256
6132
|
le(t) {
|
|
6257
|
-
let n =
|
|
6133
|
+
let n = D(t) ? t : F.val(t, this.sort);
|
|
6258
6134
|
return new H(g(e.mk_fpa_leq(f, this.ast, n.ast)));
|
|
6259
6135
|
}
|
|
6260
6136
|
ge(t) {
|
|
6261
|
-
let n =
|
|
6137
|
+
let n = D(t) ? t : F.val(t, this.sort);
|
|
6262
6138
|
return new H(g(e.mk_fpa_geq(f, this.ast, n.ast)));
|
|
6263
6139
|
}
|
|
6264
6140
|
isNaN() {
|
|
@@ -6299,11 +6175,11 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6299
6175
|
return e.is_string_sort(f, this.ptr);
|
|
6300
6176
|
}
|
|
6301
6177
|
basis() {
|
|
6302
|
-
return
|
|
6178
|
+
return b(g(e.get_seq_sort_basis(f, this.ptr)));
|
|
6303
6179
|
}
|
|
6304
6180
|
cast(e) {
|
|
6305
|
-
if (
|
|
6306
|
-
if (typeof e == "string") return
|
|
6181
|
+
if (O(e)) return p(e), e;
|
|
6182
|
+
if (typeof e == "string") return I.val(e);
|
|
6307
6183
|
throw Error("Can't cast to SeqSort");
|
|
6308
6184
|
}
|
|
6309
6185
|
}
|
|
@@ -6316,58 +6192,58 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6316
6192
|
return e.get_string(f, this.ast);
|
|
6317
6193
|
}
|
|
6318
6194
|
concat(t) {
|
|
6319
|
-
let n =
|
|
6195
|
+
let n = O(t) ? t : I.val(t);
|
|
6320
6196
|
return new J(g(e.mk_seq_concat(f, [this.ast, n.ast])));
|
|
6321
6197
|
}
|
|
6322
6198
|
length() {
|
|
6323
6199
|
return new W(g(e.mk_seq_length(f, this.ast)));
|
|
6324
6200
|
}
|
|
6325
6201
|
at(t) {
|
|
6326
|
-
let n =
|
|
6202
|
+
let n = E(t) ? t : M.val(t);
|
|
6327
6203
|
return new J(g(e.mk_seq_at(f, this.ast, n.ast)));
|
|
6328
6204
|
}
|
|
6329
6205
|
nth(t) {
|
|
6330
|
-
let n =
|
|
6331
|
-
return
|
|
6206
|
+
let n = E(t) ? t : M.val(t);
|
|
6207
|
+
return x(g(e.mk_seq_nth(f, this.ast, n.ast)));
|
|
6332
6208
|
}
|
|
6333
6209
|
extract(t, n) {
|
|
6334
|
-
let r =
|
|
6210
|
+
let r = E(t) ? t : M.val(t), i = E(n) ? n : M.val(n);
|
|
6335
6211
|
return new J(g(e.mk_seq_extract(f, this.ast, r.ast, i.ast)));
|
|
6336
6212
|
}
|
|
6337
6213
|
indexOf(t, n) {
|
|
6338
|
-
let r =
|
|
6214
|
+
let r = O(t) ? t : I.val(t), i = n === void 0 ? M.val(0) : E(n) ? n : M.val(n);
|
|
6339
6215
|
return new W(g(e.mk_seq_index(f, this.ast, r.ast, i.ast)));
|
|
6340
6216
|
}
|
|
6341
6217
|
lastIndexOf(t) {
|
|
6342
|
-
let n =
|
|
6218
|
+
let n = O(t) ? t : I.val(t);
|
|
6343
6219
|
return new W(g(e.mk_seq_last_index(f, this.ast, n.ast)));
|
|
6344
6220
|
}
|
|
6345
6221
|
contains(t) {
|
|
6346
|
-
let n =
|
|
6222
|
+
let n = O(t) ? t : I.val(t);
|
|
6347
6223
|
return new H(g(e.mk_seq_contains(f, this.ast, n.ast)));
|
|
6348
6224
|
}
|
|
6349
6225
|
prefixOf(t) {
|
|
6350
|
-
let n =
|
|
6226
|
+
let n = O(t) ? t : I.val(t);
|
|
6351
6227
|
return new H(g(e.mk_seq_prefix(f, this.ast, n.ast)));
|
|
6352
6228
|
}
|
|
6353
6229
|
suffixOf(t) {
|
|
6354
|
-
let n =
|
|
6230
|
+
let n = O(t) ? t : I.val(t);
|
|
6355
6231
|
return new H(g(e.mk_seq_suffix(f, this.ast, n.ast)));
|
|
6356
6232
|
}
|
|
6357
6233
|
replace(t, n) {
|
|
6358
|
-
let r =
|
|
6234
|
+
let r = O(t) ? t : I.val(t), i = O(n) ? n : I.val(n);
|
|
6359
6235
|
return new J(g(e.mk_seq_replace(f, this.ast, r.ast, i.ast)));
|
|
6360
6236
|
}
|
|
6361
6237
|
replaceAll(t, n) {
|
|
6362
|
-
let r =
|
|
6238
|
+
let r = O(t) ? t : I.val(t), i = O(n) ? n : I.val(n);
|
|
6363
6239
|
return new J(g(e.mk_seq_replace_all(f, this.ast, r.ast, i.ast)));
|
|
6364
6240
|
}
|
|
6365
6241
|
replaceRe(t, n) {
|
|
6366
|
-
let r =
|
|
6242
|
+
let r = O(n) ? n : I.val(n);
|
|
6367
6243
|
return new J(g(e.mk_seq_replace_re(f, this.ast, t.ast, r.ast)));
|
|
6368
6244
|
}
|
|
6369
6245
|
replaceReAll(t, n) {
|
|
6370
|
-
let r =
|
|
6246
|
+
let r = O(n) ? n : I.val(n);
|
|
6371
6247
|
return new J(g(e.mk_seq_replace_re_all(f, this.ast, t.ast, r.ast)));
|
|
6372
6248
|
}
|
|
6373
6249
|
toInt() {
|
|
@@ -6377,34 +6253,34 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6377
6253
|
return new W(g(e.mk_string_to_code(f, this.ast)));
|
|
6378
6254
|
}
|
|
6379
6255
|
lt(t) {
|
|
6380
|
-
let n =
|
|
6256
|
+
let n = O(t) ? t : I.val(t);
|
|
6381
6257
|
return new H(g(e.mk_str_lt(f, this.ast, n.ast)));
|
|
6382
6258
|
}
|
|
6383
6259
|
le(t) {
|
|
6384
|
-
let n =
|
|
6260
|
+
let n = O(t) ? t : I.val(t);
|
|
6385
6261
|
return new H(g(e.mk_str_le(f, this.ast, n.ast)));
|
|
6386
6262
|
}
|
|
6387
6263
|
map(t) {
|
|
6388
6264
|
return new J(g(e.mk_seq_map(f, t.ast, this.ast)));
|
|
6389
6265
|
}
|
|
6390
6266
|
mapi(t, n) {
|
|
6391
|
-
let r =
|
|
6267
|
+
let r = E(n) ? n : M.val(n);
|
|
6392
6268
|
return new J(g(e.mk_seq_mapi(f, t.ast, r.ast, this.ast)));
|
|
6393
6269
|
}
|
|
6394
6270
|
foldl(t, n) {
|
|
6395
|
-
return
|
|
6271
|
+
return x(g(e.mk_seq_foldl(f, t.ast, n.ast, this.ast)));
|
|
6396
6272
|
}
|
|
6397
6273
|
foldli(t, n, r) {
|
|
6398
|
-
let i =
|
|
6399
|
-
return
|
|
6274
|
+
let i = E(n) ? n : M.val(n);
|
|
6275
|
+
return x(g(e.mk_seq_foldli(f, t.ast, i.ast, r.ast, this.ast)));
|
|
6400
6276
|
}
|
|
6401
6277
|
}
|
|
6402
6278
|
class Mr extends z {
|
|
6403
6279
|
basis() {
|
|
6404
|
-
return
|
|
6280
|
+
return b(g(e.get_re_sort_basis(f, this.ptr)));
|
|
6405
6281
|
}
|
|
6406
6282
|
cast(e) {
|
|
6407
|
-
if (
|
|
6283
|
+
if (He(e)) return p(e), e;
|
|
6408
6284
|
throw Error("Can't cast to ReSort");
|
|
6409
6285
|
}
|
|
6410
6286
|
}
|
|
@@ -6442,13 +6318,13 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6442
6318
|
}
|
|
6443
6319
|
class Nr extends z {
|
|
6444
6320
|
domain() {
|
|
6445
|
-
return
|
|
6321
|
+
return b(g(e.get_array_sort_domain(f, this.ptr)));
|
|
6446
6322
|
}
|
|
6447
6323
|
domain_n(t) {
|
|
6448
|
-
return
|
|
6324
|
+
return b(g(e.get_array_sort_domain_n(f, this.ptr, t)));
|
|
6449
6325
|
}
|
|
6450
6326
|
range() {
|
|
6451
|
-
return
|
|
6327
|
+
return b(g(e.get_array_sort_range(f, this.ptr)));
|
|
6452
6328
|
}
|
|
6453
6329
|
}
|
|
6454
6330
|
class Pr extends V {
|
|
@@ -6468,7 +6344,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6468
6344
|
return pn(this, ...e);
|
|
6469
6345
|
}
|
|
6470
6346
|
default() {
|
|
6471
|
-
return
|
|
6347
|
+
return x(g(e.mk_array_default(f, this.ast)));
|
|
6472
6348
|
}
|
|
6473
6349
|
}
|
|
6474
6350
|
class X extends V {
|
|
@@ -6502,7 +6378,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6502
6378
|
}
|
|
6503
6379
|
class Fr extends z {
|
|
6504
6380
|
elemSort() {
|
|
6505
|
-
return
|
|
6381
|
+
return b(g(e.get_finite_set_sort_basis(f, this.ptr)));
|
|
6506
6382
|
}
|
|
6507
6383
|
cast(e) {
|
|
6508
6384
|
return p(e), e;
|
|
@@ -6662,19 +6538,19 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6662
6538
|
return e.get_quantifier_num_no_patterns(f, this.ast);
|
|
6663
6539
|
}
|
|
6664
6540
|
no_pattern(t) {
|
|
6665
|
-
return
|
|
6541
|
+
return x(g(e.get_quantifier_no_pattern_ast(f, this.ast, t)));
|
|
6666
6542
|
}
|
|
6667
6543
|
body() {
|
|
6668
|
-
return
|
|
6544
|
+
return x(g(e.get_quantifier_body(f, this.ast)));
|
|
6669
6545
|
}
|
|
6670
6546
|
num_vars() {
|
|
6671
6547
|
return e.get_quantifier_num_bound(f, this.ast);
|
|
6672
6548
|
}
|
|
6673
6549
|
var_name(t) {
|
|
6674
|
-
return
|
|
6550
|
+
return y(e.get_quantifier_bound_name(f, this.ast, t));
|
|
6675
6551
|
}
|
|
6676
6552
|
var_sort(t) {
|
|
6677
|
-
return
|
|
6553
|
+
return b(g(e.get_quantifier_bound_sort(f, this.ast, t)));
|
|
6678
6554
|
}
|
|
6679
6555
|
children() {
|
|
6680
6556
|
return [this.body()];
|
|
@@ -6717,7 +6593,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6717
6593
|
return pn(this, ...e);
|
|
6718
6594
|
}
|
|
6719
6595
|
default() {
|
|
6720
|
-
return
|
|
6596
|
+
return x(g(e.mk_array_default(f, this.ast)));
|
|
6721
6597
|
}
|
|
6722
6598
|
}
|
|
6723
6599
|
class Q {
|
|
@@ -6743,10 +6619,10 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6743
6619
|
get(t, n) {
|
|
6744
6620
|
let r = this.length();
|
|
6745
6621
|
if (t < 0 && (t += r), t >= r) throw RangeError(`expected from index ${t} to be less than length ${r}`);
|
|
6746
|
-
if (n === void 0) return
|
|
6622
|
+
if (n === void 0) return te(g(e.ast_vector_get(f, this.ptr, t)));
|
|
6747
6623
|
if (n < 0 && (n += r), n >= r) throw RangeError(`expected to index ${n} to be less than length ${r}`);
|
|
6748
6624
|
let i = [];
|
|
6749
|
-
for (let r = t; r < n; r++) i.push(
|
|
6625
|
+
for (let r = t; r < n; r++) i.push(te(g(e.ast_vector_get(f, this.ptr, r))));
|
|
6750
6626
|
return i;
|
|
6751
6627
|
}
|
|
6752
6628
|
set(t, n) {
|
|
@@ -6788,7 +6664,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6788
6664
|
for (let [e, t] of this.entries()) yield t;
|
|
6789
6665
|
}
|
|
6790
6666
|
get(t) {
|
|
6791
|
-
return
|
|
6667
|
+
return te(g(e.ast_map_find(f, this.ptr, t.ast)));
|
|
6792
6668
|
}
|
|
6793
6669
|
set(t, n) {
|
|
6794
6670
|
g(e.ast_map_insert(f, this.ptr, t.ast, n.ast));
|
|
@@ -6810,22 +6686,22 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6810
6686
|
p(t);
|
|
6811
6687
|
let r = [], i = [];
|
|
6812
6688
|
for (let [e, t] of n) p(e), p(t), r.push(e.ast), i.push(t.ast);
|
|
6813
|
-
return
|
|
6689
|
+
return x(g(e.substitute(f, t.ast, r, i)));
|
|
6814
6690
|
}
|
|
6815
6691
|
function Gr(t, ...n) {
|
|
6816
6692
|
p(t);
|
|
6817
6693
|
let r = [];
|
|
6818
6694
|
for (let e of n) p(e), r.push(e.ast);
|
|
6819
|
-
return
|
|
6695
|
+
return x(g(e.substitute_vars(f, t.ast, r)));
|
|
6820
6696
|
}
|
|
6821
6697
|
function Kr(t, ...n) {
|
|
6822
6698
|
p(t);
|
|
6823
6699
|
let r = [], i = [];
|
|
6824
6700
|
for (let [e, t] of n) p(e), p(t), r.push(e.ptr), i.push(t.ast);
|
|
6825
|
-
return
|
|
6701
|
+
return x(g(e.substitute_funs(f, t.ast, r, i)));
|
|
6826
6702
|
}
|
|
6827
6703
|
function qr(t, n, r) {
|
|
6828
|
-
return p(t), p(n), p(r),
|
|
6704
|
+
return p(t), p(n), p(r), x(g(e.datatype_update_field(f, n.ptr, t.ast, r.ast)));
|
|
6829
6705
|
}
|
|
6830
6706
|
function Jr(t) {
|
|
6831
6707
|
let n = new Q(g(e.parse_smtlib2_string(f, t, [], [], [], [])));
|
|
@@ -6845,76 +6721,76 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6845
6721
|
Simplifier: mr,
|
|
6846
6722
|
AstVector: Q,
|
|
6847
6723
|
AstMap: Ur,
|
|
6848
|
-
interrupt:
|
|
6849
|
-
setPrintMode:
|
|
6850
|
-
isModel:
|
|
6851
|
-
isAst:
|
|
6852
|
-
isSort:
|
|
6853
|
-
isFuncDecl:
|
|
6724
|
+
interrupt: ae,
|
|
6725
|
+
setPrintMode: oe,
|
|
6726
|
+
isModel: se,
|
|
6727
|
+
isAst: ce,
|
|
6728
|
+
isSort: le,
|
|
6729
|
+
isFuncDecl: ue,
|
|
6854
6730
|
isFuncInterp: de,
|
|
6855
6731
|
isApp: S,
|
|
6856
6732
|
isConst: C,
|
|
6857
6733
|
isExpr: w,
|
|
6858
6734
|
isVar: fe,
|
|
6859
6735
|
isAppOf: T,
|
|
6860
|
-
isBool:
|
|
6861
|
-
isTrue:
|
|
6862
|
-
isFalse:
|
|
6863
|
-
isAnd:
|
|
6864
|
-
isOr:
|
|
6865
|
-
isImplies:
|
|
6866
|
-
isNot:
|
|
6867
|
-
isEq:
|
|
6868
|
-
isDistinct:
|
|
6869
|
-
isQuantifier:
|
|
6870
|
-
isArith:
|
|
6871
|
-
isArithSort:
|
|
6872
|
-
isInt:
|
|
6873
|
-
isIntVal:
|
|
6874
|
-
isIntSort:
|
|
6875
|
-
isReal:
|
|
6876
|
-
isRealVal:
|
|
6877
|
-
isRealSort:
|
|
6878
|
-
isRCFNum:
|
|
6879
|
-
isBitVecSort:
|
|
6880
|
-
isBitVec:
|
|
6881
|
-
isBitVecVal:
|
|
6882
|
-
isFPRMSort:
|
|
6883
|
-
isFPRM:
|
|
6884
|
-
isFPSort:
|
|
6885
|
-
isFP:
|
|
6886
|
-
isFPVal:
|
|
6887
|
-
isSeqSort:
|
|
6888
|
-
isSeq:
|
|
6889
|
-
isStringSort:
|
|
6890
|
-
isString:
|
|
6891
|
-
isFiniteSetSort:
|
|
6892
|
-
isFiniteSet:
|
|
6893
|
-
isArraySort:
|
|
6894
|
-
isArray:
|
|
6895
|
-
isConstArray:
|
|
6896
|
-
isProbe:
|
|
6897
|
-
isTactic:
|
|
6898
|
-
isGoal:
|
|
6899
|
-
isAstVector:
|
|
6900
|
-
eqIdentity:
|
|
6901
|
-
getVarIndex:
|
|
6902
|
-
from:
|
|
6903
|
-
solve:
|
|
6904
|
-
Sort:
|
|
6905
|
-
Function:
|
|
6906
|
-
RecFunc:
|
|
6907
|
-
Bool:
|
|
6908
|
-
Int:
|
|
6909
|
-
Real:
|
|
6910
|
-
RCFNum:
|
|
6911
|
-
BitVec:
|
|
6912
|
-
Float:
|
|
6913
|
-
FloatRM:
|
|
6914
|
-
String:
|
|
6915
|
-
Seq:
|
|
6916
|
-
Re:
|
|
6917
|
-
Array:
|
|
6736
|
+
isBool: pe,
|
|
6737
|
+
isTrue: me,
|
|
6738
|
+
isFalse: he,
|
|
6739
|
+
isAnd: ge,
|
|
6740
|
+
isOr: _e,
|
|
6741
|
+
isImplies: ve,
|
|
6742
|
+
isNot: ye,
|
|
6743
|
+
isEq: be,
|
|
6744
|
+
isDistinct: xe,
|
|
6745
|
+
isQuantifier: Se,
|
|
6746
|
+
isArith: E,
|
|
6747
|
+
isArithSort: Ce,
|
|
6748
|
+
isInt: we,
|
|
6749
|
+
isIntVal: Te,
|
|
6750
|
+
isIntSort: Ee,
|
|
6751
|
+
isReal: De,
|
|
6752
|
+
isRealVal: Oe,
|
|
6753
|
+
isRealSort: ke,
|
|
6754
|
+
isRCFNum: Ae,
|
|
6755
|
+
isBitVecSort: je,
|
|
6756
|
+
isBitVec: Me,
|
|
6757
|
+
isBitVecVal: Ne,
|
|
6758
|
+
isFPRMSort: Le,
|
|
6759
|
+
isFPRM: Re,
|
|
6760
|
+
isFPSort: ze,
|
|
6761
|
+
isFP: D,
|
|
6762
|
+
isFPVal: Be,
|
|
6763
|
+
isSeqSort: Ve,
|
|
6764
|
+
isSeq: O,
|
|
6765
|
+
isStringSort: Ue,
|
|
6766
|
+
isString: We,
|
|
6767
|
+
isFiniteSetSort: Ge,
|
|
6768
|
+
isFiniteSet: Ke,
|
|
6769
|
+
isArraySort: Pe,
|
|
6770
|
+
isArray: Fe,
|
|
6771
|
+
isConstArray: Ie,
|
|
6772
|
+
isProbe: qe,
|
|
6773
|
+
isTactic: Je,
|
|
6774
|
+
isGoal: Ye,
|
|
6775
|
+
isAstVector: Xe,
|
|
6776
|
+
eqIdentity: Ze,
|
|
6777
|
+
getVarIndex: Qe,
|
|
6778
|
+
from: k,
|
|
6779
|
+
solve: $e,
|
|
6780
|
+
Sort: A,
|
|
6781
|
+
Function: tt,
|
|
6782
|
+
RecFunc: nt,
|
|
6783
|
+
Bool: j,
|
|
6784
|
+
Int: M,
|
|
6785
|
+
Real: N,
|
|
6786
|
+
RCFNum: rt,
|
|
6787
|
+
BitVec: P,
|
|
6788
|
+
Float: F,
|
|
6789
|
+
FloatRM: it,
|
|
6790
|
+
String: I,
|
|
6791
|
+
Seq: at,
|
|
6792
|
+
Re: ot,
|
|
6793
|
+
Array: L,
|
|
6918
6794
|
Set: st,
|
|
6919
6795
|
FiniteSet: ct,
|
|
6920
6796
|
Datatype: lt,
|
|
@@ -6987,7 +6863,7 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
6987
6863
|
substituteVars: Gr,
|
|
6988
6864
|
substituteFuns: Kr,
|
|
6989
6865
|
updateField: qr,
|
|
6990
|
-
simplify:
|
|
6866
|
+
simplify: et,
|
|
6991
6867
|
ast_from_string: Jr,
|
|
6992
6868
|
SetUnion: hn,
|
|
6993
6869
|
SetIntersect: gn,
|
|
@@ -7037,13 +6913,13 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
7037
6913
|
getFullVersion: p,
|
|
7038
6914
|
openLog: m,
|
|
7039
6915
|
appendLog: h,
|
|
7040
|
-
getParam:
|
|
6916
|
+
getParam: v,
|
|
7041
6917
|
setParam: g,
|
|
7042
6918
|
resetParams: _,
|
|
7043
|
-
Context:
|
|
6919
|
+
Context: y
|
|
7044
6920
|
};
|
|
7045
6921
|
}
|
|
7046
|
-
})),
|
|
6922
|
+
})), Ye = /* @__PURE__ */ s(((e) => {
|
|
7047
6923
|
var t = e && e.__createBinding || (Object.create ? (function(e, t, n, r) {
|
|
7048
6924
|
r === void 0 && (r = n);
|
|
7049
6925
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
@@ -7058,8 +6934,8 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
7058
6934
|
})), n = e && e.__exportStar || function(e, n) {
|
|
7059
6935
|
for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(n, r) && t(n, e, r);
|
|
7060
6936
|
};
|
|
7061
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), n(
|
|
7062
|
-
})),
|
|
6937
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), n(Je(), e), n(Ke(), e);
|
|
6938
|
+
})), Xe = /* @__PURE__ */ s(((e) => {
|
|
7063
6939
|
var t = e && e.__createBinding || (Object.create ? (function(e, t, n, r) {
|
|
7064
6940
|
r === void 0 && (r = n);
|
|
7065
6941
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
@@ -7075,8 +6951,8 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
7075
6951
|
for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(n, r) && t(n, e, r);
|
|
7076
6952
|
};
|
|
7077
6953
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.init = a;
|
|
7078
|
-
var r =
|
|
7079
|
-
n(
|
|
6954
|
+
var r = Ye(), i = Ge();
|
|
6955
|
+
n(Ke(), e), n(Ue(), e);
|
|
7080
6956
|
async function a(e = {}) {
|
|
7081
6957
|
let t = globalThis.initZ3;
|
|
7082
6958
|
if (t === void 0) throw Error("initZ3 was not imported correctly. Please consult documentation on how to load Z3 in browser");
|
|
@@ -7086,113 +6962,98 @@ var ze, Be, k, Ve, He, Ue, We, Ge = o((() => {
|
|
|
7086
6962
|
...a
|
|
7087
6963
|
};
|
|
7088
6964
|
}
|
|
7089
|
-
})),
|
|
7090
|
-
function
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
let
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
}
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
if (typeof e.isLocked == "function" && e.isLocked()) {
|
|
7103
|
-
if (typeof e.cancel == "function") try {
|
|
7104
|
-
e.cancel();
|
|
7105
|
-
} catch {}
|
|
7106
|
-
if (typeof e.release == "function") try {
|
|
7107
|
-
e.release();
|
|
7108
|
-
} catch {}
|
|
7109
|
-
}
|
|
6965
|
+
})), Ze = null, Qe = null, k = null, $e = null, et = /* @__PURE__ */ new WeakMap();
|
|
6966
|
+
function A(e, t) {
|
|
6967
|
+
if (e.error) return;
|
|
6968
|
+
let n = t instanceof Error ? t : /* @__PURE__ */ Error(`[WaSHI] Z3 internal worker error: ${typeof t == "object" && t && "message" in t ? String(t.message) : String(t)}`);
|
|
6969
|
+
e.error = n;
|
|
6970
|
+
for (let t of e.asyncRejects) t(n);
|
|
6971
|
+
e.asyncRejects.clear(), $e === e && rt();
|
|
6972
|
+
try {
|
|
6973
|
+
e.instance?.em?.PThread?.terminateAllThreads();
|
|
6974
|
+
} catch {}
|
|
6975
|
+
e.bootstrapUrl && URL.revokeObjectURL(e.bootstrapUrl);
|
|
6976
|
+
for (let t of Array.from(e.errorHandlers)) try {
|
|
6977
|
+
t(n);
|
|
7110
6978
|
} catch {}
|
|
6979
|
+
e.errorHandlers.clear();
|
|
7111
6980
|
}
|
|
7112
|
-
function
|
|
6981
|
+
function tt(e, t) {
|
|
7113
6982
|
if (!e || e.__washi_async_call_hooked) return;
|
|
7114
6983
|
e.__washi_async_call_hooked = !0;
|
|
7115
|
-
let
|
|
7116
|
-
typeof
|
|
7117
|
-
|
|
7118
|
-
|
|
6984
|
+
let n = e.async_call;
|
|
6985
|
+
typeof n == "function" && (e.async_call = function(e, ...r) {
|
|
6986
|
+
if (t.error) return Promise.reject(t.error);
|
|
6987
|
+
let i, a = new Promise((e, n) => {
|
|
6988
|
+
i = n, t.asyncRejects.add(n);
|
|
7119
6989
|
});
|
|
7120
|
-
|
|
6990
|
+
a.catch(() => {});
|
|
7121
6991
|
try {
|
|
7122
|
-
let
|
|
7123
|
-
return Promise.race([
|
|
7124
|
-
|
|
6992
|
+
let o = n.call(this, e, ...r);
|
|
6993
|
+
return Promise.race([o, a]).finally(() => {
|
|
6994
|
+
t.asyncRejects.delete(i);
|
|
7125
6995
|
});
|
|
7126
6996
|
} catch (e) {
|
|
7127
|
-
throw
|
|
6997
|
+
throw t.asyncRejects.delete(i), A(t, e), e;
|
|
7128
6998
|
}
|
|
7129
6999
|
});
|
|
7130
7000
|
}
|
|
7131
|
-
function
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7001
|
+
function nt(e, t) {
|
|
7002
|
+
let n = t ? et.get(t) : $e;
|
|
7003
|
+
return n ? n.error ? (e(n.error), () => {}) : (n.errorHandlers.add(e), () => {
|
|
7004
|
+
n.errorHandlers.delete(e);
|
|
7005
|
+
}) : () => {};
|
|
7135
7006
|
}
|
|
7136
|
-
function
|
|
7137
|
-
|
|
7138
|
-
for (let e of Array.from(L)) try {
|
|
7139
|
-
e(t);
|
|
7140
|
-
} catch {}
|
|
7141
|
-
if (L.clear(), ot(t), nt?.em?.PThread?.terminateAllThreads) try {
|
|
7142
|
-
nt.em.PThread.terminateAllThreads();
|
|
7143
|
-
} catch {}
|
|
7144
|
-
ft();
|
|
7145
|
-
for (let e of Array.from(rt)) try {
|
|
7146
|
-
e(t);
|
|
7147
|
-
} catch {}
|
|
7007
|
+
function j(e) {
|
|
7008
|
+
$e && A($e, e);
|
|
7148
7009
|
}
|
|
7149
|
-
function
|
|
7010
|
+
function M(e, t) {
|
|
7150
7011
|
if (!e || !e.PThread || e.PThread.__washi_monitored) return;
|
|
7151
7012
|
e.PThread.__washi_monitored = !0;
|
|
7152
|
-
let
|
|
7013
|
+
let n = (e) => {
|
|
7153
7014
|
e && (e.onerror = (e) => {
|
|
7154
|
-
|
|
7015
|
+
A(t, e);
|
|
7155
7016
|
}, typeof e.addEventListener == "function" && e.addEventListener("error", (e) => {
|
|
7156
|
-
|
|
7017
|
+
A(t, e), typeof e.preventDefault == "function" && e.preventDefault();
|
|
7157
7018
|
}));
|
|
7158
7019
|
};
|
|
7159
|
-
Array.isArray(e.PThread.unusedWorkers) && e.PThread.unusedWorkers.forEach(
|
|
7160
|
-
let
|
|
7161
|
-
typeof
|
|
7020
|
+
Array.isArray(e.PThread.unusedWorkers) && e.PThread.unusedWorkers.forEach(n), Array.isArray(e.PThread.runningWorkers) && e.PThread.runningWorkers.forEach(n);
|
|
7021
|
+
let r = e.PThread.loadWasmModuleToWorker;
|
|
7022
|
+
typeof r == "function" && (e.PThread.loadWasmModuleToWorker = function(e) {
|
|
7162
7023
|
try {
|
|
7163
|
-
let
|
|
7024
|
+
let n = r.call(this, e);
|
|
7164
7025
|
return e.onerror = (e) => {
|
|
7165
|
-
|
|
7166
|
-
},
|
|
7026
|
+
A(t, e);
|
|
7027
|
+
}, n;
|
|
7167
7028
|
} catch (e) {
|
|
7168
|
-
throw
|
|
7029
|
+
throw A(t, e), e;
|
|
7169
7030
|
}
|
|
7170
7031
|
});
|
|
7171
|
-
let
|
|
7172
|
-
typeof
|
|
7032
|
+
let i = e.PThread.allocateUnusedWorker;
|
|
7033
|
+
typeof i == "function" && (e.PThread.allocateUnusedWorker = function() {
|
|
7173
7034
|
try {
|
|
7174
|
-
|
|
7035
|
+
i.call(this);
|
|
7175
7036
|
let e = this.unusedWorkers?.[this.unusedWorkers.length - 1];
|
|
7176
|
-
e &&
|
|
7037
|
+
e && n(e);
|
|
7177
7038
|
} catch (e) {
|
|
7178
|
-
throw
|
|
7039
|
+
throw A(t, e), e;
|
|
7179
7040
|
}
|
|
7180
7041
|
});
|
|
7181
7042
|
}
|
|
7182
|
-
function
|
|
7183
|
-
e.jsUrl !== void 0 && (
|
|
7043
|
+
function N(e) {
|
|
7044
|
+
e.jsUrl !== void 0 && (Qe = e.jsUrl), e.wasmUrl !== void 0 && (k = e.wasmUrl), rt();
|
|
7184
7045
|
}
|
|
7185
|
-
function
|
|
7186
|
-
|
|
7046
|
+
function rt() {
|
|
7047
|
+
Ze = null, $e = null;
|
|
7187
7048
|
}
|
|
7188
|
-
function
|
|
7049
|
+
function P() {
|
|
7189
7050
|
if (typeof window > "u") return;
|
|
7190
7051
|
let e = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "[::1]";
|
|
7191
7052
|
if (!window.isSecureContext && !e) throw Error(`[WaSHI] Z3 solver requires a Secure Context (HTTPS or localhost). Current protocol: "${window.location.protocol}".`);
|
|
7192
7053
|
let t = typeof SharedArrayBuffer < "u", n = window.crossOriginIsolated === !0;
|
|
7193
7054
|
if (!t || !n) throw Error("[WaSHI] Z3 solver requires SharedArrayBuffer and crossOriginIsolated in browser environments.\nEnsure your server sends the following delivery headers on the document response:\n Cross-Origin-Opener-Policy: same-origin\n Cross-Origin-Embedder-Policy: require-corp\n(Note: Standard CORS headers alone are not sufficient, and setting 'useWorker: false' does not remove Z3's internal multithreading requirement.)");
|
|
7194
7055
|
}
|
|
7195
|
-
async function
|
|
7056
|
+
async function F(e, t) {
|
|
7196
7057
|
try {
|
|
7197
7058
|
let n = null;
|
|
7198
7059
|
try {
|
|
@@ -7209,22 +7070,22 @@ async function mt(e, t) {
|
|
|
7209
7070
|
throw Error(`[WaSHI] Failed to load Z3 asset (${t}) from "${e}": ${n.message || String(n)}. Deploy local assets with correct MIME types; no CDN fallback is attempted.`, { cause: n });
|
|
7210
7071
|
}
|
|
7211
7072
|
}
|
|
7212
|
-
function
|
|
7073
|
+
function it(e = {}) {
|
|
7213
7074
|
if (e.z3JsUrl && e.z3WasmUrl) return {
|
|
7214
7075
|
jsUrl: e.z3JsUrl,
|
|
7215
7076
|
wasmUrl: e.z3WasmUrl
|
|
7216
7077
|
};
|
|
7217
|
-
if (
|
|
7218
|
-
jsUrl: e.z3JsUrl ||
|
|
7219
|
-
wasmUrl: e.z3WasmUrl ||
|
|
7078
|
+
if (Qe && k) return {
|
|
7079
|
+
jsUrl: e.z3JsUrl || Qe,
|
|
7080
|
+
wasmUrl: e.z3WasmUrl || k
|
|
7220
7081
|
};
|
|
7221
|
-
let t =
|
|
7082
|
+
let t = ie();
|
|
7222
7083
|
return {
|
|
7223
|
-
jsUrl: e.z3JsUrl ||
|
|
7224
|
-
wasmUrl: e.z3WasmUrl ||
|
|
7084
|
+
jsUrl: e.z3JsUrl || Qe || t.jsUrl,
|
|
7085
|
+
wasmUrl: e.z3WasmUrl || k || t.wasmUrl
|
|
7225
7086
|
};
|
|
7226
7087
|
}
|
|
7227
|
-
async function
|
|
7088
|
+
async function I(e) {
|
|
7228
7089
|
let t = globalThis;
|
|
7229
7090
|
if (t.global === void 0 && (t.global = t), typeof t.initZ3 == "function") return t.initZ3;
|
|
7230
7091
|
if (typeof document < "u") await new Promise((n, r) => {
|
|
@@ -7256,149 +7117,171 @@ async function gt(e) {
|
|
|
7256
7117
|
if (typeof t.initZ3 != "function") throw Error(`[WaSHI] Script loaded from "${e}" did not define global initZ3.`);
|
|
7257
7118
|
return t.initZ3;
|
|
7258
7119
|
}
|
|
7259
|
-
async function
|
|
7260
|
-
if (
|
|
7261
|
-
let t =
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7120
|
+
async function at(e = {}) {
|
|
7121
|
+
if (Ze) return Ze;
|
|
7122
|
+
let t = {
|
|
7123
|
+
instance: null,
|
|
7124
|
+
error: null,
|
|
7125
|
+
errorHandlers: /* @__PURE__ */ new Set(),
|
|
7126
|
+
asyncRejects: /* @__PURE__ */ new Set()
|
|
7127
|
+
};
|
|
7128
|
+
$e = t;
|
|
7129
|
+
async function n(e) {
|
|
7130
|
+
if (t.error) throw t.error;
|
|
7131
|
+
let n = await e();
|
|
7132
|
+
if (t.instance = n, et.set(n, t), t.error) {
|
|
7133
|
+
try {
|
|
7134
|
+
n.em?.PThread?.terminateAllThreads();
|
|
7135
|
+
} catch {}
|
|
7136
|
+
throw t.error;
|
|
7137
|
+
}
|
|
7138
|
+
return n.em && (M(n.em, t), tt(n.em, t)), n;
|
|
7139
|
+
}
|
|
7140
|
+
let r, i = new Promise((e, t) => {
|
|
7141
|
+
r = t;
|
|
7142
|
+
});
|
|
7143
|
+
t.errorHandlers.add(r);
|
|
7144
|
+
let a = (async () => {
|
|
7145
|
+
P();
|
|
7146
|
+
let { jsUrl: r, wasmUrl: i } = it(e);
|
|
7147
|
+
if (await F(r, "JavaScript (z3-built.js)"), await F(i, "WebAssembly (z3-built.wasm)"), await I(r), t.error) throw t.error;
|
|
7148
|
+
let a = r;
|
|
7149
|
+
if (typeof window < "u" && new URL(r).origin !== window.location.origin) {
|
|
7150
|
+
let e = new Blob([`importScripts(${JSON.stringify(r)});`], { type: "application/javascript" });
|
|
7151
|
+
a = URL.createObjectURL(e), t.bootstrapUrl = a;
|
|
7269
7152
|
}
|
|
7270
|
-
let
|
|
7271
|
-
locateFile: (e) => e.endsWith(".wasm") ?
|
|
7272
|
-
mainScriptUrlOrBlob:
|
|
7153
|
+
let o = {
|
|
7154
|
+
locateFile: (e) => e.endsWith(".wasm") ? i : new URL(e, r).href,
|
|
7155
|
+
mainScriptUrlOrBlob: a
|
|
7273
7156
|
};
|
|
7274
7157
|
try {
|
|
7275
|
-
let e = await Promise.resolve().then(() => /* @__PURE__ */ u(
|
|
7276
|
-
|
|
7277
|
-
at(await Promise.resolve().then(() => (w(), ie)));
|
|
7278
|
-
} catch {}
|
|
7279
|
-
let t, n = await new Promise((n, r) => {
|
|
7280
|
-
t = ct(r), e.init(i).then(n, r);
|
|
7281
|
-
}).finally(() => t?.());
|
|
7282
|
-
return nt = n, n && n.em && (ut(n.em), st(n.em)), n;
|
|
7158
|
+
let e = await Promise.resolve().then(() => /* @__PURE__ */ u(Xe(), 1));
|
|
7159
|
+
return await n(() => e.init(o));
|
|
7283
7160
|
} catch (e) {
|
|
7284
|
-
throw
|
|
7161
|
+
throw Error(`[WaSHI] Failed to initialize Z3 in browser: ${e?.message || String(e)}`, { cause: e });
|
|
7285
7162
|
}
|
|
7286
|
-
})()
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7163
|
+
})(), o = Promise.race([a, i]).finally(() => {
|
|
7164
|
+
t.errorHandlers.delete(r);
|
|
7165
|
+
});
|
|
7166
|
+
return o.catch((e) => A(t, e)), Ze = o, o;
|
|
7290
7167
|
}
|
|
7291
|
-
async function
|
|
7292
|
-
let t = e
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
e
|
|
7296
|
-
} catch {}
|
|
7297
|
-
if (L.clear(), !t || !t.em) {
|
|
7298
|
-
ft();
|
|
7299
|
-
return;
|
|
7300
|
-
}
|
|
7301
|
-
try {
|
|
7302
|
-
let { killThreads: e } = await Promise.resolve().then(() => /* @__PURE__ */ u(N(), 1));
|
|
7303
|
-
typeof e == "function" ? await e(t.em) : t.em?.PThread?.terminateAllThreads && t.em.PThread.terminateAllThreads();
|
|
7168
|
+
async function ot(e) {
|
|
7169
|
+
let t = e ? et.get(e) : $e, n = e || t?.instance;
|
|
7170
|
+
if (t && A(t, /* @__PURE__ */ Error("[WaSHI] Z3 threads terminated")), n?.em) try {
|
|
7171
|
+
let { killThreads: e } = await Promise.resolve().then(() => /* @__PURE__ */ u(Xe(), 1));
|
|
7172
|
+
typeof e == "function" ? await e(n.em) : n.em.PThread?.terminateAllThreads();
|
|
7304
7173
|
} catch {
|
|
7305
|
-
|
|
7306
|
-
} finally {
|
|
7307
|
-
ft();
|
|
7174
|
+
n.em.PThread?.terminateAllThreads();
|
|
7308
7175
|
}
|
|
7309
7176
|
}
|
|
7310
7177
|
//#endregion
|
|
7311
7178
|
//#region src/modeler/solvers/z3/solver.ts
|
|
7312
|
-
|
|
7179
|
+
function L(e, t, n) {
|
|
7180
|
+
Object.defineProperty(e, t, {
|
|
7181
|
+
value: n,
|
|
7182
|
+
enumerable: !0,
|
|
7183
|
+
writable: !0,
|
|
7184
|
+
configurable: !0
|
|
7185
|
+
});
|
|
7186
|
+
}
|
|
7187
|
+
var st = class {
|
|
7313
7188
|
name = "z3";
|
|
7314
7189
|
capabilities = {
|
|
7315
7190
|
supportsMIP: !0,
|
|
7316
7191
|
supportsQP: !1,
|
|
7317
7192
|
supportsSMT: !0,
|
|
7318
|
-
supportsUnsatCore: !0
|
|
7193
|
+
supportsUnsatCore: !0,
|
|
7194
|
+
supportsWarmStart: !1
|
|
7319
7195
|
};
|
|
7320
7196
|
createContextTranslator(e) {
|
|
7321
|
-
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
7322
|
-
function
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7197
|
+
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
7198
|
+
function i(e, t) {
|
|
7199
|
+
let n = e || t, i = n, a = 1;
|
|
7200
|
+
for (; r.has(i);) i = `${n}__${a++}`;
|
|
7201
|
+
return r.add(i), i;
|
|
7202
|
+
}
|
|
7203
|
+
function a(n) {
|
|
7204
|
+
let r = t.get(n);
|
|
7205
|
+
if (!r) {
|
|
7206
|
+
let a = i(n.name, `v_${n.id ?? t.size}`);
|
|
7207
|
+
r = n.type === "Continuous" || n.type === "CONTINUOUS" ? e.Real.const(a) : e.Int.const(a), t.set(n, r);
|
|
7326
7208
|
}
|
|
7327
|
-
return
|
|
7209
|
+
return r;
|
|
7328
7210
|
}
|
|
7329
|
-
function
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7211
|
+
function o(t) {
|
|
7212
|
+
let r = n.get(t);
|
|
7213
|
+
if (!r) {
|
|
7214
|
+
let a = i(t.name, `b_${t.id ?? n.size}`);
|
|
7215
|
+
r = e.Bool.const(a), n.set(t, r);
|
|
7333
7216
|
}
|
|
7334
|
-
return
|
|
7217
|
+
return r;
|
|
7335
7218
|
}
|
|
7336
|
-
function
|
|
7219
|
+
function s(t) {
|
|
7337
7220
|
return typeof e.isInt == "function" && e.isInt(t) ? e.ToReal(t) : t;
|
|
7338
7221
|
}
|
|
7339
|
-
function
|
|
7222
|
+
function c(t, n) {
|
|
7340
7223
|
let r = typeof e.isInt == "function" && e.isInt(t), i = typeof e.isInt == "function" && e.isInt(n);
|
|
7341
|
-
return r && i ? t.add(n) :
|
|
7224
|
+
return r && i ? t.add(n) : s(t).add(s(n));
|
|
7342
7225
|
}
|
|
7343
|
-
function
|
|
7344
|
-
return typeof e.isInt == "function" && e.isInt(t) && Number.isInteger(n) ? t.mul(e.Int.val(n)) :
|
|
7226
|
+
function l(t, n) {
|
|
7227
|
+
return typeof e.isInt == "function" && e.isInt(t) && Number.isInteger(n) ? t.mul(e.Int.val(n)) : s(t).mul(e.Real.val(n));
|
|
7345
7228
|
}
|
|
7346
|
-
function
|
|
7229
|
+
function u(t, n) {
|
|
7347
7230
|
let r = typeof e.isInt == "function" && e.isInt(t), i = typeof e.isInt == "function" && e.isInt(n);
|
|
7348
|
-
return r && i ? t.mul(n) :
|
|
7231
|
+
return r && i ? t.mul(n) : s(t).mul(s(n));
|
|
7349
7232
|
}
|
|
7350
|
-
function
|
|
7233
|
+
function d(t, n) {
|
|
7351
7234
|
return n && Number.isInteger(t) ? e.Int.val(t) : e.Real.val(t);
|
|
7352
7235
|
}
|
|
7353
|
-
function
|
|
7354
|
-
let i = typeof e.isInt == "function" && e.isInt(t) && Number.isInteger(r),
|
|
7355
|
-
return n === "<=" ?
|
|
7236
|
+
function f(t, n, r) {
|
|
7237
|
+
let i = typeof e.isInt == "function" && e.isInt(t) && Number.isInteger(r), a = i ? t : s(t), o = i ? e.Int.val(r) : e.Real.val(r);
|
|
7238
|
+
return n === "<=" ? a.le(o) : n === ">=" ? a.ge(o) : a.eq(o);
|
|
7356
7239
|
}
|
|
7357
|
-
function
|
|
7240
|
+
function m(t) {
|
|
7358
7241
|
let n = null;
|
|
7359
|
-
if (t && t.terms) for (let [e,
|
|
7360
|
-
let t =
|
|
7361
|
-
n = n === null ? t :
|
|
7242
|
+
if (t && t.terms) for (let [e, r] of t.terms.entries()) {
|
|
7243
|
+
let t = l(a(e), r);
|
|
7244
|
+
n = n === null ? t : c(n, t);
|
|
7362
7245
|
}
|
|
7363
|
-
let
|
|
7364
|
-
if (
|
|
7365
|
-
let t =
|
|
7366
|
-
n = n === null ? t :
|
|
7246
|
+
let r = t && typeof t.constant == "number" ? t.constant : 0;
|
|
7247
|
+
if (r !== 0 || n === null) {
|
|
7248
|
+
let t = d(r, n === null || typeof e.isInt == "function" && e.isInt(n));
|
|
7249
|
+
n = n === null ? t : c(n, t);
|
|
7367
7250
|
}
|
|
7368
7251
|
return n;
|
|
7369
7252
|
}
|
|
7370
|
-
function
|
|
7253
|
+
function h(t) {
|
|
7371
7254
|
let n = null;
|
|
7372
|
-
if (t.linearTerms) for (let [e,
|
|
7373
|
-
let t =
|
|
7374
|
-
n = n === null ? t :
|
|
7255
|
+
if (t.linearTerms) for (let [e, r] of t.linearTerms.entries()) {
|
|
7256
|
+
let t = l(a(e), r);
|
|
7257
|
+
n = n === null ? t : c(n, t);
|
|
7375
7258
|
}
|
|
7376
7259
|
if (t.quadTerms) for (let e of t.quadTerms.values()) {
|
|
7377
|
-
let t =
|
|
7378
|
-
n = n === null ? t :
|
|
7260
|
+
let t = l(u(a(e.var1), a(e.var2)), e.coeff);
|
|
7261
|
+
n = n === null ? t : c(n, t);
|
|
7379
7262
|
}
|
|
7380
|
-
let
|
|
7381
|
-
if (
|
|
7382
|
-
let t =
|
|
7383
|
-
n = n === null ? t :
|
|
7263
|
+
let r = t && typeof t.constant == "number" ? t.constant : 0;
|
|
7264
|
+
if (r !== 0 || n === null) {
|
|
7265
|
+
let t = d(r, n === null || typeof e.isInt == "function" && e.isInt(n));
|
|
7266
|
+
n = n === null ? t : c(n, t);
|
|
7384
7267
|
}
|
|
7385
7268
|
return n;
|
|
7386
7269
|
}
|
|
7387
|
-
function
|
|
7388
|
-
let t = e.lhs instanceof Object && "quadTerms" in e.lhs ?
|
|
7389
|
-
return
|
|
7270
|
+
function g(e) {
|
|
7271
|
+
let t = e.lhs instanceof Object && "quadTerms" in e.lhs ? h(e.lhs) : m(e.lhs), n = typeof e.rhs == "number" ? e.rhs : 0;
|
|
7272
|
+
return f(t, e.sense, n);
|
|
7390
7273
|
}
|
|
7391
|
-
function
|
|
7392
|
-
if (t instanceof
|
|
7393
|
-
if (t instanceof
|
|
7394
|
-
if (t instanceof
|
|
7274
|
+
function y(t) {
|
|
7275
|
+
if (t instanceof _ || t && typeof t == "object" && "name" in t && typeof t.id == "number" && !("op" in t) && !("lhs" in t)) return o(t);
|
|
7276
|
+
if (t instanceof p || t && typeof t == "object" && "lhs" in t && "sense" in t) return g(t);
|
|
7277
|
+
if (t instanceof v || t && typeof t == "object" && "op" in t && Array.isArray(t.children)) {
|
|
7395
7278
|
let n = t;
|
|
7396
7279
|
switch (n.op) {
|
|
7397
|
-
case "and": return e.And(...n.children.map(
|
|
7398
|
-
case "or": return e.Or(...n.children.map(
|
|
7399
|
-
case "not": return e.Not(
|
|
7400
|
-
case "implies": return e.Implies(
|
|
7401
|
-
case "xor": return e.
|
|
7280
|
+
case "and": return e.And(...n.children.map(y));
|
|
7281
|
+
case "or": return e.Or(...n.children.map(y));
|
|
7282
|
+
case "not": return e.Not(y(n.children[0]));
|
|
7283
|
+
case "implies": return e.Implies(y(n.children[0]), y(n.children[1]));
|
|
7284
|
+
case "xor": return n.children.length === 0 ? e.Bool.val(!1) : n.children.length === 1 ? y(n.children[0]) : n.children.slice(1).reduce((t, n) => e.Xor(t, y(n)), y(n.children[0]));
|
|
7402
7285
|
default: throw Error(`Unsupported boolean operation: ${n.op}`);
|
|
7403
7286
|
}
|
|
7404
7287
|
}
|
|
@@ -7415,60 +7298,85 @@ var yt = class {
|
|
|
7415
7298
|
return Number(t);
|
|
7416
7299
|
}
|
|
7417
7300
|
return {
|
|
7418
|
-
getVarAst:
|
|
7419
|
-
getBoolVarAst:
|
|
7420
|
-
compareAstWithNumber:
|
|
7421
|
-
translateLinExpr:
|
|
7422
|
-
translateQuadExpr:
|
|
7423
|
-
translateConstraint:
|
|
7424
|
-
translateBoolExpr:
|
|
7301
|
+
getVarAst: a,
|
|
7302
|
+
getBoolVarAst: o,
|
|
7303
|
+
compareAstWithNumber: f,
|
|
7304
|
+
translateLinExpr: m,
|
|
7305
|
+
translateQuadExpr: h,
|
|
7306
|
+
translateConstraint: g,
|
|
7307
|
+
translateBoolExpr: y,
|
|
7425
7308
|
parseAstValue: ee,
|
|
7426
7309
|
varAstMap: t,
|
|
7427
7310
|
boolVarAstMap: n
|
|
7428
7311
|
};
|
|
7429
7312
|
}
|
|
7430
|
-
|
|
7431
|
-
let
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
e.lb !== -Infinity && i.add(a.compareAstWithNumber(t, ">=", e.lb)), e.ub !== Infinity && i.add(a.compareAstWithNumber(t, "<=", e.ub)), (e.type === "Binary" || e.type === "BINARY") && (i.add(a.compareAstWithNumber(t, ">=", 0)), i.add(a.compareAstWithNumber(t, "<=", 1)));
|
|
7313
|
+
addVariableBounds(e, t, n) {
|
|
7314
|
+
for (let r of t) {
|
|
7315
|
+
let t = n.getVarAst(r);
|
|
7316
|
+
r.lb !== -Infinity && e.add(n.compareAstWithNumber(t, ">=", r.lb)), r.ub !== Infinity && e.add(n.compareAstWithNumber(t, "<=", r.ub)), (r.type === "Binary" || r.type === "BINARY") && (e.add(n.compareAstWithNumber(t, ">=", 0)), e.add(n.compareAstWithNumber(t, "<=", 1)));
|
|
7435
7317
|
}
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
}
|
|
7440
|
-
for (let e = 0; e < l.length; e++) {
|
|
7441
|
-
let t = l[e], n = t && t.name || `lc_${e + 1}`, o = t && t.expr || t, s = a.translateBoolExpr(o), c = r.Bool.const(n);
|
|
7442
|
-
i.addAndTrack(s, c);
|
|
7443
|
-
}
|
|
7444
|
-
let u, d;
|
|
7318
|
+
}
|
|
7319
|
+
async runZ3CheckWithErrorGuard(e, t) {
|
|
7320
|
+
let n;
|
|
7445
7321
|
try {
|
|
7446
|
-
let
|
|
7447
|
-
|
|
7448
|
-
|
|
7322
|
+
let r = e.check();
|
|
7323
|
+
return await new Promise((e, i) => {
|
|
7324
|
+
n = nt(i, t), r.then(e, i);
|
|
7449
7325
|
});
|
|
7450
7326
|
} finally {
|
|
7451
|
-
|
|
7327
|
+
n?.();
|
|
7452
7328
|
}
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7329
|
+
}
|
|
7330
|
+
async check(e, t = {}) {
|
|
7331
|
+
if (e?.variables?.some((e) => e.initialValue !== void 0)) throw Error(`Solver "${this.name}" does not support primal initial values (initialValue). Please use a solver with warm-start support such as HiGHS.`);
|
|
7332
|
+
if (t.signal?.aborted) return {
|
|
7333
|
+
status: "Unknown",
|
|
7334
|
+
values: {}
|
|
7335
|
+
};
|
|
7336
|
+
let n = await at(t), { Context: r } = n;
|
|
7337
|
+
if (t.signal?.aborted) return {
|
|
7338
|
+
status: "Unknown",
|
|
7339
|
+
values: {}
|
|
7340
|
+
};
|
|
7341
|
+
let i = new r(`check_${Date.now()}_${Math.random().toString(36).substring(2, 7)}`), a = new i.Solver(), o = this.createContextTranslator(i), s = e.variables || [], c = e.boolVars || [], l = e.constraints || [], u = e.logicalConstraints || [];
|
|
7342
|
+
this.addVariableBounds(a, s, o);
|
|
7343
|
+
let d = new Set(c.map((e) => e.name)), f = /* @__PURE__ */ new Map(), p = 0, m = (e) => {
|
|
7344
|
+
let t = `__washi_track_${++p}`;
|
|
7345
|
+
for (; d.has(t) || f.has(t);) t = `__washi_track_${++p}`;
|
|
7346
|
+
let n = i.Bool.const(t);
|
|
7347
|
+
return f.set(t, e), f.set(n.toString(), e), n;
|
|
7348
|
+
};
|
|
7349
|
+
for (let e of l) a.addAndTrack(o.translateConstraint(e), m(e.name));
|
|
7350
|
+
for (let e = 0; e < u.length; e++) {
|
|
7351
|
+
let t = u[e], n = "name" in t && typeof t.name == "string" ? t.name : `lc_${e + 1}`, r = "expr" in t ? t.expr : t;
|
|
7352
|
+
a.addAndTrack(o.translateBoolExpr(r), m(n));
|
|
7353
|
+
}
|
|
7354
|
+
if (t.signal?.aborted) return {
|
|
7355
|
+
status: "Unknown",
|
|
7356
|
+
values: {}
|
|
7357
|
+
};
|
|
7358
|
+
let h = (await this.runZ3CheckWithErrorGuard(a, n)).toString();
|
|
7359
|
+
if (h === "sat") {
|
|
7360
|
+
let e = a.model(), t = {};
|
|
7460
7361
|
for (let n of s) {
|
|
7461
|
-
let r =
|
|
7462
|
-
t
|
|
7362
|
+
let r = o.getVarAst(n), i = e.eval(r);
|
|
7363
|
+
L(t, n.name, o.parseAstValue(i));
|
|
7364
|
+
}
|
|
7365
|
+
for (let n of c) {
|
|
7366
|
+
let r = o.getBoolVarAst(n), i = e.eval(r);
|
|
7367
|
+
L(t, n.name, i.toString() === "true");
|
|
7463
7368
|
}
|
|
7464
7369
|
return {
|
|
7465
7370
|
status: "Sat",
|
|
7466
7371
|
values: t
|
|
7467
7372
|
};
|
|
7468
7373
|
}
|
|
7469
|
-
if (
|
|
7470
|
-
let e =
|
|
7471
|
-
for (let r = 0; r < n; r++)
|
|
7374
|
+
if (h === "unsat") {
|
|
7375
|
+
let e = a.unsatCore(), t = [], n = typeof e.length == "function" ? e.length() : e.length;
|
|
7376
|
+
for (let r = 0; r < n; r++) {
|
|
7377
|
+
let n = e.get(r).toString();
|
|
7378
|
+
t.push(f.get(n) ?? n);
|
|
7379
|
+
}
|
|
7472
7380
|
return {
|
|
7473
7381
|
status: "Unsat",
|
|
7474
7382
|
values: {},
|
|
@@ -7480,71 +7388,184 @@ var yt = class {
|
|
|
7480
7388
|
values: {}
|
|
7481
7389
|
};
|
|
7482
7390
|
}
|
|
7483
|
-
async solve(e, t, n
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7391
|
+
async solve(e, t, n) {
|
|
7392
|
+
let r = (y(t) ? n : t) ?? {};
|
|
7393
|
+
if (e?.variables?.some((e) => e.initialValue !== void 0)) throw Error(`Solver "${this.name}" does not support primal initial values (initialValue). Please use a solver with warm-start support such as HiGHS.`);
|
|
7394
|
+
if (r.signal?.aborted) return {
|
|
7395
|
+
status: "Unknown",
|
|
7396
|
+
terminationStatus: "Interrupted",
|
|
7397
|
+
hasPrimalSolution: !1,
|
|
7398
|
+
objectiveValue: null,
|
|
7399
|
+
values: {}
|
|
7400
|
+
};
|
|
7401
|
+
let i = performance.now(), a = e.objective;
|
|
7402
|
+
if (!(a != null && ("quadTerms" in a ? a.linearTerms.size > 0 || a.quadTerms.size > 0 : "terms" in a && a.terms.size > 0))) {
|
|
7403
|
+
let t = await this.check(e, r), n = {}, o = {};
|
|
7404
|
+
for (let [e, r] of Object.entries(t.values)) typeof r == "boolean" ? (L(n, e, +!!r), L(o, e, r)) : L(n, e, r);
|
|
7405
|
+
let s = t.status === "Sat", c = s ? a?.constant ?? 0 : null;
|
|
7406
|
+
if (r.onProgress && !r.signal?.aborted) {
|
|
7407
|
+
let e = (performance.now() - i) / 1e3;
|
|
7408
|
+
r.onProgress({
|
|
7409
|
+
elapsedTime: e,
|
|
7410
|
+
elapsedSeconds: e,
|
|
7411
|
+
...typeof c == "number" && Number.isFinite(c) ? { objectiveValue: c } : {}
|
|
7412
|
+
});
|
|
7413
|
+
}
|
|
7414
|
+
if (r.signal?.aborted) return {
|
|
7415
|
+
status: s ? "Feasible" : "Unknown",
|
|
7416
|
+
terminationStatus: "Interrupted",
|
|
7417
|
+
hasPrimalSolution: s,
|
|
7418
|
+
objectiveValue: c,
|
|
7419
|
+
values: s ? n : {},
|
|
7420
|
+
...s && Object.keys(o).length > 0 ? { boolValues: o } : {}
|
|
7421
|
+
};
|
|
7422
|
+
let l = s ? "Optimal" : t.status === "Unsat" ? "Infeasible" : t.status === "Unknown" ? "Unknown" : "Error";
|
|
7487
7423
|
return {
|
|
7488
|
-
status:
|
|
7489
|
-
|
|
7490
|
-
|
|
7424
|
+
status: l,
|
|
7425
|
+
terminationStatus: l,
|
|
7426
|
+
hasPrimalSolution: s,
|
|
7427
|
+
objectiveValue: c,
|
|
7428
|
+
values: s ? n : {},
|
|
7429
|
+
...s && Object.keys(o).length > 0 ? { boolValues: o } : {}
|
|
7491
7430
|
};
|
|
7492
7431
|
}
|
|
7493
|
-
let
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
}
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7432
|
+
let o = await at(r), { Context: s } = o;
|
|
7433
|
+
if (r.signal?.aborted) return {
|
|
7434
|
+
status: "Unknown",
|
|
7435
|
+
terminationStatus: "Interrupted",
|
|
7436
|
+
hasPrimalSolution: !1,
|
|
7437
|
+
objectiveValue: null,
|
|
7438
|
+
values: {}
|
|
7439
|
+
};
|
|
7440
|
+
let c = new s(`opt_${Date.now()}_${Math.random().toString(36).substring(2, 7)}`), l = new c.Optimize(), u = this.createContextTranslator(c), d = e.variables || [], f = e.boolVars || [], p = e.constraints || [], m = e.logicalConstraints || [];
|
|
7441
|
+
this.addVariableBounds(l, d, u);
|
|
7442
|
+
for (let e of p) {
|
|
7443
|
+
let t = u.translateConstraint(e);
|
|
7444
|
+
l.add(t);
|
|
7505
7445
|
}
|
|
7506
|
-
let
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
try {
|
|
7510
|
-
let e = a.check();
|
|
7511
|
-
p = await new Promise((t, n) => {
|
|
7512
|
-
f = ct(n), e.then(t, n);
|
|
7513
|
-
});
|
|
7514
|
-
} finally {
|
|
7515
|
-
f?.();
|
|
7446
|
+
for (let e of m) {
|
|
7447
|
+
let t = "expr" in e ? e.expr : e, n = u.translateBoolExpr(t);
|
|
7448
|
+
l.add(n);
|
|
7516
7449
|
}
|
|
7517
|
-
let
|
|
7518
|
-
if (
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7450
|
+
let h = "quadTerms" in a ? u.translateQuadExpr(a) : u.translateLinExpr(a), g = (e.sense || "MINIMIZE").toUpperCase(), _ = g === "MAXIMIZE" ? l.maximize(h) : l.minimize(h);
|
|
7451
|
+
if (r.signal?.aborted) return {
|
|
7452
|
+
status: "Unknown",
|
|
7453
|
+
terminationStatus: "Interrupted",
|
|
7454
|
+
hasPrimalSolution: !1,
|
|
7455
|
+
objectiveValue: null,
|
|
7456
|
+
values: {}
|
|
7457
|
+
};
|
|
7458
|
+
let v = (await this.runZ3CheckWithErrorGuard(l, o)).toString();
|
|
7459
|
+
if (v === "sat") {
|
|
7460
|
+
let e = l.model(), t = {}, n = {};
|
|
7461
|
+
for (let n of d) {
|
|
7462
|
+
let r = u.getVarAst(n), i = e.eval(r);
|
|
7463
|
+
L(t, n.name, u.parseAstValue(i));
|
|
7464
|
+
}
|
|
7465
|
+
for (let r of f) {
|
|
7466
|
+
let i = u.getBoolVarAst(r), a = e.eval(i).toString() === "true";
|
|
7467
|
+
L(t, r.name, +!!a), L(n, r.name, a);
|
|
7468
|
+
}
|
|
7469
|
+
let a = u.parseAstValue(e.eval(h)), o = !1, s = !1;
|
|
7470
|
+
try {
|
|
7471
|
+
let e = g === "MAXIMIZE" ? typeof l.getUpper == "function" ? l.getUpper(_) : void 0 : typeof l.getLower == "function" ? l.getLower(_) : void 0, t = e ? e.toString() : "";
|
|
7472
|
+
t.includes("oo") ? o = !0 : t.includes("epsilon") && (s = !0);
|
|
7473
|
+
} catch {}
|
|
7474
|
+
if (o) {
|
|
7475
|
+
if (r.onProgress) {
|
|
7476
|
+
let e = (performance.now() - i) / 1e3;
|
|
7477
|
+
r.onProgress({
|
|
7478
|
+
elapsedTime: e,
|
|
7479
|
+
elapsedSeconds: e,
|
|
7480
|
+
...Number.isFinite(a) ? { objectiveValue: a } : {}
|
|
7481
|
+
});
|
|
7482
|
+
}
|
|
7483
|
+
return {
|
|
7484
|
+
status: "Unbounded",
|
|
7485
|
+
terminationStatus: "Unbounded",
|
|
7486
|
+
hasPrimalSolution: !0,
|
|
7487
|
+
objectiveValue: a,
|
|
7488
|
+
values: t,
|
|
7489
|
+
...Object.keys(n).length > 0 ? { boolValues: n } : {}
|
|
7490
|
+
};
|
|
7523
7491
|
}
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7492
|
+
if (s) {
|
|
7493
|
+
if (r.onProgress) {
|
|
7494
|
+
let e = (performance.now() - i) / 1e3;
|
|
7495
|
+
r.onProgress({
|
|
7496
|
+
elapsedTime: e,
|
|
7497
|
+
elapsedSeconds: e
|
|
7498
|
+
});
|
|
7499
|
+
}
|
|
7500
|
+
return {
|
|
7501
|
+
status: "Unknown",
|
|
7502
|
+
terminationStatus: "Unknown",
|
|
7503
|
+
hasPrimalSolution: !1,
|
|
7504
|
+
objectiveValue: null,
|
|
7505
|
+
values: {}
|
|
7506
|
+
};
|
|
7507
|
+
}
|
|
7508
|
+
if (r.onProgress) {
|
|
7509
|
+
let e = (performance.now() - i) / 1e3;
|
|
7510
|
+
r.onProgress({
|
|
7511
|
+
elapsedTime: e,
|
|
7512
|
+
elapsedSeconds: e,
|
|
7513
|
+
...Number.isFinite(a) ? { objectiveValue: a } : {}
|
|
7514
|
+
});
|
|
7527
7515
|
}
|
|
7528
7516
|
return {
|
|
7529
7517
|
status: "Optimal",
|
|
7530
|
-
|
|
7531
|
-
|
|
7518
|
+
terminationStatus: "Optimal",
|
|
7519
|
+
hasPrimalSolution: !0,
|
|
7520
|
+
objectiveValue: a,
|
|
7521
|
+
values: t,
|
|
7522
|
+
...Object.keys(n).length > 0 ? { boolValues: n } : {}
|
|
7532
7523
|
};
|
|
7533
7524
|
}
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7525
|
+
if (v === "unsat") {
|
|
7526
|
+
if (r.onProgress) {
|
|
7527
|
+
let e = (performance.now() - i) / 1e3;
|
|
7528
|
+
r.onProgress({
|
|
7529
|
+
elapsedTime: e,
|
|
7530
|
+
elapsedSeconds: e
|
|
7531
|
+
});
|
|
7532
|
+
}
|
|
7533
|
+
return {
|
|
7534
|
+
status: "Infeasible",
|
|
7535
|
+
terminationStatus: "Infeasible",
|
|
7536
|
+
hasPrimalSolution: !1,
|
|
7537
|
+
objectiveValue: null,
|
|
7538
|
+
values: {}
|
|
7539
|
+
};
|
|
7540
|
+
}
|
|
7541
|
+
if (v === "unknown") {
|
|
7542
|
+
if (r.onProgress) {
|
|
7543
|
+
let e = (performance.now() - i) / 1e3;
|
|
7544
|
+
r.onProgress({
|
|
7545
|
+
elapsedTime: e,
|
|
7546
|
+
elapsedSeconds: e
|
|
7547
|
+
});
|
|
7548
|
+
}
|
|
7549
|
+
return {
|
|
7550
|
+
status: "Unknown",
|
|
7551
|
+
terminationStatus: "Unknown",
|
|
7552
|
+
hasPrimalSolution: !1,
|
|
7553
|
+
objectiveValue: null,
|
|
7554
|
+
values: {}
|
|
7555
|
+
};
|
|
7556
|
+
}
|
|
7557
|
+
return {
|
|
7539
7558
|
status: "Error",
|
|
7559
|
+
terminationStatus: "Error",
|
|
7560
|
+
hasPrimalSolution: !1,
|
|
7540
7561
|
objectiveValue: null,
|
|
7541
7562
|
values: {}
|
|
7542
7563
|
};
|
|
7543
7564
|
}
|
|
7544
7565
|
};
|
|
7545
|
-
function
|
|
7546
|
-
|
|
7566
|
+
function ct() {
|
|
7567
|
+
x("z3", () => new st());
|
|
7547
7568
|
}
|
|
7548
|
-
|
|
7569
|
+
ct();
|
|
7549
7570
|
//#endregion
|
|
7550
|
-
export {
|
|
7571
|
+
export { st as Z3Solver, I as ensureInitZ3Loaded, ot as killZ3Threads, at as loadZ3, j as notifyZ3WorkerError, F as probeAssetUrl, nt as registerZ3ErrorHandler, ct as registerZ3Solver, rt as resetZ3LoaderCache, it as resolveZ3AssetUrls, N as setZ3Assets, P as validateZ3BrowserEnvironment };
|