@ohtaman/washi 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +139 -418
- package/README.md +139 -418
- package/README.zh-CN.md +139 -418
- package/THIRD_PARTY_LICENSES.md +39 -4
- package/dist/browser/__vite-browser-external-rTVKos2U.js +7 -0
- package/dist/browser/browser-runtime-AG5QFtKf.js +2021 -0
- package/dist/browser/highs-worker.js +26 -11
- package/dist/browser/highs.wasm +0 -0
- package/dist/browser/{loader-DewlSho8.js → loader-i3FnqMes.js} +183 -149
- package/dist/browser/solvers/glpk.js +289 -238
- package/dist/browser/solvers/glpk.min.js +1 -1
- package/dist/browser/solvers/pumpkin-_washi-pumpkin-node-runtime-CEKUDK6d.js +9 -0
- package/dist/browser/solvers/pumpkin-loader-CvdaKxf4.js +320 -0
- package/dist/browser/solvers/pumpkin-worker.js +45 -0
- package/dist/browser/solvers/pumpkin.js +1777 -0
- package/dist/browser/solvers/pumpkin.min.js +1 -0
- package/dist/browser/solvers/pumpkin.wasm +0 -0
- package/dist/browser/solvers/pumpkin.wasm.LICENSE +21 -0
- package/dist/browser/solvers/z3.js +1600 -1335
- package/dist/browser/solvers/z3.min.js +2 -2
- package/dist/browser/washi.js +3828 -1315
- package/dist/browser/washi.min.js +5 -3
- package/dist/lib/__vite-browser-external-oLchLuMx.js +7 -0
- package/dist/lib/highs-browser-runtime.js +1846 -1618
- package/dist/lib/highs-runtime.js +16 -2
- package/dist/lib/highs-worker.js +26 -11
- package/dist/lib/highs.wasm +0 -0
- package/dist/lib/{loader-BZUQNvh4.js → loader-CDpPXN_F.js} +138 -116
- package/dist/lib/registry-dx7x4e5c.js +1694 -0
- package/dist/lib/rolldown-runtime-DtPi1Y-2.js +13 -0
- package/dist/lib/solvers/glpk.js +161 -121
- package/dist/lib/solvers/pumpkin-assets.js +1 -0
- package/dist/lib/solvers/pumpkin-loader-Ow74Fa1B.js +311 -0
- package/dist/lib/solvers/pumpkin-node-runtime.js +15 -0
- package/dist/lib/solvers/pumpkin-worker-factory.js +1 -0
- package/dist/lib/solvers/pumpkin-worker.js +45 -0
- package/dist/lib/solvers/pumpkin.js +1767 -0
- package/dist/lib/solvers/pumpkin.wasm +0 -0
- package/dist/lib/solvers/pumpkin.wasm.LICENSE +21 -0
- package/dist/lib/solvers/z3.js +486 -306
- package/dist/lib/washi.js +3054 -1202
- package/dist/types/decomposition/benders.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modeler/boolean-expr.d.ts +137 -29
- package/dist/types/modeler/boolean-expr.d.ts.map +1 -1
- package/dist/types/modeler/constraint.d.ts +40 -4
- package/dist/types/modeler/constraint.d.ts.map +1 -1
- package/dist/types/modeler/expression.d.ts +176 -28
- package/dist/types/modeler/expression.d.ts.map +1 -1
- package/dist/types/modeler/index.d.ts +5 -6
- package/dist/types/modeler/index.d.ts.map +1 -1
- package/dist/types/modeler/linearizer.d.ts +11 -2
- package/dist/types/modeler/linearizer.d.ts.map +1 -1
- package/dist/types/modeler/lp-writer.d.ts.map +1 -1
- package/dist/types/modeler/model.d.ts +97 -130
- package/dist/types/modeler/model.d.ts.map +1 -1
- package/dist/types/modeler/parser.d.ts +25 -5
- package/dist/types/modeler/parser.d.ts.map +1 -1
- package/dist/types/modeler/quad-expr.d.ts +8 -2
- package/dist/types/modeler/quad-expr.d.ts.map +1 -1
- package/dist/types/modeler/solution-validator.d.ts +12 -12
- package/dist/types/modeler/solution-validator.d.ts.map +1 -1
- package/dist/types/modeler/solvers/glpk/loader.d.ts +4 -0
- package/dist/types/modeler/solvers/glpk/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/glpk/solver.d.ts +2 -2
- package/dist/types/modeler/solvers/glpk/solver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/driver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/loader.d.ts +8 -6
- package/dist/types/modeler/solvers/highs/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/solver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/worker-client.d.ts +16 -0
- package/dist/types/modeler/solvers/highs/worker-client.d.ts.map +1 -1
- package/dist/types/modeler/solvers/mock.d.ts +2 -3
- package/dist/types/modeler/solvers/mock.d.ts.map +1 -1
- package/dist/types/modeler/solvers/pumpkin/assets.d.ts +2 -0
- package/dist/types/modeler/solvers/pumpkin/assets.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin/index.d.ts +6 -0
- package/dist/types/modeler/solvers/pumpkin/index.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin/loader.d.ts +40 -0
- package/dist/types/modeler/solvers/pumpkin/loader.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin/node-runtime.d.ts +3 -0
- package/dist/types/modeler/solvers/pumpkin/node-runtime.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin/solver.d.ts +23 -0
- package/dist/types/modeler/solvers/pumpkin/solver.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin/worker-client.d.ts +74 -0
- package/dist/types/modeler/solvers/pumpkin/worker-client.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin/worker-factory.d.ts +3 -0
- package/dist/types/modeler/solvers/pumpkin/worker-factory.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin/worker.d.ts +7 -0
- package/dist/types/modeler/solvers/pumpkin/worker.d.ts.map +1 -0
- package/dist/types/modeler/solvers/pumpkin.d.ts +2 -0
- package/dist/types/modeler/solvers/pumpkin.d.ts.map +1 -0
- package/dist/types/modeler/solvers/registry.d.ts.map +1 -1
- package/dist/types/modeler/solvers/types.d.ts +9 -9
- package/dist/types/modeler/solvers/types.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/loader.d.ts +4 -0
- package/dist/types/modeler/solvers/z3/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/solver.d.ts +2 -15
- package/dist/types/modeler/solvers/z3/solver.d.ts.map +1 -1
- package/dist/types/modeler/types.d.ts +12 -15
- package/dist/types/modeler/types.d.ts.map +1 -1
- package/dist/types/modeler/validation.d.ts +26 -2
- package/dist/types/modeler/validation.d.ts.map +1 -1
- package/dist/types/modeler/variable.d.ts +9 -5
- package/dist/types/modeler/variable.d.ts.map +1 -1
- package/docs/examples/diet-sensitivity.md +15 -14
- package/docs/examples/ecommerce-coupons.md +15 -22
- package/docs/examples/index.md +20 -13
- package/docs/examples/knapsack.md +8 -7
- package/docs/examples/portfolio-qp.md +11 -4
- package/docs/examples/production.md +4 -4
- package/docs/examples/project-scheduling.md +106 -0
- package/docs/examples/shift-scheduling.md +23 -7
- package/docs/examples/smt-security.md +17 -4
- package/docs/examples/transportation.md +46 -19
- package/docs/examples/traveling-salesperson.md +29 -45
- package/docs/examples/unsat-core.md +16 -5
- package/docs/examples/vehicle-routing.md +10 -8
- package/docs/getting-started/ai-agents.md +114 -34
- package/docs/getting-started/coding-agents.md +158 -0
- package/docs/getting-started/cross-origin.md +56 -28
- package/docs/getting-started/index.md +36 -66
- package/docs/getting-started/runtimes.md +98 -69
- package/docs/guide/constraint-programming.md +141 -0
- package/docs/guide/constraints.md +100 -44
- package/docs/guide/decomposition.md +141 -273
- package/docs/guide/expressions.md +125 -42
- package/docs/guide/formulation-tips.md +212 -0
- package/docs/guide/objectives.md +70 -64
- package/docs/guide/unsat-core.md +44 -23
- package/docs/guide/variables.md +56 -48
- package/docs/solvers/custom-solver.md +18 -13
- package/docs/solvers/highs.md +41 -25
- package/docs/solvers/index.md +13 -7
- package/docs/solvers/pumpkin.md +163 -0
- package/docs/solvers/z3.md +4 -1
- package/llms-full.txt +1732 -860
- package/llms.txt +59 -36
- package/package.json +40 -13
- package/skills/washi/SKILL.md +91 -35
- package/dist/browser/_washi-node-only-BvRk9kiK.js +0 -0
- package/dist/browser/browser-runtime-TLCY0hkc.js +0 -1793
- package/dist/lib/_washi-node-only-BvRk9kiK.js +0 -0
- package/dist/lib/registry-C20sxTwm.js +0 -964
- package/docs/ja/getting-started/ai-agents.md +0 -270
- package/docs/zh/getting-started/ai-agents.md +0 -270
|
@@ -22,7 +22,13 @@ 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 =
|
|
25
|
+
}) : o, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e), f = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
function p(e) {
|
|
27
|
+
e && f.get(e)?.();
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/modeler/constraint.ts
|
|
31
|
+
var m = 0, h = class e {
|
|
26
32
|
kind = "constraint";
|
|
27
33
|
id;
|
|
28
34
|
_lhs;
|
|
@@ -31,16 +37,19 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
31
37
|
_name;
|
|
32
38
|
hasExplicitName;
|
|
33
39
|
ownerModel = null;
|
|
40
|
+
_indicatorOrigin;
|
|
41
|
+
_indicatorSnapshot;
|
|
42
|
+
_discreteVars;
|
|
34
43
|
slack = null;
|
|
35
44
|
dual = null;
|
|
36
45
|
addTerm(e, t) {
|
|
37
|
-
return t === 0 ? this : (this._lhs.addTerm(e, t), this.ownerModel
|
|
46
|
+
return t === 0 ? this : (this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0, this._lhs.addTerm(e, t), p(this.ownerModel), this);
|
|
38
47
|
}
|
|
39
48
|
setTerm(e, t) {
|
|
40
|
-
return this._lhs.setTerm(e, t), this.ownerModel
|
|
49
|
+
return this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0, this._lhs.setTerm(e, t), p(this.ownerModel), this;
|
|
41
50
|
}
|
|
42
51
|
constructor(e, t, n, r) {
|
|
43
|
-
this.id = ++
|
|
52
|
+
this.id = ++m, this._lhs = e, this._sense = t, this._rhs = n;
|
|
44
53
|
let i = typeof r == "string" ? r.trim() : void 0;
|
|
45
54
|
i && i.length > 0 ? (this._name = i, this.hasExplicitName = !0) : (this._name = `c_${this.id}`, this.hasExplicitName = !1);
|
|
46
55
|
}
|
|
@@ -48,43 +57,83 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
48
57
|
return this._lhs;
|
|
49
58
|
}
|
|
50
59
|
set lhs(e) {
|
|
51
|
-
this._lhs !== e && (this._lhs = e, this.ownerModel
|
|
60
|
+
this._lhs !== e && (this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0, this._lhs = e, p(this.ownerModel));
|
|
52
61
|
}
|
|
53
62
|
get sense() {
|
|
54
63
|
return this._sense;
|
|
55
64
|
}
|
|
56
65
|
set sense(e) {
|
|
57
|
-
|
|
66
|
+
if (e === "!=" && !Number.isSafeInteger(this._rhs)) throw Error(`Discrete "!=" in constraint "${this._name}" requires a safe integer RHS, received ${this._rhs}.`);
|
|
67
|
+
this._sense !== e && (this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0, this._sense = e, p(this.ownerModel));
|
|
58
68
|
}
|
|
59
69
|
get rhs() {
|
|
60
70
|
return this._rhs;
|
|
61
71
|
}
|
|
62
72
|
set rhs(e) {
|
|
63
|
-
|
|
73
|
+
if (this._sense === "!=" && !Number.isSafeInteger(e)) throw Error(`Discrete "!=" in constraint "${this._name}" requires a safe integer RHS, received ${e}.`);
|
|
74
|
+
Object.is(this._rhs, e) || (this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0, this._rhs = e, p(this.ownerModel));
|
|
64
75
|
}
|
|
65
76
|
get name() {
|
|
66
77
|
return this._name;
|
|
67
78
|
}
|
|
68
79
|
set name(e) {
|
|
69
|
-
this._name !== e && (this._name = e, this.ownerModel
|
|
80
|
+
this._name !== e && (this._name = e, p(this.ownerModel)), this.hasExplicitName = !0;
|
|
81
|
+
}
|
|
82
|
+
get _indicatorMeta() {
|
|
83
|
+
let e = this._indicatorOrigin, t = this._indicatorSnapshot;
|
|
84
|
+
if (!e || !t) return;
|
|
85
|
+
if (this._lhs !== t.lhsRef || this._sense !== t.sense || !Object.is(this._rhs, t.rhs) || !Object.is(this._lhs.constant, t.constant) || this._lhs.nonlinearTerms.length > 0 || this._lhs.terms.size !== t.terms.size) {
|
|
86
|
+
this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
for (let [e, n] of t.terms) if (!this._lhs.terms.has(e) || !Object.is(this._lhs.terms.get(e), n)) {
|
|
90
|
+
this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let n = e.targetRhs - (e.targetLhs.constant ?? 0), r = 0;
|
|
94
|
+
for (let [t, n] of e.targetLhs.terms) {
|
|
95
|
+
if (n === 0) continue;
|
|
96
|
+
let i = e.targetSense === "<=" ? n > 0 ? t.ub : t.lb : n > 0 ? t.lb : t.ub;
|
|
97
|
+
if (!Number.isFinite(i) || (r += n * i, !Number.isFinite(r))) return;
|
|
98
|
+
}
|
|
99
|
+
if (!((e.targetSense === "<=" ? r - n : n - r) > e.derivedM + 1e-9)) return e;
|
|
100
|
+
}
|
|
101
|
+
_setIndicatorOrigin(e) {
|
|
102
|
+
if (!e) {
|
|
103
|
+
this._indicatorOrigin = void 0, this._indicatorSnapshot = void 0;
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this._indicatorOrigin = e, this._indicatorSnapshot = {
|
|
107
|
+
lhsRef: this._lhs,
|
|
108
|
+
terms: new Map(this._lhs.terms),
|
|
109
|
+
constant: this._lhs.constant,
|
|
110
|
+
sense: this._sense,
|
|
111
|
+
rhs: this._rhs
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
get _requiredDiscreteVars() {
|
|
115
|
+
return this._discreteVars;
|
|
116
|
+
}
|
|
117
|
+
_setDiscreteVars(e) {
|
|
118
|
+
this._discreteVars = e;
|
|
70
119
|
}
|
|
71
120
|
_assignModelName(e, t) {
|
|
72
121
|
this._name = e, this.hasExplicitName = t;
|
|
73
122
|
}
|
|
74
123
|
and(e) {
|
|
75
|
-
return new
|
|
124
|
+
return new y("and", [this, e]);
|
|
76
125
|
}
|
|
77
126
|
or(e) {
|
|
78
|
-
return new
|
|
127
|
+
return new y("or", [this, e]);
|
|
79
128
|
}
|
|
80
129
|
implies(e) {
|
|
81
|
-
return new
|
|
130
|
+
return new y("implies", [this, e]);
|
|
82
131
|
}
|
|
83
132
|
xor(e) {
|
|
84
|
-
return new
|
|
133
|
+
return new y("xor", [this, e]);
|
|
85
134
|
}
|
|
86
135
|
not() {
|
|
87
|
-
return new
|
|
136
|
+
return new y("not", [this]);
|
|
88
137
|
}
|
|
89
138
|
add(e) {
|
|
90
139
|
throw Error("Cannot perform arithmetic on a Constraint: expected a number, Var, LinExpr, or QuadExpr.");
|
|
@@ -110,6 +159,15 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
110
159
|
eq(e, t) {
|
|
111
160
|
throw Error("Cannot compare a Constraint in (==): expected a number, Var, or LinExpr.");
|
|
112
161
|
}
|
|
162
|
+
lt(e, t) {
|
|
163
|
+
throw Error("Cannot compare a Constraint in (<): expected a number, Var, or LinExpr.");
|
|
164
|
+
}
|
|
165
|
+
gt(e, t) {
|
|
166
|
+
throw Error("Cannot compare a Constraint in (>): expected a number, Var, or LinExpr.");
|
|
167
|
+
}
|
|
168
|
+
ne(e, t) {
|
|
169
|
+
throw Error("Cannot compare a Constraint in (!=): expected a number, Var, or LinExpr.");
|
|
170
|
+
}
|
|
113
171
|
get value() {
|
|
114
172
|
throw Error("Cannot read numeric value of a Constraint: expected a Var, LinExpr, or QuadExpr.");
|
|
115
173
|
}
|
|
@@ -117,142 +175,169 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
117
175
|
throw Error("Cannot read numeric constant of a Constraint: expected a LinExpr or QuadExpr.");
|
|
118
176
|
}
|
|
119
177
|
clone() {
|
|
120
|
-
|
|
178
|
+
let t = new e(this._lhs.clone(), this._sense, this._rhs, this.hasExplicitName ? this._name : void 0);
|
|
179
|
+
return this._discreteVars && t._setDiscreteVars(new Set(this._discreteVars)), t;
|
|
121
180
|
}
|
|
122
181
|
toString() {
|
|
123
182
|
let e = this.sense === "==" ? "=" : this.sense;
|
|
124
183
|
return `${this.name}: ${this.lhs.toString()} ${e} ${this.rhs}`;
|
|
125
184
|
}
|
|
126
|
-
},
|
|
127
|
-
function
|
|
128
|
-
if (e instanceof
|
|
185
|
+
}, g = 0;
|
|
186
|
+
function _(e, t) {
|
|
187
|
+
if (e instanceof ee || e instanceof h) return e;
|
|
129
188
|
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
189
|
}
|
|
131
|
-
var
|
|
190
|
+
var ee = class {
|
|
132
191
|
and(e) {
|
|
133
|
-
return new
|
|
192
|
+
return new y("and", [this, _(e, "and")]);
|
|
134
193
|
}
|
|
135
194
|
or(e) {
|
|
136
|
-
return new
|
|
195
|
+
return new y("or", [this, _(e, "or")]);
|
|
137
196
|
}
|
|
138
197
|
implies(e) {
|
|
139
|
-
return new
|
|
198
|
+
return new y("implies", [this, _(e, "implies")]);
|
|
140
199
|
}
|
|
141
200
|
xor(e) {
|
|
142
|
-
return new
|
|
201
|
+
return new y("xor", [this, _(e, "xor")]);
|
|
143
202
|
}
|
|
144
203
|
not() {
|
|
145
|
-
return new
|
|
204
|
+
return new y("not", [this]);
|
|
146
205
|
}
|
|
147
|
-
},
|
|
206
|
+
}, v = class extends ee {
|
|
148
207
|
id;
|
|
208
|
+
type = "Boolean";
|
|
149
209
|
name;
|
|
150
210
|
value = null;
|
|
151
211
|
constructor(e) {
|
|
152
|
-
super(), this.id = ++
|
|
212
|
+
super(), this.id = ++g, this.name = e || `p_${this.id}`;
|
|
153
213
|
}
|
|
154
214
|
toString() {
|
|
155
215
|
return this.name;
|
|
156
216
|
}
|
|
157
|
-
},
|
|
217
|
+
}, y = class extends ee {
|
|
158
218
|
op;
|
|
159
219
|
children;
|
|
160
220
|
constructor(e, t) {
|
|
161
|
-
super(), this.op = e, this.children = t.map((t) =>
|
|
221
|
+
super(), this.op = e, this.children = t.map((t) => _(t, e));
|
|
162
222
|
}
|
|
163
223
|
toString() {
|
|
164
224
|
return this.op === "not" ? `not(${this.children[0].toString()})` : `(${this.children.map((e) => e.toString()).join(` ${this.op} `)})`;
|
|
165
225
|
}
|
|
226
|
+
}, te = class extends ee {
|
|
227
|
+
spec;
|
|
228
|
+
discreteVars;
|
|
229
|
+
constructor(e, t) {
|
|
230
|
+
super(), this.spec = e, this.discreteVars = t;
|
|
231
|
+
}
|
|
232
|
+
toString() {
|
|
233
|
+
switch (this.spec.kind) {
|
|
234
|
+
case "distinct": return `distinct(${this.spec.args.map((e) => e.toString()).join(", ")})`;
|
|
235
|
+
case "disjoint": return `disjoint([${this.spec.tasks.map((e) => `{ start: ${e.start.toString()}, duration: ${e.duration} }`).join(", ")}])`;
|
|
236
|
+
case "cumulative": return `cumulative([${this.spec.tasks.map((e) => `{ start: ${e.start.toString()}, duration: ${e.duration}, demand: ${e.demand} }`).join(", ")}], ${this.spec.capacity})`;
|
|
237
|
+
case "allowed": return `allowed([${this.spec.vars.map((e) => e.toString()).join(", ")}], [${this.spec.tuples.map((e) => `[${e.join(", ")}]`).join(", ")}])`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
166
240
|
};
|
|
167
241
|
//#endregion
|
|
242
|
+
//#region src/modeler/types.ts
|
|
243
|
+
function b(e) {
|
|
244
|
+
if (e === void 0) return "Minimize";
|
|
245
|
+
if (typeof e == "string") {
|
|
246
|
+
let t = e.toLowerCase();
|
|
247
|
+
if (t === "maximize") return "Maximize";
|
|
248
|
+
if (t === "minimize") return "Minimize";
|
|
249
|
+
}
|
|
250
|
+
throw Error(`Invalid optimization sense "${String(e)}": expected "Maximize", "Minimize", "maximize", or "minimize".`);
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
168
253
|
//#region src/modeler/lp-writer.ts
|
|
169
|
-
function
|
|
254
|
+
function x(e) {
|
|
170
255
|
return typeof e == "object" && !!e && typeof e.lpString == "string" && e.nameToVar instanceof Map && e.nameToConstraint instanceof Map;
|
|
171
256
|
}
|
|
172
257
|
//#endregion
|
|
173
258
|
//#region src/modeler/solvers/registry.ts
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
var
|
|
177
|
-
function
|
|
178
|
-
|
|
259
|
+
var S = Symbol.for("washi.solverRegistry"), C = globalThis;
|
|
260
|
+
C[S] || (C[S] = /* @__PURE__ */ new Map());
|
|
261
|
+
var w = C[S];
|
|
262
|
+
function ne(e, t) {
|
|
263
|
+
w.set(e.toLowerCase(), t);
|
|
179
264
|
}
|
|
180
265
|
//#endregion
|
|
181
266
|
//#region \0washi-browser-z3-assets
|
|
182
|
-
var
|
|
183
|
-
function
|
|
184
|
-
if (!
|
|
185
|
-
return new URL(e,
|
|
267
|
+
var re = import.meta.url;
|
|
268
|
+
function ie(e) {
|
|
269
|
+
if (!re) throw Error("[WaSHI] Load the browser IIFE using an external script src, or use the browser ESM build.");
|
|
270
|
+
return new URL(e, re).href;
|
|
186
271
|
}
|
|
187
|
-
function
|
|
272
|
+
function ae() {
|
|
188
273
|
return {
|
|
189
|
-
jsUrl:
|
|
190
|
-
wasmUrl:
|
|
274
|
+
jsUrl: ie("z3-built.js"),
|
|
275
|
+
wasmUrl: ie("z3-built.wasm")
|
|
191
276
|
};
|
|
192
277
|
}
|
|
193
278
|
//#endregion
|
|
194
279
|
//#region node_modules/tslib/tslib.es6.mjs
|
|
195
|
-
var
|
|
196
|
-
__addDisposableResource: () =>
|
|
197
|
-
__assign: () =>
|
|
198
|
-
__asyncDelegator: () =>
|
|
199
|
-
__asyncGenerator: () =>
|
|
200
|
-
__asyncValues: () =>
|
|
201
|
-
__await: () =>
|
|
202
|
-
__awaiter: () =>
|
|
203
|
-
__classPrivateFieldGet: () =>
|
|
204
|
-
__classPrivateFieldIn: () =>
|
|
205
|
-
__classPrivateFieldSet: () =>
|
|
206
|
-
__createBinding: () =>
|
|
207
|
-
__decorate: () =>
|
|
208
|
-
__disposeResources: () =>
|
|
209
|
-
__esDecorate: () =>
|
|
210
|
-
__exportStar: () =>
|
|
211
|
-
__extends: () =>
|
|
212
|
-
__generator: () =>
|
|
213
|
-
__importDefault: () =>
|
|
214
|
-
__importStar: () =>
|
|
215
|
-
__makeTemplateObject: () =>
|
|
216
|
-
__metadata: () =>
|
|
217
|
-
__param: () =>
|
|
218
|
-
__propKey: () =>
|
|
219
|
-
__read: () =>
|
|
220
|
-
__rest: () =>
|
|
221
|
-
__rewriteRelativeImportExtension: () =>
|
|
222
|
-
__runInitializers: () =>
|
|
223
|
-
__setFunctionName: () =>
|
|
224
|
-
__spread: () =>
|
|
225
|
-
__spreadArray: () =>
|
|
226
|
-
__spreadArrays: () =>
|
|
227
|
-
__values: () =>
|
|
228
|
-
default: () =>
|
|
280
|
+
var oe = /* @__PURE__ */ c({
|
|
281
|
+
__addDisposableResource: () => Ae,
|
|
282
|
+
__assign: () => Pe,
|
|
283
|
+
__asyncDelegator: () => Se,
|
|
284
|
+
__asyncGenerator: () => xe,
|
|
285
|
+
__asyncValues: () => Ce,
|
|
286
|
+
__await: () => O,
|
|
287
|
+
__awaiter: () => pe,
|
|
288
|
+
__classPrivateFieldGet: () => De,
|
|
289
|
+
__classPrivateFieldIn: () => ke,
|
|
290
|
+
__classPrivateFieldSet: () => Oe,
|
|
291
|
+
__createBinding: () => Fe,
|
|
292
|
+
__decorate: () => le,
|
|
293
|
+
__disposeResources: () => je,
|
|
294
|
+
__esDecorate: () => E,
|
|
295
|
+
__exportStar: () => he,
|
|
296
|
+
__extends: () => se,
|
|
297
|
+
__generator: () => me,
|
|
298
|
+
__importDefault: () => Ee,
|
|
299
|
+
__importStar: () => Te,
|
|
300
|
+
__makeTemplateObject: () => we,
|
|
301
|
+
__metadata: () => fe,
|
|
302
|
+
__param: () => T,
|
|
303
|
+
__propKey: () => D,
|
|
304
|
+
__read: () => _e,
|
|
305
|
+
__rest: () => ce,
|
|
306
|
+
__rewriteRelativeImportExtension: () => Me,
|
|
307
|
+
__runInitializers: () => ue,
|
|
308
|
+
__setFunctionName: () => de,
|
|
309
|
+
__spread: () => ve,
|
|
310
|
+
__spreadArray: () => be,
|
|
311
|
+
__spreadArrays: () => ye,
|
|
312
|
+
__values: () => ge,
|
|
313
|
+
default: () => Re
|
|
229
314
|
});
|
|
230
|
-
function
|
|
315
|
+
function se(e, t) {
|
|
231
316
|
if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
232
|
-
|
|
317
|
+
Ne(e, t);
|
|
233
318
|
function n() {
|
|
234
319
|
this.constructor = e;
|
|
235
320
|
}
|
|
236
321
|
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
237
322
|
}
|
|
238
|
-
function
|
|
323
|
+
function ce(e, t) {
|
|
239
324
|
var n = {};
|
|
240
325
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
241
326
|
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]]);
|
|
242
327
|
return n;
|
|
243
328
|
}
|
|
244
|
-
function
|
|
329
|
+
function le(e, t, n, r) {
|
|
245
330
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
246
331
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
247
332
|
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);
|
|
248
333
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
249
334
|
}
|
|
250
|
-
function
|
|
335
|
+
function T(e, t) {
|
|
251
336
|
return function(n, r) {
|
|
252
337
|
t(n, r, e);
|
|
253
338
|
};
|
|
254
339
|
}
|
|
255
|
-
function
|
|
340
|
+
function E(e, t, n, r, i, a) {
|
|
256
341
|
function o(e) {
|
|
257
342
|
if (e !== void 0 && typeof e != "function") throw TypeError("Function expected");
|
|
258
343
|
return e;
|
|
@@ -277,23 +362,23 @@ function ue(e, t, n, r, i, a) {
|
|
|
277
362
|
}
|
|
278
363
|
l && Object.defineProperty(l, r.name, u), f = !0;
|
|
279
364
|
}
|
|
280
|
-
function
|
|
365
|
+
function ue(e, t, n) {
|
|
281
366
|
for (var r = arguments.length > 2, i = 0; i < t.length; i++) n = r ? t[i].call(e, n) : t[i].call(e);
|
|
282
367
|
return r ? n : void 0;
|
|
283
368
|
}
|
|
284
|
-
function
|
|
369
|
+
function D(e) {
|
|
285
370
|
return typeof e == "symbol" ? e : `${e}`;
|
|
286
371
|
}
|
|
287
|
-
function
|
|
372
|
+
function de(e, t, n) {
|
|
288
373
|
return typeof t == "symbol" && (t = t.description ? `[${t.description}]` : ""), Object.defineProperty(e, "name", {
|
|
289
374
|
configurable: !0,
|
|
290
375
|
value: n ? `${n} ${t}` : t
|
|
291
376
|
});
|
|
292
377
|
}
|
|
293
|
-
function
|
|
378
|
+
function fe(e, t) {
|
|
294
379
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
295
380
|
}
|
|
296
|
-
function
|
|
381
|
+
function pe(e, t, n, r) {
|
|
297
382
|
function i(e) {
|
|
298
383
|
return e instanceof n ? e : new n(function(t) {
|
|
299
384
|
t(e);
|
|
@@ -320,7 +405,7 @@ function fe(e, t, n, r) {
|
|
|
320
405
|
c((r = r.apply(e, t || [])).next());
|
|
321
406
|
});
|
|
322
407
|
}
|
|
323
|
-
function
|
|
408
|
+
function me(e, t) {
|
|
324
409
|
var n = {
|
|
325
410
|
label: 0,
|
|
326
411
|
sent: function() {
|
|
@@ -390,10 +475,10 @@ function T(e, t) {
|
|
|
390
475
|
};
|
|
391
476
|
}
|
|
392
477
|
}
|
|
393
|
-
function
|
|
394
|
-
for (var n in e) n !== "default" && !Object.prototype.hasOwnProperty.call(t, n) &&
|
|
478
|
+
function he(e, t) {
|
|
479
|
+
for (var n in e) n !== "default" && !Object.prototype.hasOwnProperty.call(t, n) && Fe(t, e, n);
|
|
395
480
|
}
|
|
396
|
-
function
|
|
481
|
+
function ge(e) {
|
|
397
482
|
var t = typeof Symbol == "function" && Symbol.iterator, n = t && e[t], r = 0;
|
|
398
483
|
if (n) return n.call(e);
|
|
399
484
|
if (e && typeof e.length == "number") return { next: function() {
|
|
@@ -404,7 +489,7 @@ function me(e) {
|
|
|
404
489
|
} };
|
|
405
490
|
throw TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
406
491
|
}
|
|
407
|
-
function
|
|
492
|
+
function _e(e, t) {
|
|
408
493
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
409
494
|
if (!n) return e;
|
|
410
495
|
var r = n.call(e), i, a = [], o;
|
|
@@ -421,23 +506,23 @@ function he(e, t) {
|
|
|
421
506
|
}
|
|
422
507
|
return a;
|
|
423
508
|
}
|
|
424
|
-
function
|
|
425
|
-
for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(
|
|
509
|
+
function ve() {
|
|
510
|
+
for (var e = [], t = 0; t < arguments.length; t++) e = e.concat(_e(arguments[t]));
|
|
426
511
|
return e;
|
|
427
512
|
}
|
|
428
|
-
function
|
|
513
|
+
function ye() {
|
|
429
514
|
for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
|
|
430
515
|
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];
|
|
431
516
|
return r;
|
|
432
517
|
}
|
|
433
|
-
function
|
|
518
|
+
function be(e, t, n) {
|
|
434
519
|
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]);
|
|
435
520
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
436
521
|
}
|
|
437
|
-
function
|
|
438
|
-
return this instanceof
|
|
522
|
+
function O(e) {
|
|
523
|
+
return this instanceof O ? (this.v = e, this) : new O(e);
|
|
439
524
|
}
|
|
440
|
-
function
|
|
525
|
+
function xe(e, t, n) {
|
|
441
526
|
if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
|
|
442
527
|
var r = n.apply(e, t || []), i, a = [];
|
|
443
528
|
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), s("next"), s("throw"), s("return", o), i[Symbol.asyncIterator] = function() {
|
|
@@ -468,7 +553,7 @@ function be(e, t, n) {
|
|
|
468
553
|
}
|
|
469
554
|
}
|
|
470
555
|
function l(e) {
|
|
471
|
-
e.value instanceof
|
|
556
|
+
e.value instanceof O ? Promise.resolve(e.value.v).then(u, d) : f(a[0][2], e);
|
|
472
557
|
}
|
|
473
558
|
function u(e) {
|
|
474
559
|
c("next", e);
|
|
@@ -480,7 +565,7 @@ function be(e, t, n) {
|
|
|
480
565
|
e(t), a.shift(), a.length && c(a[0][0], a[0][1]);
|
|
481
566
|
}
|
|
482
567
|
}
|
|
483
|
-
function
|
|
568
|
+
function Se(e) {
|
|
484
569
|
var t = {}, n;
|
|
485
570
|
return r("next"), r("throw", function(e) {
|
|
486
571
|
throw e;
|
|
@@ -490,16 +575,16 @@ function xe(e) {
|
|
|
490
575
|
function r(r, i) {
|
|
491
576
|
t[r] = e[r] ? function(t) {
|
|
492
577
|
return (n = !n) ? {
|
|
493
|
-
value:
|
|
578
|
+
value: O(e[r](t)),
|
|
494
579
|
done: !1
|
|
495
580
|
} : i ? i(t) : t;
|
|
496
581
|
} : i;
|
|
497
582
|
}
|
|
498
583
|
}
|
|
499
|
-
function
|
|
584
|
+
function Ce(e) {
|
|
500
585
|
if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
|
|
501
586
|
var t = e[Symbol.asyncIterator], n;
|
|
502
|
-
return t ? t.call(e) : (e = typeof
|
|
587
|
+
return t ? t.call(e) : (e = typeof ge == "function" ? ge(e) : e[Symbol.iterator](), n = {}, r("next"), r("throw"), r("return"), n[Symbol.asyncIterator] = function() {
|
|
503
588
|
return this;
|
|
504
589
|
}, n);
|
|
505
590
|
function r(t) {
|
|
@@ -518,34 +603,34 @@ function Se(e) {
|
|
|
518
603
|
}, t);
|
|
519
604
|
}
|
|
520
605
|
}
|
|
521
|
-
function
|
|
606
|
+
function we(e, t) {
|
|
522
607
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
523
608
|
}
|
|
524
|
-
function
|
|
609
|
+
function Te(e) {
|
|
525
610
|
if (e && e.__esModule) return e;
|
|
526
611
|
var t = {};
|
|
527
|
-
if (e != null) for (var n =
|
|
528
|
-
return
|
|
612
|
+
if (e != null) for (var n = Le(e), r = 0; r < n.length; r++) n[r] !== "default" && Fe(t, e, n[r]);
|
|
613
|
+
return Ie(t, e), t;
|
|
529
614
|
}
|
|
530
|
-
function
|
|
615
|
+
function Ee(e) {
|
|
531
616
|
return e && e.__esModule ? e : { default: e };
|
|
532
617
|
}
|
|
533
|
-
function
|
|
618
|
+
function De(e, t, n, r) {
|
|
534
619
|
if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
|
|
535
620
|
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");
|
|
536
621
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
537
622
|
}
|
|
538
|
-
function
|
|
623
|
+
function Oe(e, t, n, r, i) {
|
|
539
624
|
if (r === "m") throw TypeError("Private method is not writable");
|
|
540
625
|
if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
|
|
541
626
|
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");
|
|
542
627
|
return r === "a" ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
|
|
543
628
|
}
|
|
544
|
-
function
|
|
629
|
+
function ke(e, t) {
|
|
545
630
|
if (t === null || typeof t != "object" && typeof t != "function") throw TypeError("Cannot use 'in' operator on non-object");
|
|
546
631
|
return typeof e == "function" ? t === e : e.has(t);
|
|
547
632
|
}
|
|
548
|
-
function
|
|
633
|
+
function Ae(e, t, n) {
|
|
549
634
|
if (t != null) {
|
|
550
635
|
if (typeof t != "object" && typeof t != "function") throw TypeError("Object expected.");
|
|
551
636
|
var r, i;
|
|
@@ -572,9 +657,9 @@ function Oe(e, t, n) {
|
|
|
572
657
|
} else n && e.stack.push({ async: !0 });
|
|
573
658
|
return t;
|
|
574
659
|
}
|
|
575
|
-
function
|
|
660
|
+
function je(e) {
|
|
576
661
|
function t(t) {
|
|
577
|
-
e.error = e.hasError ? new
|
|
662
|
+
e.error = e.hasError ? new k(t, e.error, "An error was suppressed during disposal.") : t, e.hasError = !0;
|
|
578
663
|
}
|
|
579
664
|
var n, r = 0;
|
|
580
665
|
function i() {
|
|
@@ -594,24 +679,24 @@ function ke(e) {
|
|
|
594
679
|
}
|
|
595
680
|
return i();
|
|
596
681
|
}
|
|
597
|
-
function
|
|
682
|
+
function Me(e, t) {
|
|
598
683
|
return typeof e == "string" && /^\.\.?\//.test(e) ? e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(e, n, r, i, a) {
|
|
599
684
|
return n ? t ? ".jsx" : ".js" : r && (!i || !a) ? e : r + i + "." + a.toLowerCase() + "js";
|
|
600
685
|
}) : e;
|
|
601
686
|
}
|
|
602
|
-
var
|
|
603
|
-
|
|
604
|
-
return
|
|
687
|
+
var Ne, Pe, Fe, Ie, Le, k, Re, ze = o((() => {
|
|
688
|
+
Ne = function(e, t) {
|
|
689
|
+
return Ne = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
|
|
605
690
|
e.__proto__ = t;
|
|
606
691
|
} || function(e, t) {
|
|
607
692
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
608
|
-
},
|
|
609
|
-
},
|
|
610
|
-
return
|
|
693
|
+
}, Ne(e, t);
|
|
694
|
+
}, Pe = function() {
|
|
695
|
+
return Pe = Object.assign || function(e) {
|
|
611
696
|
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]);
|
|
612
697
|
return e;
|
|
613
|
-
},
|
|
614
|
-
},
|
|
698
|
+
}, Pe.apply(this, arguments);
|
|
699
|
+
}, Fe = Object.create ? (function(e, t, n, r) {
|
|
615
700
|
r === void 0 && (r = n);
|
|
616
701
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
617
702
|
(!i || ("get" in i ? !t.__esModule : i.writable || i.configurable)) && (i = {
|
|
@@ -622,61 +707,61 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
622
707
|
}), Object.defineProperty(e, r, i);
|
|
623
708
|
}) : (function(e, t, n, r) {
|
|
624
709
|
r === void 0 && (r = n), e[r] = t[n];
|
|
625
|
-
}),
|
|
710
|
+
}), Ie = Object.create ? (function(e, t) {
|
|
626
711
|
Object.defineProperty(e, "default", {
|
|
627
712
|
enumerable: !0,
|
|
628
713
|
value: t
|
|
629
714
|
});
|
|
630
715
|
}) : function(e, t) {
|
|
631
716
|
e.default = t;
|
|
632
|
-
},
|
|
633
|
-
return
|
|
717
|
+
}, Le = function(e) {
|
|
718
|
+
return Le = Object.getOwnPropertyNames || function(e) {
|
|
634
719
|
var t = [];
|
|
635
720
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[t.length] = n);
|
|
636
721
|
return t;
|
|
637
|
-
},
|
|
638
|
-
},
|
|
722
|
+
}, Le(e);
|
|
723
|
+
}, k = typeof SuppressedError == "function" ? SuppressedError : function(e, t, n) {
|
|
639
724
|
var r = Error(n);
|
|
640
725
|
return r.name = "SuppressedError", r.error = e, r.suppressed = t, r;
|
|
641
|
-
},
|
|
642
|
-
__extends:
|
|
643
|
-
__assign:
|
|
644
|
-
__rest:
|
|
645
|
-
__decorate:
|
|
646
|
-
__param:
|
|
647
|
-
__esDecorate:
|
|
648
|
-
__runInitializers:
|
|
649
|
-
__propKey:
|
|
650
|
-
__setFunctionName:
|
|
651
|
-
__metadata:
|
|
652
|
-
__awaiter:
|
|
653
|
-
__generator:
|
|
654
|
-
__createBinding:
|
|
655
|
-
__exportStar:
|
|
656
|
-
__values:
|
|
657
|
-
__read:
|
|
658
|
-
__spread:
|
|
659
|
-
__spreadArrays:
|
|
660
|
-
__spreadArray:
|
|
661
|
-
__await:
|
|
662
|
-
__asyncGenerator:
|
|
663
|
-
__asyncDelegator:
|
|
664
|
-
__asyncValues:
|
|
665
|
-
__makeTemplateObject:
|
|
666
|
-
__importStar:
|
|
667
|
-
__importDefault:
|
|
668
|
-
__classPrivateFieldGet:
|
|
669
|
-
__classPrivateFieldSet:
|
|
670
|
-
__classPrivateFieldIn:
|
|
671
|
-
__addDisposableResource:
|
|
672
|
-
__disposeResources:
|
|
673
|
-
__rewriteRelativeImportExtension:
|
|
726
|
+
}, Re = {
|
|
727
|
+
__extends: se,
|
|
728
|
+
__assign: Pe,
|
|
729
|
+
__rest: ce,
|
|
730
|
+
__decorate: le,
|
|
731
|
+
__param: T,
|
|
732
|
+
__esDecorate: E,
|
|
733
|
+
__runInitializers: ue,
|
|
734
|
+
__propKey: D,
|
|
735
|
+
__setFunctionName: de,
|
|
736
|
+
__metadata: fe,
|
|
737
|
+
__awaiter: pe,
|
|
738
|
+
__generator: me,
|
|
739
|
+
__createBinding: Fe,
|
|
740
|
+
__exportStar: he,
|
|
741
|
+
__values: ge,
|
|
742
|
+
__read: _e,
|
|
743
|
+
__spread: ve,
|
|
744
|
+
__spreadArrays: ye,
|
|
745
|
+
__spreadArray: be,
|
|
746
|
+
__await: O,
|
|
747
|
+
__asyncGenerator: xe,
|
|
748
|
+
__asyncDelegator: Se,
|
|
749
|
+
__asyncValues: Ce,
|
|
750
|
+
__makeTemplateObject: we,
|
|
751
|
+
__importStar: Te,
|
|
752
|
+
__importDefault: Ee,
|
|
753
|
+
__classPrivateFieldGet: De,
|
|
754
|
+
__classPrivateFieldSet: Oe,
|
|
755
|
+
__classPrivateFieldIn: ke,
|
|
756
|
+
__addDisposableResource: Ae,
|
|
757
|
+
__disposeResources: je,
|
|
758
|
+
__rewriteRelativeImportExtension: Me
|
|
674
759
|
};
|
|
675
|
-
})),
|
|
760
|
+
})), A = /* @__PURE__ */ s(((e) => {
|
|
676
761
|
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");
|
|
677
|
-
})),
|
|
762
|
+
})), Be = /* @__PURE__ */ s(((e) => {
|
|
678
763
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
679
|
-
var t = (
|
|
764
|
+
var t = (ze(), d(oe)), n = A();
|
|
680
765
|
e.default = function() {
|
|
681
766
|
function e(e, t) {
|
|
682
767
|
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");
|
|
@@ -745,9 +830,9 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
745
830
|
}), this._waiters = [];
|
|
746
831
|
}, e;
|
|
747
832
|
}();
|
|
748
|
-
})),
|
|
833
|
+
})), Ve = /* @__PURE__ */ s(((e) => {
|
|
749
834
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
750
|
-
var t = (
|
|
835
|
+
var t = (ze(), d(oe)), n = Be();
|
|
751
836
|
e.default = function() {
|
|
752
837
|
function e(e) {
|
|
753
838
|
this._semaphore = new n.default(1, e);
|
|
@@ -776,9 +861,9 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
776
861
|
return this._semaphore.cancel();
|
|
777
862
|
}, e;
|
|
778
863
|
}();
|
|
779
|
-
})),
|
|
864
|
+
})), He = /* @__PURE__ */ s(((e) => {
|
|
780
865
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.withTimeout = void 0;
|
|
781
|
-
var t = (
|
|
866
|
+
var t = (ze(), d(oe)), n = A();
|
|
782
867
|
function r(e, r, i) {
|
|
783
868
|
var a = this;
|
|
784
869
|
return i === void 0 && (i = n.E_TIMEOUT), {
|
|
@@ -843,44 +928,44 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
843
928
|
};
|
|
844
929
|
}
|
|
845
930
|
e.withTimeout = r;
|
|
846
|
-
})),
|
|
931
|
+
})), Ue = /* @__PURE__ */ s(((e) => {
|
|
847
932
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.tryAcquire = void 0;
|
|
848
|
-
var t =
|
|
933
|
+
var t = A(), n = He();
|
|
849
934
|
function r(e, r) {
|
|
850
935
|
return r === void 0 && (r = t.E_ALREADY_LOCKED), (0, n.withTimeout)(e, 0, r);
|
|
851
936
|
}
|
|
852
937
|
e.tryAcquire = r;
|
|
853
|
-
})),
|
|
938
|
+
})), We = /* @__PURE__ */ s(((e) => {
|
|
854
939
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.tryAcquire = e.withTimeout = e.Semaphore = e.Mutex = void 0;
|
|
855
|
-
var t = (
|
|
940
|
+
var t = (ze(), d(oe)), n = Ve();
|
|
856
941
|
Object.defineProperty(e, "Mutex", {
|
|
857
942
|
enumerable: !0,
|
|
858
943
|
get: function() {
|
|
859
944
|
return n.default;
|
|
860
945
|
}
|
|
861
946
|
});
|
|
862
|
-
var r =
|
|
947
|
+
var r = Be();
|
|
863
948
|
Object.defineProperty(e, "Semaphore", {
|
|
864
949
|
enumerable: !0,
|
|
865
950
|
get: function() {
|
|
866
951
|
return r.default;
|
|
867
952
|
}
|
|
868
953
|
});
|
|
869
|
-
var i =
|
|
954
|
+
var i = He();
|
|
870
955
|
Object.defineProperty(e, "withTimeout", {
|
|
871
956
|
enumerable: !0,
|
|
872
957
|
get: function() {
|
|
873
958
|
return i.withTimeout;
|
|
874
959
|
}
|
|
875
960
|
});
|
|
876
|
-
var a =
|
|
961
|
+
var a = Ue();
|
|
877
962
|
Object.defineProperty(e, "tryAcquire", {
|
|
878
963
|
enumerable: !0,
|
|
879
964
|
get: function() {
|
|
880
965
|
return a.tryAcquire;
|
|
881
966
|
}
|
|
882
|
-
}), (0, t.__exportStar)(
|
|
883
|
-
})),
|
|
967
|
+
}), (0, t.__exportStar)(A(), e);
|
|
968
|
+
})), Ge = /* @__PURE__ */ s(((e) => {
|
|
884
969
|
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;
|
|
885
970
|
var t;
|
|
886
971
|
(function(e) {
|
|
@@ -922,7 +1007,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
922
1007
|
(function(e) {
|
|
923
1008
|
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";
|
|
924
1009
|
})(u || (e.Z3_goal_prec = u = {}));
|
|
925
|
-
})),
|
|
1010
|
+
})), Ke = /* @__PURE__ */ s(((e) => {
|
|
926
1011
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.init = t;
|
|
927
1012
|
async function t(e, t = {}) {
|
|
928
1013
|
let n = await e(t);
|
|
@@ -3859,7 +3944,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
3859
3944
|
}
|
|
3860
3945
|
};
|
|
3861
3946
|
}
|
|
3862
|
-
})),
|
|
3947
|
+
})), qe = /* @__PURE__ */ s(((e) => {
|
|
3863
3948
|
var t = e && e.__createBinding || (Object.create ? (function(e, t, n, r) {
|
|
3864
3949
|
r === void 0 && (r = n);
|
|
3865
3950
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
@@ -3874,14 +3959,14 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
3874
3959
|
})), n = e && e.__exportStar || function(e, n) {
|
|
3875
3960
|
for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(n, r) && t(n, e, r);
|
|
3876
3961
|
};
|
|
3877
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), n(
|
|
3878
|
-
})),
|
|
3962
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), n(Ge(), e), n(Ke(), e);
|
|
3963
|
+
})), Je = /* @__PURE__ */ s(((e) => {
|
|
3879
3964
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.Z3AssertionError = e.Z3Error = void 0;
|
|
3880
3965
|
var t = class extends Error {};
|
|
3881
3966
|
e.Z3Error = t, e.Z3AssertionError = class extends t {};
|
|
3882
|
-
})),
|
|
3967
|
+
})), Ye = /* @__PURE__ */ s(((e) => {
|
|
3883
3968
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.assertExhaustive = n, e.assert = r, e.allSatisfy = i;
|
|
3884
|
-
var t =
|
|
3969
|
+
var t = Je();
|
|
3885
3970
|
function n(e) {
|
|
3886
3971
|
throw Error("Unexpected code execution detected, should be caught at compile time");
|
|
3887
3972
|
}
|
|
@@ -3893,9 +3978,9 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
3893
3978
|
for (let r of e) if (n = !0, !t(r)) return !1;
|
|
3894
3979
|
return n === !0 || null;
|
|
3895
3980
|
}
|
|
3896
|
-
})),
|
|
3981
|
+
})), Xe = /* @__PURE__ */ s(((e) => {
|
|
3897
3982
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.createApi = c;
|
|
3898
|
-
var t =
|
|
3983
|
+
var t = We(), n = qe(), r = Je(), i = Ye(), a = 17, o = new t.Mutex();
|
|
3899
3984
|
function s(e) {
|
|
3900
3985
|
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");
|
|
3901
3986
|
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;
|
|
@@ -3930,10 +4015,10 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
3930
4015
|
function _() {
|
|
3931
4016
|
e.global_param_reset_all();
|
|
3932
4017
|
}
|
|
3933
|
-
function
|
|
4018
|
+
function ee(t) {
|
|
3934
4019
|
return e.global_param_get(t);
|
|
3935
4020
|
}
|
|
3936
|
-
function
|
|
4021
|
+
function v(l, u) {
|
|
3937
4022
|
let d = e.mk_config();
|
|
3938
4023
|
u != null && Object.entries(u).forEach(([t, n]) => g(e.set_param_value(d, t, n.toString())));
|
|
3939
4024
|
let f = e.mk_context_rc(d);
|
|
@@ -3953,7 +4038,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
3953
4038
|
function _(t) {
|
|
3954
4039
|
return g(typeof t == "number" ? e.mk_int_symbol(f, t) : e.mk_string_symbol(f, t));
|
|
3955
4040
|
}
|
|
3956
|
-
function
|
|
4041
|
+
function v(t) {
|
|
3957
4042
|
let r = g(e.get_symbol_kind(f, t));
|
|
3958
4043
|
switch (r) {
|
|
3959
4044
|
case n.Z3_symbol_kind.Z3_INT_SYMBOL: return e.get_symbol_int(f, t);
|
|
@@ -3961,167 +4046,175 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
3961
4046
|
default: (0, i.assertExhaustive)(r);
|
|
3962
4047
|
}
|
|
3963
4048
|
}
|
|
3964
|
-
function
|
|
4049
|
+
function y(t, n) {
|
|
3965
4050
|
let r = e.mk_params(f);
|
|
3966
4051
|
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;
|
|
3967
4052
|
}
|
|
3968
4053
|
function te(t) {
|
|
3969
4054
|
switch (g(e.get_ast_kind(f, t))) {
|
|
3970
4055
|
case n.Z3_ast_kind.Z3_SORT_AST: return b(t);
|
|
3971
|
-
case n.Z3_ast_kind.Z3_FUNC_DECL_AST: return new
|
|
4056
|
+
case n.Z3_ast_kind.Z3_FUNC_DECL_AST: return new V(t);
|
|
3972
4057
|
default: return x(t);
|
|
3973
4058
|
}
|
|
3974
4059
|
}
|
|
3975
4060
|
function b(t) {
|
|
3976
4061
|
switch (g(e.get_sort_kind(f, t))) {
|
|
3977
|
-
case n.Z3_sort_kind.Z3_BOOL_SORT: return new
|
|
4062
|
+
case n.Z3_sort_kind.Z3_BOOL_SORT: return new or(t);
|
|
3978
4063
|
case n.Z3_sort_kind.Z3_INT_SORT:
|
|
3979
|
-
case n.Z3_sort_kind.Z3_REAL_SORT: return new
|
|
3980
|
-
case n.Z3_sort_kind.Z3_BV_SORT: return new
|
|
3981
|
-
case n.Z3_sort_kind.Z3_FLOATING_POINT_SORT: return new
|
|
3982
|
-
case n.Z3_sort_kind.Z3_ROUNDING_MODE_SORT: return new
|
|
3983
|
-
case n.Z3_sort_kind.Z3_SEQ_SORT: return new
|
|
3984
|
-
case n.Z3_sort_kind.Z3_RE_SORT: return new
|
|
3985
|
-
case n.Z3_sort_kind.Z3_ARRAY_SORT: return new
|
|
3986
|
-
default: return e.is_finite_set_sort(f, t) ? new Fr(t) : new
|
|
4064
|
+
case n.Z3_sort_kind.Z3_REAL_SORT: return new mr(t);
|
|
4065
|
+
case n.Z3_sort_kind.Z3_BV_SORT: return new wr(t);
|
|
4066
|
+
case n.Z3_sort_kind.Z3_FLOATING_POINT_SORT: return new Or(t);
|
|
4067
|
+
case n.Z3_sort_kind.Z3_ROUNDING_MODE_SORT: return new Er(t);
|
|
4068
|
+
case n.Z3_sort_kind.Z3_SEQ_SORT: return new Ar(t);
|
|
4069
|
+
case n.Z3_sort_kind.Z3_RE_SORT: return new jr(t);
|
|
4070
|
+
case n.Z3_sort_kind.Z3_ARRAY_SORT: return new Mr(t);
|
|
4071
|
+
default: return e.is_finite_set_sort(f, t) ? new Fr(t) : new B(t);
|
|
3987
4072
|
}
|
|
3988
4073
|
}
|
|
3989
4074
|
function x(t) {
|
|
3990
4075
|
let r = g(e.get_ast_kind(f, t));
|
|
3991
4076
|
if (r === n.Z3_ast_kind.Z3_QUANTIFIER_AST) return e.is_lambda(f, t) ? new Hr(t) : new Vr(t);
|
|
3992
4077
|
switch (g(e.get_sort_kind(f, e.get_sort(f, t)))) {
|
|
3993
|
-
case n.Z3_sort_kind.Z3_BOOL_SORT: return new
|
|
3994
|
-
case n.Z3_sort_kind.Z3_INT_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST ? new
|
|
3995
|
-
case n.Z3_sort_kind.Z3_REAL_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST ? new
|
|
3996
|
-
case n.Z3_sort_kind.Z3_BV_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST ? new
|
|
3997
|
-
case n.Z3_sort_kind.Z3_FLOATING_POINT_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST || r === n.Z3_ast_kind.Z3_APP_AST ? new
|
|
3998
|
-
case n.Z3_sort_kind.Z3_ROUNDING_MODE_SORT: return new
|
|
3999
|
-
case n.Z3_sort_kind.Z3_SEQ_SORT: return new
|
|
4000
|
-
case n.Z3_sort_kind.Z3_RE_SORT: return new
|
|
4001
|
-
case n.Z3_sort_kind.Z3_ARRAY_SORT: return new
|
|
4002
|
-
default: return e.is_finite_set_sort(f, e.get_sort(f, t)) ? new Z(t) : new
|
|
4003
|
-
}
|
|
4004
|
-
}
|
|
4005
|
-
function
|
|
4078
|
+
case n.Z3_sort_kind.Z3_BOOL_SORT: return new U(t);
|
|
4079
|
+
case n.Z3_sort_kind.Z3_INT_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST ? new Sr(t) : new G(t);
|
|
4080
|
+
case n.Z3_sort_kind.Z3_REAL_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST ? new Cr(t) : new G(t);
|
|
4081
|
+
case n.Z3_sort_kind.Z3_BV_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST ? new Tr(t) : new q(t);
|
|
4082
|
+
case n.Z3_sort_kind.Z3_FLOATING_POINT_SORT: return r === n.Z3_ast_kind.Z3_NUMERAL_AST || r === n.Z3_ast_kind.Z3_APP_AST ? new kr(t) : new J(t);
|
|
4083
|
+
case n.Z3_sort_kind.Z3_ROUNDING_MODE_SORT: return new Dr(t);
|
|
4084
|
+
case n.Z3_sort_kind.Z3_SEQ_SORT: return new Y(t);
|
|
4085
|
+
case n.Z3_sort_kind.Z3_RE_SORT: return new X(t);
|
|
4086
|
+
case n.Z3_sort_kind.Z3_ARRAY_SORT: return new Nr(t);
|
|
4087
|
+
default: return e.is_finite_set_sort(f, e.get_sort(f, t)) ? new Z(t) : new H(t);
|
|
4088
|
+
}
|
|
4089
|
+
}
|
|
4090
|
+
function S(e) {
|
|
4006
4091
|
let t = [];
|
|
4007
|
-
for (let n of e)
|
|
4092
|
+
for (let n of e) Je(n) ? t.push(...n.values()) : t.push(n);
|
|
4008
4093
|
return t;
|
|
4009
4094
|
}
|
|
4010
|
-
function
|
|
4011
|
-
return
|
|
4095
|
+
function C(e) {
|
|
4096
|
+
return Ge(e) ? e : new sr(e);
|
|
4012
4097
|
}
|
|
4013
|
-
function
|
|
4098
|
+
function w(e, t) {
|
|
4014
4099
|
(0, i.assert)(t.length > 0, "At least one argument expected");
|
|
4015
|
-
let n =
|
|
4016
|
-
for (let r = 1; r < t.length; r++) n = new
|
|
4100
|
+
let n = C(t[0]);
|
|
4101
|
+
for (let r = 1; r < t.length; r++) n = new sr(g(e(f, n.ptr, C(t[r]).ptr)));
|
|
4017
4102
|
return n;
|
|
4018
4103
|
}
|
|
4019
|
-
function
|
|
4104
|
+
function ne() {
|
|
4020
4105
|
g(e.interrupt(f));
|
|
4021
4106
|
}
|
|
4022
|
-
function
|
|
4107
|
+
function re(t) {
|
|
4023
4108
|
e.set_ast_print_mode(f, t);
|
|
4024
4109
|
}
|
|
4025
|
-
function
|
|
4026
|
-
let t = e instanceof
|
|
4110
|
+
function ie(e) {
|
|
4111
|
+
let t = e instanceof tr;
|
|
4027
4112
|
return t && p(e), t;
|
|
4028
4113
|
}
|
|
4029
|
-
function
|
|
4030
|
-
let t = e instanceof
|
|
4114
|
+
function ae(e) {
|
|
4115
|
+
let t = e instanceof Zn;
|
|
4031
4116
|
return t && p(e), t;
|
|
4032
4117
|
}
|
|
4033
|
-
function
|
|
4034
|
-
let t = e instanceof
|
|
4118
|
+
function oe(e) {
|
|
4119
|
+
let t = e instanceof B;
|
|
4035
4120
|
return t && p(e), t;
|
|
4036
4121
|
}
|
|
4037
|
-
function
|
|
4038
|
-
let t = e instanceof
|
|
4122
|
+
function se(e) {
|
|
4123
|
+
let t = e instanceof V;
|
|
4039
4124
|
return t && p(e), t;
|
|
4040
4125
|
}
|
|
4041
|
-
function
|
|
4042
|
-
let t = e instanceof
|
|
4126
|
+
function ce(e) {
|
|
4127
|
+
let t = e instanceof ir;
|
|
4043
4128
|
return t && p(e), t;
|
|
4044
4129
|
}
|
|
4045
|
-
function
|
|
4046
|
-
if (!
|
|
4130
|
+
function le(t) {
|
|
4131
|
+
if (!E(t)) return !1;
|
|
4047
4132
|
let r = g(e.get_ast_kind(f, t.ast));
|
|
4048
4133
|
return r === n.Z3_ast_kind.Z3_NUMERAL_AST || r === n.Z3_ast_kind.Z3_APP_AST;
|
|
4049
4134
|
}
|
|
4050
|
-
function
|
|
4051
|
-
return
|
|
4135
|
+
function T(e) {
|
|
4136
|
+
return E(e) && le(e) && e.numArgs() === 0;
|
|
4052
4137
|
}
|
|
4053
|
-
function
|
|
4054
|
-
let t = e instanceof
|
|
4138
|
+
function E(e) {
|
|
4139
|
+
let t = e instanceof H;
|
|
4055
4140
|
return t && p(e), t;
|
|
4056
4141
|
}
|
|
4057
|
-
function
|
|
4058
|
-
return
|
|
4142
|
+
function ue(t) {
|
|
4143
|
+
return E(t) && g(e.get_ast_kind(f, t.ast)) === n.Z3_ast_kind.Z3_VAR_AST;
|
|
4059
4144
|
}
|
|
4060
|
-
function
|
|
4061
|
-
return
|
|
4145
|
+
function D(e, t) {
|
|
4146
|
+
return E(e) && le(e) && e.decl().kind() === t;
|
|
4062
4147
|
}
|
|
4063
|
-
function
|
|
4064
|
-
let t = e instanceof
|
|
4148
|
+
function de(e) {
|
|
4149
|
+
let t = e instanceof H && e.sort.kind() === n.Z3_sort_kind.Z3_BOOL_SORT;
|
|
4065
4150
|
return t && p(e), t;
|
|
4066
4151
|
}
|
|
4152
|
+
function fe(e) {
|
|
4153
|
+
return D(e, n.Z3_decl_kind.Z3_OP_TRUE);
|
|
4154
|
+
}
|
|
4155
|
+
function pe(e) {
|
|
4156
|
+
return D(e, n.Z3_decl_kind.Z3_OP_FALSE);
|
|
4157
|
+
}
|
|
4067
4158
|
function me(e) {
|
|
4068
|
-
return
|
|
4159
|
+
return D(e, n.Z3_decl_kind.Z3_OP_AND);
|
|
4069
4160
|
}
|
|
4070
4161
|
function he(e) {
|
|
4071
|
-
return
|
|
4162
|
+
return D(e, n.Z3_decl_kind.Z3_OP_OR);
|
|
4072
4163
|
}
|
|
4073
4164
|
function ge(e) {
|
|
4074
|
-
return
|
|
4165
|
+
return D(e, n.Z3_decl_kind.Z3_OP_IMPLIES);
|
|
4075
4166
|
}
|
|
4076
4167
|
function _e(e) {
|
|
4077
|
-
return
|
|
4168
|
+
return D(e, n.Z3_decl_kind.Z3_OP_NOT);
|
|
4078
4169
|
}
|
|
4079
4170
|
function ve(e) {
|
|
4080
|
-
return
|
|
4171
|
+
return D(e, n.Z3_decl_kind.Z3_OP_EQ);
|
|
4081
4172
|
}
|
|
4082
4173
|
function ye(e) {
|
|
4083
|
-
return
|
|
4174
|
+
return D(e, n.Z3_decl_kind.Z3_OP_DISTINCT);
|
|
4084
4175
|
}
|
|
4085
4176
|
function be(e) {
|
|
4086
|
-
return T(e, n.Z3_decl_kind.Z3_OP_EQ);
|
|
4087
|
-
}
|
|
4088
|
-
function xe(e) {
|
|
4089
|
-
return T(e, n.Z3_decl_kind.Z3_OP_DISTINCT);
|
|
4090
|
-
}
|
|
4091
|
-
function Se(e) {
|
|
4092
4177
|
let t = e instanceof Br;
|
|
4093
4178
|
return t && p(e), t;
|
|
4094
4179
|
}
|
|
4095
|
-
function
|
|
4096
|
-
let t = e instanceof
|
|
4180
|
+
function O(e) {
|
|
4181
|
+
let t = e instanceof G;
|
|
4182
|
+
return t && p(e), t;
|
|
4183
|
+
}
|
|
4184
|
+
function xe(e) {
|
|
4185
|
+
let t = e instanceof mr;
|
|
4097
4186
|
return t && p(e), t;
|
|
4098
4187
|
}
|
|
4188
|
+
function Se(e) {
|
|
4189
|
+
return O(e) && we(e.sort);
|
|
4190
|
+
}
|
|
4099
4191
|
function Ce(e) {
|
|
4100
|
-
let t = e instanceof
|
|
4192
|
+
let t = e instanceof Sr;
|
|
4101
4193
|
return t && p(e), t;
|
|
4102
4194
|
}
|
|
4103
4195
|
function we(e) {
|
|
4104
|
-
return
|
|
4196
|
+
return oe(e) && e.kind() === n.Z3_sort_kind.Z3_INT_SORT;
|
|
4105
4197
|
}
|
|
4106
4198
|
function Te(e) {
|
|
4107
|
-
|
|
4108
|
-
return t && p(e), t;
|
|
4199
|
+
return O(e) && De(e.sort);
|
|
4109
4200
|
}
|
|
4110
4201
|
function Ee(e) {
|
|
4111
|
-
|
|
4202
|
+
let t = e instanceof Cr;
|
|
4203
|
+
return t && p(e), t;
|
|
4112
4204
|
}
|
|
4113
4205
|
function De(e) {
|
|
4114
|
-
return
|
|
4206
|
+
return oe(e) && e.kind() === n.Z3_sort_kind.Z3_REAL_SORT;
|
|
4115
4207
|
}
|
|
4116
4208
|
function Oe(e) {
|
|
4117
|
-
let t = e instanceof
|
|
4209
|
+
let t = e instanceof K;
|
|
4118
4210
|
return t && p(e), t;
|
|
4119
4211
|
}
|
|
4120
4212
|
function ke(e) {
|
|
4121
|
-
|
|
4213
|
+
let t = e instanceof wr;
|
|
4214
|
+
return t && p(e), t;
|
|
4122
4215
|
}
|
|
4123
4216
|
function Ae(e) {
|
|
4124
|
-
let t = e instanceof
|
|
4217
|
+
let t = e instanceof q;
|
|
4125
4218
|
return t && p(e), t;
|
|
4126
4219
|
}
|
|
4127
4220
|
function je(e) {
|
|
@@ -4129,68 +4222,68 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4129
4222
|
return t && p(e), t;
|
|
4130
4223
|
}
|
|
4131
4224
|
function Me(e) {
|
|
4132
|
-
let t = e instanceof
|
|
4225
|
+
let t = e instanceof Mr;
|
|
4133
4226
|
return t && p(e), t;
|
|
4134
4227
|
}
|
|
4135
4228
|
function Ne(e) {
|
|
4136
|
-
let t = e instanceof
|
|
4229
|
+
let t = e instanceof Nr;
|
|
4137
4230
|
return t && p(e), t;
|
|
4138
4231
|
}
|
|
4139
4232
|
function Pe(e) {
|
|
4140
|
-
|
|
4141
|
-
return t && p(e), t;
|
|
4233
|
+
return D(e, n.Z3_decl_kind.Z3_OP_CONST_ARRAY);
|
|
4142
4234
|
}
|
|
4143
4235
|
function Fe(e) {
|
|
4144
|
-
let t = e instanceof
|
|
4236
|
+
let t = e instanceof Er;
|
|
4145
4237
|
return t && p(e), t;
|
|
4146
4238
|
}
|
|
4147
4239
|
function Ie(e) {
|
|
4148
|
-
return T(e, n.Z3_decl_kind.Z3_OP_CONST_ARRAY);
|
|
4149
|
-
}
|
|
4150
|
-
function Le(e) {
|
|
4151
4240
|
let t = e instanceof Dr;
|
|
4152
4241
|
return t && p(e), t;
|
|
4153
4242
|
}
|
|
4154
|
-
function
|
|
4243
|
+
function Le(e) {
|
|
4155
4244
|
let t = e instanceof Or;
|
|
4156
4245
|
return t && p(e), t;
|
|
4157
4246
|
}
|
|
4158
|
-
function
|
|
4159
|
-
let t = e instanceof
|
|
4247
|
+
function k(e) {
|
|
4248
|
+
let t = e instanceof J;
|
|
4160
4249
|
return t && p(e), t;
|
|
4161
4250
|
}
|
|
4162
|
-
function
|
|
4163
|
-
let t = e instanceof
|
|
4251
|
+
function Re(e) {
|
|
4252
|
+
let t = e instanceof kr;
|
|
4164
4253
|
return t && p(e), t;
|
|
4165
4254
|
}
|
|
4166
|
-
function
|
|
4255
|
+
function ze(e) {
|
|
4167
4256
|
let t = e instanceof Ar;
|
|
4168
4257
|
return t && p(e), t;
|
|
4169
4258
|
}
|
|
4170
|
-
function
|
|
4171
|
-
let t = e instanceof
|
|
4259
|
+
function A(e) {
|
|
4260
|
+
let t = e instanceof Y;
|
|
4172
4261
|
return t && p(e), t;
|
|
4173
4262
|
}
|
|
4174
|
-
function
|
|
4175
|
-
let t = e instanceof
|
|
4263
|
+
function Be(e) {
|
|
4264
|
+
let t = e instanceof X;
|
|
4176
4265
|
return t && p(e), t;
|
|
4177
4266
|
}
|
|
4267
|
+
function Ve(e) {
|
|
4268
|
+
return ze(e) && e.isString();
|
|
4269
|
+
}
|
|
4178
4270
|
function He(e) {
|
|
4179
|
-
|
|
4180
|
-
return t && p(e), t;
|
|
4271
|
+
return A(e) && e.isString();
|
|
4181
4272
|
}
|
|
4182
4273
|
function Ue(e) {
|
|
4183
|
-
|
|
4274
|
+
let t = e instanceof Fr;
|
|
4275
|
+
return t && p(e), t;
|
|
4184
4276
|
}
|
|
4185
4277
|
function We(e) {
|
|
4186
|
-
|
|
4278
|
+
let t = e instanceof Z;
|
|
4279
|
+
return t && p(e), t;
|
|
4187
4280
|
}
|
|
4188
4281
|
function Ge(e) {
|
|
4189
|
-
let t = e instanceof
|
|
4282
|
+
let t = e instanceof sr;
|
|
4190
4283
|
return t && p(e), t;
|
|
4191
4284
|
}
|
|
4192
4285
|
function Ke(e) {
|
|
4193
|
-
let t = e instanceof
|
|
4286
|
+
let t = e instanceof W;
|
|
4194
4287
|
return t && p(e), t;
|
|
4195
4288
|
}
|
|
4196
4289
|
function qe(e) {
|
|
@@ -4198,252 +4291,244 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4198
4291
|
return t && p(e), t;
|
|
4199
4292
|
}
|
|
4200
4293
|
function Je(e) {
|
|
4201
|
-
let t = e instanceof U;
|
|
4202
|
-
return t && p(e), t;
|
|
4203
|
-
}
|
|
4204
|
-
function Ye(e) {
|
|
4205
|
-
let t = e instanceof lr;
|
|
4206
|
-
return t && p(e), t;
|
|
4207
|
-
}
|
|
4208
|
-
function Xe(e) {
|
|
4209
4294
|
let t = e instanceof Q;
|
|
4210
4295
|
return t && p(e), t;
|
|
4211
4296
|
}
|
|
4212
|
-
function
|
|
4297
|
+
function Ye(e, t) {
|
|
4213
4298
|
return e.eqIdentity(t);
|
|
4214
4299
|
}
|
|
4215
|
-
function
|
|
4216
|
-
return (0, i.assert)(
|
|
4300
|
+
function Xe(t) {
|
|
4301
|
+
return (0, i.assert)(ue(t), "Z3 bound variable expected"), e.get_index_value(f, t.ast);
|
|
4217
4302
|
}
|
|
4218
|
-
function
|
|
4219
|
-
if (typeof e == "boolean") return
|
|
4303
|
+
function j(e) {
|
|
4304
|
+
if (typeof e == "boolean") return N.val(e);
|
|
4220
4305
|
if (typeof e == "number") {
|
|
4221
4306
|
if (!Number.isFinite(e)) throw Error(`cannot represent infinity/NaN (got ${e})`);
|
|
4222
|
-
return Math.floor(e) === e ?
|
|
4307
|
+
return Math.floor(e) === e ? P.val(e) : F.val(e);
|
|
4223
4308
|
}
|
|
4224
|
-
if (s(e)) return
|
|
4225
|
-
if (typeof e == "bigint") return
|
|
4226
|
-
if (
|
|
4309
|
+
if (s(e)) return F.val(e);
|
|
4310
|
+
if (typeof e == "bigint") return P.val(e);
|
|
4311
|
+
if (E(e)) return e;
|
|
4227
4312
|
(0, i.assert)(!1);
|
|
4228
4313
|
}
|
|
4229
|
-
async function
|
|
4314
|
+
async function Ze(...e) {
|
|
4230
4315
|
let t = new $.Solver();
|
|
4231
4316
|
t.add(...e);
|
|
4232
4317
|
let n = await t.check();
|
|
4233
4318
|
return n === "sat" ? t.model() : n;
|
|
4234
4319
|
}
|
|
4235
|
-
async function
|
|
4320
|
+
async function Qe(t) {
|
|
4236
4321
|
return x(g(await e.simplify(f, t.ast)));
|
|
4237
4322
|
}
|
|
4238
|
-
let
|
|
4323
|
+
let $e = { declare: (t) => new B(e.mk_uninterpreted_sort(f, _(t))) }, et = {
|
|
4239
4324
|
declare: (t, ...n) => {
|
|
4240
4325
|
let r = n.length - 1, i = n[r];
|
|
4241
4326
|
p(i);
|
|
4242
4327
|
let a = [];
|
|
4243
4328
|
for (let e = 0; e < r; e++) p(n[e]), a.push(n[e].ptr);
|
|
4244
|
-
return new
|
|
4329
|
+
return new V(e.mk_func_decl(f, _(t), a, i.ptr));
|
|
4245
4330
|
},
|
|
4246
4331
|
fresh: (...t) => {
|
|
4247
4332
|
let n = t.length - 1, r = t[n];
|
|
4248
4333
|
p(r);
|
|
4249
4334
|
let i = [];
|
|
4250
4335
|
for (let e = 0; e < n; e++) p(t[e]), i.push(t[e].ptr);
|
|
4251
|
-
return new
|
|
4336
|
+
return new V(e.mk_fresh_func_decl(f, "f", i, r.ptr));
|
|
4252
4337
|
}
|
|
4253
|
-
},
|
|
4338
|
+
}, M = {
|
|
4254
4339
|
declare: (t, ...n) => {
|
|
4255
4340
|
let r = n.length - 1, i = n[r];
|
|
4256
4341
|
p(i);
|
|
4257
4342
|
let a = [];
|
|
4258
4343
|
for (let e = 0; e < r; e++) p(n[e]), a.push(n[e].ptr);
|
|
4259
|
-
return new
|
|
4344
|
+
return new V(e.mk_rec_func_decl(f, _(t), a, i.ptr));
|
|
4260
4345
|
},
|
|
4261
4346
|
addDefinition: (t, n, r) => {
|
|
4262
4347
|
p(t, ...n, r), g(e.add_rec_def(f, t.ptr, n.map((e) => e.ast), r.ast));
|
|
4263
4348
|
}
|
|
4264
|
-
},
|
|
4265
|
-
sort: () => new
|
|
4266
|
-
const: (t) => new
|
|
4267
|
-
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4349
|
+
}, N = {
|
|
4350
|
+
sort: () => new or(e.mk_bool_sort(f)),
|
|
4351
|
+
const: (t) => new U(e.mk_const(f, _(t), N.sort().ptr)),
|
|
4352
|
+
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) => N.const(e))),
|
|
4268
4353
|
vector: (e, t) => {
|
|
4269
4354
|
let n = [];
|
|
4270
|
-
for (let r = 0; r < t; r++) n.push(
|
|
4355
|
+
for (let r = 0; r < t; r++) n.push(N.const(`${e}__${r}`));
|
|
4271
4356
|
return n;
|
|
4272
4357
|
},
|
|
4273
|
-
fresh: (t = "b") => new
|
|
4274
|
-
val: (t) => t ? new
|
|
4275
|
-
},
|
|
4276
|
-
sort: () => new
|
|
4277
|
-
const: (t) => new
|
|
4278
|
-
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4358
|
+
fresh: (t = "b") => new U(e.mk_fresh_const(f, t, N.sort().ptr)),
|
|
4359
|
+
val: (t) => t ? new U(e.mk_true(f)) : new U(e.mk_false(f))
|
|
4360
|
+
}, P = {
|
|
4361
|
+
sort: () => new mr(e.mk_int_sort(f)),
|
|
4362
|
+
const: (t) => new G(e.mk_const(f, _(t), P.sort().ptr)),
|
|
4363
|
+
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) => P.const(e))),
|
|
4279
4364
|
vector: (e, t) => {
|
|
4280
4365
|
let n = [];
|
|
4281
|
-
for (let r = 0; r < t; r++) n.push(
|
|
4366
|
+
for (let r = 0; r < t; r++) n.push(P.const(`${e}__${r}`));
|
|
4282
4367
|
return n;
|
|
4283
4368
|
},
|
|
4284
|
-
fresh: (t = "x") => new
|
|
4285
|
-
val: (t) => ((0, i.assert)(typeof t == "bigint" || typeof t == "string" || Number.isSafeInteger(t)), new
|
|
4286
|
-
},
|
|
4287
|
-
sort: () => new
|
|
4288
|
-
const: (t) => new
|
|
4289
|
-
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4369
|
+
fresh: (t = "x") => new G(e.mk_fresh_const(f, t, P.sort().ptr)),
|
|
4370
|
+
val: (t) => ((0, i.assert)(typeof t == "bigint" || typeof t == "string" || Number.isSafeInteger(t)), new Sr(g(e.mk_numeral(f, t.toString(), P.sort().ptr))))
|
|
4371
|
+
}, F = {
|
|
4372
|
+
sort: () => new mr(e.mk_real_sort(f)),
|
|
4373
|
+
const: (t) => new G(g(e.mk_const(f, _(t), F.sort().ptr))),
|
|
4374
|
+
consts: (e) => (typeof e == "string" && (e = e.split(" ")), e.map((e) => F.const(e))),
|
|
4290
4375
|
vector: (e, t) => {
|
|
4291
4376
|
let n = [];
|
|
4292
|
-
for (let r = 0; r < t; r++) n.push(
|
|
4377
|
+
for (let r = 0; r < t; r++) n.push(F.const(`${e}__${r}`));
|
|
4293
4378
|
return n;
|
|
4294
4379
|
},
|
|
4295
|
-
fresh: (t = "b") => new
|
|
4296
|
-
val: (t) => (s(t) && (t = `${t.numerator}/${t.denominator}`), new
|
|
4297
|
-
},
|
|
4298
|
-
pi: () => new
|
|
4299
|
-
e: () => new
|
|
4300
|
-
infinitesimal: () => new
|
|
4380
|
+
fresh: (t = "b") => new G(e.mk_fresh_const(f, t, F.sort().ptr)),
|
|
4381
|
+
val: (t) => (s(t) && (t = `${t.numerator}/${t.denominator}`), new Cr(e.mk_numeral(f, t.toString(), F.sort().ptr)))
|
|
4382
|
+
}, tt = Object.assign((e) => new K(e), {
|
|
4383
|
+
pi: () => new K(g(e.rcf_mk_pi(f))),
|
|
4384
|
+
e: () => new K(g(e.rcf_mk_e(f))),
|
|
4385
|
+
infinitesimal: () => new K(g(e.rcf_mk_infinitesimal(f))),
|
|
4301
4386
|
roots: (t) => {
|
|
4302
4387
|
(0, i.assert)(t.length > 0, "Polynomial coefficients cannot be empty");
|
|
4303
4388
|
let n = t.map((e) => e.ptr), { rv: r, roots: a } = e.rcf_mk_roots(f, n), o = [];
|
|
4304
|
-
for (let e = 0; e < r; e++) o.push(new
|
|
4389
|
+
for (let e = 0; e < r; e++) o.push(new K(a[e]));
|
|
4305
4390
|
return o;
|
|
4306
4391
|
}
|
|
4307
|
-
}),
|
|
4392
|
+
}), nt = {
|
|
4308
4393
|
sort(t) {
|
|
4309
|
-
return (0, i.assert)(Number.isSafeInteger(t), "number of bits must be an integer"), new
|
|
4394
|
+
return (0, i.assert)(Number.isSafeInteger(t), "number of bits must be an integer"), new wr(e.mk_bv_sort(f, t));
|
|
4310
4395
|
},
|
|
4311
4396
|
const(t, n) {
|
|
4312
|
-
return new
|
|
4397
|
+
return new q(g(e.mk_const(f, _(t), ke(n) ? n.ptr : nt.sort(n).ptr)));
|
|
4313
4398
|
},
|
|
4314
4399
|
consts(e, t) {
|
|
4315
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4400
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => nt.const(e, t));
|
|
4316
4401
|
},
|
|
4317
4402
|
val(t, n) {
|
|
4318
|
-
return t === !0 ?
|
|
4403
|
+
return t === !0 ? nt.val(1, n) : t === !1 ? nt.val(0, n) : new Tr(g(e.mk_numeral(f, t.toString(), ke(n) ? n.ptr : nt.sort(n).ptr)));
|
|
4319
4404
|
}
|
|
4320
|
-
},
|
|
4405
|
+
}, I = {
|
|
4321
4406
|
sort(t, n) {
|
|
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
|
|
4407
|
+
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 Or(e.mk_fpa_sort(f, t, n));
|
|
4323
4408
|
},
|
|
4324
4409
|
sort16() {
|
|
4325
|
-
return new
|
|
4410
|
+
return new Or(e.mk_fpa_sort_16(f));
|
|
4326
4411
|
},
|
|
4327
4412
|
sort32() {
|
|
4328
|
-
return new
|
|
4413
|
+
return new Or(e.mk_fpa_sort_32(f));
|
|
4329
4414
|
},
|
|
4330
4415
|
sort64() {
|
|
4331
|
-
return new
|
|
4416
|
+
return new Or(e.mk_fpa_sort_64(f));
|
|
4332
4417
|
},
|
|
4333
4418
|
sort128() {
|
|
4334
|
-
return new
|
|
4419
|
+
return new Or(e.mk_fpa_sort_128(f));
|
|
4335
4420
|
},
|
|
4336
4421
|
const(t, n) {
|
|
4337
|
-
return new
|
|
4422
|
+
return new J(g(e.mk_const(f, _(t), n.ptr)));
|
|
4338
4423
|
},
|
|
4339
4424
|
consts(e, t) {
|
|
4340
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4425
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => I.const(e, t));
|
|
4341
4426
|
},
|
|
4342
4427
|
val(t, n) {
|
|
4343
|
-
return new
|
|
4428
|
+
return new kr(g(e.mk_fpa_numeral_double(f, t, n.ptr)));
|
|
4344
4429
|
},
|
|
4345
4430
|
NaN(t) {
|
|
4346
|
-
return new
|
|
4431
|
+
return new kr(g(e.mk_fpa_nan(f, t.ptr)));
|
|
4347
4432
|
},
|
|
4348
4433
|
inf(t, n = !1) {
|
|
4349
|
-
return new
|
|
4434
|
+
return new kr(g(e.mk_fpa_inf(f, t.ptr, n)));
|
|
4350
4435
|
},
|
|
4351
4436
|
zero(t, n = !1) {
|
|
4352
|
-
return new
|
|
4437
|
+
return new kr(g(e.mk_fpa_zero(f, t.ptr, n)));
|
|
4353
4438
|
}
|
|
4354
|
-
},
|
|
4439
|
+
}, rt = {
|
|
4355
4440
|
sort() {
|
|
4356
|
-
return new
|
|
4441
|
+
return new Er(e.mk_fpa_rounding_mode_sort(f));
|
|
4357
4442
|
},
|
|
4358
4443
|
RNE() {
|
|
4359
|
-
return new
|
|
4444
|
+
return new Dr(g(e.mk_fpa_rne(f)));
|
|
4360
4445
|
},
|
|
4361
4446
|
RNA() {
|
|
4362
|
-
return new
|
|
4447
|
+
return new Dr(g(e.mk_fpa_rna(f)));
|
|
4363
4448
|
},
|
|
4364
4449
|
RTP() {
|
|
4365
|
-
return new
|
|
4450
|
+
return new Dr(g(e.mk_fpa_rtp(f)));
|
|
4366
4451
|
},
|
|
4367
4452
|
RTN() {
|
|
4368
|
-
return new
|
|
4453
|
+
return new Dr(g(e.mk_fpa_rtn(f)));
|
|
4369
4454
|
},
|
|
4370
4455
|
RTZ() {
|
|
4371
|
-
return new
|
|
4456
|
+
return new Dr(g(e.mk_fpa_rtz(f)));
|
|
4372
4457
|
}
|
|
4373
|
-
},
|
|
4458
|
+
}, L = {
|
|
4374
4459
|
sort() {
|
|
4375
|
-
return new
|
|
4460
|
+
return new Ar(e.mk_string_sort(f));
|
|
4376
4461
|
},
|
|
4377
4462
|
const(t) {
|
|
4378
|
-
return new
|
|
4463
|
+
return new Y(g(e.mk_const(f, _(t), L.sort().ptr)));
|
|
4379
4464
|
},
|
|
4380
4465
|
consts(e) {
|
|
4381
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4466
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => L.const(e));
|
|
4382
4467
|
},
|
|
4383
4468
|
val(t) {
|
|
4384
|
-
return new
|
|
4469
|
+
return new Y(g(e.mk_string(f, t)));
|
|
4385
4470
|
},
|
|
4386
4471
|
fromCode(t) {
|
|
4387
|
-
let n =
|
|
4388
|
-
return new
|
|
4472
|
+
let n = O(t) ? t : P.val(t);
|
|
4473
|
+
return new Y(g(e.mk_string_from_code(f, n.ast)));
|
|
4389
4474
|
},
|
|
4390
4475
|
fromInt(t) {
|
|
4391
|
-
let n =
|
|
4392
|
-
return new
|
|
4476
|
+
let n = O(t) ? t : P.val(t);
|
|
4477
|
+
return new Y(g(e.mk_int_to_str(f, n.ast)));
|
|
4393
4478
|
}
|
|
4394
|
-
},
|
|
4479
|
+
}, it = {
|
|
4395
4480
|
sort(t) {
|
|
4396
|
-
return new
|
|
4481
|
+
return new Ar(e.mk_seq_sort(f, t.ptr));
|
|
4397
4482
|
},
|
|
4398
4483
|
empty(t) {
|
|
4399
|
-
return new
|
|
4484
|
+
return new Y(g(e.mk_seq_empty(f, it.sort(t).ptr)));
|
|
4400
4485
|
},
|
|
4401
4486
|
unit(t) {
|
|
4402
|
-
return new
|
|
4487
|
+
return new Y(g(e.mk_seq_unit(f, t.ast)));
|
|
4403
4488
|
}
|
|
4404
|
-
},
|
|
4489
|
+
}, at = {
|
|
4405
4490
|
sort(t) {
|
|
4406
|
-
return new
|
|
4491
|
+
return new jr(e.mk_re_sort(f, t.ptr));
|
|
4407
4492
|
},
|
|
4408
4493
|
toRe(t) {
|
|
4409
|
-
let n =
|
|
4410
|
-
return new
|
|
4494
|
+
let n = A(t) ? t : L.val(t);
|
|
4495
|
+
return new X(g(e.mk_seq_to_re(f, n.ast)));
|
|
4411
4496
|
}
|
|
4412
|
-
},
|
|
4497
|
+
}, ot = {
|
|
4413
4498
|
sort(...t) {
|
|
4414
4499
|
let n = t.length - 1, r = t[n], i = t[0];
|
|
4415
|
-
if (n === 1) return new
|
|
4500
|
+
if (n === 1) return new Mr(e.mk_array_sort(f, i.ptr, r.ptr));
|
|
4416
4501
|
let a = t.slice(0, n);
|
|
4417
|
-
return new
|
|
4502
|
+
return new Mr(e.mk_array_sort_n(f, a.map((e) => e.ptr), r.ptr));
|
|
4418
4503
|
},
|
|
4419
4504
|
const(t, ...n) {
|
|
4420
|
-
return new
|
|
4505
|
+
return new Nr(g(e.mk_const(f, _(t), ot.sort(...n).ptr)));
|
|
4421
4506
|
},
|
|
4422
4507
|
consts(e, ...t) {
|
|
4423
|
-
return typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4508
|
+
return typeof e == "string" && (e = e.split(" ")), e.map((e) => ot.const(e, ...t));
|
|
4424
4509
|
},
|
|
4425
4510
|
K(t, n) {
|
|
4426
|
-
return new
|
|
4511
|
+
return new Nr(g(e.mk_const_array(f, t.ptr, n.ptr)));
|
|
4427
4512
|
},
|
|
4428
4513
|
fromFunc(t) {
|
|
4429
|
-
return new
|
|
4514
|
+
return new Nr(g(e.mk_as_array(f, t.ptr)));
|
|
4430
4515
|
}
|
|
4431
4516
|
}, st = {
|
|
4432
4517
|
sort(e) {
|
|
4433
|
-
return
|
|
4518
|
+
return ot.sort(e, N.sort());
|
|
4434
4519
|
},
|
|
4435
4520
|
const(t, n) {
|
|
4436
|
-
return new
|
|
4521
|
+
return new Pr(g(e.mk_const(f, _(t), ot.sort(n, N.sort()).ptr)));
|
|
4437
4522
|
},
|
|
4438
4523
|
consts(e, t) {
|
|
4439
4524
|
return typeof e == "string" && (e = e.split(" ")), e.map((e) => st.const(e, t));
|
|
4440
4525
|
},
|
|
4441
4526
|
empty(e) {
|
|
4442
|
-
return
|
|
4527
|
+
return bn(e);
|
|
4443
4528
|
},
|
|
4444
4529
|
val(e, t) {
|
|
4445
|
-
var n =
|
|
4446
|
-
for (let t of e) n =
|
|
4530
|
+
var n = bn(t);
|
|
4531
|
+
for (let t of e) n = _n(n, t);
|
|
4447
4532
|
return n;
|
|
4448
4533
|
}
|
|
4449
4534
|
}, ct = {
|
|
@@ -4474,163 +4559,163 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4474
4559
|
}
|
|
4475
4560
|
});
|
|
4476
4561
|
function ut(t) {
|
|
4477
|
-
return new
|
|
4562
|
+
return new B(g(e.mk_type_variable(f, e.mk_string_symbol(f, t))));
|
|
4478
4563
|
}
|
|
4479
|
-
function
|
|
4480
|
-
return
|
|
4564
|
+
function R(t, n, r) {
|
|
4565
|
+
return Ge(t) && Ke(n) && Ke(r) ? zt(t, n, r) : ((0, i.assert)(!Ge(t) && !Ke(n) && !Ke(r), "Mixed expressions and goals"), typeof t == "boolean" && (t = N.val(t)), n = j(n), r = j(r), x(g(e.mk_ite(f, t.ptr, n.ast, r.ast))));
|
|
4481
4566
|
}
|
|
4482
|
-
function
|
|
4483
|
-
return (0, i.assert)(t.length > 0, "Can't make Distinct ouf of nothing"), new
|
|
4567
|
+
function dt(...t) {
|
|
4568
|
+
return (0, i.assert)(t.length > 0, "Can't make Distinct ouf of nothing"), new U(g(e.mk_distinct(f, t.map((e) => (e = j(e), p(e), e.ast)))));
|
|
4484
4569
|
}
|
|
4485
|
-
function
|
|
4570
|
+
function ft(t, n) {
|
|
4486
4571
|
return p(n), x(g(e.mk_const(f, _(t), n.ptr)));
|
|
4487
4572
|
}
|
|
4488
|
-
function
|
|
4489
|
-
return p(t), typeof e == "string" && (e = e.split(" ")), e.map((e) =>
|
|
4573
|
+
function pt(e, t) {
|
|
4574
|
+
return p(t), typeof e == "string" && (e = e.split(" ")), e.map((e) => ft(e, t));
|
|
4490
4575
|
}
|
|
4491
|
-
function
|
|
4576
|
+
function mt(t, n = "c") {
|
|
4492
4577
|
return p(t), x(e.mk_fresh_const(t.ctx.ptr, n, t.ptr));
|
|
4493
4578
|
}
|
|
4494
|
-
function
|
|
4579
|
+
function ht(t, n) {
|
|
4495
4580
|
return p(n), x(e.mk_bound(n.ctx.ptr, t, n.ptr));
|
|
4496
4581
|
}
|
|
4497
|
-
function
|
|
4498
|
-
return t =
|
|
4582
|
+
function gt(t, n) {
|
|
4583
|
+
return t = j(t), n = j(n), p(t, n), new U(g(e.mk_implies(f, t.ptr, n.ptr)));
|
|
4499
4584
|
}
|
|
4500
|
-
function
|
|
4501
|
-
return t =
|
|
4585
|
+
function _t(t, n) {
|
|
4586
|
+
return t = j(t), n = j(n), p(t, n), new U(g(e.mk_iff(f, t.ptr, n.ptr)));
|
|
4502
4587
|
}
|
|
4503
|
-
function
|
|
4504
|
-
return e =
|
|
4588
|
+
function vt(e, t) {
|
|
4589
|
+
return e = j(e), t = j(t), p(e, t), e.eq(t);
|
|
4505
4590
|
}
|
|
4506
|
-
function
|
|
4507
|
-
return t =
|
|
4591
|
+
function yt(t, n) {
|
|
4592
|
+
return t = j(t), n = j(n), p(t, n), new U(g(e.mk_xor(f, t.ptr, n.ptr)));
|
|
4508
4593
|
}
|
|
4509
|
-
function
|
|
4510
|
-
return typeof t == "boolean" && (t =
|
|
4594
|
+
function bt(t) {
|
|
4595
|
+
return typeof t == "boolean" && (t = j(t)), p(t), Ge(t) ? new sr(g(e.probe_not(f, t.ptr))) : new U(g(e.mk_not(f, t.ptr)));
|
|
4511
4596
|
}
|
|
4512
|
-
function
|
|
4513
|
-
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t,
|
|
4597
|
+
function xt(...t) {
|
|
4598
|
+
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t, de) ?? !0, "AstVector containing not bools")), (0, i.allSatisfy)(t, Ge) ?? !1) return w(e.probe_and, t);
|
|
4514
4599
|
{
|
|
4515
|
-
let n = t.map(
|
|
4516
|
-
return p(...n), new
|
|
4600
|
+
let n = t.map(j);
|
|
4601
|
+
return p(...n), new U(g(e.mk_and(f, n.map((e) => e.ptr))));
|
|
4517
4602
|
}
|
|
4518
4603
|
}
|
|
4519
|
-
function
|
|
4520
|
-
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t,
|
|
4604
|
+
function St(...t) {
|
|
4605
|
+
if (t.length == 1 && t[0] instanceof $.AstVector && (t = [...t[0].values()], (0, i.assert)((0, i.allSatisfy)(t, de) ?? !0, "AstVector containing not bools")), (0, i.allSatisfy)(t, Ge) ?? !1) return w(e.probe_or, t);
|
|
4521
4606
|
{
|
|
4522
|
-
let n = t.map(
|
|
4523
|
-
return p(...n), new
|
|
4607
|
+
let n = t.map(j);
|
|
4608
|
+
return p(...n), new U(g(e.mk_or(f, n.map((e) => e.ptr))));
|
|
4524
4609
|
}
|
|
4525
4610
|
}
|
|
4611
|
+
function Ct(t, n, r) {
|
|
4612
|
+
if (p(...t), t.length !== n.length) throw Error("Number of arguments and coefficients must match");
|
|
4613
|
+
return new U(g(e.mk_pbeq(f, t.map((e) => e.ast), n, r)));
|
|
4614
|
+
}
|
|
4526
4615
|
function wt(t, n, r) {
|
|
4527
4616
|
if (p(...t), t.length !== n.length) throw Error("Number of arguments and coefficients must match");
|
|
4528
|
-
return new
|
|
4617
|
+
return new U(g(e.mk_pbge(f, t.map((e) => e.ast), n, r)));
|
|
4529
4618
|
}
|
|
4530
4619
|
function Tt(t, n, r) {
|
|
4531
4620
|
if (p(...t), t.length !== n.length) throw Error("Number of arguments and coefficients must match");
|
|
4532
|
-
return new
|
|
4621
|
+
return new U(g(e.mk_pble(f, t.map((e) => e.ast), n, r)));
|
|
4533
4622
|
}
|
|
4534
|
-
function Et(t, n
|
|
4535
|
-
|
|
4536
|
-
return new H(g(e.mk_pble(f, t.map((e) => e.ast), n, r)));
|
|
4623
|
+
function Et(t, n) {
|
|
4624
|
+
return p(...t), new U(g(e.mk_atmost(f, t.map((e) => e.ast), n)));
|
|
4537
4625
|
}
|
|
4538
4626
|
function Dt(t, n) {
|
|
4539
|
-
return p(...t), new
|
|
4540
|
-
}
|
|
4541
|
-
function Ot(t, n) {
|
|
4542
|
-
return p(...t), new H(g(e.mk_atleast(f, t.map((e) => e.ast), n)));
|
|
4627
|
+
return p(...t), new U(g(e.mk_atleast(f, t.map((e) => e.ast), n)));
|
|
4543
4628
|
}
|
|
4544
|
-
function
|
|
4545
|
-
if (!(0, i.allSatisfy)(t,
|
|
4629
|
+
function Ot(t, n, r = 1) {
|
|
4630
|
+
if (!(0, i.allSatisfy)(t, T)) throw Error("Quantifier variables must be constants");
|
|
4546
4631
|
return new Vr(g(e.mk_quantifier_const_ex(f, !0, r, _(""), _(""), t.map((e) => e.ptr), [], [], n.ptr)));
|
|
4547
4632
|
}
|
|
4548
|
-
function
|
|
4549
|
-
if (!(0, i.allSatisfy)(t,
|
|
4633
|
+
function kt(t, n, r = 1) {
|
|
4634
|
+
if (!(0, i.allSatisfy)(t, T)) throw Error("Quantifier variables must be constants");
|
|
4550
4635
|
return new Vr(g(e.mk_quantifier_const_ex(f, !1, r, _(""), _(""), t.map((e) => e.ptr), [], [], n.ptr)));
|
|
4551
4636
|
}
|
|
4552
|
-
function
|
|
4553
|
-
if (!(0, i.allSatisfy)(t,
|
|
4637
|
+
function At(t, n) {
|
|
4638
|
+
if (!(0, i.allSatisfy)(t, T)) throw Error("Quantifier variables must be constants");
|
|
4554
4639
|
return new Hr(g(e.mk_lambda_const(f, t.map((e) => e.ptr), n.ptr)));
|
|
4555
4640
|
}
|
|
4641
|
+
function jt(t) {
|
|
4642
|
+
return t = j(t), p(t), (0, i.assert)(Se(t), "Int expression expected"), new G(g(e.mk_int2real(f, t.ast)));
|
|
4643
|
+
}
|
|
4556
4644
|
function Mt(t) {
|
|
4557
|
-
return t =
|
|
4645
|
+
return E(t) || (t = F.val(t)), p(t), (0, i.assert)(Te(t), "Real expression expected"), new G(g(e.mk_real2int(f, t.ast)));
|
|
4558
4646
|
}
|
|
4559
4647
|
function Nt(t) {
|
|
4560
|
-
return
|
|
4648
|
+
return E(t) || (t = F.val(t)), p(t), (0, i.assert)(Te(t), "Real expression expected"), new U(g(e.mk_is_int(f, t.ast)));
|
|
4561
4649
|
}
|
|
4562
|
-
function Pt(
|
|
4563
|
-
return
|
|
4650
|
+
function Pt(e) {
|
|
4651
|
+
return E(e) || (e = F.val(e)), e.pow("1/2");
|
|
4564
4652
|
}
|
|
4565
4653
|
function Ft(e) {
|
|
4566
|
-
return
|
|
4654
|
+
return E(e) || (e = F.val(e)), e.pow("1/3");
|
|
4567
4655
|
}
|
|
4568
|
-
function It(
|
|
4569
|
-
return
|
|
4656
|
+
function It(t, n) {
|
|
4657
|
+
return p(t), new G(g(e.mk_bv2int(f, t.ast, n)));
|
|
4570
4658
|
}
|
|
4571
4659
|
function Lt(t, n) {
|
|
4572
|
-
return
|
|
4660
|
+
return O(t) ? (0, i.assert)(Se(t), "parameter must be an integer") : ((0, i.assert)(typeof t != "number" || Number.isSafeInteger(t), "parameter must not have decimal places"), t = P.val(t)), new q(g(e.mk_int2bv(f, n, t.ast)));
|
|
4573
4661
|
}
|
|
4574
|
-
function Rt(t
|
|
4575
|
-
return
|
|
4662
|
+
function Rt(...t) {
|
|
4663
|
+
return p(...t), t.reduce((t, n) => new q(g(e.mk_concat(f, t.ast, n.ast))));
|
|
4576
4664
|
}
|
|
4577
|
-
function zt(
|
|
4578
|
-
return p(
|
|
4665
|
+
function zt(t, n, r) {
|
|
4666
|
+
return p(t, n, r), new W(g(e.tactic_cond(f, t.ptr, n.ptr, r.ptr)));
|
|
4579
4667
|
}
|
|
4580
|
-
function
|
|
4581
|
-
return
|
|
4668
|
+
function z(e) {
|
|
4669
|
+
return typeof e == "string" ? new W(e) : e;
|
|
4582
4670
|
}
|
|
4583
|
-
function
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
let i = R(t), a = R(n);
|
|
4588
|
-
p(i, a), i = new U(g(e.tactic_and_then(f, i.ptr, a.ptr)));
|
|
4589
|
-
for (let t of r) a = R(t), p(i, a), i = new U(g(e.tactic_and_then(f, i.ptr, a.ptr)));
|
|
4671
|
+
function Bt(t, n, ...r) {
|
|
4672
|
+
let i = z(t), a = z(n);
|
|
4673
|
+
p(i, a), i = new W(g(e.tactic_and_then(f, i.ptr, a.ptr)));
|
|
4674
|
+
for (let t of r) a = z(t), p(i, a), i = new W(g(e.tactic_and_then(f, i.ptr, a.ptr)));
|
|
4590
4675
|
return i;
|
|
4591
4676
|
}
|
|
4592
|
-
function
|
|
4593
|
-
let i =
|
|
4594
|
-
p(i, a), i = new
|
|
4595
|
-
for (let t of r) a =
|
|
4677
|
+
function Vt(t, n, ...r) {
|
|
4678
|
+
let i = z(t), a = z(n);
|
|
4679
|
+
p(i, a), i = new W(g(e.tactic_or_else(f, i.ptr, a.ptr)));
|
|
4680
|
+
for (let t of r) a = z(t), p(i, a), i = new W(g(e.tactic_or_else(f, i.ptr, a.ptr)));
|
|
4596
4681
|
return i;
|
|
4597
4682
|
}
|
|
4598
|
-
function
|
|
4599
|
-
let r =
|
|
4683
|
+
function Ht(t, n) {
|
|
4684
|
+
let r = z(t);
|
|
4600
4685
|
p(r);
|
|
4601
4686
|
let i = n === void 0 ? 4294967295 : n;
|
|
4602
|
-
return new
|
|
4687
|
+
return new W(g(e.tactic_repeat(f, r.ptr, i)));
|
|
4688
|
+
}
|
|
4689
|
+
function Ut(t, n) {
|
|
4690
|
+
let r = z(t);
|
|
4691
|
+
return p(r), new W(g(e.tactic_try_for(f, r.ptr, n)));
|
|
4603
4692
|
}
|
|
4604
4693
|
function Wt(t, n) {
|
|
4605
|
-
let r =
|
|
4606
|
-
return p(r), new
|
|
4694
|
+
let r = z(n);
|
|
4695
|
+
return p(t, r), new W(g(e.tactic_when(f, t.ptr, r.ptr)));
|
|
4607
4696
|
}
|
|
4608
|
-
function Gt(
|
|
4609
|
-
|
|
4610
|
-
return p(t, r), new U(g(e.tactic_when(f, t.ptr, r.ptr)));
|
|
4697
|
+
function Gt() {
|
|
4698
|
+
return new W(g(e.tactic_skip(f)));
|
|
4611
4699
|
}
|
|
4612
4700
|
function Kt() {
|
|
4613
|
-
return new
|
|
4701
|
+
return new W(g(e.tactic_fail(f)));
|
|
4614
4702
|
}
|
|
4615
|
-
function qt() {
|
|
4616
|
-
return new
|
|
4703
|
+
function qt(t) {
|
|
4704
|
+
return p(t), new W(g(e.tactic_fail_if(f, t.ptr)));
|
|
4617
4705
|
}
|
|
4618
|
-
function Jt(t) {
|
|
4619
|
-
return p(t), new U(g(e.tactic_fail_if(f, t.ptr)));
|
|
4620
|
-
}
|
|
4621
|
-
function Yt(...t) {
|
|
4706
|
+
function Jt(...t) {
|
|
4622
4707
|
(0, i.assert)(t.length > 0, "ParOr requires at least one tactic");
|
|
4623
|
-
let n = t.map((e) =>
|
|
4708
|
+
let n = t.map((e) => z(e));
|
|
4624
4709
|
p(...n);
|
|
4625
4710
|
let r = n.map((e) => e.ptr);
|
|
4626
|
-
return new
|
|
4711
|
+
return new W(g(e.tactic_par_or(f, r)));
|
|
4627
4712
|
}
|
|
4628
|
-
function
|
|
4629
|
-
let r =
|
|
4630
|
-
return p(r, i), new
|
|
4713
|
+
function Yt(t, n) {
|
|
4714
|
+
let r = z(t), i = z(n);
|
|
4715
|
+
return p(r, i), new W(g(e.tactic_par_and_then(f, r.ptr, i.ptr)));
|
|
4631
4716
|
}
|
|
4632
|
-
function
|
|
4633
|
-
let r =
|
|
4717
|
+
function Xt(t, n) {
|
|
4718
|
+
let r = z(t);
|
|
4634
4719
|
p(r);
|
|
4635
4720
|
let i = g(e.mk_params(f));
|
|
4636
4721
|
e.params_inc_ref(f, i);
|
|
@@ -4642,187 +4727,187 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4642
4727
|
else if (typeof r == "string") e.params_set_symbol(f, i, n, _(r));
|
|
4643
4728
|
else throw Error(`Unsupported parameter type for ${t}`);
|
|
4644
4729
|
}
|
|
4645
|
-
return new
|
|
4730
|
+
return new W(g(e.tactic_using_params(f, r.ptr, i)));
|
|
4646
4731
|
} finally {
|
|
4647
4732
|
e.params_dec_ref(f, i);
|
|
4648
4733
|
}
|
|
4649
4734
|
}
|
|
4735
|
+
function Zt(t, n) {
|
|
4736
|
+
return new U(g(e.mk_lt(f, t.ast, t.sort.cast(n).ast)));
|
|
4737
|
+
}
|
|
4650
4738
|
function Qt(t, n) {
|
|
4651
|
-
return new
|
|
4739
|
+
return new U(g(e.mk_gt(f, t.ast, t.sort.cast(n).ast)));
|
|
4652
4740
|
}
|
|
4653
4741
|
function $t(t, n) {
|
|
4654
|
-
return new
|
|
4742
|
+
return new U(g(e.mk_le(f, t.ast, t.sort.cast(n).ast)));
|
|
4655
4743
|
}
|
|
4656
4744
|
function en(t, n) {
|
|
4657
|
-
return new
|
|
4745
|
+
return new U(g(e.mk_ge(f, t.ast, t.sort.cast(n).ast)));
|
|
4658
4746
|
}
|
|
4659
4747
|
function tn(t, n) {
|
|
4660
|
-
return new
|
|
4748
|
+
return new U(g(e.mk_bvult(f, t.ast, t.sort.cast(n).ast)));
|
|
4661
4749
|
}
|
|
4662
4750
|
function nn(t, n) {
|
|
4663
|
-
return new
|
|
4751
|
+
return new U(g(e.mk_bvugt(f, t.ast, t.sort.cast(n).ast)));
|
|
4664
4752
|
}
|
|
4665
4753
|
function rn(t, n) {
|
|
4666
|
-
return new
|
|
4754
|
+
return new U(g(e.mk_bvule(f, t.ast, t.sort.cast(n).ast)));
|
|
4667
4755
|
}
|
|
4668
4756
|
function an(t, n) {
|
|
4669
|
-
return new
|
|
4757
|
+
return new U(g(e.mk_bvuge(f, t.ast, t.sort.cast(n).ast)));
|
|
4670
4758
|
}
|
|
4671
4759
|
function on(t, n) {
|
|
4672
|
-
return new
|
|
4760
|
+
return new U(g(e.mk_bvslt(f, t.ast, t.sort.cast(n).ast)));
|
|
4673
4761
|
}
|
|
4674
4762
|
function sn(t, n) {
|
|
4675
|
-
return new
|
|
4763
|
+
return new U(g(e.mk_bvsgt(f, t.ast, t.sort.cast(n).ast)));
|
|
4676
4764
|
}
|
|
4677
4765
|
function cn(t, n) {
|
|
4678
|
-
return new
|
|
4766
|
+
return new U(g(e.mk_bvsle(f, t.ast, t.sort.cast(n).ast)));
|
|
4679
4767
|
}
|
|
4680
4768
|
function ln(t, n) {
|
|
4681
|
-
return new
|
|
4769
|
+
return new U(g(e.mk_bvsge(f, t.ast, t.sort.cast(n).ast)));
|
|
4682
4770
|
}
|
|
4683
|
-
function un(t, n) {
|
|
4684
|
-
return new
|
|
4771
|
+
function un(t, n, r) {
|
|
4772
|
+
return new q(g(e.mk_extract(f, t, n, r.ast)));
|
|
4685
4773
|
}
|
|
4686
|
-
function dn(t, n
|
|
4687
|
-
return new K(g(e.mk_extract(f, t, n, r.ast)));
|
|
4688
|
-
}
|
|
4689
|
-
function fn(t, ...n) {
|
|
4774
|
+
function dn(t, ...n) {
|
|
4690
4775
|
let r = n.map((e, n) => t.domain_n(n).cast(e));
|
|
4691
4776
|
if (r.length === 1) return x(g(e.mk_select(f, t.ast, r[0].ast)));
|
|
4692
4777
|
let i = r.map((e) => e.ast);
|
|
4693
4778
|
return x(g(e.mk_select_n(f, t.ast, i)));
|
|
4694
4779
|
}
|
|
4695
|
-
function
|
|
4780
|
+
function fn(t, ...n) {
|
|
4696
4781
|
let r = n.map((e, r) => r === n.length - 1 ? t.range().cast(e) : t.domain_n(r).cast(e));
|
|
4697
4782
|
if (r.length <= 1) throw Error("Array store requires both index and value arguments");
|
|
4698
4783
|
if (r.length === 2) return x(g(e.mk_store(f, t.ast, r[0].ast, r[1].ast)));
|
|
4699
4784
|
let i = r.slice(0, r.length - 1).map((e) => e.ast);
|
|
4700
4785
|
return x(g(e.mk_store_n(f, t.ast, i, r[r.length - 1].ast)));
|
|
4701
4786
|
}
|
|
4702
|
-
function
|
|
4787
|
+
function pn(t, n) {
|
|
4703
4788
|
return x(g(e.mk_array_ext(f, t.ast, n.ast)));
|
|
4704
4789
|
}
|
|
4790
|
+
function mn(...t) {
|
|
4791
|
+
return new Pr(g(e.mk_set_union(f, t.map((e) => e.ast))));
|
|
4792
|
+
}
|
|
4705
4793
|
function hn(...t) {
|
|
4706
|
-
return new
|
|
4794
|
+
return new Pr(g(e.mk_set_intersect(f, t.map((e) => e.ast))));
|
|
4707
4795
|
}
|
|
4708
|
-
function gn(
|
|
4709
|
-
return new
|
|
4796
|
+
function gn(t, n) {
|
|
4797
|
+
return new Pr(g(e.mk_set_difference(f, t.ast, n.ast)));
|
|
4710
4798
|
}
|
|
4711
4799
|
function _n(t, n) {
|
|
4712
|
-
|
|
4800
|
+
let r = t.elemSort().cast(n);
|
|
4801
|
+
return new Pr(g(e.mk_set_add(f, t.ast, r.ast)));
|
|
4713
4802
|
}
|
|
4714
4803
|
function vn(t, n) {
|
|
4715
4804
|
let r = t.elemSort().cast(n);
|
|
4716
|
-
return new
|
|
4805
|
+
return new Pr(g(e.mk_set_del(f, t.ast, r.ast)));
|
|
4717
4806
|
}
|
|
4718
|
-
function yn(t
|
|
4719
|
-
|
|
4720
|
-
return new X(g(e.mk_set_del(f, t.ast, r.ast)));
|
|
4807
|
+
function yn(t) {
|
|
4808
|
+
return new Pr(g(e.mk_set_complement(f, t.ast)));
|
|
4721
4809
|
}
|
|
4722
4810
|
function bn(t) {
|
|
4723
|
-
return new
|
|
4811
|
+
return new Pr(g(e.mk_empty_set(f, t.ptr)));
|
|
4724
4812
|
}
|
|
4725
4813
|
function xn(t) {
|
|
4726
|
-
return new
|
|
4814
|
+
return new Pr(g(e.mk_full_set(f, t.ptr)));
|
|
4727
4815
|
}
|
|
4728
|
-
function Sn(t) {
|
|
4729
|
-
|
|
4816
|
+
function Sn(t, n) {
|
|
4817
|
+
let r = n.elemSort().cast(t);
|
|
4818
|
+
return new U(g(e.mk_set_member(f, r.ast, n.ast)));
|
|
4730
4819
|
}
|
|
4731
4820
|
function Cn(t, n) {
|
|
4732
|
-
|
|
4733
|
-
return new H(g(e.mk_set_member(f, r.ast, n.ast)));
|
|
4821
|
+
return new U(g(e.mk_set_subset(f, t.ast, n.ast)));
|
|
4734
4822
|
}
|
|
4735
4823
|
function wn(t, n) {
|
|
4736
|
-
|
|
4824
|
+
let r = A(t) ? t : L.val(t);
|
|
4825
|
+
return new U(g(e.mk_seq_in_re(f, r.ast, n.ast)));
|
|
4737
4826
|
}
|
|
4738
|
-
function Tn(t
|
|
4739
|
-
let r = O(t) ? t : I.val(t);
|
|
4740
|
-
return new H(g(e.mk_seq_in_re(f, r.ast, n.ast)));
|
|
4741
|
-
}
|
|
4742
|
-
function En(...t) {
|
|
4827
|
+
function Tn(...t) {
|
|
4743
4828
|
if (t.length === 0) throw Error("Union requires at least one argument");
|
|
4744
|
-
return t.length === 1 ? t[0] : new
|
|
4829
|
+
return t.length === 1 ? t[0] : new X(g(e.mk_re_union(f, t.map((e) => e.ast))));
|
|
4745
4830
|
}
|
|
4746
|
-
function
|
|
4831
|
+
function En(...t) {
|
|
4747
4832
|
if (t.length === 0) throw Error("Intersect requires at least one argument");
|
|
4748
|
-
return t.length === 1 ? t[0] : new
|
|
4833
|
+
return t.length === 1 ? t[0] : new X(g(e.mk_re_intersect(f, t.map((e) => e.ast))));
|
|
4749
4834
|
}
|
|
4750
|
-
function
|
|
4835
|
+
function Dn(...t) {
|
|
4751
4836
|
if (t.length === 0) throw Error("ReConcat requires at least one argument");
|
|
4752
|
-
return t.length === 1 ? t[0] : new
|
|
4837
|
+
return t.length === 1 ? t[0] : new X(g(e.mk_re_concat(f, t.map((e) => e.ast))));
|
|
4838
|
+
}
|
|
4839
|
+
function On(t) {
|
|
4840
|
+
return new X(g(e.mk_re_plus(f, t.ast)));
|
|
4753
4841
|
}
|
|
4754
4842
|
function kn(t) {
|
|
4755
|
-
return new
|
|
4843
|
+
return new X(g(e.mk_re_star(f, t.ast)));
|
|
4756
4844
|
}
|
|
4757
4845
|
function An(t) {
|
|
4758
|
-
return new
|
|
4846
|
+
return new X(g(e.mk_re_option(f, t.ast)));
|
|
4759
4847
|
}
|
|
4760
4848
|
function jn(t) {
|
|
4761
|
-
return new
|
|
4849
|
+
return new X(g(e.mk_re_complement(f, t.ast)));
|
|
4762
4850
|
}
|
|
4763
|
-
function Mn(t) {
|
|
4764
|
-
return new
|
|
4851
|
+
function Mn(t, n) {
|
|
4852
|
+
return new X(g(e.mk_re_diff(f, t.ast, n.ast)));
|
|
4765
4853
|
}
|
|
4766
4854
|
function Nn(t, n) {
|
|
4767
|
-
|
|
4855
|
+
let r = A(t) ? t : L.val(t), i = A(n) ? n : L.val(n);
|
|
4856
|
+
return new X(g(e.mk_re_range(f, r.ast, i.ast)));
|
|
4768
4857
|
}
|
|
4769
|
-
function Pn(t, n) {
|
|
4770
|
-
|
|
4771
|
-
return new Y(g(e.mk_re_range(f, r.ast, i.ast)));
|
|
4858
|
+
function Pn(t, n, r = 0) {
|
|
4859
|
+
return new X(g(e.mk_re_loop(f, t.ast, n, r)));
|
|
4772
4860
|
}
|
|
4773
|
-
function Fn(t, n
|
|
4774
|
-
return new
|
|
4861
|
+
function Fn(t, n) {
|
|
4862
|
+
return new X(g(e.mk_re_power(f, t.ast, n)));
|
|
4775
4863
|
}
|
|
4776
|
-
function In(t
|
|
4777
|
-
return new
|
|
4864
|
+
function In(t) {
|
|
4865
|
+
return new X(g(e.mk_re_allchar(f, t.ptr)));
|
|
4778
4866
|
}
|
|
4779
4867
|
function Ln(t) {
|
|
4780
|
-
return new
|
|
4868
|
+
return new X(g(e.mk_re_empty(f, t.ptr)));
|
|
4781
4869
|
}
|
|
4782
4870
|
function Rn(t) {
|
|
4783
|
-
return new
|
|
4871
|
+
return new X(g(e.mk_re_full(f, t.ptr)));
|
|
4784
4872
|
}
|
|
4785
|
-
function zn(t) {
|
|
4786
|
-
return new
|
|
4873
|
+
function zn(t, n) {
|
|
4874
|
+
return new V(g(e.mk_partial_order(f, t.ptr, n)));
|
|
4787
4875
|
}
|
|
4788
4876
|
function Bn(t, n) {
|
|
4789
|
-
return new
|
|
4877
|
+
return new V(g(e.mk_linear_order(f, t.ptr, n)));
|
|
4790
4878
|
}
|
|
4791
4879
|
function Vn(t, n) {
|
|
4792
|
-
return new
|
|
4880
|
+
return new V(g(e.mk_piecewise_linear_order(f, t.ptr, n)));
|
|
4793
4881
|
}
|
|
4794
4882
|
function Hn(t, n) {
|
|
4795
|
-
return new
|
|
4883
|
+
return new V(g(e.mk_tree_order(f, t.ptr, n)));
|
|
4796
4884
|
}
|
|
4797
|
-
function Un(t
|
|
4798
|
-
return new
|
|
4885
|
+
function Un(t) {
|
|
4886
|
+
return new V(g(e.mk_transitive_closure(f, t.ptr)));
|
|
4799
4887
|
}
|
|
4800
4888
|
function Wn(t) {
|
|
4801
|
-
return new
|
|
4889
|
+
return new H(g(e.mk_char(f, t)));
|
|
4802
4890
|
}
|
|
4803
|
-
function Gn(t) {
|
|
4804
|
-
return new
|
|
4891
|
+
function Gn(t, n) {
|
|
4892
|
+
return new U(g(e.mk_char_le(f, t.ast, n.ast)));
|
|
4805
4893
|
}
|
|
4806
|
-
function Kn(t
|
|
4807
|
-
return new
|
|
4894
|
+
function Kn(t) {
|
|
4895
|
+
return new G(g(e.mk_char_to_int(f, t.ast)));
|
|
4808
4896
|
}
|
|
4809
4897
|
function qn(t) {
|
|
4810
|
-
return new
|
|
4898
|
+
return new H(g(e.mk_char_to_bv(f, t.ast)));
|
|
4811
4899
|
}
|
|
4812
4900
|
function Jn(t) {
|
|
4813
|
-
return new
|
|
4901
|
+
return new H(g(e.mk_char_from_bv(f, t.ast)));
|
|
4814
4902
|
}
|
|
4815
4903
|
function Yn(t) {
|
|
4816
|
-
return new
|
|
4817
|
-
}
|
|
4818
|
-
function Xn(t) {
|
|
4819
|
-
return new H(g(e.mk_char_is_digit(f, t.ast)));
|
|
4904
|
+
return new U(g(e.mk_char_is_digit(f, t.ast)));
|
|
4820
4905
|
}
|
|
4821
|
-
async function
|
|
4906
|
+
async function Xn(t, n, r) {
|
|
4822
4907
|
let i = await e.polynomial_subresultants(f, t.ast, n.ast, r.ast);
|
|
4823
4908
|
return new Q(g(i));
|
|
4824
4909
|
}
|
|
4825
|
-
class
|
|
4910
|
+
class Zn {
|
|
4826
4911
|
constructor(t) {
|
|
4827
4912
|
this.ptr = t, this.ctx = $;
|
|
4828
4913
|
let n = this.ast;
|
|
@@ -4850,7 +4935,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4850
4935
|
return this.sexpr();
|
|
4851
4936
|
}
|
|
4852
4937
|
}
|
|
4853
|
-
class
|
|
4938
|
+
class Qn {
|
|
4854
4939
|
get ptr() {
|
|
4855
4940
|
return m(this._ptr), this._ptr;
|
|
4856
4941
|
}
|
|
@@ -4864,7 +4949,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4864
4949
|
}, this);
|
|
4865
4950
|
}
|
|
4866
4951
|
set(t, n) {
|
|
4867
|
-
e.solver_set_params(f, this.ptr,
|
|
4952
|
+
e.solver_set_params(f, this.ptr, y(t, n));
|
|
4868
4953
|
}
|
|
4869
4954
|
push() {
|
|
4870
4955
|
e.solver_push(f, this.ptr);
|
|
@@ -4879,12 +4964,12 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4879
4964
|
e.solver_reset(f, this.ptr);
|
|
4880
4965
|
}
|
|
4881
4966
|
add(...t) {
|
|
4882
|
-
|
|
4967
|
+
S(t).forEach((t) => {
|
|
4883
4968
|
p(t), g(e.solver_assert(f, this.ptr, t.ast));
|
|
4884
4969
|
});
|
|
4885
4970
|
}
|
|
4886
4971
|
addAndTrack(t, n) {
|
|
4887
|
-
typeof n == "string" && (n =
|
|
4972
|
+
typeof n == "string" && (n = N.const(n)), (0, i.assert)(T(n), "Provided expression that is not a constant to addAndTrack"), g(e.solver_assert_and_track(f, this.ptr, t.ast, n.ast));
|
|
4888
4973
|
}
|
|
4889
4974
|
addSimplifier(t) {
|
|
4890
4975
|
p(t), g(e.solver_add_simplifier(f, this.ptr, t.ptr));
|
|
@@ -4893,7 +4978,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4893
4978
|
return new Q(g(e.solver_get_assertions(f, this.ptr)));
|
|
4894
4979
|
}
|
|
4895
4980
|
async check(...t) {
|
|
4896
|
-
let r =
|
|
4981
|
+
let r = S(t).map((e) => (p(e), e.ast)), a = await o.runExclusive(() => g(e.solver_check_assumptions(f, this.ptr, r)));
|
|
4897
4982
|
switch (a) {
|
|
4898
4983
|
case n.Z3_lbool.Z3_L_FALSE: return "unsat";
|
|
4899
4984
|
case n.Z3_lbool.Z3_L_TRUE: return "sat";
|
|
@@ -4905,10 +4990,10 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4905
4990
|
return new Q(g(e.solver_get_unsat_core(f, this.ptr)));
|
|
4906
4991
|
}
|
|
4907
4992
|
model() {
|
|
4908
|
-
return new
|
|
4993
|
+
return new tr(g(e.solver_get_model(f, this.ptr)));
|
|
4909
4994
|
}
|
|
4910
4995
|
statistics() {
|
|
4911
|
-
return new
|
|
4996
|
+
return new nr(g(e.solver_get_statistics(f, this.ptr)));
|
|
4912
4997
|
}
|
|
4913
4998
|
reasonUnknown() {
|
|
4914
4999
|
return g(e.solver_get_reason_unknown(f, this.ptr));
|
|
@@ -4958,7 +5043,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
4958
5043
|
}
|
|
4959
5044
|
async getConsequences(t, r) {
|
|
4960
5045
|
let i = new Q(), a = new Q(), s = new Q();
|
|
4961
|
-
|
|
5046
|
+
S(t).forEach((t) => {
|
|
4962
5047
|
p(t), e.ast_vector_push(f, i.ptr, t.ast);
|
|
4963
5048
|
}), r.forEach((t) => {
|
|
4964
5049
|
p(t), e.ast_vector_push(f, a.ptr, t.ast);
|
|
@@ -5014,7 +5099,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5014
5099
|
this._onClauseCallbackIdx.value = n, t._Z3_solver_register_on_clause(f, this.ptr, 0, n);
|
|
5015
5100
|
}
|
|
5016
5101
|
}
|
|
5017
|
-
class
|
|
5102
|
+
class $n {
|
|
5018
5103
|
get ptr() {
|
|
5019
5104
|
return m(this._ptr), this._ptr;
|
|
5020
5105
|
}
|
|
@@ -5024,7 +5109,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5024
5109
|
n = t, this._ptr = n, e.optimize_inc_ref(f, n), c.register(this, () => e.optimize_dec_ref(f, n), this);
|
|
5025
5110
|
}
|
|
5026
5111
|
set(t, n) {
|
|
5027
|
-
e.optimize_set_params(f, this.ptr,
|
|
5112
|
+
e.optimize_set_params(f, this.ptr, y(t, n));
|
|
5028
5113
|
}
|
|
5029
5114
|
push() {
|
|
5030
5115
|
e.optimize_push(f, this.ptr);
|
|
@@ -5033,7 +5118,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5033
5118
|
e.optimize_pop(f, this.ptr);
|
|
5034
5119
|
}
|
|
5035
5120
|
add(...t) {
|
|
5036
|
-
|
|
5121
|
+
S(t).forEach((t) => {
|
|
5037
5122
|
p(t), g(e.optimize_assert(f, this.ptr, t.ast));
|
|
5038
5123
|
});
|
|
5039
5124
|
}
|
|
@@ -5041,7 +5126,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5041
5126
|
s(n) && (n = `${n.numerator}/${n.denominator}`), g(e.optimize_assert_soft(f, this.ptr, t.ast, n.toString(), _(r)));
|
|
5042
5127
|
}
|
|
5043
5128
|
addAndTrack(t, n) {
|
|
5044
|
-
typeof n == "string" && (n =
|
|
5129
|
+
typeof n == "string" && (n = N.const(n)), (0, i.assert)(T(n), "Provided expression that is not a constant to addAndTrack"), g(e.optimize_assert_and_track(f, this.ptr, t.ast, n.ast));
|
|
5045
5130
|
}
|
|
5046
5131
|
assertions() {
|
|
5047
5132
|
return new Q(g(e.optimize_get_assertions(f, this.ptr)));
|
|
@@ -5081,7 +5166,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5081
5166
|
return new t.Optimize(n);
|
|
5082
5167
|
}
|
|
5083
5168
|
async check(...t) {
|
|
5084
|
-
let r =
|
|
5169
|
+
let r = S(t).map((e) => (p(e), e.ast)), a = await o.runExclusive(() => g(e.optimize_check(f, this.ptr, r)));
|
|
5085
5170
|
switch (a) {
|
|
5086
5171
|
case n.Z3_lbool.Z3_L_FALSE: return "unsat";
|
|
5087
5172
|
case n.Z3_lbool.Z3_L_TRUE: return "sat";
|
|
@@ -5090,10 +5175,10 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5090
5175
|
}
|
|
5091
5176
|
}
|
|
5092
5177
|
model() {
|
|
5093
|
-
return new
|
|
5178
|
+
return new tr(g(e.optimize_get_model(f, this.ptr)));
|
|
5094
5179
|
}
|
|
5095
5180
|
statistics() {
|
|
5096
|
-
return new
|
|
5181
|
+
return new nr(g(e.optimize_get_statistics(f, this.ptr)));
|
|
5097
5182
|
}
|
|
5098
5183
|
setInitialValue(t, n) {
|
|
5099
5184
|
p(t), p(n), e.optimize_set_initial_value(f, this.ptr, t.ast, n.ast), h();
|
|
@@ -5108,7 +5193,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5108
5193
|
e.optimize_dec_ref(f, this.ptr), this._ptr = null, c.unregister(this);
|
|
5109
5194
|
}
|
|
5110
5195
|
}
|
|
5111
|
-
class
|
|
5196
|
+
class er {
|
|
5112
5197
|
get ptr() {
|
|
5113
5198
|
return m(this._ptr), this._ptr;
|
|
5114
5199
|
}
|
|
@@ -5118,7 +5203,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5118
5203
|
n = t, this._ptr = n, e.fixedpoint_inc_ref(f, n), c.register(this, () => e.fixedpoint_dec_ref(f, n), this);
|
|
5119
5204
|
}
|
|
5120
5205
|
set(t, n) {
|
|
5121
|
-
e.fixedpoint_set_params(f, this.ptr,
|
|
5206
|
+
e.fixedpoint_set_params(f, this.ptr, y(t, n));
|
|
5122
5207
|
}
|
|
5123
5208
|
help() {
|
|
5124
5209
|
return g(e.fixedpoint_get_help(f, this.ptr));
|
|
@@ -5205,13 +5290,13 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5205
5290
|
return new Q(n);
|
|
5206
5291
|
}
|
|
5207
5292
|
statistics() {
|
|
5208
|
-
return new
|
|
5293
|
+
return new nr(g(e.fixedpoint_get_statistics(f, this.ptr)));
|
|
5209
5294
|
}
|
|
5210
5295
|
release() {
|
|
5211
5296
|
e.fixedpoint_dec_ref(f, this.ptr), this._ptr = null, c.unregister(this);
|
|
5212
5297
|
}
|
|
5213
5298
|
}
|
|
5214
|
-
class
|
|
5299
|
+
class tr {
|
|
5215
5300
|
get ptr() {
|
|
5216
5301
|
return m(this._ptr), this._ptr;
|
|
5217
5302
|
}
|
|
@@ -5255,22 +5340,22 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5255
5340
|
if (t >= r) throw RangeError(`expected index ${t} to be less than length ${r}`);
|
|
5256
5341
|
if (n === void 0) {
|
|
5257
5342
|
let n = g(e.model_get_num_consts(f, this.ptr));
|
|
5258
|
-
return t < n ? new
|
|
5343
|
+
return t < n ? new V(g(e.model_get_const_decl(f, this.ptr, t))) : new V(g(e.model_get_func_decl(f, this.ptr, t - n)));
|
|
5259
5344
|
}
|
|
5260
5345
|
if (n < 0 && (n += r), n >= r) throw RangeError(`expected index ${n} to be less than length ${r}`);
|
|
5261
5346
|
let i = [];
|
|
5262
5347
|
for (let e = t; e < n; e++) i.push(this.get(e));
|
|
5263
5348
|
return i;
|
|
5264
5349
|
}
|
|
5265
|
-
if (
|
|
5350
|
+
if (se(t) || E(t) && T(t)) {
|
|
5266
5351
|
let e = this.getInterp(t);
|
|
5267
5352
|
return (0, i.assert)(e !== null), e;
|
|
5268
5353
|
}
|
|
5269
|
-
if (
|
|
5354
|
+
if (oe(t)) return this.getUniverse(t);
|
|
5270
5355
|
(0, i.assert)(!1, "Number, declaration or constant expected");
|
|
5271
5356
|
}
|
|
5272
5357
|
updateValue(t, n) {
|
|
5273
|
-
if (p(t), p(n),
|
|
5358
|
+
if (p(t), p(n), E(t) && (t = t.decl()), se(t) && t.arity() !== 0 && ce(n)) {
|
|
5274
5359
|
let e = this.addFuncInterp(t, n.elseValue());
|
|
5275
5360
|
for (let t = 0; t < n.numEntries(); t++) {
|
|
5276
5361
|
let r = n.entry(t), i = r.numArgs(), a = globalThis.Array.from({ length: i }, (e, t) => r.argValue(t));
|
|
@@ -5278,22 +5363,22 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5278
5363
|
}
|
|
5279
5364
|
return;
|
|
5280
5365
|
}
|
|
5281
|
-
if (!
|
|
5282
|
-
if (!
|
|
5366
|
+
if (!se(t) || t.arity() !== 0) throw new r.Z3Error("Expecting 0-ary function or constant expression");
|
|
5367
|
+
if (!ae(n)) throw new r.Z3Error("Only func declarations can be assigned to func interpretations");
|
|
5283
5368
|
g(e.add_const_interp(f, this.ptr, t.ptr, n.ast));
|
|
5284
5369
|
}
|
|
5285
5370
|
addFuncInterp(t, n) {
|
|
5286
5371
|
let r = g(e.add_func_interp(f, this.ptr, t.ptr, t.range().cast(n).ptr));
|
|
5287
|
-
return new
|
|
5372
|
+
return new ir(r);
|
|
5288
5373
|
}
|
|
5289
5374
|
getInterp(t) {
|
|
5290
|
-
if ((0, i.assert)(
|
|
5375
|
+
if ((0, i.assert)(se(t) || T(t), "Declaration expected"), T(t) && ((0, i.assert)(E(t)), t = t.decl()), (0, i.assert)(se(t)), t.arity() === 0) {
|
|
5291
5376
|
let n = g(e.model_get_const_interp(f, this.ptr, t.ptr));
|
|
5292
5377
|
return n === null ? null : x(n);
|
|
5293
5378
|
}
|
|
5294
5379
|
{
|
|
5295
5380
|
let n = g(e.model_get_func_interp(f, this.ptr, t.ptr));
|
|
5296
|
-
return n === null ? null : new
|
|
5381
|
+
return n === null ? null : new ir(n);
|
|
5297
5382
|
}
|
|
5298
5383
|
}
|
|
5299
5384
|
getUniverse(t) {
|
|
@@ -5321,7 +5406,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5321
5406
|
e.model_dec_ref(f, this.ptr), this._ptr = null, c.unregister(this);
|
|
5322
5407
|
}
|
|
5323
5408
|
}
|
|
5324
|
-
class
|
|
5409
|
+
class nr {
|
|
5325
5410
|
get ptr() {
|
|
5326
5411
|
return m(this._ptr), this._ptr;
|
|
5327
5412
|
}
|
|
@@ -5362,7 +5447,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5362
5447
|
e.stats_dec_ref(f, this.ptr), this._ptr = null, c.unregister(this);
|
|
5363
5448
|
}
|
|
5364
5449
|
}
|
|
5365
|
-
class
|
|
5450
|
+
class rr {
|
|
5366
5451
|
constructor(t) {
|
|
5367
5452
|
this.ptr = t, this.ctx = $, e.func_entry_inc_ref(f, t), c.register(this, () => e.func_entry_dec_ref(f, t), this);
|
|
5368
5453
|
}
|
|
@@ -5376,7 +5461,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5376
5461
|
return x(g(e.func_entry_get_value(f, this.ptr)));
|
|
5377
5462
|
}
|
|
5378
5463
|
}
|
|
5379
|
-
class
|
|
5464
|
+
class ir {
|
|
5380
5465
|
constructor(t) {
|
|
5381
5466
|
this.ptr = t, this.ctx = $, e.func_interp_inc_ref(f, t), c.register(this, () => e.func_interp_dec_ref(f, t), this);
|
|
5382
5467
|
}
|
|
@@ -5390,7 +5475,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5390
5475
|
return g(e.func_interp_get_arity(f, this.ptr));
|
|
5391
5476
|
}
|
|
5392
5477
|
entry(t) {
|
|
5393
|
-
return new
|
|
5478
|
+
return new rr(g(e.func_interp_get_entry(f, this.ptr, t)));
|
|
5394
5479
|
}
|
|
5395
5480
|
addEntry(t, n) {
|
|
5396
5481
|
let r = new Q();
|
|
@@ -5398,7 +5483,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5398
5483
|
p(r), p(n), (0, i.assert)(this.arity() === r.length(), "Number of arguments in entry doesn't match function arity"), g(e.func_interp_add_entry(f, this.ptr, r.ptr, n.ptr));
|
|
5399
5484
|
}
|
|
5400
5485
|
}
|
|
5401
|
-
class
|
|
5486
|
+
class B extends Zn {
|
|
5402
5487
|
get ast() {
|
|
5403
5488
|
return e.sort_to_ast(f, this.ptr);
|
|
5404
5489
|
}
|
|
@@ -5412,7 +5497,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5412
5497
|
return p(e), (0, i.assert)(e.sort.eqIdentity(e.sort), "Sort mismatch"), e;
|
|
5413
5498
|
}
|
|
5414
5499
|
name() {
|
|
5415
|
-
return
|
|
5500
|
+
return v(e.get_sort_name(f, this.ptr));
|
|
5416
5501
|
}
|
|
5417
5502
|
eqIdentity(t) {
|
|
5418
5503
|
return p(t), g(e.is_eq_sort(f, this.ptr, t.ptr));
|
|
@@ -5421,12 +5506,12 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5421
5506
|
return !this.eqIdentity(e);
|
|
5422
5507
|
}
|
|
5423
5508
|
}
|
|
5424
|
-
class
|
|
5509
|
+
class V extends Zn {
|
|
5425
5510
|
get ast() {
|
|
5426
5511
|
return e.func_decl_to_ast(f, this.ptr);
|
|
5427
5512
|
}
|
|
5428
5513
|
name() {
|
|
5429
|
-
return
|
|
5514
|
+
return v(e.get_decl_name(f, this.ptr));
|
|
5430
5515
|
}
|
|
5431
5516
|
arity() {
|
|
5432
5517
|
return e.get_arity(f, this.ptr);
|
|
@@ -5455,16 +5540,16 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5455
5540
|
r.push(g(e.get_decl_rational_parameter(f, this.ptr, a)));
|
|
5456
5541
|
break;
|
|
5457
5542
|
case n.Z3_parameter_kind.Z3_PARAMETER_SYMBOL:
|
|
5458
|
-
r.push(
|
|
5543
|
+
r.push(v(g(e.get_decl_symbol_parameter(f, this.ptr, a))));
|
|
5459
5544
|
break;
|
|
5460
5545
|
case n.Z3_parameter_kind.Z3_PARAMETER_SORT:
|
|
5461
|
-
r.push(new
|
|
5546
|
+
r.push(new B(g(e.get_decl_sort_parameter(f, this.ptr, a))));
|
|
5462
5547
|
break;
|
|
5463
5548
|
case n.Z3_parameter_kind.Z3_PARAMETER_AST:
|
|
5464
|
-
r.push(new
|
|
5549
|
+
r.push(new H(g(e.get_decl_ast_parameter(f, this.ptr, a))));
|
|
5465
5550
|
break;
|
|
5466
5551
|
case n.Z3_parameter_kind.Z3_PARAMETER_FUNC_DECL:
|
|
5467
|
-
r.push(new
|
|
5552
|
+
r.push(new V(g(e.get_decl_func_decl_parameter(f, this.ptr, a))));
|
|
5468
5553
|
break;
|
|
5469
5554
|
case n.Z3_parameter_kind.Z3_PARAMETER_INTERNAL: break;
|
|
5470
5555
|
case n.Z3_parameter_kind.Z3_PARAMETER_ZSTRING: break;
|
|
@@ -5477,15 +5562,15 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5477
5562
|
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))));
|
|
5478
5563
|
}
|
|
5479
5564
|
}
|
|
5480
|
-
class
|
|
5565
|
+
class H extends Zn {
|
|
5481
5566
|
get sort() {
|
|
5482
5567
|
return b(e.get_sort(f, this.ast));
|
|
5483
5568
|
}
|
|
5484
5569
|
eq(t) {
|
|
5485
|
-
return new
|
|
5570
|
+
return new U(g(e.mk_eq(f, this.ast, j(t).ast)));
|
|
5486
5571
|
}
|
|
5487
5572
|
neq(t) {
|
|
5488
|
-
return new
|
|
5573
|
+
return new U(g(e.mk_distinct(f, [this, t].map((e) => j(e).ast))));
|
|
5489
5574
|
}
|
|
5490
5575
|
name() {
|
|
5491
5576
|
return this.decl().name();
|
|
@@ -5494,17 +5579,17 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5494
5579
|
return this.decl().params();
|
|
5495
5580
|
}
|
|
5496
5581
|
decl() {
|
|
5497
|
-
return (0, i.assert)(
|
|
5582
|
+
return (0, i.assert)(le(this), "Z3 application expected"), new V(g(e.get_app_decl(f, g(e.to_app(f, this.ast)))));
|
|
5498
5583
|
}
|
|
5499
5584
|
numArgs() {
|
|
5500
|
-
return (0, i.assert)(
|
|
5585
|
+
return (0, i.assert)(le(this), "Z3 applicaiton expected"), g(e.get_app_num_args(f, g(e.to_app(f, this.ast))));
|
|
5501
5586
|
}
|
|
5502
5587
|
arg(t) {
|
|
5503
|
-
return (0, i.assert)(
|
|
5588
|
+
return (0, i.assert)(le(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)));
|
|
5504
5589
|
}
|
|
5505
5590
|
children() {
|
|
5506
5591
|
let e = this.numArgs();
|
|
5507
|
-
if (
|
|
5592
|
+
if (le(this)) {
|
|
5508
5593
|
let t = [];
|
|
5509
5594
|
for (let n = 0; n < e; n++) t.push(this.arg(n));
|
|
5510
5595
|
return t;
|
|
@@ -5512,40 +5597,40 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5512
5597
|
return [];
|
|
5513
5598
|
}
|
|
5514
5599
|
}
|
|
5515
|
-
class
|
|
5600
|
+
class ar {
|
|
5516
5601
|
constructor(e) {
|
|
5517
5602
|
this.ptr = e, this.ctx = $;
|
|
5518
5603
|
}
|
|
5519
5604
|
}
|
|
5520
|
-
class
|
|
5605
|
+
class or extends B {
|
|
5521
5606
|
cast(e) {
|
|
5522
|
-
return typeof e == "boolean" && (e =
|
|
5607
|
+
return typeof e == "boolean" && (e = N.val(e)), (0, i.assert)(E(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;
|
|
5523
5608
|
}
|
|
5524
5609
|
subsort(e) {
|
|
5525
|
-
return p(e.ctx), e instanceof
|
|
5610
|
+
return p(e.ctx), e instanceof mr;
|
|
5526
5611
|
}
|
|
5527
5612
|
}
|
|
5528
|
-
class
|
|
5613
|
+
class U extends H {
|
|
5529
5614
|
not() {
|
|
5530
|
-
return
|
|
5615
|
+
return bt(this);
|
|
5531
5616
|
}
|
|
5532
5617
|
and(e) {
|
|
5533
|
-
return
|
|
5618
|
+
return xt(this, e);
|
|
5534
5619
|
}
|
|
5535
5620
|
or(e) {
|
|
5536
|
-
return
|
|
5621
|
+
return St(this, e);
|
|
5537
5622
|
}
|
|
5538
5623
|
xor(e) {
|
|
5539
|
-
return
|
|
5624
|
+
return yt(this, e);
|
|
5540
5625
|
}
|
|
5541
5626
|
implies(e) {
|
|
5542
|
-
return
|
|
5627
|
+
return gt(this, e);
|
|
5543
5628
|
}
|
|
5544
5629
|
iff(e) {
|
|
5545
|
-
return
|
|
5630
|
+
return _t(this, e);
|
|
5546
5631
|
}
|
|
5547
5632
|
}
|
|
5548
|
-
class
|
|
5633
|
+
class sr {
|
|
5549
5634
|
constructor(e) {
|
|
5550
5635
|
this.ptr = e, this.ctx = $;
|
|
5551
5636
|
}
|
|
@@ -5553,19 +5638,19 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5553
5638
|
return p(t), e.probe_apply(f, this.ptr, t.ptr);
|
|
5554
5639
|
}
|
|
5555
5640
|
}
|
|
5556
|
-
class
|
|
5641
|
+
class cr {
|
|
5557
5642
|
constructor(t = !0, n = !1, r = !1) {
|
|
5558
5643
|
this.ctx = $;
|
|
5559
5644
|
let i = g(e.mk_goal(f, t, n, r));
|
|
5560
5645
|
this.ptr = i, e.goal_inc_ref(f, i), c.register(this, () => e.goal_dec_ref(f, i), this);
|
|
5561
5646
|
}
|
|
5562
5647
|
static fromPtr(t) {
|
|
5563
|
-
let n = Object.create(
|
|
5648
|
+
let n = Object.create(cr.prototype);
|
|
5564
5649
|
return n.ctx = $, n.ptr = t, e.goal_inc_ref(f, t), c.register(n, () => e.goal_dec_ref(f, t), n), n;
|
|
5565
5650
|
}
|
|
5566
5651
|
add(...t) {
|
|
5567
5652
|
for (let n of t) {
|
|
5568
|
-
let t =
|
|
5653
|
+
let t = de(n) ? n : N.val(n);
|
|
5569
5654
|
p(t), e.goal_assert(f, this.ptr, t.ast);
|
|
5570
5655
|
}
|
|
5571
5656
|
}
|
|
@@ -5575,7 +5660,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5575
5660
|
get(t) {
|
|
5576
5661
|
(0, i.assert)(t >= 0 && t < this.size(), "Index out of bounds");
|
|
5577
5662
|
let n = g(e.goal_formula(f, this.ptr, t));
|
|
5578
|
-
return new
|
|
5663
|
+
return new U(n);
|
|
5579
5664
|
}
|
|
5580
5665
|
depth() {
|
|
5581
5666
|
return e.goal_depth(f, this.ptr);
|
|
@@ -5601,16 +5686,16 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5601
5686
|
convertModel(t) {
|
|
5602
5687
|
p(t);
|
|
5603
5688
|
let n = g(e.goal_convert_model(f, this.ptr, t.ptr));
|
|
5604
|
-
return new
|
|
5689
|
+
return new tr(n);
|
|
5605
5690
|
}
|
|
5606
5691
|
asExpr() {
|
|
5607
5692
|
let e = this.size();
|
|
5608
|
-
if (e === 0) return
|
|
5693
|
+
if (e === 0) return N.val(!0);
|
|
5609
5694
|
if (e === 1) return this.get(0);
|
|
5610
5695
|
{
|
|
5611
5696
|
let t = [];
|
|
5612
5697
|
for (let n = 0; n < e; n++) t.push(this.get(n));
|
|
5613
|
-
return
|
|
5698
|
+
return xt(...t);
|
|
5614
5699
|
}
|
|
5615
5700
|
}
|
|
5616
5701
|
toString() {
|
|
@@ -5620,7 +5705,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5620
5705
|
return e.goal_to_dimacs_string(f, this.ptr, t);
|
|
5621
5706
|
}
|
|
5622
5707
|
}
|
|
5623
|
-
class
|
|
5708
|
+
class lr {
|
|
5624
5709
|
constructor(t) {
|
|
5625
5710
|
this.ctx = $, this.ptr = t, e.apply_result_inc_ref(f, t), c.register(this, () => e.apply_result_dec_ref(f, t), this);
|
|
5626
5711
|
}
|
|
@@ -5630,20 +5715,20 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5630
5715
|
getSubgoal(t) {
|
|
5631
5716
|
(0, i.assert)(t >= 0 && t < this.length(), "Index out of bounds");
|
|
5632
5717
|
let n = g(e.apply_result_get_subgoal(f, this.ptr, t));
|
|
5633
|
-
return
|
|
5718
|
+
return cr.fromPtr(n);
|
|
5634
5719
|
}
|
|
5635
5720
|
toString() {
|
|
5636
5721
|
return e.apply_result_to_string(f, this.ptr);
|
|
5637
5722
|
}
|
|
5638
5723
|
}
|
|
5639
|
-
let
|
|
5724
|
+
let ur = { get(e, t) {
|
|
5640
5725
|
if (typeof t == "string") {
|
|
5641
5726
|
let n = parseInt(t, 10);
|
|
5642
5727
|
if (!isNaN(n) && n >= 0 && n < e.length()) return e.getSubgoal(n);
|
|
5643
5728
|
}
|
|
5644
5729
|
return e[t];
|
|
5645
5730
|
} };
|
|
5646
|
-
class
|
|
5731
|
+
class W {
|
|
5647
5732
|
constructor(t) {
|
|
5648
5733
|
this.ctx = $;
|
|
5649
5734
|
let n;
|
|
@@ -5651,28 +5736,28 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5651
5736
|
}
|
|
5652
5737
|
async apply(t) {
|
|
5653
5738
|
let n;
|
|
5654
|
-
|
|
5655
|
-
let r = await e.tactic_apply(f, this.ptr, n.ptr), i = new
|
|
5656
|
-
return new Proxy(i,
|
|
5739
|
+
de(t) ? (n = new cr(), n.add(t)) : n = t, p(n);
|
|
5740
|
+
let r = await e.tactic_apply(f, this.ptr, n.ptr), i = new lr(g(r));
|
|
5741
|
+
return new Proxy(i, ur);
|
|
5657
5742
|
}
|
|
5658
5743
|
solver() {
|
|
5659
5744
|
let t = g(e.mk_solver_from_tactic(f, this.ptr));
|
|
5660
|
-
return new
|
|
5745
|
+
return new Qn(t);
|
|
5661
5746
|
}
|
|
5662
5747
|
help() {
|
|
5663
5748
|
return e.tactic_get_help(f, this.ptr);
|
|
5664
5749
|
}
|
|
5665
5750
|
paramDescrs() {
|
|
5666
5751
|
let t = g(e.tactic_get_param_descrs(f, this.ptr));
|
|
5667
|
-
return new
|
|
5752
|
+
return new fr(t);
|
|
5668
5753
|
}
|
|
5669
5754
|
usingParams(t) {
|
|
5670
5755
|
p(t);
|
|
5671
5756
|
let n = g(e.tactic_using_params(f, this.ptr, t.ptr));
|
|
5672
|
-
return new
|
|
5757
|
+
return new W(n);
|
|
5673
5758
|
}
|
|
5674
5759
|
}
|
|
5675
|
-
class
|
|
5760
|
+
class dr {
|
|
5676
5761
|
constructor(t) {
|
|
5677
5762
|
this.ctx = $, this.ptr = t || e.mk_params(f), e.params_inc_ref(f, this.ptr), c.register(this, () => e.params_dec_ref(f, this.ptr), this);
|
|
5678
5763
|
}
|
|
@@ -5687,7 +5772,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5687
5772
|
return e.params_to_string(f, this.ptr);
|
|
5688
5773
|
}
|
|
5689
5774
|
}
|
|
5690
|
-
class
|
|
5775
|
+
class fr {
|
|
5691
5776
|
constructor(t) {
|
|
5692
5777
|
this.ctx = $, this.ptr = t, e.param_descrs_inc_ref(f, this.ptr), c.register(this, () => e.param_descrs_dec_ref(f, this.ptr), this);
|
|
5693
5778
|
}
|
|
@@ -5695,7 +5780,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5695
5780
|
return e.param_descrs_size(f, this.ptr);
|
|
5696
5781
|
}
|
|
5697
5782
|
getName(t) {
|
|
5698
|
-
let n =
|
|
5783
|
+
let n = v(e.param_descrs_get_name(f, this.ptr, t));
|
|
5699
5784
|
return typeof n == "string" ? n : `${n}`;
|
|
5700
5785
|
}
|
|
5701
5786
|
getKind(t) {
|
|
@@ -5708,7 +5793,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5708
5793
|
return e.param_descrs_to_string(f, this.ptr);
|
|
5709
5794
|
}
|
|
5710
5795
|
}
|
|
5711
|
-
class
|
|
5796
|
+
class pr {
|
|
5712
5797
|
constructor(t) {
|
|
5713
5798
|
this.ctx = $;
|
|
5714
5799
|
let n;
|
|
@@ -5719,105 +5804,105 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5719
5804
|
}
|
|
5720
5805
|
paramDescrs() {
|
|
5721
5806
|
let t = g(e.simplifier_get_param_descrs(f, this.ptr));
|
|
5722
|
-
return new
|
|
5807
|
+
return new fr(t);
|
|
5723
5808
|
}
|
|
5724
5809
|
usingParams(t) {
|
|
5725
5810
|
p(t);
|
|
5726
5811
|
let n = g(e.simplifier_using_params(f, this.ptr, t.ptr));
|
|
5727
|
-
return new
|
|
5812
|
+
return new pr(n);
|
|
5728
5813
|
}
|
|
5729
5814
|
andThen(t) {
|
|
5730
5815
|
p(t);
|
|
5731
5816
|
let n = g(e.simplifier_and_then(f, this.ptr, t.ptr));
|
|
5732
|
-
return new
|
|
5817
|
+
return new pr(n);
|
|
5733
5818
|
}
|
|
5734
5819
|
}
|
|
5735
|
-
class
|
|
5820
|
+
class mr extends B {
|
|
5736
5821
|
cast(e) {
|
|
5737
|
-
let t =
|
|
5738
|
-
if (
|
|
5822
|
+
let t = we(this) ? "IntSort" : "RealSort";
|
|
5823
|
+
if (E(e)) {
|
|
5739
5824
|
let n = e.sort;
|
|
5740
|
-
if (
|
|
5825
|
+
if (O(e)) {
|
|
5741
5826
|
if (this.eqIdentity(n)) return e;
|
|
5742
|
-
if (
|
|
5827
|
+
if (we(n) && De(this)) return jt(e);
|
|
5743
5828
|
(0, i.assert)(!1, "Can't cast Real to IntSort without loss");
|
|
5744
|
-
} else if (
|
|
5829
|
+
} else if (de(e)) return we(this) ? R(e, 1, 0) : jt(R(e, 1, 0));
|
|
5745
5830
|
(0, i.assert)(!1, `Can't cast expression to ${t}`);
|
|
5746
5831
|
} else {
|
|
5747
|
-
if (typeof e != "boolean") return
|
|
5832
|
+
if (typeof e != "boolean") return we(this) ? ((0, i.assert)(!s(e), "Can't cast fraction to IntSort"), P.val(e)) : F.val(e);
|
|
5748
5833
|
(0, i.assert)(!1, `Can't cast primitive to ${t}`);
|
|
5749
5834
|
}
|
|
5750
5835
|
}
|
|
5751
5836
|
}
|
|
5752
|
-
function
|
|
5753
|
-
if (t instanceof
|
|
5837
|
+
function hr(t, ...n) {
|
|
5838
|
+
if (t instanceof q) {
|
|
5754
5839
|
if (n.length !== 1) throw Error("BitVec add only supports 2 arguments");
|
|
5755
|
-
return new
|
|
5840
|
+
return new q(g(e.mk_bvadd(f, t.ast, t.sort.cast(n[0]).ast)));
|
|
5756
5841
|
}
|
|
5757
|
-
return (0, i.assert)(t instanceof
|
|
5842
|
+
return (0, i.assert)(t instanceof G), new G(g(e.mk_add(f, [t.ast].concat(n.map((e) => t.sort.cast(e).ast)))));
|
|
5758
5843
|
}
|
|
5759
|
-
function
|
|
5760
|
-
if (t instanceof
|
|
5844
|
+
function gr(t, ...n) {
|
|
5845
|
+
if (t instanceof q) {
|
|
5761
5846
|
if (n.length !== 1) throw Error("BitVec sub only supports 2 arguments");
|
|
5762
|
-
return new
|
|
5847
|
+
return new q(g(e.mk_bvsub(f, t.ast, t.sort.cast(n[0]).ast)));
|
|
5763
5848
|
}
|
|
5764
|
-
return (0, i.assert)(t instanceof
|
|
5849
|
+
return (0, i.assert)(t instanceof G), new G(g(e.mk_sub(f, [t.ast].concat(n.map((e) => t.sort.cast(e).ast)))));
|
|
5765
5850
|
}
|
|
5766
|
-
function
|
|
5767
|
-
if (t instanceof
|
|
5851
|
+
function _r(t, ...n) {
|
|
5852
|
+
if (t instanceof q) {
|
|
5768
5853
|
if (n.length !== 1) throw Error("BitVec mul only supports 2 arguments");
|
|
5769
|
-
return new
|
|
5854
|
+
return new q(g(e.mk_bvmul(f, t.ast, t.sort.cast(n[0]).ast)));
|
|
5770
5855
|
}
|
|
5771
|
-
return (0, i.assert)(t instanceof
|
|
5856
|
+
return (0, i.assert)(t instanceof G), new G(g(e.mk_mul(f, [t.ast].concat(n.map((e) => t.sort.cast(e).ast)))));
|
|
5772
5857
|
}
|
|
5773
|
-
function
|
|
5774
|
-
return t instanceof
|
|
5858
|
+
function vr(t, n) {
|
|
5859
|
+
return t instanceof q ? new q(g(e.mk_bvsdiv(f, t.ast, t.sort.cast(n).ast))) : ((0, i.assert)(t instanceof G), new G(g(e.mk_div(f, t.ast, t.sort.cast(n).ast))));
|
|
5775
5860
|
}
|
|
5776
|
-
function
|
|
5777
|
-
return new
|
|
5861
|
+
function yr(t, n) {
|
|
5862
|
+
return new q(g(e.mk_bvudiv(f, t.ast, t.sort.cast(n).ast)));
|
|
5778
5863
|
}
|
|
5779
|
-
function
|
|
5780
|
-
return t instanceof
|
|
5864
|
+
function br(t) {
|
|
5865
|
+
return t instanceof q ? new q(g(e.mk_bvneg(f, t.ast))) : ((0, i.assert)(t instanceof G), new G(g(e.mk_unary_minus(f, t.ast))));
|
|
5781
5866
|
}
|
|
5782
|
-
function
|
|
5783
|
-
return t instanceof
|
|
5867
|
+
function xr(t, n) {
|
|
5868
|
+
return t instanceof q ? new q(g(e.mk_bvsrem(f, t.ast, t.sort.cast(n).ast))) : ((0, i.assert)(t instanceof G), new G(g(e.mk_mod(f, t.ast, t.sort.cast(n).ast))));
|
|
5784
5869
|
}
|
|
5785
|
-
class
|
|
5870
|
+
class G extends H {
|
|
5786
5871
|
add(e) {
|
|
5787
|
-
return
|
|
5872
|
+
return hr(this, e);
|
|
5788
5873
|
}
|
|
5789
5874
|
mul(e) {
|
|
5790
|
-
return
|
|
5875
|
+
return _r(this, e);
|
|
5791
5876
|
}
|
|
5792
5877
|
sub(e) {
|
|
5793
|
-
return
|
|
5878
|
+
return gr(this, e);
|
|
5794
5879
|
}
|
|
5795
5880
|
pow(t) {
|
|
5796
|
-
return new
|
|
5881
|
+
return new G(g(e.mk_power(f, this.ast, this.sort.cast(t).ast)));
|
|
5797
5882
|
}
|
|
5798
5883
|
div(e) {
|
|
5799
|
-
return
|
|
5884
|
+
return vr(this, e);
|
|
5800
5885
|
}
|
|
5801
5886
|
mod(e) {
|
|
5802
|
-
return
|
|
5887
|
+
return xr(this, e);
|
|
5803
5888
|
}
|
|
5804
5889
|
neg() {
|
|
5805
|
-
return
|
|
5890
|
+
return br(this);
|
|
5806
5891
|
}
|
|
5807
5892
|
le(e) {
|
|
5808
|
-
return
|
|
5893
|
+
return $t(this, e);
|
|
5809
5894
|
}
|
|
5810
5895
|
lt(e) {
|
|
5811
|
-
return
|
|
5896
|
+
return Zt(this, e);
|
|
5812
5897
|
}
|
|
5813
5898
|
gt(e) {
|
|
5814
|
-
return
|
|
5899
|
+
return Qt(this, e);
|
|
5815
5900
|
}
|
|
5816
5901
|
ge(e) {
|
|
5817
|
-
return
|
|
5902
|
+
return en(this, e);
|
|
5818
5903
|
}
|
|
5819
5904
|
}
|
|
5820
|
-
class
|
|
5905
|
+
class Sr extends G {
|
|
5821
5906
|
value() {
|
|
5822
5907
|
return BigInt(this.asString());
|
|
5823
5908
|
}
|
|
@@ -5828,7 +5913,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5828
5913
|
return e.get_numeral_binary_string(f, this.ast);
|
|
5829
5914
|
}
|
|
5830
5915
|
}
|
|
5831
|
-
class
|
|
5916
|
+
class Cr extends G {
|
|
5832
5917
|
value() {
|
|
5833
5918
|
return {
|
|
5834
5919
|
numerator: this.numerator().value(),
|
|
@@ -5836,48 +5921,48 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5836
5921
|
};
|
|
5837
5922
|
}
|
|
5838
5923
|
numerator() {
|
|
5839
|
-
return new
|
|
5924
|
+
return new Sr(e.get_numerator(f, this.ast));
|
|
5840
5925
|
}
|
|
5841
5926
|
denominator() {
|
|
5842
|
-
return new
|
|
5927
|
+
return new Sr(e.get_denominator(f, this.ast));
|
|
5843
5928
|
}
|
|
5844
5929
|
asNumber() {
|
|
5845
5930
|
let { numerator: e, denominator: t } = this.value(), n = e / t;
|
|
5846
5931
|
return Number(n) + Number(e - n * t) / Number(t);
|
|
5847
5932
|
}
|
|
5848
|
-
asDecimal(t = Number.parseInt(
|
|
5933
|
+
asDecimal(t = Number.parseInt(ee("precision") ?? a.toString())) {
|
|
5849
5934
|
return e.get_numeral_decimal_string(f, this.ast, t);
|
|
5850
5935
|
}
|
|
5851
5936
|
asString() {
|
|
5852
5937
|
return e.get_numeral_string(f, this.ast);
|
|
5853
5938
|
}
|
|
5854
5939
|
}
|
|
5855
|
-
class
|
|
5940
|
+
class K {
|
|
5856
5941
|
constructor(t) {
|
|
5857
5942
|
this.ctx = $;
|
|
5858
5943
|
let n;
|
|
5859
5944
|
n = typeof t == "string" ? g(e.rcf_mk_rational(f, t)) : typeof t == "number" ? g(e.rcf_mk_small_int(f, t)) : t, this.ptr = n, c.register(this, () => e.rcf_del(f, n), this);
|
|
5860
5945
|
}
|
|
5861
5946
|
add(t) {
|
|
5862
|
-
return p(t), new
|
|
5947
|
+
return p(t), new K(g(e.rcf_add(f, this.ptr, t.ptr)));
|
|
5863
5948
|
}
|
|
5864
5949
|
sub(t) {
|
|
5865
|
-
return p(t), new
|
|
5950
|
+
return p(t), new K(g(e.rcf_sub(f, this.ptr, t.ptr)));
|
|
5866
5951
|
}
|
|
5867
5952
|
mul(t) {
|
|
5868
|
-
return p(t), new
|
|
5953
|
+
return p(t), new K(g(e.rcf_mul(f, this.ptr, t.ptr)));
|
|
5869
5954
|
}
|
|
5870
5955
|
div(t) {
|
|
5871
|
-
return p(t), new
|
|
5956
|
+
return p(t), new K(g(e.rcf_div(f, this.ptr, t.ptr)));
|
|
5872
5957
|
}
|
|
5873
5958
|
neg() {
|
|
5874
|
-
return new
|
|
5959
|
+
return new K(g(e.rcf_neg(f, this.ptr)));
|
|
5875
5960
|
}
|
|
5876
5961
|
inv() {
|
|
5877
|
-
return new
|
|
5962
|
+
return new K(g(e.rcf_inv(f, this.ptr)));
|
|
5878
5963
|
}
|
|
5879
5964
|
power(t) {
|
|
5880
|
-
return new
|
|
5965
|
+
return new K(g(e.rcf_power(f, this.ptr, t)));
|
|
5881
5966
|
}
|
|
5882
5967
|
lt(t) {
|
|
5883
5968
|
return p(t), g(e.rcf_lt(f, this.ptr, t.ptr));
|
|
@@ -5916,149 +6001,149 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
5916
6001
|
return g(e.rcf_num_to_decimal_string(f, this.ptr, t));
|
|
5917
6002
|
}
|
|
5918
6003
|
}
|
|
5919
|
-
class
|
|
6004
|
+
class wr extends B {
|
|
5920
6005
|
size() {
|
|
5921
6006
|
return e.get_bv_sort_size(f, this.ptr);
|
|
5922
6007
|
}
|
|
5923
6008
|
subsort(e) {
|
|
5924
|
-
return
|
|
6009
|
+
return ke(e) && this.size() < e.size();
|
|
5925
6010
|
}
|
|
5926
6011
|
cast(e) {
|
|
5927
|
-
return
|
|
6012
|
+
return E(e) ? (p(e), e) : ((0, i.assert)(!s(e), "Can't convert rational to BitVec"), nt.val(e, this.size()));
|
|
5928
6013
|
}
|
|
5929
6014
|
}
|
|
5930
|
-
class
|
|
6015
|
+
class q extends H {
|
|
5931
6016
|
size() {
|
|
5932
6017
|
return this.sort.size();
|
|
5933
6018
|
}
|
|
5934
6019
|
add(e) {
|
|
5935
|
-
return
|
|
6020
|
+
return hr(this, e);
|
|
5936
6021
|
}
|
|
5937
6022
|
mul(e) {
|
|
5938
|
-
return
|
|
6023
|
+
return _r(this, e);
|
|
5939
6024
|
}
|
|
5940
6025
|
sub(e) {
|
|
5941
|
-
return
|
|
6026
|
+
return gr(this, e);
|
|
5942
6027
|
}
|
|
5943
6028
|
sdiv(e) {
|
|
5944
|
-
return
|
|
6029
|
+
return vr(this, e);
|
|
5945
6030
|
}
|
|
5946
6031
|
udiv(e) {
|
|
5947
|
-
return
|
|
6032
|
+
return yr(this, e);
|
|
5948
6033
|
}
|
|
5949
6034
|
smod(e) {
|
|
5950
|
-
return
|
|
6035
|
+
return xr(this, e);
|
|
5951
6036
|
}
|
|
5952
6037
|
urem(t) {
|
|
5953
|
-
return new
|
|
6038
|
+
return new q(g(e.mk_bvurem(f, this.ast, this.sort.cast(t).ast)));
|
|
5954
6039
|
}
|
|
5955
6040
|
srem(t) {
|
|
5956
|
-
return new
|
|
6041
|
+
return new q(g(e.mk_bvsrem(f, this.ast, this.sort.cast(t).ast)));
|
|
5957
6042
|
}
|
|
5958
6043
|
neg() {
|
|
5959
|
-
return
|
|
6044
|
+
return br(this);
|
|
5960
6045
|
}
|
|
5961
6046
|
or(t) {
|
|
5962
|
-
return new
|
|
6047
|
+
return new q(g(e.mk_bvor(f, this.ast, this.sort.cast(t).ast)));
|
|
5963
6048
|
}
|
|
5964
6049
|
and(t) {
|
|
5965
|
-
return new
|
|
6050
|
+
return new q(g(e.mk_bvand(f, this.ast, this.sort.cast(t).ast)));
|
|
5966
6051
|
}
|
|
5967
6052
|
nand(t) {
|
|
5968
|
-
return new
|
|
6053
|
+
return new q(g(e.mk_bvnand(f, this.ast, this.sort.cast(t).ast)));
|
|
5969
6054
|
}
|
|
5970
6055
|
xor(t) {
|
|
5971
|
-
return new
|
|
6056
|
+
return new q(g(e.mk_bvxor(f, this.ast, this.sort.cast(t).ast)));
|
|
5972
6057
|
}
|
|
5973
6058
|
xnor(t) {
|
|
5974
|
-
return new
|
|
6059
|
+
return new q(g(e.mk_bvxnor(f, this.ast, this.sort.cast(t).ast)));
|
|
5975
6060
|
}
|
|
5976
6061
|
shr(t) {
|
|
5977
|
-
return new
|
|
6062
|
+
return new q(g(e.mk_bvashr(f, this.ast, this.sort.cast(t).ast)));
|
|
5978
6063
|
}
|
|
5979
6064
|
lshr(t) {
|
|
5980
|
-
return new
|
|
6065
|
+
return new q(g(e.mk_bvlshr(f, this.ast, this.sort.cast(t).ast)));
|
|
5981
6066
|
}
|
|
5982
6067
|
shl(t) {
|
|
5983
|
-
return new
|
|
6068
|
+
return new q(g(e.mk_bvshl(f, this.ast, this.sort.cast(t).ast)));
|
|
5984
6069
|
}
|
|
5985
6070
|
rotateRight(t) {
|
|
5986
|
-
return new
|
|
6071
|
+
return new q(g(e.mk_ext_rotate_right(f, this.ast, this.sort.cast(t).ast)));
|
|
5987
6072
|
}
|
|
5988
6073
|
rotateLeft(t) {
|
|
5989
|
-
return new
|
|
6074
|
+
return new q(g(e.mk_ext_rotate_left(f, this.ast, this.sort.cast(t).ast)));
|
|
5990
6075
|
}
|
|
5991
6076
|
not() {
|
|
5992
|
-
return new
|
|
6077
|
+
return new q(g(e.mk_bvnot(f, this.ast)));
|
|
5993
6078
|
}
|
|
5994
6079
|
extract(e, t) {
|
|
5995
|
-
return
|
|
6080
|
+
return un(e, t, this);
|
|
5996
6081
|
}
|
|
5997
6082
|
signExt(t) {
|
|
5998
|
-
return new
|
|
6083
|
+
return new q(g(e.mk_sign_ext(f, t, this.ast)));
|
|
5999
6084
|
}
|
|
6000
6085
|
zeroExt(t) {
|
|
6001
|
-
return new
|
|
6086
|
+
return new q(g(e.mk_zero_ext(f, t, this.ast)));
|
|
6002
6087
|
}
|
|
6003
6088
|
repeat(t) {
|
|
6004
|
-
return new
|
|
6089
|
+
return new q(g(e.mk_repeat(f, t, this.ast)));
|
|
6005
6090
|
}
|
|
6006
6091
|
sle(e) {
|
|
6007
|
-
return
|
|
6092
|
+
return cn(this, e);
|
|
6008
6093
|
}
|
|
6009
6094
|
ule(e) {
|
|
6010
|
-
return
|
|
6095
|
+
return rn(this, e);
|
|
6011
6096
|
}
|
|
6012
6097
|
slt(e) {
|
|
6013
|
-
return
|
|
6098
|
+
return on(this, e);
|
|
6014
6099
|
}
|
|
6015
6100
|
ult(e) {
|
|
6016
|
-
return
|
|
6101
|
+
return tn(this, e);
|
|
6017
6102
|
}
|
|
6018
6103
|
sge(e) {
|
|
6019
|
-
return
|
|
6104
|
+
return ln(this, e);
|
|
6020
6105
|
}
|
|
6021
6106
|
uge(e) {
|
|
6022
|
-
return
|
|
6107
|
+
return an(this, e);
|
|
6023
6108
|
}
|
|
6024
6109
|
sgt(e) {
|
|
6025
|
-
return
|
|
6110
|
+
return sn(this, e);
|
|
6026
6111
|
}
|
|
6027
6112
|
ugt(e) {
|
|
6028
|
-
return
|
|
6113
|
+
return nn(this, e);
|
|
6029
6114
|
}
|
|
6030
6115
|
redAnd() {
|
|
6031
|
-
return new
|
|
6116
|
+
return new q(g(e.mk_bvredand(f, this.ast)));
|
|
6032
6117
|
}
|
|
6033
6118
|
redOr() {
|
|
6034
|
-
return new
|
|
6119
|
+
return new q(g(e.mk_bvredor(f, this.ast)));
|
|
6035
6120
|
}
|
|
6036
6121
|
addNoOverflow(t, n) {
|
|
6037
|
-
return new
|
|
6122
|
+
return new U(g(e.mk_bvadd_no_overflow(f, this.ast, this.sort.cast(t).ast, n)));
|
|
6038
6123
|
}
|
|
6039
6124
|
addNoUnderflow(t) {
|
|
6040
|
-
return new
|
|
6125
|
+
return new U(g(e.mk_bvadd_no_underflow(f, this.ast, this.sort.cast(t).ast)));
|
|
6041
6126
|
}
|
|
6042
6127
|
subNoOverflow(t) {
|
|
6043
|
-
return new
|
|
6128
|
+
return new U(g(e.mk_bvsub_no_overflow(f, this.ast, this.sort.cast(t).ast)));
|
|
6044
6129
|
}
|
|
6045
6130
|
subNoUnderflow(t, n) {
|
|
6046
|
-
return new
|
|
6131
|
+
return new U(g(e.mk_bvsub_no_underflow(f, this.ast, this.sort.cast(t).ast, n)));
|
|
6047
6132
|
}
|
|
6048
6133
|
sdivNoOverflow(t) {
|
|
6049
|
-
return new
|
|
6134
|
+
return new U(g(e.mk_bvsdiv_no_overflow(f, this.ast, this.sort.cast(t).ast)));
|
|
6050
6135
|
}
|
|
6051
6136
|
mulNoOverflow(t, n) {
|
|
6052
|
-
return new
|
|
6137
|
+
return new U(g(e.mk_bvmul_no_overflow(f, this.ast, this.sort.cast(t).ast, n)));
|
|
6053
6138
|
}
|
|
6054
6139
|
mulNoUnderflow(t) {
|
|
6055
|
-
return new
|
|
6140
|
+
return new U(g(e.mk_bvmul_no_underflow(f, this.ast, this.sort.cast(t).ast)));
|
|
6056
6141
|
}
|
|
6057
6142
|
negNoOverflow() {
|
|
6058
|
-
return new
|
|
6143
|
+
return new U(g(e.mk_bvneg_no_overflow(f, this.ast)));
|
|
6059
6144
|
}
|
|
6060
6145
|
}
|
|
6061
|
-
class
|
|
6146
|
+
class Tr extends q {
|
|
6062
6147
|
value() {
|
|
6063
6148
|
return BigInt(this.asString());
|
|
6064
6149
|
}
|
|
@@ -6073,14 +6158,14 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6073
6158
|
return e.get_numeral_binary_string(f, this.ast);
|
|
6074
6159
|
}
|
|
6075
6160
|
}
|
|
6076
|
-
class
|
|
6161
|
+
class Er extends B {
|
|
6077
6162
|
cast(e) {
|
|
6078
|
-
if (
|
|
6163
|
+
if (Ie(e)) return p(e), e;
|
|
6079
6164
|
throw Error("Can't cast to FPRMSort");
|
|
6080
6165
|
}
|
|
6081
6166
|
}
|
|
6082
|
-
class
|
|
6083
|
-
class
|
|
6167
|
+
class Dr extends H {}
|
|
6168
|
+
class Or extends B {
|
|
6084
6169
|
ebits() {
|
|
6085
6170
|
return e.fpa_get_ebits(f, this.ptr);
|
|
6086
6171
|
}
|
|
@@ -6088,95 +6173,95 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6088
6173
|
return e.fpa_get_sbits(f, this.ptr);
|
|
6089
6174
|
}
|
|
6090
6175
|
cast(e) {
|
|
6091
|
-
if (
|
|
6092
|
-
if (typeof e == "number") return
|
|
6176
|
+
if (E(e)) return p(e), e;
|
|
6177
|
+
if (typeof e == "number") return I.val(e, this);
|
|
6093
6178
|
throw Error("Can't cast to FPSort");
|
|
6094
6179
|
}
|
|
6095
6180
|
}
|
|
6096
|
-
class
|
|
6181
|
+
class J extends H {
|
|
6097
6182
|
add(t, n) {
|
|
6098
|
-
let r =
|
|
6099
|
-
return new
|
|
6183
|
+
let r = k(n) ? n : I.val(n, this.sort);
|
|
6184
|
+
return new J(g(e.mk_fpa_add(f, t.ast, this.ast, r.ast)));
|
|
6100
6185
|
}
|
|
6101
6186
|
sub(t, n) {
|
|
6102
|
-
let r =
|
|
6103
|
-
return new
|
|
6187
|
+
let r = k(n) ? n : I.val(n, this.sort);
|
|
6188
|
+
return new J(g(e.mk_fpa_sub(f, t.ast, this.ast, r.ast)));
|
|
6104
6189
|
}
|
|
6105
6190
|
mul(t, n) {
|
|
6106
|
-
let r =
|
|
6107
|
-
return new
|
|
6191
|
+
let r = k(n) ? n : I.val(n, this.sort);
|
|
6192
|
+
return new J(g(e.mk_fpa_mul(f, t.ast, this.ast, r.ast)));
|
|
6108
6193
|
}
|
|
6109
6194
|
div(t, n) {
|
|
6110
|
-
let r =
|
|
6111
|
-
return new
|
|
6195
|
+
let r = k(n) ? n : I.val(n, this.sort);
|
|
6196
|
+
return new J(g(e.mk_fpa_div(f, t.ast, this.ast, r.ast)));
|
|
6112
6197
|
}
|
|
6113
6198
|
neg() {
|
|
6114
|
-
return new
|
|
6199
|
+
return new J(g(e.mk_fpa_neg(f, this.ast)));
|
|
6115
6200
|
}
|
|
6116
6201
|
abs() {
|
|
6117
|
-
return new
|
|
6202
|
+
return new J(g(e.mk_fpa_abs(f, this.ast)));
|
|
6118
6203
|
}
|
|
6119
6204
|
sqrt(t) {
|
|
6120
|
-
return new
|
|
6205
|
+
return new J(g(e.mk_fpa_sqrt(f, t.ast, this.ast)));
|
|
6121
6206
|
}
|
|
6122
6207
|
rem(t) {
|
|
6123
|
-
let n =
|
|
6124
|
-
return new
|
|
6208
|
+
let n = k(t) ? t : I.val(t, this.sort);
|
|
6209
|
+
return new J(g(e.mk_fpa_rem(f, this.ast, n.ast)));
|
|
6125
6210
|
}
|
|
6126
6211
|
fma(t, n, r) {
|
|
6127
|
-
let i =
|
|
6128
|
-
return new
|
|
6212
|
+
let i = k(n) ? n : I.val(n, this.sort), a = k(r) ? r : I.val(r, this.sort);
|
|
6213
|
+
return new J(g(e.mk_fpa_fma(f, t.ast, this.ast, i.ast, a.ast)));
|
|
6129
6214
|
}
|
|
6130
6215
|
lt(t) {
|
|
6131
|
-
let n =
|
|
6132
|
-
return new
|
|
6216
|
+
let n = k(t) ? t : I.val(t, this.sort);
|
|
6217
|
+
return new U(g(e.mk_fpa_lt(f, this.ast, n.ast)));
|
|
6133
6218
|
}
|
|
6134
6219
|
gt(t) {
|
|
6135
|
-
let n =
|
|
6136
|
-
return new
|
|
6220
|
+
let n = k(t) ? t : I.val(t, this.sort);
|
|
6221
|
+
return new U(g(e.mk_fpa_gt(f, this.ast, n.ast)));
|
|
6137
6222
|
}
|
|
6138
6223
|
le(t) {
|
|
6139
|
-
let n =
|
|
6140
|
-
return new
|
|
6224
|
+
let n = k(t) ? t : I.val(t, this.sort);
|
|
6225
|
+
return new U(g(e.mk_fpa_leq(f, this.ast, n.ast)));
|
|
6141
6226
|
}
|
|
6142
6227
|
ge(t) {
|
|
6143
|
-
let n =
|
|
6144
|
-
return new
|
|
6228
|
+
let n = k(t) ? t : I.val(t, this.sort);
|
|
6229
|
+
return new U(g(e.mk_fpa_geq(f, this.ast, n.ast)));
|
|
6145
6230
|
}
|
|
6146
6231
|
isNaN() {
|
|
6147
|
-
return new
|
|
6232
|
+
return new U(g(e.mk_fpa_is_nan(f, this.ast)));
|
|
6148
6233
|
}
|
|
6149
6234
|
isInf() {
|
|
6150
|
-
return new
|
|
6235
|
+
return new U(g(e.mk_fpa_is_infinite(f, this.ast)));
|
|
6151
6236
|
}
|
|
6152
6237
|
isZero() {
|
|
6153
|
-
return new
|
|
6238
|
+
return new U(g(e.mk_fpa_is_zero(f, this.ast)));
|
|
6154
6239
|
}
|
|
6155
6240
|
isNormal() {
|
|
6156
|
-
return new
|
|
6241
|
+
return new U(g(e.mk_fpa_is_normal(f, this.ast)));
|
|
6157
6242
|
}
|
|
6158
6243
|
isSubnormal() {
|
|
6159
|
-
return new
|
|
6244
|
+
return new U(g(e.mk_fpa_is_subnormal(f, this.ast)));
|
|
6160
6245
|
}
|
|
6161
6246
|
isNegative() {
|
|
6162
|
-
return new
|
|
6247
|
+
return new U(g(e.mk_fpa_is_negative(f, this.ast)));
|
|
6163
6248
|
}
|
|
6164
6249
|
isPositive() {
|
|
6165
|
-
return new
|
|
6250
|
+
return new U(g(e.mk_fpa_is_positive(f, this.ast)));
|
|
6166
6251
|
}
|
|
6167
6252
|
toIEEEBV() {
|
|
6168
|
-
return new
|
|
6253
|
+
return new q(g(e.mk_fpa_to_ieee_bv(f, this.ast)));
|
|
6169
6254
|
}
|
|
6170
6255
|
toReal() {
|
|
6171
|
-
return new
|
|
6256
|
+
return new G(g(e.mk_fpa_to_real(f, this.ast)));
|
|
6172
6257
|
}
|
|
6173
6258
|
}
|
|
6174
|
-
class
|
|
6259
|
+
class kr extends J {
|
|
6175
6260
|
value() {
|
|
6176
6261
|
return e.get_numeral_double(f, this.ast);
|
|
6177
6262
|
}
|
|
6178
6263
|
}
|
|
6179
|
-
class
|
|
6264
|
+
class Ar extends B {
|
|
6180
6265
|
isString() {
|
|
6181
6266
|
return e.is_string_sort(f, this.ptr);
|
|
6182
6267
|
}
|
|
@@ -6184,12 +6269,12 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6184
6269
|
return b(g(e.get_seq_sort_basis(f, this.ptr)));
|
|
6185
6270
|
}
|
|
6186
6271
|
cast(e) {
|
|
6187
|
-
if (
|
|
6188
|
-
if (typeof e == "string") return
|
|
6272
|
+
if (A(e)) return p(e), e;
|
|
6273
|
+
if (typeof e == "string") return L.val(e);
|
|
6189
6274
|
throw Error("Can't cast to SeqSort");
|
|
6190
6275
|
}
|
|
6191
6276
|
}
|
|
6192
|
-
class
|
|
6277
|
+
class Y extends H {
|
|
6193
6278
|
isString() {
|
|
6194
6279
|
return e.is_string_sort(f, e.get_sort(f, this.ast));
|
|
6195
6280
|
}
|
|
@@ -6198,131 +6283,131 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6198
6283
|
return e.get_string(f, this.ast);
|
|
6199
6284
|
}
|
|
6200
6285
|
concat(t) {
|
|
6201
|
-
let n =
|
|
6202
|
-
return new
|
|
6286
|
+
let n = A(t) ? t : L.val(t);
|
|
6287
|
+
return new Y(g(e.mk_seq_concat(f, [this.ast, n.ast])));
|
|
6203
6288
|
}
|
|
6204
6289
|
length() {
|
|
6205
|
-
return new
|
|
6290
|
+
return new G(g(e.mk_seq_length(f, this.ast)));
|
|
6206
6291
|
}
|
|
6207
6292
|
at(t) {
|
|
6208
|
-
let n =
|
|
6209
|
-
return new
|
|
6293
|
+
let n = O(t) ? t : P.val(t);
|
|
6294
|
+
return new Y(g(e.mk_seq_at(f, this.ast, n.ast)));
|
|
6210
6295
|
}
|
|
6211
6296
|
nth(t) {
|
|
6212
|
-
let n =
|
|
6297
|
+
let n = O(t) ? t : P.val(t);
|
|
6213
6298
|
return x(g(e.mk_seq_nth(f, this.ast, n.ast)));
|
|
6214
6299
|
}
|
|
6215
6300
|
extract(t, n) {
|
|
6216
|
-
let r =
|
|
6217
|
-
return new
|
|
6301
|
+
let r = O(t) ? t : P.val(t), i = O(n) ? n : P.val(n);
|
|
6302
|
+
return new Y(g(e.mk_seq_extract(f, this.ast, r.ast, i.ast)));
|
|
6218
6303
|
}
|
|
6219
6304
|
indexOf(t, n) {
|
|
6220
|
-
let r =
|
|
6221
|
-
return new
|
|
6305
|
+
let r = A(t) ? t : L.val(t), i = n === void 0 ? P.val(0) : O(n) ? n : P.val(n);
|
|
6306
|
+
return new G(g(e.mk_seq_index(f, this.ast, r.ast, i.ast)));
|
|
6222
6307
|
}
|
|
6223
6308
|
lastIndexOf(t) {
|
|
6224
|
-
let n =
|
|
6225
|
-
return new
|
|
6309
|
+
let n = A(t) ? t : L.val(t);
|
|
6310
|
+
return new G(g(e.mk_seq_last_index(f, this.ast, n.ast)));
|
|
6226
6311
|
}
|
|
6227
6312
|
contains(t) {
|
|
6228
|
-
let n =
|
|
6229
|
-
return new
|
|
6313
|
+
let n = A(t) ? t : L.val(t);
|
|
6314
|
+
return new U(g(e.mk_seq_contains(f, this.ast, n.ast)));
|
|
6230
6315
|
}
|
|
6231
6316
|
prefixOf(t) {
|
|
6232
|
-
let n =
|
|
6233
|
-
return new
|
|
6317
|
+
let n = A(t) ? t : L.val(t);
|
|
6318
|
+
return new U(g(e.mk_seq_prefix(f, this.ast, n.ast)));
|
|
6234
6319
|
}
|
|
6235
6320
|
suffixOf(t) {
|
|
6236
|
-
let n =
|
|
6237
|
-
return new
|
|
6321
|
+
let n = A(t) ? t : L.val(t);
|
|
6322
|
+
return new U(g(e.mk_seq_suffix(f, this.ast, n.ast)));
|
|
6238
6323
|
}
|
|
6239
6324
|
replace(t, n) {
|
|
6240
|
-
let r =
|
|
6241
|
-
return new
|
|
6325
|
+
let r = A(t) ? t : L.val(t), i = A(n) ? n : L.val(n);
|
|
6326
|
+
return new Y(g(e.mk_seq_replace(f, this.ast, r.ast, i.ast)));
|
|
6242
6327
|
}
|
|
6243
6328
|
replaceAll(t, n) {
|
|
6244
|
-
let r =
|
|
6245
|
-
return new
|
|
6329
|
+
let r = A(t) ? t : L.val(t), i = A(n) ? n : L.val(n);
|
|
6330
|
+
return new Y(g(e.mk_seq_replace_all(f, this.ast, r.ast, i.ast)));
|
|
6246
6331
|
}
|
|
6247
6332
|
replaceRe(t, n) {
|
|
6248
|
-
let r =
|
|
6249
|
-
return new
|
|
6333
|
+
let r = A(n) ? n : L.val(n);
|
|
6334
|
+
return new Y(g(e.mk_seq_replace_re(f, this.ast, t.ast, r.ast)));
|
|
6250
6335
|
}
|
|
6251
6336
|
replaceReAll(t, n) {
|
|
6252
|
-
let r =
|
|
6253
|
-
return new
|
|
6337
|
+
let r = A(n) ? n : L.val(n);
|
|
6338
|
+
return new Y(g(e.mk_seq_replace_re_all(f, this.ast, t.ast, r.ast)));
|
|
6254
6339
|
}
|
|
6255
6340
|
toInt() {
|
|
6256
|
-
return new
|
|
6341
|
+
return new G(g(e.mk_str_to_int(f, this.ast)));
|
|
6257
6342
|
}
|
|
6258
6343
|
toCode() {
|
|
6259
|
-
return new
|
|
6344
|
+
return new G(g(e.mk_string_to_code(f, this.ast)));
|
|
6260
6345
|
}
|
|
6261
6346
|
lt(t) {
|
|
6262
|
-
let n =
|
|
6263
|
-
return new
|
|
6347
|
+
let n = A(t) ? t : L.val(t);
|
|
6348
|
+
return new U(g(e.mk_str_lt(f, this.ast, n.ast)));
|
|
6264
6349
|
}
|
|
6265
6350
|
le(t) {
|
|
6266
|
-
let n =
|
|
6267
|
-
return new
|
|
6351
|
+
let n = A(t) ? t : L.val(t);
|
|
6352
|
+
return new U(g(e.mk_str_le(f, this.ast, n.ast)));
|
|
6268
6353
|
}
|
|
6269
6354
|
map(t) {
|
|
6270
|
-
return new
|
|
6355
|
+
return new Y(g(e.mk_seq_map(f, t.ast, this.ast)));
|
|
6271
6356
|
}
|
|
6272
6357
|
mapi(t, n) {
|
|
6273
|
-
let r =
|
|
6274
|
-
return new
|
|
6358
|
+
let r = O(n) ? n : P.val(n);
|
|
6359
|
+
return new Y(g(e.mk_seq_mapi(f, t.ast, r.ast, this.ast)));
|
|
6275
6360
|
}
|
|
6276
6361
|
foldl(t, n) {
|
|
6277
6362
|
return x(g(e.mk_seq_foldl(f, t.ast, n.ast, this.ast)));
|
|
6278
6363
|
}
|
|
6279
6364
|
foldli(t, n, r) {
|
|
6280
|
-
let i =
|
|
6365
|
+
let i = O(n) ? n : P.val(n);
|
|
6281
6366
|
return x(g(e.mk_seq_foldli(f, t.ast, i.ast, r.ast, this.ast)));
|
|
6282
6367
|
}
|
|
6283
6368
|
}
|
|
6284
|
-
class
|
|
6369
|
+
class jr extends B {
|
|
6285
6370
|
basis() {
|
|
6286
6371
|
return b(g(e.get_re_sort_basis(f, this.ptr)));
|
|
6287
6372
|
}
|
|
6288
6373
|
cast(e) {
|
|
6289
|
-
if (
|
|
6374
|
+
if (Be(e)) return p(e), e;
|
|
6290
6375
|
throw Error("Can't cast to ReSort");
|
|
6291
6376
|
}
|
|
6292
6377
|
}
|
|
6293
|
-
class
|
|
6378
|
+
class X extends H {
|
|
6294
6379
|
plus() {
|
|
6295
|
-
return new
|
|
6380
|
+
return new X(g(e.mk_re_plus(f, this.ast)));
|
|
6296
6381
|
}
|
|
6297
6382
|
star() {
|
|
6298
|
-
return new
|
|
6383
|
+
return new X(g(e.mk_re_star(f, this.ast)));
|
|
6299
6384
|
}
|
|
6300
6385
|
option() {
|
|
6301
|
-
return new
|
|
6386
|
+
return new X(g(e.mk_re_option(f, this.ast)));
|
|
6302
6387
|
}
|
|
6303
6388
|
complement() {
|
|
6304
|
-
return new
|
|
6389
|
+
return new X(g(e.mk_re_complement(f, this.ast)));
|
|
6305
6390
|
}
|
|
6306
6391
|
union(t) {
|
|
6307
|
-
return new
|
|
6392
|
+
return new X(g(e.mk_re_union(f, [this.ast, t.ast])));
|
|
6308
6393
|
}
|
|
6309
6394
|
intersect(t) {
|
|
6310
|
-
return new
|
|
6395
|
+
return new X(g(e.mk_re_intersect(f, [this.ast, t.ast])));
|
|
6311
6396
|
}
|
|
6312
6397
|
diff(t) {
|
|
6313
|
-
return new
|
|
6398
|
+
return new X(g(e.mk_re_diff(f, this.ast, t.ast)));
|
|
6314
6399
|
}
|
|
6315
6400
|
concat(t) {
|
|
6316
|
-
return new
|
|
6401
|
+
return new X(g(e.mk_re_concat(f, [this.ast, t.ast])));
|
|
6317
6402
|
}
|
|
6318
6403
|
loop(t, n = 0) {
|
|
6319
|
-
return new
|
|
6404
|
+
return new X(g(e.mk_re_loop(f, this.ast, t, n)));
|
|
6320
6405
|
}
|
|
6321
6406
|
power(t) {
|
|
6322
|
-
return new
|
|
6407
|
+
return new X(g(e.mk_re_power(f, this.ast, t)));
|
|
6323
6408
|
}
|
|
6324
6409
|
}
|
|
6325
|
-
class
|
|
6410
|
+
class Mr extends B {
|
|
6326
6411
|
domain() {
|
|
6327
6412
|
return b(g(e.get_array_sort_domain(f, this.ptr)));
|
|
6328
6413
|
}
|
|
@@ -6333,7 +6418,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6333
6418
|
return b(g(e.get_array_sort_range(f, this.ptr)));
|
|
6334
6419
|
}
|
|
6335
6420
|
}
|
|
6336
|
-
class
|
|
6421
|
+
class Nr extends H {
|
|
6337
6422
|
domain() {
|
|
6338
6423
|
return this.sort.domain();
|
|
6339
6424
|
}
|
|
@@ -6344,45 +6429,45 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6344
6429
|
return this.sort.range();
|
|
6345
6430
|
}
|
|
6346
6431
|
select(...e) {
|
|
6347
|
-
return
|
|
6432
|
+
return dn(this, ...e);
|
|
6348
6433
|
}
|
|
6349
6434
|
store(...e) {
|
|
6350
|
-
return
|
|
6435
|
+
return fn(this, ...e);
|
|
6351
6436
|
}
|
|
6352
6437
|
default() {
|
|
6353
6438
|
return x(g(e.mk_array_default(f, this.ast)));
|
|
6354
6439
|
}
|
|
6355
6440
|
}
|
|
6356
|
-
class
|
|
6441
|
+
class Pr extends H {
|
|
6357
6442
|
elemSort() {
|
|
6358
6443
|
return this.sort.domain();
|
|
6359
6444
|
}
|
|
6360
6445
|
union(...e) {
|
|
6361
|
-
return
|
|
6446
|
+
return mn(this, ...e);
|
|
6362
6447
|
}
|
|
6363
6448
|
intersect(...e) {
|
|
6364
|
-
return
|
|
6449
|
+
return hn(this, ...e);
|
|
6365
6450
|
}
|
|
6366
6451
|
diff(e) {
|
|
6367
|
-
return
|
|
6452
|
+
return gn(this, e);
|
|
6368
6453
|
}
|
|
6369
6454
|
add(e) {
|
|
6370
|
-
return
|
|
6455
|
+
return _n(this, e);
|
|
6371
6456
|
}
|
|
6372
6457
|
del(e) {
|
|
6373
|
-
return
|
|
6458
|
+
return vn(this, e);
|
|
6374
6459
|
}
|
|
6375
6460
|
complement() {
|
|
6376
|
-
return
|
|
6461
|
+
return yn(this);
|
|
6377
6462
|
}
|
|
6378
6463
|
contains(e) {
|
|
6379
|
-
return
|
|
6464
|
+
return Sn(e, this);
|
|
6380
6465
|
}
|
|
6381
6466
|
subsetOf(e) {
|
|
6382
|
-
return
|
|
6467
|
+
return Cn(this, e);
|
|
6383
6468
|
}
|
|
6384
6469
|
}
|
|
6385
|
-
class Fr extends
|
|
6470
|
+
class Fr extends B {
|
|
6386
6471
|
elemSort() {
|
|
6387
6472
|
return b(g(e.get_finite_set_sort_basis(f, this.ptr)));
|
|
6388
6473
|
}
|
|
@@ -6390,7 +6475,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6390
6475
|
return p(e), e;
|
|
6391
6476
|
}
|
|
6392
6477
|
}
|
|
6393
|
-
class Z extends
|
|
6478
|
+
class Z extends H {
|
|
6394
6479
|
union(t) {
|
|
6395
6480
|
return new Z(g(e.mk_finite_set_union(f, this.ast, t.ast)));
|
|
6396
6481
|
}
|
|
@@ -6401,13 +6486,13 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6401
6486
|
return new Z(g(e.mk_finite_set_difference(f, this.ast, t.ast)));
|
|
6402
6487
|
}
|
|
6403
6488
|
contains(t) {
|
|
6404
|
-
return new
|
|
6489
|
+
return new U(g(e.mk_finite_set_member(f, t.ast, this.ast)));
|
|
6405
6490
|
}
|
|
6406
6491
|
size() {
|
|
6407
|
-
return new
|
|
6492
|
+
return new H(g(e.mk_finite_set_size(f, this.ast)));
|
|
6408
6493
|
}
|
|
6409
6494
|
subsetOf(t) {
|
|
6410
|
-
return new
|
|
6495
|
+
return new U(g(e.mk_finite_set_subset(f, this.ast, t.ast)));
|
|
6411
6496
|
}
|
|
6412
6497
|
map(t) {
|
|
6413
6498
|
return new Z(g(e.mk_finite_set_map(f, t.ast, this.ast)));
|
|
@@ -6430,24 +6515,24 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6430
6515
|
return zr(e, this);
|
|
6431
6516
|
}
|
|
6432
6517
|
}
|
|
6433
|
-
class Lr extends
|
|
6518
|
+
class Lr extends B {
|
|
6434
6519
|
numConstructors() {
|
|
6435
6520
|
return e.get_datatype_sort_num_constructors(f, this.ptr);
|
|
6436
6521
|
}
|
|
6437
6522
|
constructorDecl(t) {
|
|
6438
6523
|
let n = e.get_datatype_sort_constructor(f, this.ptr, t);
|
|
6439
|
-
return new
|
|
6524
|
+
return new V(n);
|
|
6440
6525
|
}
|
|
6441
6526
|
recognizer(t) {
|
|
6442
6527
|
let n = e.get_datatype_sort_recognizer(f, this.ptr, t);
|
|
6443
|
-
return new
|
|
6528
|
+
return new V(n);
|
|
6444
6529
|
}
|
|
6445
6530
|
accessor(t, n) {
|
|
6446
6531
|
let r = e.get_datatype_sort_constructor_accessor(f, this.ptr, t, n);
|
|
6447
|
-
return new
|
|
6532
|
+
return new V(r);
|
|
6448
6533
|
}
|
|
6449
6534
|
cast(e) {
|
|
6450
|
-
if (
|
|
6535
|
+
if (E(e)) return (0, i.assert)(this.eqIdentity(e.sort), "Value cannot be converted to this datatype"), e;
|
|
6451
6536
|
throw Error("Cannot coerce value to datatype expression");
|
|
6452
6537
|
}
|
|
6453
6538
|
subsort(e) {
|
|
@@ -6521,7 +6606,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6521
6606
|
for (let t of r) e.del_constructor(f, t);
|
|
6522
6607
|
}
|
|
6523
6608
|
}
|
|
6524
|
-
class Br extends
|
|
6609
|
+
class Br extends H {
|
|
6525
6610
|
is_forall() {
|
|
6526
6611
|
return e.is_quantifier_forall(f, this.ast);
|
|
6527
6612
|
}
|
|
@@ -6538,7 +6623,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6538
6623
|
return e.get_quantifier_num_patterns(f, this.ast);
|
|
6539
6624
|
}
|
|
6540
6625
|
pattern(t) {
|
|
6541
|
-
return new
|
|
6626
|
+
return new ar(g(e.get_quantifier_pattern_ast(f, this.ast, t)));
|
|
6542
6627
|
}
|
|
6543
6628
|
num_no_patterns() {
|
|
6544
6629
|
return e.get_quantifier_num_no_patterns(f, this.ast);
|
|
@@ -6553,7 +6638,7 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6553
6638
|
return e.get_quantifier_num_bound(f, this.ast);
|
|
6554
6639
|
}
|
|
6555
6640
|
var_name(t) {
|
|
6556
|
-
return
|
|
6641
|
+
return v(e.get_quantifier_bound_name(f, this.ast, t));
|
|
6557
6642
|
}
|
|
6558
6643
|
var_sort(t) {
|
|
6559
6644
|
return b(g(e.get_quantifier_bound_sort(f, this.ast, t)));
|
|
@@ -6564,22 +6649,22 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6564
6649
|
}
|
|
6565
6650
|
class Vr extends Br {
|
|
6566
6651
|
not() {
|
|
6567
|
-
return
|
|
6652
|
+
return bt(this);
|
|
6568
6653
|
}
|
|
6569
6654
|
and(e) {
|
|
6570
|
-
return
|
|
6655
|
+
return xt(this, e);
|
|
6571
6656
|
}
|
|
6572
6657
|
or(e) {
|
|
6573
|
-
return
|
|
6658
|
+
return St(this, e);
|
|
6574
6659
|
}
|
|
6575
6660
|
xor(e) {
|
|
6576
|
-
return
|
|
6661
|
+
return yt(this, e);
|
|
6577
6662
|
}
|
|
6578
6663
|
implies(e) {
|
|
6579
|
-
return
|
|
6664
|
+
return gt(this, e);
|
|
6580
6665
|
}
|
|
6581
6666
|
iff(e) {
|
|
6582
|
-
return
|
|
6667
|
+
return _t(this, e);
|
|
6583
6668
|
}
|
|
6584
6669
|
}
|
|
6585
6670
|
class Hr extends Br {
|
|
@@ -6593,10 +6678,10 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6593
6678
|
return this.sort.range();
|
|
6594
6679
|
}
|
|
6595
6680
|
select(...e) {
|
|
6596
|
-
return
|
|
6681
|
+
return dn(this, ...e);
|
|
6597
6682
|
}
|
|
6598
6683
|
store(...e) {
|
|
6599
|
-
return
|
|
6684
|
+
return fn(this, ...e);
|
|
6600
6685
|
}
|
|
6601
6686
|
default() {
|
|
6602
6687
|
return x(g(e.mk_array_default(f, this.ast)));
|
|
@@ -6717,197 +6802,197 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6717
6802
|
let $ = {
|
|
6718
6803
|
ptr: f,
|
|
6719
6804
|
name: l,
|
|
6720
|
-
Solver:
|
|
6721
|
-
Optimize:
|
|
6722
|
-
Fixedpoint:
|
|
6723
|
-
Model:
|
|
6724
|
-
Tactic:
|
|
6725
|
-
Goal:
|
|
6726
|
-
Params:
|
|
6727
|
-
Simplifier:
|
|
6805
|
+
Solver: Qn,
|
|
6806
|
+
Optimize: $n,
|
|
6807
|
+
Fixedpoint: er,
|
|
6808
|
+
Model: tr,
|
|
6809
|
+
Tactic: W,
|
|
6810
|
+
Goal: cr,
|
|
6811
|
+
Params: dr,
|
|
6812
|
+
Simplifier: pr,
|
|
6728
6813
|
AstVector: Q,
|
|
6729
6814
|
AstMap: Ur,
|
|
6730
|
-
interrupt:
|
|
6731
|
-
setPrintMode:
|
|
6732
|
-
isModel:
|
|
6733
|
-
isAst:
|
|
6734
|
-
isSort:
|
|
6735
|
-
isFuncDecl:
|
|
6736
|
-
isFuncInterp:
|
|
6737
|
-
isApp:
|
|
6738
|
-
isConst:
|
|
6739
|
-
isExpr:
|
|
6740
|
-
isVar:
|
|
6741
|
-
isAppOf:
|
|
6742
|
-
isBool:
|
|
6743
|
-
isTrue:
|
|
6744
|
-
isFalse:
|
|
6745
|
-
isAnd:
|
|
6746
|
-
isOr:
|
|
6747
|
-
isImplies:
|
|
6748
|
-
isNot:
|
|
6749
|
-
isEq:
|
|
6750
|
-
isDistinct:
|
|
6751
|
-
isQuantifier:
|
|
6752
|
-
isArith:
|
|
6753
|
-
isArithSort:
|
|
6754
|
-
isInt:
|
|
6755
|
-
isIntVal:
|
|
6756
|
-
isIntSort:
|
|
6757
|
-
isReal:
|
|
6758
|
-
isRealVal:
|
|
6759
|
-
isRealSort:
|
|
6760
|
-
isRCFNum:
|
|
6761
|
-
isBitVecSort:
|
|
6762
|
-
isBitVec:
|
|
6763
|
-
isBitVecVal:
|
|
6764
|
-
isFPRMSort:
|
|
6765
|
-
isFPRM:
|
|
6766
|
-
isFPSort:
|
|
6767
|
-
isFP:
|
|
6768
|
-
isFPVal:
|
|
6769
|
-
isSeqSort:
|
|
6770
|
-
isSeq:
|
|
6771
|
-
isStringSort:
|
|
6772
|
-
isString:
|
|
6773
|
-
isFiniteSetSort:
|
|
6774
|
-
isFiniteSet:
|
|
6775
|
-
isArraySort:
|
|
6776
|
-
isArray:
|
|
6777
|
-
isConstArray:
|
|
6778
|
-
isProbe:
|
|
6779
|
-
isTactic:
|
|
6780
|
-
isGoal:
|
|
6781
|
-
isAstVector:
|
|
6782
|
-
eqIdentity:
|
|
6783
|
-
getVarIndex:
|
|
6784
|
-
from:
|
|
6785
|
-
solve:
|
|
6786
|
-
Sort:
|
|
6787
|
-
Function:
|
|
6788
|
-
RecFunc:
|
|
6789
|
-
Bool:
|
|
6790
|
-
Int:
|
|
6791
|
-
Real:
|
|
6792
|
-
RCFNum:
|
|
6793
|
-
BitVec:
|
|
6794
|
-
Float:
|
|
6795
|
-
FloatRM:
|
|
6796
|
-
String:
|
|
6797
|
-
Seq:
|
|
6798
|
-
Re:
|
|
6799
|
-
Array:
|
|
6815
|
+
interrupt: ne,
|
|
6816
|
+
setPrintMode: re,
|
|
6817
|
+
isModel: ie,
|
|
6818
|
+
isAst: ae,
|
|
6819
|
+
isSort: oe,
|
|
6820
|
+
isFuncDecl: se,
|
|
6821
|
+
isFuncInterp: ce,
|
|
6822
|
+
isApp: le,
|
|
6823
|
+
isConst: T,
|
|
6824
|
+
isExpr: E,
|
|
6825
|
+
isVar: ue,
|
|
6826
|
+
isAppOf: D,
|
|
6827
|
+
isBool: de,
|
|
6828
|
+
isTrue: fe,
|
|
6829
|
+
isFalse: pe,
|
|
6830
|
+
isAnd: me,
|
|
6831
|
+
isOr: he,
|
|
6832
|
+
isImplies: ge,
|
|
6833
|
+
isNot: _e,
|
|
6834
|
+
isEq: ve,
|
|
6835
|
+
isDistinct: ye,
|
|
6836
|
+
isQuantifier: be,
|
|
6837
|
+
isArith: O,
|
|
6838
|
+
isArithSort: xe,
|
|
6839
|
+
isInt: Se,
|
|
6840
|
+
isIntVal: Ce,
|
|
6841
|
+
isIntSort: we,
|
|
6842
|
+
isReal: Te,
|
|
6843
|
+
isRealVal: Ee,
|
|
6844
|
+
isRealSort: De,
|
|
6845
|
+
isRCFNum: Oe,
|
|
6846
|
+
isBitVecSort: ke,
|
|
6847
|
+
isBitVec: Ae,
|
|
6848
|
+
isBitVecVal: je,
|
|
6849
|
+
isFPRMSort: Fe,
|
|
6850
|
+
isFPRM: Ie,
|
|
6851
|
+
isFPSort: Le,
|
|
6852
|
+
isFP: k,
|
|
6853
|
+
isFPVal: Re,
|
|
6854
|
+
isSeqSort: ze,
|
|
6855
|
+
isSeq: A,
|
|
6856
|
+
isStringSort: Ve,
|
|
6857
|
+
isString: He,
|
|
6858
|
+
isFiniteSetSort: Ue,
|
|
6859
|
+
isFiniteSet: We,
|
|
6860
|
+
isArraySort: Me,
|
|
6861
|
+
isArray: Ne,
|
|
6862
|
+
isConstArray: Pe,
|
|
6863
|
+
isProbe: Ge,
|
|
6864
|
+
isTactic: Ke,
|
|
6865
|
+
isGoal: qe,
|
|
6866
|
+
isAstVector: Je,
|
|
6867
|
+
eqIdentity: Ye,
|
|
6868
|
+
getVarIndex: Xe,
|
|
6869
|
+
from: j,
|
|
6870
|
+
solve: Ze,
|
|
6871
|
+
Sort: $e,
|
|
6872
|
+
Function: et,
|
|
6873
|
+
RecFunc: M,
|
|
6874
|
+
Bool: N,
|
|
6875
|
+
Int: P,
|
|
6876
|
+
Real: F,
|
|
6877
|
+
RCFNum: tt,
|
|
6878
|
+
BitVec: nt,
|
|
6879
|
+
Float: I,
|
|
6880
|
+
FloatRM: rt,
|
|
6881
|
+
String: L,
|
|
6882
|
+
Seq: it,
|
|
6883
|
+
Re: at,
|
|
6884
|
+
Array: ot,
|
|
6800
6885
|
Set: st,
|
|
6801
6886
|
FiniteSet: ct,
|
|
6802
6887
|
Datatype: lt,
|
|
6803
6888
|
TypeVariable: ut,
|
|
6804
|
-
If:
|
|
6805
|
-
Distinct:
|
|
6806
|
-
Const:
|
|
6807
|
-
Consts:
|
|
6808
|
-
FreshConst:
|
|
6809
|
-
Var:
|
|
6810
|
-
Implies:
|
|
6811
|
-
Iff:
|
|
6812
|
-
Eq:
|
|
6813
|
-
Xor:
|
|
6814
|
-
Not:
|
|
6815
|
-
And:
|
|
6816
|
-
Or:
|
|
6817
|
-
PbEq:
|
|
6818
|
-
PbGe:
|
|
6819
|
-
PbLe:
|
|
6820
|
-
AtMost:
|
|
6821
|
-
AtLeast:
|
|
6822
|
-
ForAll:
|
|
6823
|
-
Exists:
|
|
6824
|
-
Lambda:
|
|
6825
|
-
ToReal:
|
|
6826
|
-
ToInt:
|
|
6827
|
-
IsInt:
|
|
6828
|
-
Sqrt:
|
|
6829
|
-
Cbrt:
|
|
6830
|
-
BV2Int:
|
|
6831
|
-
Int2BV:
|
|
6832
|
-
Concat:
|
|
6833
|
-
Cond:
|
|
6834
|
-
AndThen:
|
|
6835
|
-
OrElse:
|
|
6836
|
-
Repeat:
|
|
6837
|
-
TryFor:
|
|
6838
|
-
When:
|
|
6839
|
-
Skip:
|
|
6840
|
-
Fail:
|
|
6841
|
-
FailIf:
|
|
6842
|
-
ParOr:
|
|
6843
|
-
ParAndThen:
|
|
6844
|
-
With:
|
|
6845
|
-
LT:
|
|
6846
|
-
GT:
|
|
6847
|
-
LE:
|
|
6848
|
-
GE:
|
|
6849
|
-
ULT:
|
|
6850
|
-
UGT:
|
|
6851
|
-
ULE:
|
|
6852
|
-
UGE:
|
|
6853
|
-
SLT:
|
|
6854
|
-
SGT:
|
|
6855
|
-
SLE:
|
|
6856
|
-
SGE:
|
|
6857
|
-
Sum:
|
|
6858
|
-
Sub:
|
|
6859
|
-
Product:
|
|
6860
|
-
Div:
|
|
6861
|
-
BUDiv:
|
|
6862
|
-
Neg:
|
|
6863
|
-
Mod:
|
|
6864
|
-
Select:
|
|
6865
|
-
Store:
|
|
6866
|
-
Ext:
|
|
6867
|
-
Extract:
|
|
6889
|
+
If: R,
|
|
6890
|
+
Distinct: dt,
|
|
6891
|
+
Const: ft,
|
|
6892
|
+
Consts: pt,
|
|
6893
|
+
FreshConst: mt,
|
|
6894
|
+
Var: ht,
|
|
6895
|
+
Implies: gt,
|
|
6896
|
+
Iff: _t,
|
|
6897
|
+
Eq: vt,
|
|
6898
|
+
Xor: yt,
|
|
6899
|
+
Not: bt,
|
|
6900
|
+
And: xt,
|
|
6901
|
+
Or: St,
|
|
6902
|
+
PbEq: Ct,
|
|
6903
|
+
PbGe: wt,
|
|
6904
|
+
PbLe: Tt,
|
|
6905
|
+
AtMost: Et,
|
|
6906
|
+
AtLeast: Dt,
|
|
6907
|
+
ForAll: Ot,
|
|
6908
|
+
Exists: kt,
|
|
6909
|
+
Lambda: At,
|
|
6910
|
+
ToReal: jt,
|
|
6911
|
+
ToInt: Mt,
|
|
6912
|
+
IsInt: Nt,
|
|
6913
|
+
Sqrt: Pt,
|
|
6914
|
+
Cbrt: Ft,
|
|
6915
|
+
BV2Int: It,
|
|
6916
|
+
Int2BV: Lt,
|
|
6917
|
+
Concat: Rt,
|
|
6918
|
+
Cond: zt,
|
|
6919
|
+
AndThen: Bt,
|
|
6920
|
+
OrElse: Vt,
|
|
6921
|
+
Repeat: Ht,
|
|
6922
|
+
TryFor: Ut,
|
|
6923
|
+
When: Wt,
|
|
6924
|
+
Skip: Gt,
|
|
6925
|
+
Fail: Kt,
|
|
6926
|
+
FailIf: qt,
|
|
6927
|
+
ParOr: Jt,
|
|
6928
|
+
ParAndThen: Yt,
|
|
6929
|
+
With: Xt,
|
|
6930
|
+
LT: Zt,
|
|
6931
|
+
GT: Qt,
|
|
6932
|
+
LE: $t,
|
|
6933
|
+
GE: en,
|
|
6934
|
+
ULT: tn,
|
|
6935
|
+
UGT: nn,
|
|
6936
|
+
ULE: rn,
|
|
6937
|
+
UGE: an,
|
|
6938
|
+
SLT: on,
|
|
6939
|
+
SGT: sn,
|
|
6940
|
+
SLE: cn,
|
|
6941
|
+
SGE: ln,
|
|
6942
|
+
Sum: hr,
|
|
6943
|
+
Sub: gr,
|
|
6944
|
+
Product: _r,
|
|
6945
|
+
Div: vr,
|
|
6946
|
+
BUDiv: yr,
|
|
6947
|
+
Neg: br,
|
|
6948
|
+
Mod: xr,
|
|
6949
|
+
Select: dn,
|
|
6950
|
+
Store: fn,
|
|
6951
|
+
Ext: pn,
|
|
6952
|
+
Extract: un,
|
|
6868
6953
|
substitute: Wr,
|
|
6869
6954
|
substituteVars: Gr,
|
|
6870
6955
|
substituteFuns: Kr,
|
|
6871
6956
|
updateField: qr,
|
|
6872
|
-
simplify:
|
|
6957
|
+
simplify: Qe,
|
|
6873
6958
|
ast_from_string: Jr,
|
|
6874
|
-
SetUnion:
|
|
6875
|
-
SetIntersect:
|
|
6876
|
-
SetDifference:
|
|
6877
|
-
SetAdd:
|
|
6878
|
-
SetDel:
|
|
6879
|
-
SetComplement:
|
|
6880
|
-
EmptySet:
|
|
6881
|
-
FullSet:
|
|
6882
|
-
isMember:
|
|
6883
|
-
isSubset:
|
|
6884
|
-
InRe:
|
|
6885
|
-
Union:
|
|
6886
|
-
Intersect:
|
|
6887
|
-
ReConcat:
|
|
6888
|
-
Plus:
|
|
6889
|
-
Star:
|
|
6890
|
-
Option:
|
|
6891
|
-
Complement:
|
|
6892
|
-
Diff:
|
|
6893
|
-
Range:
|
|
6894
|
-
Loop:
|
|
6895
|
-
Power:
|
|
6896
|
-
AllChar:
|
|
6897
|
-
Empty:
|
|
6898
|
-
Full:
|
|
6899
|
-
mkPartialOrder:
|
|
6900
|
-
mkLinearOrder:
|
|
6901
|
-
mkPiecewiseLinearOrder:
|
|
6902
|
-
mkTreeOrder:
|
|
6903
|
-
mkTransitiveClosure:
|
|
6904
|
-
mkChar:
|
|
6905
|
-
mkCharLe:
|
|
6906
|
-
mkCharToInt:
|
|
6907
|
-
mkCharToBV:
|
|
6908
|
-
mkCharFromBV:
|
|
6909
|
-
mkCharIsDigit:
|
|
6910
|
-
polynomialSubresultants:
|
|
6959
|
+
SetUnion: mn,
|
|
6960
|
+
SetIntersect: hn,
|
|
6961
|
+
SetDifference: gn,
|
|
6962
|
+
SetAdd: _n,
|
|
6963
|
+
SetDel: vn,
|
|
6964
|
+
SetComplement: yn,
|
|
6965
|
+
EmptySet: bn,
|
|
6966
|
+
FullSet: xn,
|
|
6967
|
+
isMember: Sn,
|
|
6968
|
+
isSubset: Cn,
|
|
6969
|
+
InRe: wn,
|
|
6970
|
+
Union: Tn,
|
|
6971
|
+
Intersect: En,
|
|
6972
|
+
ReConcat: Dn,
|
|
6973
|
+
Plus: On,
|
|
6974
|
+
Star: kn,
|
|
6975
|
+
Option: An,
|
|
6976
|
+
Complement: jn,
|
|
6977
|
+
Diff: Mn,
|
|
6978
|
+
Range: Nn,
|
|
6979
|
+
Loop: Pn,
|
|
6980
|
+
Power: Fn,
|
|
6981
|
+
AllChar: In,
|
|
6982
|
+
Empty: Ln,
|
|
6983
|
+
Full: Rn,
|
|
6984
|
+
mkPartialOrder: zn,
|
|
6985
|
+
mkLinearOrder: Bn,
|
|
6986
|
+
mkPiecewiseLinearOrder: Vn,
|
|
6987
|
+
mkTreeOrder: Hn,
|
|
6988
|
+
mkTransitiveClosure: Un,
|
|
6989
|
+
mkChar: Wn,
|
|
6990
|
+
mkCharLe: Gn,
|
|
6991
|
+
mkCharToInt: Kn,
|
|
6992
|
+
mkCharToBV: qn,
|
|
6993
|
+
mkCharFromBV: Jn,
|
|
6994
|
+
mkCharIsDigit: Yn,
|
|
6995
|
+
polynomialSubresultants: Xn
|
|
6911
6996
|
};
|
|
6912
6997
|
return c.register($, () => e.del_context(f)), $;
|
|
6913
6998
|
}
|
|
@@ -6919,13 +7004,13 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6919
7004
|
getFullVersion: p,
|
|
6920
7005
|
openLog: m,
|
|
6921
7006
|
appendLog: h,
|
|
6922
|
-
getParam:
|
|
7007
|
+
getParam: ee,
|
|
6923
7008
|
setParam: g,
|
|
6924
7009
|
resetParams: _,
|
|
6925
|
-
Context:
|
|
7010
|
+
Context: v
|
|
6926
7011
|
};
|
|
6927
7012
|
}
|
|
6928
|
-
})),
|
|
7013
|
+
})), j = /* @__PURE__ */ s(((e) => {
|
|
6929
7014
|
var t = e && e.__createBinding || (Object.create ? (function(e, t, n, r) {
|
|
6930
7015
|
r === void 0 && (r = n);
|
|
6931
7016
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
@@ -6940,8 +7025,8 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6940
7025
|
})), n = e && e.__exportStar || function(e, n) {
|
|
6941
7026
|
for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(n, r) && t(n, e, r);
|
|
6942
7027
|
};
|
|
6943
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), n(
|
|
6944
|
-
})),
|
|
7028
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), n(Xe(), e), n(Je(), e);
|
|
7029
|
+
})), Ze = /* @__PURE__ */ s(((e) => {
|
|
6945
7030
|
var t = e && e.__createBinding || (Object.create ? (function(e, t, n, r) {
|
|
6946
7031
|
r === void 0 && (r = n);
|
|
6947
7032
|
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
@@ -6957,8 +7042,8 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6957
7042
|
for (var r in e) r !== "default" && !Object.prototype.hasOwnProperty.call(n, r) && t(n, e, r);
|
|
6958
7043
|
};
|
|
6959
7044
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.init = a;
|
|
6960
|
-
var r =
|
|
6961
|
-
n(
|
|
7045
|
+
var r = j(), i = qe();
|
|
7046
|
+
n(Je(), e), n(Ge(), e);
|
|
6962
7047
|
async function a(e = {}) {
|
|
6963
7048
|
let t = globalThis.initZ3;
|
|
6964
7049
|
if (t === void 0) throw Error("initZ3 was not imported correctly. Please consult documentation on how to load Z3 in browser");
|
|
@@ -6968,13 +7053,13 @@ var je, Me, Ne, Pe, Fe, Ie, Le, Re = o((() => {
|
|
|
6968
7053
|
...a
|
|
6969
7054
|
};
|
|
6970
7055
|
}
|
|
6971
|
-
})),
|
|
6972
|
-
function
|
|
7056
|
+
})), Qe = null, $e = null, et = null, M = null, N = /* @__PURE__ */ new WeakMap();
|
|
7057
|
+
function P(e, t) {
|
|
6973
7058
|
if (e.error) return;
|
|
6974
7059
|
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
7060
|
e.error = n;
|
|
6976
7061
|
for (let t of e.asyncRejects) t(n);
|
|
6977
|
-
e.asyncRejects.clear(),
|
|
7062
|
+
e.asyncRejects.clear(), M === e && L();
|
|
6978
7063
|
try {
|
|
6979
7064
|
e.instance?.em?.PThread?.terminateAllThreads();
|
|
6980
7065
|
} catch {}
|
|
@@ -6984,7 +7069,7 @@ function A(e, t) {
|
|
|
6984
7069
|
} catch {}
|
|
6985
7070
|
e.errorHandlers.clear();
|
|
6986
7071
|
}
|
|
6987
|
-
function
|
|
7072
|
+
function F(e, t) {
|
|
6988
7073
|
if (!e || e.__washi_async_call_hooked) return;
|
|
6989
7074
|
e.__washi_async_call_hooked = !0;
|
|
6990
7075
|
let n = e.async_call;
|
|
@@ -7000,27 +7085,27 @@ function tt(e, t) {
|
|
|
7000
7085
|
t.asyncRejects.delete(i);
|
|
7001
7086
|
});
|
|
7002
7087
|
} catch (e) {
|
|
7003
|
-
throw t.asyncRejects.delete(i),
|
|
7088
|
+
throw t.asyncRejects.delete(i), P(t, e), e;
|
|
7004
7089
|
}
|
|
7005
7090
|
});
|
|
7006
7091
|
}
|
|
7007
|
-
function
|
|
7008
|
-
let n = t ?
|
|
7092
|
+
function tt(e, t) {
|
|
7093
|
+
let n = t ? N.get(t) : M;
|
|
7009
7094
|
return n ? n.error ? (e(n.error), () => {}) : (n.errorHandlers.add(e), () => {
|
|
7010
7095
|
n.errorHandlers.delete(e);
|
|
7011
7096
|
}) : () => {};
|
|
7012
7097
|
}
|
|
7013
|
-
function
|
|
7014
|
-
|
|
7098
|
+
function nt(e) {
|
|
7099
|
+
M && P(M, e);
|
|
7015
7100
|
}
|
|
7016
|
-
function
|
|
7101
|
+
function I(e, t) {
|
|
7017
7102
|
if (!e || !e.PThread || e.PThread.__washi_monitored) return;
|
|
7018
7103
|
e.PThread.__washi_monitored = !0;
|
|
7019
7104
|
let n = (e) => {
|
|
7020
7105
|
e && (e.onerror = (e) => {
|
|
7021
|
-
|
|
7106
|
+
P(t, e);
|
|
7022
7107
|
}, typeof e.addEventListener == "function" && e.addEventListener("error", (e) => {
|
|
7023
|
-
|
|
7108
|
+
P(t, e), typeof e.preventDefault == "function" && e.preventDefault();
|
|
7024
7109
|
}));
|
|
7025
7110
|
};
|
|
7026
7111
|
Array.isArray(e.PThread.unusedWorkers) && e.PThread.unusedWorkers.forEach(n), Array.isArray(e.PThread.runningWorkers) && e.PThread.runningWorkers.forEach(n);
|
|
@@ -7029,10 +7114,10 @@ function M(e, t) {
|
|
|
7029
7114
|
try {
|
|
7030
7115
|
let n = r.call(this, e);
|
|
7031
7116
|
return e.onerror = (e) => {
|
|
7032
|
-
|
|
7117
|
+
P(t, e);
|
|
7033
7118
|
}, n;
|
|
7034
7119
|
} catch (e) {
|
|
7035
|
-
throw
|
|
7120
|
+
throw P(t, e), e;
|
|
7036
7121
|
}
|
|
7037
7122
|
});
|
|
7038
7123
|
let i = e.PThread.allocateUnusedWorker;
|
|
@@ -7042,24 +7127,27 @@ function M(e, t) {
|
|
|
7042
7127
|
let e = this.unusedWorkers?.[this.unusedWorkers.length - 1];
|
|
7043
7128
|
e && n(e);
|
|
7044
7129
|
} catch (e) {
|
|
7045
|
-
throw
|
|
7130
|
+
throw P(t, e), e;
|
|
7046
7131
|
}
|
|
7047
7132
|
});
|
|
7048
7133
|
}
|
|
7049
|
-
function
|
|
7050
|
-
e.jsUrl !== void 0 && (
|
|
7134
|
+
function rt(e) {
|
|
7135
|
+
e.jsUrl !== void 0 && ($e = e.jsUrl), e.wasmUrl !== void 0 && (et = e.wasmUrl), L();
|
|
7051
7136
|
}
|
|
7052
|
-
function
|
|
7053
|
-
|
|
7137
|
+
function L() {
|
|
7138
|
+
Qe = null, M = null;
|
|
7054
7139
|
}
|
|
7055
|
-
function
|
|
7140
|
+
function it() {
|
|
7141
|
+
return !(!M?.instance || M.error);
|
|
7142
|
+
}
|
|
7143
|
+
function at() {
|
|
7056
7144
|
if (typeof window > "u") return;
|
|
7057
7145
|
let e = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "[::1]";
|
|
7058
7146
|
if (!window.isSecureContext && !e) throw Error(`[WaSHI] Z3 solver requires a Secure Context (HTTPS or localhost). Current protocol: "${window.location.protocol}".`);
|
|
7059
7147
|
let t = typeof SharedArrayBuffer < "u", n = window.crossOriginIsolated === !0;
|
|
7060
7148
|
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.)");
|
|
7061
7149
|
}
|
|
7062
|
-
async function
|
|
7150
|
+
async function ot(e, t) {
|
|
7063
7151
|
try {
|
|
7064
7152
|
let n = null;
|
|
7065
7153
|
try {
|
|
@@ -7076,22 +7164,22 @@ async function F(e, t) {
|
|
|
7076
7164
|
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 });
|
|
7077
7165
|
}
|
|
7078
7166
|
}
|
|
7079
|
-
function
|
|
7167
|
+
function st(e = {}) {
|
|
7080
7168
|
if (e.z3JsUrl && e.z3WasmUrl) return {
|
|
7081
7169
|
jsUrl: e.z3JsUrl,
|
|
7082
7170
|
wasmUrl: e.z3WasmUrl
|
|
7083
7171
|
};
|
|
7084
|
-
if (
|
|
7085
|
-
jsUrl: e.z3JsUrl ||
|
|
7086
|
-
wasmUrl: e.z3WasmUrl ||
|
|
7172
|
+
if ($e && et) return {
|
|
7173
|
+
jsUrl: e.z3JsUrl || $e,
|
|
7174
|
+
wasmUrl: e.z3WasmUrl || et
|
|
7087
7175
|
};
|
|
7088
|
-
let t =
|
|
7176
|
+
let t = ae();
|
|
7089
7177
|
return {
|
|
7090
|
-
jsUrl: e.z3JsUrl ||
|
|
7091
|
-
wasmUrl: e.z3WasmUrl ||
|
|
7178
|
+
jsUrl: e.z3JsUrl || $e || t.jsUrl,
|
|
7179
|
+
wasmUrl: e.z3WasmUrl || et || t.wasmUrl
|
|
7092
7180
|
};
|
|
7093
7181
|
}
|
|
7094
|
-
async function
|
|
7182
|
+
async function ct(e) {
|
|
7095
7183
|
let t = globalThis;
|
|
7096
7184
|
if (t.global === void 0 && (t.global = t), typeof t.initZ3 == "function") return t.initZ3;
|
|
7097
7185
|
if (typeof document < "u") await new Promise((n, r) => {
|
|
@@ -7123,34 +7211,34 @@ async function I(e) {
|
|
|
7123
7211
|
if (typeof t.initZ3 != "function") throw Error(`[WaSHI] Script loaded from "${e}" did not define global initZ3.`);
|
|
7124
7212
|
return t.initZ3;
|
|
7125
7213
|
}
|
|
7126
|
-
async function
|
|
7127
|
-
if (
|
|
7214
|
+
async function lt(e = {}) {
|
|
7215
|
+
if (Qe) return Qe;
|
|
7128
7216
|
let t = {
|
|
7129
7217
|
instance: null,
|
|
7130
7218
|
error: null,
|
|
7131
7219
|
errorHandlers: /* @__PURE__ */ new Set(),
|
|
7132
7220
|
asyncRejects: /* @__PURE__ */ new Set()
|
|
7133
7221
|
};
|
|
7134
|
-
|
|
7222
|
+
M = t;
|
|
7135
7223
|
async function n(e) {
|
|
7136
7224
|
if (t.error) throw t.error;
|
|
7137
7225
|
let n = await e();
|
|
7138
|
-
if (t.instance = n,
|
|
7226
|
+
if (t.instance = n, N.set(n, t), t.error) {
|
|
7139
7227
|
try {
|
|
7140
7228
|
n.em?.PThread?.terminateAllThreads();
|
|
7141
7229
|
} catch {}
|
|
7142
7230
|
throw t.error;
|
|
7143
7231
|
}
|
|
7144
|
-
return n.em && (
|
|
7232
|
+
return n.em && (I(n.em, t), F(n.em, t)), n;
|
|
7145
7233
|
}
|
|
7146
7234
|
let r, i = new Promise((e, t) => {
|
|
7147
7235
|
r = t;
|
|
7148
7236
|
});
|
|
7149
7237
|
t.errorHandlers.add(r);
|
|
7150
7238
|
let a = (async () => {
|
|
7151
|
-
|
|
7152
|
-
let { jsUrl: r, wasmUrl: i } =
|
|
7153
|
-
if (await
|
|
7239
|
+
at();
|
|
7240
|
+
let { jsUrl: r, wasmUrl: i } = st(e);
|
|
7241
|
+
if (await ot(r, "JavaScript (z3-built.js)"), await ot(i, "WebAssembly (z3-built.wasm)"), await ct(r), t.error) throw t.error;
|
|
7154
7242
|
let a = r;
|
|
7155
7243
|
if (typeof window < "u" && new URL(r).origin !== window.location.origin) {
|
|
7156
7244
|
let e = new Blob([`importScripts(${JSON.stringify(r)});`], { type: "application/javascript" });
|
|
@@ -7161,7 +7249,7 @@ async function at(e = {}) {
|
|
|
7161
7249
|
mainScriptUrlOrBlob: a
|
|
7162
7250
|
};
|
|
7163
7251
|
try {
|
|
7164
|
-
let e = await Promise.resolve().then(() => /* @__PURE__ */ u(
|
|
7252
|
+
let e = await Promise.resolve().then(() => /* @__PURE__ */ u(Ze(), 1));
|
|
7165
7253
|
return await n(() => e.init(o));
|
|
7166
7254
|
} catch (e) {
|
|
7167
7255
|
throw Error(`[WaSHI] Failed to initialize Z3 in browser: ${e?.message || String(e)}`, { cause: e });
|
|
@@ -7169,12 +7257,12 @@ async function at(e = {}) {
|
|
|
7169
7257
|
})(), o = Promise.race([a, i]).finally(() => {
|
|
7170
7258
|
t.errorHandlers.delete(r);
|
|
7171
7259
|
});
|
|
7172
|
-
return o.catch((e) =>
|
|
7260
|
+
return o.catch((e) => P(t, e)), Qe = o, o;
|
|
7173
7261
|
}
|
|
7174
|
-
async function
|
|
7175
|
-
let t = e ?
|
|
7176
|
-
if (t &&
|
|
7177
|
-
let { killThreads: e } = await Promise.resolve().then(() => /* @__PURE__ */ u(
|
|
7262
|
+
async function ut(e) {
|
|
7263
|
+
let t = e ? N.get(e) : M, n = e || t?.instance;
|
|
7264
|
+
if (t && P(t, /* @__PURE__ */ Error("[WaSHI] Z3 threads terminated")), n?.em) try {
|
|
7265
|
+
let { killThreads: e } = await Promise.resolve().then(() => /* @__PURE__ */ u(Ze(), 1));
|
|
7178
7266
|
typeof e == "function" ? await e(n.em) : n.em.PThread?.terminateAllThreads();
|
|
7179
7267
|
} catch {
|
|
7180
7268
|
n.em.PThread?.terminateAllThreads();
|
|
@@ -7182,7 +7270,7 @@ async function ot(e) {
|
|
|
7182
7270
|
}
|
|
7183
7271
|
//#endregion
|
|
7184
7272
|
//#region src/modeler/solvers/z3/solver.ts
|
|
7185
|
-
function
|
|
7273
|
+
function R(e, t, n) {
|
|
7186
7274
|
Object.defineProperty(e, t, {
|
|
7187
7275
|
value: n,
|
|
7188
7276
|
enumerable: !0,
|
|
@@ -7190,15 +7278,53 @@ function L(e, t, n) {
|
|
|
7190
7278
|
configurable: !0
|
|
7191
7279
|
});
|
|
7192
7280
|
}
|
|
7193
|
-
var
|
|
7281
|
+
var dt = /* @__PURE__ */ new Set([
|
|
7282
|
+
"timeLimit",
|
|
7283
|
+
"presolve",
|
|
7284
|
+
"relativeGap",
|
|
7285
|
+
"absoluteGap",
|
|
7286
|
+
"threads",
|
|
7287
|
+
"verbose",
|
|
7288
|
+
"outputFlag"
|
|
7289
|
+
]), ft = /* @__PURE__ */ new Set([
|
|
7290
|
+
"signal",
|
|
7291
|
+
"onProgress",
|
|
7292
|
+
"relax",
|
|
7293
|
+
"useWorker",
|
|
7294
|
+
"z3JsUrl",
|
|
7295
|
+
"z3WasmUrl"
|
|
7296
|
+
]);
|
|
7297
|
+
function pt(e = {}) {
|
|
7298
|
+
if (e.relax !== void 0) {
|
|
7299
|
+
if (typeof e.relax != "boolean") throw Error(`Invalid Z3 option "relax": expected boolean, got ${typeof e.relax}.`);
|
|
7300
|
+
if (e.relax === !0) throw Error("Solver \"z3\" does not support option \"relax: true\" (LP relaxation). Use a simplex/IPM solver such as HiGHS or GLPK.");
|
|
7301
|
+
}
|
|
7302
|
+
if (e.useWorker !== void 0) {
|
|
7303
|
+
if (typeof e.useWorker != "boolean") throw Error(`Invalid Z3 option "useWorker": expected boolean, got ${typeof e.useWorker}.`);
|
|
7304
|
+
if (e.useWorker === !0) throw Error("Solver \"z3\" does not support option \"useWorker: true\".");
|
|
7305
|
+
}
|
|
7306
|
+
for (let t of dt) if (e[t] !== void 0) throw Error(`Solver "z3" does not support option "${t}".`);
|
|
7307
|
+
for (let [t, n] of Object.entries(e)) if (n !== void 0 && !ft.has(t)) throw Error(`Solver "z3" does not support option "${t}".`);
|
|
7308
|
+
if (e.onProgress !== void 0 && typeof e.onProgress != "function") throw Error(`Invalid Z3 option "onProgress": expected function, got ${typeof e.onProgress}.`);
|
|
7309
|
+
for (let t of ["z3JsUrl", "z3WasmUrl"]) {
|
|
7310
|
+
let n = e[t];
|
|
7311
|
+
if (n !== void 0 && (typeof n != "string" || n === "")) throw Error(`Invalid Z3 option "${t}": expected a non-empty string.`);
|
|
7312
|
+
}
|
|
7313
|
+
}
|
|
7314
|
+
var mt = class {
|
|
7194
7315
|
name = "z3";
|
|
7316
|
+
options;
|
|
7195
7317
|
capabilities = {
|
|
7196
7318
|
supportsMIP: !0,
|
|
7197
7319
|
supportsQP: !1,
|
|
7198
7320
|
supportsSMT: !0,
|
|
7321
|
+
supportsLogicalConstraints: !0,
|
|
7199
7322
|
supportsUnsatCore: !0,
|
|
7200
7323
|
supportsWarmStart: !1
|
|
7201
7324
|
};
|
|
7325
|
+
constructor(e = {}) {
|
|
7326
|
+
this.options = e;
|
|
7327
|
+
}
|
|
7202
7328
|
createContextTranslator(e) {
|
|
7203
7329
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
7204
7330
|
function i(e, t) {
|
|
@@ -7223,95 +7349,234 @@ var st = class {
|
|
|
7223
7349
|
return r;
|
|
7224
7350
|
}
|
|
7225
7351
|
function s(t) {
|
|
7226
|
-
return typeof e.isInt == "function" && e.isInt(t)
|
|
7352
|
+
return typeof e.isInt == "function" && e.isInt(t);
|
|
7353
|
+
}
|
|
7354
|
+
function c(t) {
|
|
7355
|
+
return s(t) ? e.ToReal(t) : t;
|
|
7356
|
+
}
|
|
7357
|
+
function l(e, t) {
|
|
7358
|
+
return s(e) === s(t) ? [e, t] : [c(e), c(t)];
|
|
7359
|
+
}
|
|
7360
|
+
function u(t, n, r) {
|
|
7361
|
+
let [i, a] = l(n, r);
|
|
7362
|
+
return e.If(t, i, a);
|
|
7227
7363
|
}
|
|
7228
|
-
function
|
|
7229
|
-
let r
|
|
7230
|
-
return
|
|
7364
|
+
function d(e, t, n) {
|
|
7365
|
+
let [r, i] = l(e, n);
|
|
7366
|
+
return t === "<=" ? r.le(i) : t === ">=" ? r.ge(i) : t === "!=" ? r.neq(i) : r.eq(i);
|
|
7231
7367
|
}
|
|
7232
|
-
function
|
|
7233
|
-
|
|
7368
|
+
function f(e, t) {
|
|
7369
|
+
let n = s(e), r = s(t);
|
|
7370
|
+
return n && r ? e.add(t) : c(e).add(c(t));
|
|
7234
7371
|
}
|
|
7235
|
-
function
|
|
7236
|
-
|
|
7237
|
-
return r && i ? t.mul(n) : s(t).mul(s(n));
|
|
7372
|
+
function p(t, n) {
|
|
7373
|
+
return s(t) && Number.isInteger(n) ? t.mul(e.Int.val(n)) : c(t).mul(e.Real.val(n));
|
|
7238
7374
|
}
|
|
7239
|
-
function
|
|
7375
|
+
function m(e, t) {
|
|
7376
|
+
let n = s(e), r = s(t);
|
|
7377
|
+
return n && r ? e.mul(t) : c(e).mul(c(t));
|
|
7378
|
+
}
|
|
7379
|
+
function g(t, n) {
|
|
7240
7380
|
return n && Number.isInteger(t) ? e.Int.val(t) : e.Real.val(t);
|
|
7241
7381
|
}
|
|
7242
|
-
function
|
|
7243
|
-
let i =
|
|
7244
|
-
return n === "<=" ? a.le(o) : n === ">=" ? a.ge(o) : a.eq(o);
|
|
7382
|
+
function _(t, n, r) {
|
|
7383
|
+
let i = s(t) && Number.isInteger(r), a = i ? t : c(t), o = i ? e.Int.val(r) : e.Real.val(r);
|
|
7384
|
+
return n === "<=" ? a.le(o) : n === ">=" ? a.ge(o) : n === "!=" ? a.neq(o) : a.eq(o);
|
|
7245
7385
|
}
|
|
7246
|
-
function
|
|
7386
|
+
function ee(t, n) {
|
|
7387
|
+
switch (t.kind) {
|
|
7388
|
+
case "abs": {
|
|
7389
|
+
let e = b(t.arg, n), r = g(0, s(e));
|
|
7390
|
+
return u(e.ge(r), e, p(e, -1));
|
|
7391
|
+
}
|
|
7392
|
+
case "max": {
|
|
7393
|
+
let r = b(t.args[0], n);
|
|
7394
|
+
for (let i = 1; i < t.args.length; i++) {
|
|
7395
|
+
let a = b(t.args[i], n), [o, s] = l(r, a);
|
|
7396
|
+
r = e.If(o.ge(s), o, s);
|
|
7397
|
+
}
|
|
7398
|
+
return r;
|
|
7399
|
+
}
|
|
7400
|
+
case "min": {
|
|
7401
|
+
let r = b(t.args[0], n);
|
|
7402
|
+
for (let i = 1; i < t.args.length; i++) {
|
|
7403
|
+
let a = b(t.args[i], n), [o, s] = l(r, a);
|
|
7404
|
+
r = e.If(o.le(s), o, s);
|
|
7405
|
+
}
|
|
7406
|
+
return r;
|
|
7407
|
+
}
|
|
7408
|
+
case "at": {
|
|
7409
|
+
let r = b(t.index, n), i = t.array.map((e) => b(e, n));
|
|
7410
|
+
n.push(e.And(_(r, ">=", 0), _(r, "<=", i.length - 1)));
|
|
7411
|
+
let a = i[i.length - 1];
|
|
7412
|
+
for (let e = i.length - 2; e >= 0; e--) a = u(_(r, "==", e), i[e], a);
|
|
7413
|
+
return a;
|
|
7414
|
+
}
|
|
7415
|
+
}
|
|
7416
|
+
}
|
|
7417
|
+
function b(e, t = []) {
|
|
7247
7418
|
let n = null;
|
|
7248
|
-
if (
|
|
7249
|
-
let
|
|
7250
|
-
n = n === null ?
|
|
7419
|
+
if (e && e.terms) for (let [t, r] of e.terms.entries()) {
|
|
7420
|
+
let e = p(a(t), r);
|
|
7421
|
+
n = n === null ? e : f(n, e);
|
|
7251
7422
|
}
|
|
7252
|
-
|
|
7423
|
+
if (e && Array.isArray(e.nonlinearTerms)) for (let r of e.nonlinearTerms) {
|
|
7424
|
+
if (r.coeff === 0) continue;
|
|
7425
|
+
let e = ee(r.atom, t), i = r.coeff === 1 ? e : p(e, r.coeff);
|
|
7426
|
+
n = n === null ? i : f(n, i);
|
|
7427
|
+
}
|
|
7428
|
+
let r = e?.constant ?? 0;
|
|
7429
|
+
if (typeof r != "number" || !Number.isFinite(r)) throw Error(`Z3: invalid non-finite expression constant (${String(r)}).`);
|
|
7253
7430
|
if (r !== 0 || n === null) {
|
|
7254
|
-
let
|
|
7255
|
-
n = n === null ?
|
|
7431
|
+
let e = g(r, n === null || s(n));
|
|
7432
|
+
n = n === null ? e : f(n, e);
|
|
7256
7433
|
}
|
|
7257
7434
|
return n;
|
|
7258
7435
|
}
|
|
7259
|
-
function
|
|
7436
|
+
function x(e, t = []) {
|
|
7260
7437
|
let n = null;
|
|
7261
|
-
if (
|
|
7262
|
-
let
|
|
7263
|
-
n = n === null ?
|
|
7438
|
+
if (e.linearTerms) for (let [t, r] of e.linearTerms.entries()) {
|
|
7439
|
+
let e = p(a(t), r);
|
|
7440
|
+
n = n === null ? e : f(n, e);
|
|
7441
|
+
}
|
|
7442
|
+
if (e.quadTerms) for (let t of e.quadTerms.values()) {
|
|
7443
|
+
let e = p(m(a(t.var1), a(t.var2)), t.coeff);
|
|
7444
|
+
n = n === null ? e : f(n, e);
|
|
7264
7445
|
}
|
|
7265
|
-
if (
|
|
7266
|
-
|
|
7267
|
-
|
|
7446
|
+
if (Array.isArray(e.nonlinearTerms)) for (let r of e.nonlinearTerms) {
|
|
7447
|
+
if (r.coeff === 0) continue;
|
|
7448
|
+
let e = ee(r.atom, t), i = r.coeff === 1 ? e : p(e, r.coeff);
|
|
7449
|
+
n = n === null ? i : f(n, i);
|
|
7268
7450
|
}
|
|
7269
|
-
let r =
|
|
7451
|
+
let r = e?.constant ?? 0;
|
|
7452
|
+
if (typeof r != "number" || !Number.isFinite(r)) throw Error(`Z3: invalid non-finite expression constant (${String(r)}).`);
|
|
7270
7453
|
if (r !== 0 || n === null) {
|
|
7271
|
-
let
|
|
7272
|
-
n = n === null ?
|
|
7454
|
+
let e = g(r, n === null || s(n));
|
|
7455
|
+
n = n === null ? e : f(n, e);
|
|
7273
7456
|
}
|
|
7274
7457
|
return n;
|
|
7275
7458
|
}
|
|
7276
|
-
function
|
|
7277
|
-
|
|
7278
|
-
|
|
7459
|
+
function S(t, n) {
|
|
7460
|
+
if (t._indicatorMeta) {
|
|
7461
|
+
let r = t._indicatorMeta;
|
|
7462
|
+
if (typeof r.targetRhs != "number" || !Number.isFinite(r.targetRhs)) throw Error(`Z3: invalid non-finite indicator target RHS (${String(r.targetRhs)}).`);
|
|
7463
|
+
let i = _(a(r.binVar), "==", r.activeValue), o = [], s = n ?? o, c = _(b(r.targetLhs, s), r.targetSense, r.targetRhs), l = !n && o.length > 0 ? e.And(c, ...o) : c;
|
|
7464
|
+
return e.Implies(i, l);
|
|
7465
|
+
}
|
|
7466
|
+
let r = [], i = n ?? r, o = t.lhs instanceof Object && "quadTerms" in t.lhs ? x(t.lhs, i) : b(t.lhs, i);
|
|
7467
|
+
if (typeof t.rhs != "number" || !Number.isFinite(t.rhs)) throw Error(`Z3: invalid non-finite constraint RHS (${String(t.rhs)}).`);
|
|
7468
|
+
let s = _(o, t.sense, t.rhs);
|
|
7469
|
+
return !n && r.length > 0 ? e.And(s, ...r) : s;
|
|
7279
7470
|
}
|
|
7280
|
-
function
|
|
7281
|
-
if (t instanceof
|
|
7282
|
-
if (t instanceof
|
|
7283
|
-
if (t instanceof
|
|
7284
|
-
let
|
|
7285
|
-
switch (
|
|
7286
|
-
case "
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7471
|
+
function C(t, n = []) {
|
|
7472
|
+
if (t instanceof v || t && typeof t == "object" && "name" in t && typeof t.id == "number" && !("op" in t) && !("lhs" in t) && !("spec" in t)) return o(t);
|
|
7473
|
+
if (t instanceof h || t && typeof t == "object" && "lhs" in t && "sense" in t) return S(t, n);
|
|
7474
|
+
if (t instanceof te || t && typeof t == "object" && "spec" in t && typeof t.spec == "object") {
|
|
7475
|
+
let r = t.spec;
|
|
7476
|
+
switch (r.kind) {
|
|
7477
|
+
case "distinct": {
|
|
7478
|
+
let t = r.args.map((e) => b(e, n));
|
|
7479
|
+
if (t.length <= 1) return e.Bool.val(!0);
|
|
7480
|
+
let i = t.some((e) => !s(e)) ? t.map(c) : t;
|
|
7481
|
+
return e.Distinct(...i);
|
|
7482
|
+
}
|
|
7483
|
+
case "disjoint": {
|
|
7484
|
+
let t = r.tasks.map((e) => b(e.start, n)), i = [];
|
|
7485
|
+
for (let n = 0; n < r.tasks.length; n++) for (let a = n + 1; a < r.tasks.length; a++) {
|
|
7486
|
+
let o = r.tasks[n].duration, c = r.tasks[a].duration;
|
|
7487
|
+
if (o === 0 && c === 0) continue;
|
|
7488
|
+
let l = f(t[n], g(o, s(t[n]))), u = f(t[a], g(c, s(t[a])));
|
|
7489
|
+
i.push(e.Or(d(l, "<=", t[a]), d(u, "<=", t[n])));
|
|
7490
|
+
}
|
|
7491
|
+
return i.length === 0 ? e.Bool.val(!0) : e.And(...i);
|
|
7492
|
+
}
|
|
7493
|
+
case "cumulative": {
|
|
7494
|
+
let t = r.tasks.map((e) => ({
|
|
7495
|
+
duration: e.duration,
|
|
7496
|
+
demand: e.demand,
|
|
7497
|
+
startAst: b(e.start, n)
|
|
7498
|
+
})).filter((e) => e.duration > 0 && e.demand > 0);
|
|
7499
|
+
if (t.length === 0) return e.Bool.val(!0);
|
|
7500
|
+
if (t.some((e) => e.demand > r.capacity)) return e.Bool.val(!1);
|
|
7501
|
+
let i = t.map((e) => e.startAst), a = [];
|
|
7502
|
+
for (let n = 0; n < t.length; n++) {
|
|
7503
|
+
let o = g(t[n].demand, !0);
|
|
7504
|
+
for (let r = 0; r < t.length; r++) {
|
|
7505
|
+
if (r === n) continue;
|
|
7506
|
+
let a = e.And(d(i[r], "<=", i[n]), d(i[n], "<=", f(i[r], g(t[r].duration - 1, s(i[r]))))), c = e.If(a, e.Int.val(t[r].demand), e.Int.val(0));
|
|
7507
|
+
o = f(o, c);
|
|
7508
|
+
}
|
|
7509
|
+
a.push(_(o, "<=", r.capacity));
|
|
7510
|
+
}
|
|
7511
|
+
return e.And(...a);
|
|
7512
|
+
}
|
|
7513
|
+
case "allowed": {
|
|
7514
|
+
let t = r.vars.map((e) => b(e, n));
|
|
7515
|
+
if (r.tuples.length === 0) return e.Bool.val(!1);
|
|
7516
|
+
let i = r.tuples.map((n) => e.And(...n.map((e, n) => _(t[n], "==", e))));
|
|
7517
|
+
return i.length === 1 ? i[0] : e.Or(...i);
|
|
7518
|
+
}
|
|
7519
|
+
}
|
|
7520
|
+
}
|
|
7521
|
+
if (t instanceof y || t && typeof t == "object" && "op" in t && Array.isArray(t.children)) {
|
|
7522
|
+
let r = t;
|
|
7523
|
+
switch (r.op) {
|
|
7524
|
+
case "and": return e.And(...r.children.map((e) => C(e, n)));
|
|
7525
|
+
case "or": return e.Or(...r.children.map((e) => C(e, n)));
|
|
7526
|
+
case "not": return e.Not(C(r.children[0], n));
|
|
7527
|
+
case "implies": return e.Implies(C(r.children[0], n), C(r.children[1], n));
|
|
7528
|
+
case "xor": return r.children.length === 0 ? e.Bool.val(!1) : r.children.length === 1 ? C(r.children[0], n) : r.children.slice(1).reduce((t, r) => e.Xor(t, C(r, n)), C(r.children[0], n));
|
|
7529
|
+
default: throw Error(`Unsupported boolean operation: ${r.op}`);
|
|
7292
7530
|
}
|
|
7293
7531
|
}
|
|
7294
7532
|
throw Error(`Unknown logic element: ${String(t)}`);
|
|
7295
7533
|
}
|
|
7296
|
-
function
|
|
7297
|
-
|
|
7298
|
-
if (
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7534
|
+
function w(e) {
|
|
7535
|
+
let t = e.trim();
|
|
7536
|
+
if (!t) throw Error("Z3 returned an empty AST value string.");
|
|
7537
|
+
if (t.startsWith("(- ") && t.endsWith(")")) {
|
|
7538
|
+
let e = -w(t.slice(3, -1));
|
|
7539
|
+
return e === 0 ? 0 : e;
|
|
7540
|
+
}
|
|
7541
|
+
if (t.startsWith("(/ ") && t.endsWith(")")) {
|
|
7542
|
+
let n = t.slice(3, -1).trim(), r = 0, i = -1;
|
|
7543
|
+
for (let e = 0; e < n.length; e++) {
|
|
7544
|
+
let t = n[e];
|
|
7545
|
+
if (t === "(") r++;
|
|
7546
|
+
else if (t === ")") r--;
|
|
7547
|
+
else if (r === 0 && /\s/.test(t)) {
|
|
7548
|
+
i = e;
|
|
7549
|
+
break;
|
|
7550
|
+
}
|
|
7551
|
+
}
|
|
7552
|
+
if (i !== -1) {
|
|
7553
|
+
let t = w(n.slice(0, i)) / w(n.slice(i + 1));
|
|
7554
|
+
if (!Number.isFinite(t)) throw Error(`Z3 returned a non-finite rational AST value: "${e}".`);
|
|
7555
|
+
return t === 0 ? 0 : t;
|
|
7556
|
+
}
|
|
7557
|
+
}
|
|
7558
|
+
let n = Number(t);
|
|
7559
|
+
if (!Number.isFinite(n)) throw Error(`Z3 returned a non-numeric or non-finite AST value: "${e}".`);
|
|
7560
|
+
return n === 0 ? 0 : n;
|
|
7561
|
+
}
|
|
7562
|
+
function ne(e) {
|
|
7563
|
+
if (e == null) throw Error("Z3 model evaluation returned a missing AST value.");
|
|
7564
|
+
if (typeof e.asNumber == "function") {
|
|
7565
|
+
let t = e.asNumber();
|
|
7566
|
+
if (typeof t == "number" && Number.isFinite(t)) return t === 0 ? 0 : t;
|
|
7567
|
+
}
|
|
7568
|
+
if (typeof e.toString != "function") throw Error("Z3 model evaluation returned an unreadable AST value.");
|
|
7569
|
+
return w(e.toString());
|
|
7305
7570
|
}
|
|
7306
7571
|
return {
|
|
7307
7572
|
getVarAst: a,
|
|
7308
7573
|
getBoolVarAst: o,
|
|
7309
|
-
compareAstWithNumber:
|
|
7310
|
-
translateLinExpr:
|
|
7311
|
-
translateQuadExpr:
|
|
7312
|
-
translateConstraint:
|
|
7313
|
-
translateBoolExpr:
|
|
7314
|
-
parseAstValue:
|
|
7574
|
+
compareAstWithNumber: _,
|
|
7575
|
+
translateLinExpr: b,
|
|
7576
|
+
translateQuadExpr: x,
|
|
7577
|
+
translateConstraint: S,
|
|
7578
|
+
translateBoolExpr: C,
|
|
7579
|
+
parseAstValue: ne,
|
|
7315
7580
|
varAstMap: t,
|
|
7316
7581
|
boolVarAstMap: n
|
|
7317
7582
|
};
|
|
@@ -7327,251 +7592,251 @@ var st = class {
|
|
|
7327
7592
|
try {
|
|
7328
7593
|
let r = e.check();
|
|
7329
7594
|
return await new Promise((e, i) => {
|
|
7330
|
-
n =
|
|
7595
|
+
n = tt(i, t), r.then(e, i);
|
|
7331
7596
|
});
|
|
7332
7597
|
} finally {
|
|
7333
7598
|
n?.();
|
|
7334
7599
|
}
|
|
7335
7600
|
}
|
|
7336
7601
|
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
|
-
|
|
7602
|
+
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 or Pumpkin.`);
|
|
7603
|
+
let n = {
|
|
7604
|
+
...this.options,
|
|
7605
|
+
...t
|
|
7606
|
+
};
|
|
7607
|
+
if (pt(n), n.signal?.aborted) return {
|
|
7339
7608
|
status: "Unknown",
|
|
7340
7609
|
values: {}
|
|
7341
7610
|
};
|
|
7342
|
-
let
|
|
7343
|
-
if (
|
|
7611
|
+
let r = await lt(n), { Context: i } = r;
|
|
7612
|
+
if (n.signal?.aborted) return {
|
|
7344
7613
|
status: "Unknown",
|
|
7345
|
-
values: {}
|
|
7614
|
+
values: {},
|
|
7615
|
+
runTime: 0
|
|
7346
7616
|
};
|
|
7347
|
-
let
|
|
7348
|
-
this.addVariableBounds(
|
|
7349
|
-
let
|
|
7350
|
-
let t = `__washi_track_${++
|
|
7351
|
-
for (;
|
|
7352
|
-
let n =
|
|
7353
|
-
return
|
|
7617
|
+
let a = performance.now(), o = new i(`check_${Date.now()}_${Math.random().toString(36).substring(2, 7)}`), s = new o.Solver(), c = this.createContextTranslator(o), l = e.variables || [], u = e.boolVars || [], d = e.constraints || [], f = e.logicalConstraints || [];
|
|
7618
|
+
this.addVariableBounds(s, l, c);
|
|
7619
|
+
let p = new Set(u.map((e) => e.name)), m = /* @__PURE__ */ new Map(), h = 0, g = (e) => {
|
|
7620
|
+
let t = `__washi_track_${++h}`;
|
|
7621
|
+
for (; p.has(t) || m.has(t);) t = `__washi_track_${++h}`;
|
|
7622
|
+
let n = o.Bool.const(t);
|
|
7623
|
+
return m.set(t, e), m.set(n.toString(), e), n;
|
|
7354
7624
|
};
|
|
7355
|
-
for (let e of
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7625
|
+
for (let e of d) {
|
|
7626
|
+
let t = [], n = c.translateConstraint(e, t), r = t.length > 0 ? o.And(n, ...t) : n;
|
|
7627
|
+
s.addAndTrack(r, g(e.name));
|
|
7628
|
+
}
|
|
7629
|
+
for (let e = 0; e < f.length; e++) {
|
|
7630
|
+
let t = f[e], n = "name" in t && typeof t.name == "string" ? t.name : `lc_${e + 1}`, r = "expr" in t ? t.expr : t, i = [], a = c.translateBoolExpr(r, i), l = i.length > 0 ? o.And(a, ...i) : a;
|
|
7631
|
+
s.addAndTrack(l, g(n));
|
|
7359
7632
|
}
|
|
7360
|
-
if (
|
|
7633
|
+
if (n.signal?.aborted) return {
|
|
7361
7634
|
status: "Unknown",
|
|
7362
|
-
values: {}
|
|
7635
|
+
values: {},
|
|
7636
|
+
runTime: (performance.now() - a) / 1e3
|
|
7363
7637
|
};
|
|
7364
|
-
let
|
|
7365
|
-
if (
|
|
7366
|
-
let e =
|
|
7367
|
-
for (let n of
|
|
7368
|
-
let r =
|
|
7369
|
-
|
|
7370
|
-
}
|
|
7371
|
-
for (let n of
|
|
7372
|
-
let r =
|
|
7373
|
-
|
|
7638
|
+
let _ = (await this.runZ3CheckWithErrorGuard(s, r)).toString();
|
|
7639
|
+
if (_ === "sat") {
|
|
7640
|
+
let e = s.model(), t = {};
|
|
7641
|
+
for (let n of l) {
|
|
7642
|
+
let r = c.getVarAst(n), i = e.eval(r, !0);
|
|
7643
|
+
R(t, n.name, c.parseAstValue(i));
|
|
7644
|
+
}
|
|
7645
|
+
for (let n of u) {
|
|
7646
|
+
let r = c.getBoolVarAst(n), i = e.eval(r, !0)?.toString?.();
|
|
7647
|
+
if (i !== "true" && i !== "false") throw Error(`Z3 model evaluation returned non-boolean AST value for BoolVar "${n.name}": "${String(i)}".`);
|
|
7648
|
+
R(t, n.name, i === "true");
|
|
7374
7649
|
}
|
|
7375
7650
|
return {
|
|
7376
7651
|
status: "Sat",
|
|
7377
|
-
values: t
|
|
7652
|
+
values: t,
|
|
7653
|
+
runTime: (performance.now() - a) / 1e3
|
|
7378
7654
|
};
|
|
7379
7655
|
}
|
|
7380
|
-
if (
|
|
7381
|
-
let e =
|
|
7656
|
+
if (_ === "unsat") {
|
|
7657
|
+
let e = s.unsatCore(), t = [], n = typeof e.length == "function" ? e.length() : e.length;
|
|
7382
7658
|
for (let r = 0; r < n; r++) {
|
|
7383
7659
|
let n = e.get(r).toString();
|
|
7384
|
-
t.push(
|
|
7660
|
+
t.push(m.get(n) ?? n);
|
|
7385
7661
|
}
|
|
7386
7662
|
return {
|
|
7387
7663
|
status: "Unsat",
|
|
7388
7664
|
values: {},
|
|
7389
|
-
unsatCore: t
|
|
7665
|
+
unsatCore: t,
|
|
7666
|
+
runTime: (performance.now() - a) / 1e3
|
|
7390
7667
|
};
|
|
7391
7668
|
}
|
|
7392
7669
|
return {
|
|
7393
7670
|
status: "Unknown",
|
|
7394
|
-
values: {}
|
|
7671
|
+
values: {},
|
|
7672
|
+
runTime: (performance.now() - a) / 1e3
|
|
7395
7673
|
};
|
|
7396
7674
|
}
|
|
7397
7675
|
async solve(e, t, n) {
|
|
7398
|
-
let r = (
|
|
7399
|
-
|
|
7400
|
-
|
|
7676
|
+
let r = (x(t) ? n : t) ?? {}, i = {
|
|
7677
|
+
...this.options,
|
|
7678
|
+
...r
|
|
7679
|
+
};
|
|
7680
|
+
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 or Pumpkin.`);
|
|
7681
|
+
pt(i);
|
|
7682
|
+
let a = b(e.sense), o = e.objective;
|
|
7683
|
+
if (o && (typeof o.constant != "number" || !Number.isFinite(o.constant))) throw Error(`Z3: invalid non-finite objective constant (${String(o.constant)}).`);
|
|
7684
|
+
if (i.signal?.aborted) return {
|
|
7401
7685
|
status: "Unknown",
|
|
7402
7686
|
terminationStatus: "Interrupted",
|
|
7403
7687
|
hasPrimalSolution: !1,
|
|
7404
7688
|
objectiveValue: null,
|
|
7405
7689
|
values: {}
|
|
7406
7690
|
};
|
|
7407
|
-
let
|
|
7408
|
-
if (!(
|
|
7409
|
-
let t = await this.check(e,
|
|
7410
|
-
for (let [e,
|
|
7411
|
-
let
|
|
7412
|
-
if (
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
});
|
|
7419
|
-
}
|
|
7420
|
-
if (r.signal?.aborted) return {
|
|
7421
|
-
status: s ? "Feasible" : "Unknown",
|
|
7691
|
+
let s = performance.now(), c = o != null && Array.isArray(o.nonlinearTerms) && o.nonlinearTerms.length > 0;
|
|
7692
|
+
if (!(o != null && (c || ("quadTerms" in o ? o.linearTerms.size > 0 || o.quadTerms.size > 0 : "terms" in o && o.terms.size > 0)))) {
|
|
7693
|
+
let t = await this.check(e, i), n = {}, r = {};
|
|
7694
|
+
for (let [e, i] of Object.entries(t.values)) typeof i == "boolean" ? (R(n, e, +!!i), R(r, e, i)) : R(n, e, i);
|
|
7695
|
+
let a = t.status === "Sat", c = a ? o?.constant ?? 0 : null, l = t.runTime ?? (performance.now() - s) / 1e3;
|
|
7696
|
+
if (i.onProgress && !i.signal?.aborted && i.onProgress({
|
|
7697
|
+
elapsedTime: l,
|
|
7698
|
+
elapsedSeconds: l,
|
|
7699
|
+
...typeof c == "number" && Number.isFinite(c) ? { objectiveValue: c } : {}
|
|
7700
|
+
}), i.signal?.aborted) return {
|
|
7701
|
+
status: a ? "Feasible" : "Unknown",
|
|
7422
7702
|
terminationStatus: "Interrupted",
|
|
7423
|
-
hasPrimalSolution:
|
|
7703
|
+
hasPrimalSolution: a,
|
|
7424
7704
|
objectiveValue: c,
|
|
7425
|
-
values:
|
|
7426
|
-
|
|
7705
|
+
values: a ? n : {},
|
|
7706
|
+
runTime: l,
|
|
7707
|
+
...a && Object.keys(r).length > 0 ? { boolValues: r } : {}
|
|
7427
7708
|
};
|
|
7428
|
-
let
|
|
7709
|
+
let u = a ? "Optimal" : t.status === "Unsat" ? "Infeasible" : t.status === "Unknown" ? "Unknown" : "Error";
|
|
7429
7710
|
return {
|
|
7430
|
-
status:
|
|
7431
|
-
terminationStatus:
|
|
7432
|
-
hasPrimalSolution:
|
|
7711
|
+
status: u,
|
|
7712
|
+
terminationStatus: u,
|
|
7713
|
+
hasPrimalSolution: a,
|
|
7433
7714
|
objectiveValue: c,
|
|
7434
|
-
values:
|
|
7435
|
-
|
|
7715
|
+
values: a ? n : {},
|
|
7716
|
+
runTime: l,
|
|
7717
|
+
...a && Object.keys(r).length > 0 ? { boolValues: r } : {}
|
|
7436
7718
|
};
|
|
7437
7719
|
}
|
|
7438
|
-
let
|
|
7439
|
-
if (
|
|
7720
|
+
let l = await lt(i), { Context: u } = l;
|
|
7721
|
+
if (i.signal?.aborted) return {
|
|
7440
7722
|
status: "Unknown",
|
|
7441
7723
|
terminationStatus: "Interrupted",
|
|
7442
7724
|
hasPrimalSolution: !1,
|
|
7443
7725
|
objectiveValue: null,
|
|
7444
|
-
values: {}
|
|
7726
|
+
values: {},
|
|
7727
|
+
runTime: 0
|
|
7445
7728
|
};
|
|
7446
|
-
let
|
|
7447
|
-
this.addVariableBounds(
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7729
|
+
let d = performance.now(), f = new u(`opt_${Date.now()}_${Math.random().toString(36).substring(2, 7)}`), p = new f.Optimize(), m = this.createContextTranslator(f), h = e.variables || [], g = e.boolVars || [], _ = e.constraints || [], ee = e.logicalConstraints || [];
|
|
7730
|
+
this.addVariableBounds(p, h, m);
|
|
7731
|
+
let v = [];
|
|
7732
|
+
for (let e of _) {
|
|
7733
|
+
let t = m.translateConstraint(e, v);
|
|
7734
|
+
p.add(t);
|
|
7451
7735
|
}
|
|
7452
|
-
for (let e of
|
|
7453
|
-
let t = "expr" in e ? e.expr : e, n =
|
|
7454
|
-
|
|
7736
|
+
for (let e of ee) {
|
|
7737
|
+
let t = "expr" in e ? e.expr : e, n = m.translateBoolExpr(t, v);
|
|
7738
|
+
p.add(n);
|
|
7455
7739
|
}
|
|
7456
|
-
let
|
|
7457
|
-
|
|
7740
|
+
let y = "quadTerms" in o ? m.translateQuadExpr(o, v) : m.translateLinExpr(o, v);
|
|
7741
|
+
for (let e of v) p.add(e);
|
|
7742
|
+
let te = a === "Maximize", S = te ? p.maximize(y) : p.minimize(y);
|
|
7743
|
+
if (i.signal?.aborted) return {
|
|
7458
7744
|
status: "Unknown",
|
|
7459
7745
|
terminationStatus: "Interrupted",
|
|
7460
7746
|
hasPrimalSolution: !1,
|
|
7461
7747
|
objectiveValue: null,
|
|
7462
|
-
values: {}
|
|
7748
|
+
values: {},
|
|
7749
|
+
runTime: (performance.now() - d) / 1e3
|
|
7463
7750
|
};
|
|
7464
|
-
let
|
|
7465
|
-
if (
|
|
7466
|
-
let e =
|
|
7467
|
-
for (let n of
|
|
7468
|
-
let r =
|
|
7469
|
-
|
|
7470
|
-
}
|
|
7471
|
-
for (let r of
|
|
7472
|
-
let i =
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
if (o) {
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
terminationStatus: "Unbounded",
|
|
7492
|
-
hasPrimalSolution: !0,
|
|
7493
|
-
objectiveValue: a,
|
|
7494
|
-
values: t,
|
|
7495
|
-
...Object.keys(n).length > 0 ? { boolValues: n } : {}
|
|
7496
|
-
};
|
|
7497
|
-
}
|
|
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
|
-
});
|
|
7521
|
-
}
|
|
7522
|
-
return {
|
|
7523
|
-
status: "Optimal",
|
|
7524
|
-
terminationStatus: "Optimal",
|
|
7751
|
+
let C = (await this.runZ3CheckWithErrorGuard(p, l)).toString(), w = (performance.now() - d) / 1e3;
|
|
7752
|
+
if (C === "sat") {
|
|
7753
|
+
let e = p.model(), t = {}, n = {};
|
|
7754
|
+
for (let n of h) {
|
|
7755
|
+
let r = m.getVarAst(n), i = e.eval(r, !0);
|
|
7756
|
+
R(t, n.name, m.parseAstValue(i));
|
|
7757
|
+
}
|
|
7758
|
+
for (let r of g) {
|
|
7759
|
+
let i = m.getBoolVarAst(r), a = e.eval(i, !0)?.toString?.();
|
|
7760
|
+
if (a !== "true" && a !== "false") throw Error(`Z3 model evaluation returned non-boolean AST value for BoolVar "${r.name}": "${String(a)}".`);
|
|
7761
|
+
let o = a === "true";
|
|
7762
|
+
R(t, r.name, +!!o), R(n, r.name, o);
|
|
7763
|
+
}
|
|
7764
|
+
let r = m.parseAstValue(e.eval(y, !0)), a = te ? "getUpper" : "getLower";
|
|
7765
|
+
if (te ? typeof p.getUpper != "function" : typeof p.getLower != "function") throw Error(`Z3 Optimize instance is missing "${a}" required to verify objective boundedness.`);
|
|
7766
|
+
let o = te ? p.getUpper(S) : p.getLower(S);
|
|
7767
|
+
if (o == null || typeof o.toString != "function") throw Error(`Z3 Optimize "${a}" returned an invalid bound AST.`);
|
|
7768
|
+
let s = o.toString(), c = !1, l = !1;
|
|
7769
|
+
s.includes("oo") ? c = !0 : s.includes("epsilon") && (l = !0);
|
|
7770
|
+
let u = (performance.now() - d) / 1e3;
|
|
7771
|
+
return c ? (i.onProgress && i.onProgress({
|
|
7772
|
+
elapsedTime: u,
|
|
7773
|
+
elapsedSeconds: u,
|
|
7774
|
+
...Number.isFinite(r) ? { objectiveValue: r } : {}
|
|
7775
|
+
}), {
|
|
7776
|
+
status: "Unbounded",
|
|
7777
|
+
terminationStatus: "Unbounded",
|
|
7525
7778
|
hasPrimalSolution: !0,
|
|
7526
|
-
objectiveValue:
|
|
7779
|
+
objectiveValue: r,
|
|
7527
7780
|
values: t,
|
|
7781
|
+
runTime: u,
|
|
7528
7782
|
...Object.keys(n).length > 0 ? { boolValues: n } : {}
|
|
7529
|
-
}
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
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 {
|
|
7783
|
+
}) : l ? (i.onProgress && i.onProgress({
|
|
7784
|
+
elapsedTime: u,
|
|
7785
|
+
elapsedSeconds: u
|
|
7786
|
+
}), {
|
|
7556
7787
|
status: "Unknown",
|
|
7557
7788
|
terminationStatus: "Unknown",
|
|
7558
7789
|
hasPrimalSolution: !1,
|
|
7559
7790
|
objectiveValue: null,
|
|
7560
|
-
values: {}
|
|
7561
|
-
|
|
7791
|
+
values: {},
|
|
7792
|
+
runTime: u
|
|
7793
|
+
}) : (i.onProgress && i.onProgress({
|
|
7794
|
+
elapsedTime: u,
|
|
7795
|
+
elapsedSeconds: u,
|
|
7796
|
+
...Number.isFinite(r) ? { objectiveValue: r } : {}
|
|
7797
|
+
}), {
|
|
7798
|
+
status: "Optimal",
|
|
7799
|
+
terminationStatus: "Optimal",
|
|
7800
|
+
hasPrimalSolution: !0,
|
|
7801
|
+
objectiveValue: r,
|
|
7802
|
+
values: t,
|
|
7803
|
+
runTime: u,
|
|
7804
|
+
...Object.keys(n).length > 0 ? { boolValues: n } : {}
|
|
7805
|
+
});
|
|
7562
7806
|
}
|
|
7563
|
-
return {
|
|
7807
|
+
return C === "unsat" ? (i.onProgress && i.onProgress({
|
|
7808
|
+
elapsedTime: w,
|
|
7809
|
+
elapsedSeconds: w
|
|
7810
|
+
}), {
|
|
7811
|
+
status: "Infeasible",
|
|
7812
|
+
terminationStatus: "Infeasible",
|
|
7813
|
+
hasPrimalSolution: !1,
|
|
7814
|
+
objectiveValue: null,
|
|
7815
|
+
values: {},
|
|
7816
|
+
runTime: w
|
|
7817
|
+
}) : C === "unknown" ? (i.onProgress && i.onProgress({
|
|
7818
|
+
elapsedTime: w,
|
|
7819
|
+
elapsedSeconds: w
|
|
7820
|
+
}), {
|
|
7821
|
+
status: "Unknown",
|
|
7822
|
+
terminationStatus: "Unknown",
|
|
7823
|
+
hasPrimalSolution: !1,
|
|
7824
|
+
objectiveValue: null,
|
|
7825
|
+
values: {},
|
|
7826
|
+
runTime: w
|
|
7827
|
+
}) : {
|
|
7564
7828
|
status: "Error",
|
|
7565
7829
|
terminationStatus: "Error",
|
|
7566
7830
|
hasPrimalSolution: !1,
|
|
7567
7831
|
objectiveValue: null,
|
|
7568
|
-
values: {}
|
|
7832
|
+
values: {},
|
|
7833
|
+
runTime: w
|
|
7569
7834
|
};
|
|
7570
7835
|
}
|
|
7571
7836
|
};
|
|
7572
|
-
function
|
|
7573
|
-
|
|
7837
|
+
function ht() {
|
|
7838
|
+
ne("z3", (e) => new mt(e));
|
|
7574
7839
|
}
|
|
7575
|
-
|
|
7840
|
+
ht();
|
|
7576
7841
|
//#endregion
|
|
7577
|
-
export {
|
|
7842
|
+
export { mt as Z3Solver, ct as ensureInitZ3Loaded, it as isZ3Loaded, ut as killZ3Threads, lt as loadZ3, nt as notifyZ3WorkerError, ot as probeAssetUrl, tt as registerZ3ErrorHandler, ht as registerZ3Solver, L as resetZ3LoaderCache, st as resolveZ3AssetUrls, rt as setZ3Assets, at as validateZ3BrowserEnvironment };
|