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