@ohtaman/washi 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -10
- package/THIRD_PARTY_LICENSES.md +4 -4
- package/dist/{browser/washi.js → core-b430-tAc.js} +656 -661
- package/dist/solvers/browser-_washi-browser-node-runtime-BOEcR5J2.js +28 -0
- package/dist/solvers/browser-browser-worker-CT6498Is.js +13 -0
- package/dist/{lib/solvers/loader-b5PNpCmX.js → solvers/browser-loader-D21chr4P.js} +12 -23
- package/dist/{lib/solvers/loader-DCtyxsfF.js → solvers/browser-loader-DWFhT0yY.js} +13 -13
- package/dist/solvers/browser-lp-writer-DH_1sdsF.js +115 -0
- package/dist/solvers/glpk.js +310 -0
- package/dist/{lib/solvers/glpk.js → solvers/glpk.node.js} +5 -9
- package/dist/{lib/solvers/__vite-browser-external-oLchLuMx.js → solvers/highs-browser-__vite-browser-external-Cu-Zq4Hm.js} +1 -1
- package/dist/solvers/highs-browser-runtime.js +2410 -0
- package/dist/{lib/solvers → solvers}/highs-node-runtime.js +1 -1
- package/dist/{lib/solvers → solvers}/highs-worker.js +2 -2
- package/dist/{lib/solvers → solvers}/highs.js +64 -70
- package/dist/{browser/solvers/highs-loader-Csn3-0tq.js → solvers/highs.node.js} +520 -138
- package/dist/solvers/node-browser-worker-CN93BPoO.js +54 -0
- package/dist/{lib/solvers/lp-writer-CLScMFbS.js → solvers/node-lp-writer-CqMLgMIk.js} +1 -1
- package/dist/solvers/node-node-runtime-BUlNfXvx.js +10 -0
- package/dist/solvers/node-registry-CrYRRk9q.js +907 -0
- package/dist/solvers/node-types-BGqPkxwu.js +12 -0
- package/dist/{lib/solvers → solvers}/pumpkin-node-runtime.js +1 -1
- package/dist/{browser/solvers → solvers}/pumpkin-worker.js +2 -1
- package/dist/{lib/solvers → solvers}/pumpkin.js +174 -164
- package/dist/solvers/pumpkin.node.js +1228 -0
- package/dist/{lib/solvers → solvers}/z3.js +123 -120
- package/dist/types/core.d.ts +11 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modeler/core.d.ts +14 -0
- package/dist/types/modeler/core.d.ts.map +1 -0
- package/dist/types/modeler/index.d.ts +1 -13
- package/dist/types/modeler/index.d.ts.map +1 -1
- package/dist/types/modeler/model.d.ts +1 -1
- package/dist/types/modeler/model.d.ts.map +1 -1
- package/dist/types/modeler/solvers/browser-worker.d.ts +17 -0
- package/dist/types/modeler/solvers/browser-worker.d.ts.map +1 -0
- package/dist/types/modeler/solvers/glpk/loader.d.ts +2 -2
- package/dist/types/modeler/solvers/glpk/node-runtime.d.ts +5 -0
- package/dist/types/modeler/solvers/glpk/node-runtime.d.ts.map +1 -0
- package/dist/types/modeler/solvers/highs/worker-client.d.ts +5 -5
- package/dist/types/modeler/solvers/highs/worker-client.d.ts.map +1 -1
- package/dist/types/modeler/solvers/pumpkin/loader.d.ts +0 -4
- package/dist/types/modeler/solvers/pumpkin/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/pumpkin/solver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/pumpkin/worker-client.d.ts +4 -3
- package/dist/types/modeler/solvers/pumpkin/worker-client.d.ts.map +1 -1
- package/dist/types/modeler/solvers/types.d.ts +5 -1
- package/dist/types/modeler/solvers/types.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/loader.d.ts +3 -8
- package/dist/types/modeler/solvers/z3/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/solver.d.ts +3 -2
- package/dist/types/modeler/solvers/z3/solver.d.ts.map +1 -1
- package/dist/types/modeler/types.d.ts +18 -3
- package/dist/types/modeler/types.d.ts.map +1 -1
- package/dist/washi.js +4 -0
- package/dist/washi.min.js +6 -0
- package/dist/washi.node.js +4 -0
- package/docs/getting-started/ai-agents.md +23 -22
- package/docs/getting-started/coding-agents.md +26 -17
- package/docs/getting-started/cross-origin.md +2 -1
- package/docs/getting-started/index.md +3 -1
- package/docs/getting-started/runtimes.md +53 -63
- package/docs/guide/objectives.md +3 -3
- package/docs/solvers/custom-solver.md +4 -9
- package/docs/solvers/glpk.md +2 -0
- package/docs/solvers/highs.md +8 -10
- package/docs/solvers/index.md +1 -1
- package/docs/solvers/pumpkin.md +7 -7
- package/docs/solvers/z3.md +18 -1
- package/llms-full.txt +124 -118
- package/llms.txt +23 -22
- package/package.json +31 -64
- package/skills/washi/SKILL.md +18 -18
- package/skills/washi/references/single-html.md +7 -12
- package/dist/browser/solvers/glpk.js +0 -1263
- package/dist/browser/solvers/glpk.min.js +0 -1
- package/dist/browser/solvers/highs-__vite-browser-external-xcxOpLMD.js +0 -7
- package/dist/browser/solvers/highs-browser-runtime-ccRmE4qj.js +0 -2021
- package/dist/browser/solvers/highs-worker.js +0 -55
- package/dist/browser/solvers/highs.js +0 -1454
- package/dist/browser/solvers/pumpkin-_washi-pumpkin-node-runtime-CEKUDK6d.js +0 -9
- package/dist/browser/solvers/pumpkin-loader-BI3n3dWO.js +0 -401
- package/dist/browser/solvers/pumpkin.js +0 -1796
- package/dist/browser/solvers/z3-built.js +0 -8245
- package/dist/browser/solvers/z3-built.wasm +0 -4
- package/dist/browser/solvers/z3.js +0 -7842
- package/dist/browser/solvers/z3.min.js +0 -5
- package/dist/browser/washi.min.js +0 -6
- package/dist/lib/solvers/highs-browser-runtime.js +0 -2413
- package/dist/lib/solvers/highs.wasm +0 -0
- package/dist/lib/solvers/highs.wasm.LICENSE +0 -21
- package/dist/lib/solvers/pumpkin-worker.js +0 -47
- package/dist/lib/solvers/pumpkin.wasm +0 -0
- package/dist/lib/solvers/pumpkin.wasm.LICENSE +0 -21
- package/dist/lib/solvers/z3-assets.js +0 -1
- package/dist/lib/solvers/z3-built.js +0 -8245
- package/dist/lib/solvers/z3-built.wasm +0 -4
- package/dist/lib/washi.js +0 -5662
- package/dist/types/modeler/solvers/z3/assets.d.ts +0 -11
- package/dist/types/modeler/solvers/z3/assets.d.ts.map +0 -1
- /package/dist/{lib/solvers/embedded-wasm-CSFlLV5N.js → solvers/browser-embedded-wasm-CSFlLV5N.js} +0 -0
- /package/dist/{lib/solvers/registry-CrYRRk9q.js → solvers/browser-registry-CrYRRk9q.js} +0 -0
- /package/dist/{lib/solvers/types-BGqPkxwu.js → solvers/browser-types-BGqPkxwu.js} +0 -0
- /package/dist/{lib/solvers → solvers}/highs-assets.js +0 -0
- /package/dist/{lib/solvers/rolldown-runtime-DtPi1Y-2.js → solvers/highs-browser-rolldown-runtime-DtPi1Y-2.js} +0 -0
- /package/dist/{browser/solvers → solvers}/highs-inline.js +0 -0
- /package/dist/{lib/solvers → solvers}/highs-runtime.js +0 -0
- /package/dist/{lib/solvers → solvers}/highs-worker-factory.js +0 -0
- /package/dist/{browser/solvers → solvers}/highs.wasm +0 -0
- /package/dist/{browser/solvers → solvers}/highs.wasm.LICENSE +0 -0
- /package/dist/{lib/solvers → solvers}/pumpkin-assets.js +0 -0
- /package/dist/{browser/solvers → solvers}/pumpkin-inline.js +0 -0
- /package/dist/{lib/solvers → solvers}/pumpkin-worker-factory.js +0 -0
- /package/dist/{browser/solvers → solvers}/pumpkin.wasm +0 -0
- /package/dist/{browser/solvers → solvers}/pumpkin.wasm.LICENSE +0 -0
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { c as e, l as t, o as n, s as r, t as i } from "./registry-CrYRRk9q.js";
|
|
2
|
-
import { r as a } from "./lp-writer-
|
|
3
|
-
import { t as o } from "./types-BGqPkxwu.js";
|
|
4
|
-
import { getBundledZ3AssetUrls as s } from "./z3-assets.js";
|
|
1
|
+
import { c as e, l as t, o as n, s as r, t as i } from "./browser-registry-CrYRRk9q.js";
|
|
2
|
+
import { r as a } from "./browser-lp-writer-DH_1sdsF.js";
|
|
3
|
+
import { t as o } from "./browser-types-BGqPkxwu.js";
|
|
5
4
|
//#region src/modeler/solvers/z3/loader.ts
|
|
6
|
-
var
|
|
7
|
-
function
|
|
5
|
+
var s = null, c = null, l = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function u(e, t) {
|
|
8
7
|
if (e.error) return;
|
|
9
8
|
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)}`);
|
|
10
9
|
e.error = n;
|
|
11
10
|
for (let t of e.asyncRejects) t(n);
|
|
12
|
-
e.asyncRejects.clear(),
|
|
11
|
+
e.asyncRejects.clear(), c === e && h();
|
|
13
12
|
try {
|
|
14
13
|
e.instance?.em?.PThread?.terminateAllThreads();
|
|
15
14
|
} catch {}
|
|
@@ -19,7 +18,7 @@ function p(e, t) {
|
|
|
19
18
|
} catch {}
|
|
20
19
|
e.errorHandlers.clear();
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function d(e, t) {
|
|
23
22
|
if (!e || e.__washi_async_call_hooked) return;
|
|
24
23
|
e.__washi_async_call_hooked = !0;
|
|
25
24
|
let n = e.async_call;
|
|
@@ -35,27 +34,27 @@ function m(e, t) {
|
|
|
35
34
|
t.asyncRejects.delete(i);
|
|
36
35
|
});
|
|
37
36
|
} catch (e) {
|
|
38
|
-
throw t.asyncRejects.delete(i),
|
|
37
|
+
throw t.asyncRejects.delete(i), u(t, e), e;
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
|
-
function
|
|
43
|
-
let n = t ?
|
|
41
|
+
function f(e, t) {
|
|
42
|
+
let n = t ? l.get(t) : c;
|
|
44
43
|
return n ? n.error ? (e(n.error), () => {}) : (n.errorHandlers.add(e), () => {
|
|
45
44
|
n.errorHandlers.delete(e);
|
|
46
45
|
}) : () => {};
|
|
47
46
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
47
|
+
function p(e) {
|
|
48
|
+
c && u(c, e);
|
|
50
49
|
}
|
|
51
|
-
function
|
|
50
|
+
function m(e, t) {
|
|
52
51
|
if (!e || !e.PThread || e.PThread.__washi_monitored) return;
|
|
53
52
|
e.PThread.__washi_monitored = !0;
|
|
54
53
|
let n = (e) => {
|
|
55
54
|
e && (e.onerror = (e) => {
|
|
56
|
-
|
|
55
|
+
u(t, e);
|
|
57
56
|
}, typeof e.addEventListener == "function" && e.addEventListener("error", (e) => {
|
|
58
|
-
|
|
57
|
+
u(t, e), typeof e.preventDefault == "function" && e.preventDefault();
|
|
59
58
|
}));
|
|
60
59
|
};
|
|
61
60
|
Array.isArray(e.PThread.unusedWorkers) && e.PThread.unusedWorkers.forEach(n), Array.isArray(e.PThread.runningWorkers) && e.PThread.runningWorkers.forEach(n);
|
|
@@ -64,10 +63,10 @@ function _(e, t) {
|
|
|
64
63
|
try {
|
|
65
64
|
let n = r.call(this, e);
|
|
66
65
|
return e.onerror = (e) => {
|
|
67
|
-
|
|
66
|
+
u(t, e);
|
|
68
67
|
}, n;
|
|
69
68
|
} catch (e) {
|
|
70
|
-
throw
|
|
69
|
+
throw u(t, e), e;
|
|
71
70
|
}
|
|
72
71
|
});
|
|
73
72
|
let i = e.PThread.allocateUnusedWorker;
|
|
@@ -77,27 +76,25 @@ function _(e, t) {
|
|
|
77
76
|
let e = this.unusedWorkers?.[this.unusedWorkers.length - 1];
|
|
78
77
|
e && n(e);
|
|
79
78
|
} catch (e) {
|
|
80
|
-
throw
|
|
79
|
+
throw u(t, e), e;
|
|
81
80
|
}
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
function y() {
|
|
88
|
-
c = null, d = null;
|
|
83
|
+
function h() {
|
|
84
|
+
s = null, c = null;
|
|
89
85
|
}
|
|
90
|
-
function
|
|
91
|
-
return !(!
|
|
86
|
+
function g() {
|
|
87
|
+
return !(!c?.instance || c.error);
|
|
92
88
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
function _() {
|
|
90
|
+
let e = typeof window < "u" ? window : typeof globalThis < "u" && typeof globalThis.WorkerGlobalScope == "function" && globalThis instanceof globalThis.WorkerGlobalScope ? globalThis : null;
|
|
91
|
+
if (!e) return;
|
|
92
|
+
let t = e.location?.hostname ?? "", n = t === "localhost" || t === "127.0.0.1" || t === "[::1]";
|
|
93
|
+
if (!e.isSecureContext && !n) throw Error(`[WaSHI] Z3 solver requires a Secure Context (HTTPS or localhost). Current protocol: "${e.location?.protocol ?? "unknown"}".`);
|
|
94
|
+
let r = typeof SharedArrayBuffer < "u", i = e.crossOriginIsolated === !0;
|
|
95
|
+
if (!r || !i) 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.)");
|
|
99
96
|
}
|
|
100
|
-
async function
|
|
97
|
+
async function v(e, t) {
|
|
101
98
|
try {
|
|
102
99
|
let n = null;
|
|
103
100
|
try {
|
|
@@ -114,22 +111,16 @@ async function S(e, t) {
|
|
|
114
111
|
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 });
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (l && u) return {
|
|
123
|
-
jsUrl: e.z3JsUrl || l,
|
|
124
|
-
wasmUrl: e.z3WasmUrl || u
|
|
125
|
-
};
|
|
126
|
-
let t = s();
|
|
127
|
-
return {
|
|
128
|
-
jsUrl: e.z3JsUrl || l || t.jsUrl,
|
|
129
|
-
wasmUrl: e.z3WasmUrl || u || t.wasmUrl
|
|
114
|
+
function y(e = {}) {
|
|
115
|
+
let t = e.z3JsUrl, n = e.z3WasmUrl;
|
|
116
|
+
if (t && n) return {
|
|
117
|
+
jsUrl: t,
|
|
118
|
+
wasmUrl: n
|
|
130
119
|
};
|
|
120
|
+
let r = [];
|
|
121
|
+
throw t || r.push("z3JsUrl"), n || r.push("z3WasmUrl"), Error(`[WaSHI] Browser Z3 requires explicit ${r.join(" and ")} asset URL(s) because WaSHI does not bundle z3-built.js/wasm.\nInstall z3-solver and configure registerZ3Solver() before solving:\n // Bundler (Vite / webpack):\n registerZ3Solver({\n z3JsUrl: new URL("z3-solver/build/z3-built.js", import.meta.url).href,\n z3WasmUrl: new URL("z3-solver/build/z3-built.wasm", import.meta.url).href,\n });\n // Or CDN / self-hosted static path:\n registerZ3Solver({\n z3JsUrl: "https://cdn.jsdelivr.net/npm/z3-solver/build/z3-built.js",\n z3WasmUrl: "https://cdn.jsdelivr.net/npm/z3-solver/build/z3-built.wasm",\n });\nYou can also pass { z3JsUrl, z3WasmUrl } per m.solve() / m.check() call.`);
|
|
131
122
|
}
|
|
132
|
-
async function
|
|
123
|
+
async function b(e) {
|
|
133
124
|
let t = globalThis;
|
|
134
125
|
if (t.global === void 0 && (t.global = t), typeof t.initZ3 == "function") return t.initZ3;
|
|
135
126
|
if (typeof document < "u") await new Promise((n, r) => {
|
|
@@ -156,30 +147,39 @@ async function w(e) {
|
|
|
156
147
|
c && window.removeEventListener("error", s), r(/* @__PURE__ */ Error(`[WaSHI] Failed to load Z3 runtime script from "${e}".`));
|
|
157
148
|
}, document.head.appendChild(l);
|
|
158
149
|
});
|
|
159
|
-
else if (typeof globalThis.importScripts == "function")
|
|
150
|
+
else if (typeof globalThis.importScripts == "function") try {
|
|
151
|
+
globalThis.importScripts(e);
|
|
152
|
+
} catch (t) {
|
|
153
|
+
if (t instanceof TypeError) {
|
|
154
|
+
let t = await fetch(e);
|
|
155
|
+
if (!t.ok) throw Error(`[WaSHI] Failed to load Z3 runtime script from "${e}": HTTP ${t.status} ${t.statusText}`);
|
|
156
|
+
let n = await t.text();
|
|
157
|
+
(0, eval)(n);
|
|
158
|
+
} else throw t;
|
|
159
|
+
}
|
|
160
160
|
else throw Error("[WaSHI] Cannot load z3-built.js in this environment: neither document nor importScripts is available.");
|
|
161
161
|
if (typeof t.initZ3 != "function") throw Error(`[WaSHI] Script loaded from "${e}" did not define global initZ3.`);
|
|
162
162
|
return t.initZ3;
|
|
163
163
|
}
|
|
164
|
-
async function
|
|
165
|
-
if (
|
|
164
|
+
async function x(e = {}) {
|
|
165
|
+
if (s) return s;
|
|
166
166
|
let t = {
|
|
167
167
|
instance: null,
|
|
168
168
|
error: null,
|
|
169
169
|
errorHandlers: /* @__PURE__ */ new Set(),
|
|
170
170
|
asyncRejects: /* @__PURE__ */ new Set()
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
c = t;
|
|
173
173
|
async function n(e) {
|
|
174
174
|
if (t.error) throw t.error;
|
|
175
175
|
let n = await e();
|
|
176
|
-
if (t.instance = n,
|
|
176
|
+
if (t.instance = n, l.set(n, t), t.error) {
|
|
177
177
|
try {
|
|
178
178
|
n.em?.PThread?.terminateAllThreads();
|
|
179
179
|
} catch {}
|
|
180
180
|
throw t.error;
|
|
181
181
|
}
|
|
182
|
-
return n.em && (
|
|
182
|
+
return n.em && (m(n.em, t), d(n.em, t)), n;
|
|
183
183
|
}
|
|
184
184
|
let r, i = new Promise((e, t) => {
|
|
185
185
|
r = t;
|
|
@@ -192,41 +192,42 @@ async function T(e = {}) {
|
|
|
192
192
|
} catch (e) {
|
|
193
193
|
throw Error(`[WaSHI] Failed to load z3-solver. Ensure the optional dependency is installed (npm install z3-solver) and supported in this environment. Error: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
|
|
194
194
|
}
|
|
195
|
-
|
|
196
|
-
let { jsUrl: r, wasmUrl: i } =
|
|
197
|
-
if (await
|
|
198
|
-
let o = r;
|
|
199
|
-
if (
|
|
200
|
-
let e = new Blob([`importScripts(${JSON.stringify(
|
|
201
|
-
o = URL.createObjectURL(
|
|
195
|
+
_();
|
|
196
|
+
let { jsUrl: r, wasmUrl: i } = y(e);
|
|
197
|
+
if (await v(r, "JavaScript (z3-built.js)"), await v(i, "WebAssembly (z3-built.wasm)"), await b(r), t.error) throw t.error;
|
|
198
|
+
let o = r, s = typeof window < "u" ? window.location.origin : typeof self < "u" && self.location?.origin ? self.location.origin : null;
|
|
199
|
+
if (s && new URL(r, s).origin !== s) {
|
|
200
|
+
let e = new URL(r, s).href, n = new Blob([`importScripts(${JSON.stringify(e)});`], { type: "application/javascript" });
|
|
201
|
+
o = URL.createObjectURL(n), t.bootstrapUrl = o;
|
|
202
202
|
}
|
|
203
|
-
let
|
|
203
|
+
let c = {
|
|
204
204
|
locateFile: (e) => e.endsWith(".wasm") ? i : new URL(e, r).href,
|
|
205
205
|
mainScriptUrlOrBlob: o
|
|
206
206
|
};
|
|
207
207
|
try {
|
|
208
|
-
let e = await import("z3-solver");
|
|
209
|
-
|
|
208
|
+
let e = await import("z3-solver"), t = typeof e.init == "function" ? e.init : e.default?.init;
|
|
209
|
+
if (typeof t != "function") throw Error("Optional \"z3-solver\" module did not export init().");
|
|
210
|
+
return await n(() => t(c));
|
|
210
211
|
} catch (e) {
|
|
211
212
|
throw Error(`[WaSHI] Failed to initialize Z3 in browser: ${e?.message || String(e)}`, { cause: e });
|
|
212
213
|
}
|
|
213
|
-
})(),
|
|
214
|
+
})(), f = Promise.race([o, i]).finally(() => {
|
|
214
215
|
t.errorHandlers.delete(r);
|
|
215
216
|
});
|
|
216
|
-
return
|
|
217
|
+
return f.catch((e) => u(t, e)), s = f, f;
|
|
217
218
|
}
|
|
218
|
-
async function
|
|
219
|
-
let t = e ?
|
|
220
|
-
if (t &&
|
|
221
|
-
let
|
|
222
|
-
typeof
|
|
219
|
+
async function S(e) {
|
|
220
|
+
let t = e ? l.get(e) : c, n = e || t?.instance;
|
|
221
|
+
if (t && u(t, /* @__PURE__ */ Error("[WaSHI] Z3 threads terminated")), n?.em) try {
|
|
222
|
+
let e = await import("z3-solver"), t = typeof e.killThreads == "function" ? e.killThreads : e.default?.killThreads;
|
|
223
|
+
typeof t == "function" ? await t(n.em) : n.em.PThread?.terminateAllThreads();
|
|
223
224
|
} catch {
|
|
224
225
|
n.em.PThread?.terminateAllThreads();
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
//#endregion
|
|
228
229
|
//#region src/modeler/solvers/z3/solver.ts
|
|
229
|
-
function
|
|
230
|
+
function C(e, t, n) {
|
|
230
231
|
Object.defineProperty(e, t, {
|
|
231
232
|
value: n,
|
|
232
233
|
enumerable: !0,
|
|
@@ -234,7 +235,7 @@ function D(e, t, n) {
|
|
|
234
235
|
configurable: !0
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
|
-
var
|
|
238
|
+
var w = /* @__PURE__ */ new Set([
|
|
238
239
|
"timeLimit",
|
|
239
240
|
"presolve",
|
|
240
241
|
"relativeGap",
|
|
@@ -242,7 +243,7 @@ var O = /* @__PURE__ */ new Set([
|
|
|
242
243
|
"threads",
|
|
243
244
|
"verbose",
|
|
244
245
|
"outputFlag"
|
|
245
|
-
]),
|
|
246
|
+
]), T = /* @__PURE__ */ new Set([
|
|
246
247
|
"signal",
|
|
247
248
|
"onProgress",
|
|
248
249
|
"relax",
|
|
@@ -250,7 +251,13 @@ var O = /* @__PURE__ */ new Set([
|
|
|
250
251
|
"z3JsUrl",
|
|
251
252
|
"z3WasmUrl"
|
|
252
253
|
]);
|
|
253
|
-
function
|
|
254
|
+
function E(e, t) {
|
|
255
|
+
if (!e && !t) return;
|
|
256
|
+
let n = {};
|
|
257
|
+
for (let r of [e, t]) if (r) for (let [e, t] of Object.entries(r)) t !== void 0 && C(n, e, t);
|
|
258
|
+
return n;
|
|
259
|
+
}
|
|
260
|
+
function D(e = {}) {
|
|
254
261
|
if (e.relax !== void 0) {
|
|
255
262
|
if (typeof e.relax != "boolean") throw Error(`Invalid Z3 option "relax": expected boolean, got ${typeof e.relax}.`);
|
|
256
263
|
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.");
|
|
@@ -259,15 +266,15 @@ function A(e = {}) {
|
|
|
259
266
|
if (typeof e.useWorker != "boolean") throw Error(`Invalid Z3 option "useWorker": expected boolean, got ${typeof e.useWorker}.`);
|
|
260
267
|
if (e.useWorker === !0) throw Error("Solver \"z3\" does not support option \"useWorker: true\".");
|
|
261
268
|
}
|
|
262
|
-
for (let t of
|
|
263
|
-
for (let [t, n] of Object.entries(e)) if (n !== void 0 && !
|
|
269
|
+
for (let t of w) if (e[t] !== void 0) throw Error(`Solver "z3" does not support option "${t}".`);
|
|
270
|
+
for (let [t, n] of Object.entries(e)) if (n !== void 0 && !T.has(t)) throw Error(`Solver "z3" does not support option "${t}".`);
|
|
264
271
|
if (e.onProgress !== void 0 && typeof e.onProgress != "function") throw Error(`Invalid Z3 option "onProgress": expected function, got ${typeof e.onProgress}.`);
|
|
265
272
|
for (let t of ["z3JsUrl", "z3WasmUrl"]) {
|
|
266
273
|
let n = e[t];
|
|
267
274
|
if (n !== void 0 && (typeof n != "string" || n === "")) throw Error(`Invalid Z3 option "${t}": expected a non-empty string.`);
|
|
268
275
|
}
|
|
269
276
|
}
|
|
270
|
-
var
|
|
277
|
+
var O = class {
|
|
271
278
|
name = "z3";
|
|
272
279
|
options;
|
|
273
280
|
capabilities = {
|
|
@@ -548,7 +555,7 @@ var j = class {
|
|
|
548
555
|
try {
|
|
549
556
|
let r = e.check();
|
|
550
557
|
return await new Promise((e, i) => {
|
|
551
|
-
n =
|
|
558
|
+
n = f(i, t), r.then(e, i);
|
|
552
559
|
});
|
|
553
560
|
} finally {
|
|
554
561
|
n?.();
|
|
@@ -556,15 +563,12 @@ var j = class {
|
|
|
556
563
|
}
|
|
557
564
|
async check(e, t = {}) {
|
|
558
565
|
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.`);
|
|
559
|
-
let n = {
|
|
560
|
-
|
|
561
|
-
...t
|
|
562
|
-
};
|
|
563
|
-
if (A(n), n.signal?.aborted) return {
|
|
566
|
+
let n = E(this.options, t) ?? {};
|
|
567
|
+
if (D(n), n.signal?.aborted) return {
|
|
564
568
|
status: "Unknown",
|
|
565
569
|
values: {}
|
|
566
570
|
};
|
|
567
|
-
let r = await
|
|
571
|
+
let r = await x(n), { Context: i } = r;
|
|
568
572
|
if (n.signal?.aborted) return {
|
|
569
573
|
status: "Unknown",
|
|
570
574
|
values: {},
|
|
@@ -596,12 +600,12 @@ var j = class {
|
|
|
596
600
|
let e = s.model(), t = {};
|
|
597
601
|
for (let n of l) {
|
|
598
602
|
let r = c.getVarAst(n), i = e.eval(r, !0);
|
|
599
|
-
|
|
603
|
+
C(t, n.name, c.parseAstValue(i));
|
|
600
604
|
}
|
|
601
605
|
for (let n of u) {
|
|
602
606
|
let r = c.getBoolVarAst(n), i = e.eval(r, !0)?.toString?.();
|
|
603
607
|
if (i !== "true" && i !== "false") throw Error(`Z3 model evaluation returned non-boolean AST value for BoolVar "${n.name}": "${String(i)}".`);
|
|
604
|
-
|
|
608
|
+
C(t, n.name, i === "true");
|
|
605
609
|
}
|
|
606
610
|
return {
|
|
607
611
|
status: "Sat",
|
|
@@ -629,12 +633,9 @@ var j = class {
|
|
|
629
633
|
};
|
|
630
634
|
}
|
|
631
635
|
async solve(e, t, n) {
|
|
632
|
-
let r = (a(t) ? n : t) ?? {}, i = {
|
|
633
|
-
...this.options,
|
|
634
|
-
...r
|
|
635
|
-
};
|
|
636
|
+
let r = (a(t) ? n : t) ?? {}, i = E(this.options, r) ?? {};
|
|
636
637
|
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.`);
|
|
637
|
-
|
|
638
|
+
D(i);
|
|
638
639
|
let s = o(e.sense), c = e.objective;
|
|
639
640
|
if (c && (typeof c.constant != "number" || !Number.isFinite(c.constant))) throw Error(`Z3: invalid non-finite objective constant (${String(c.constant)}).`);
|
|
640
641
|
if (i.signal?.aborted) return {
|
|
@@ -647,7 +648,7 @@ var j = class {
|
|
|
647
648
|
let l = performance.now(), u = c != null && Array.isArray(c.nonlinearTerms) && c.nonlinearTerms.length > 0;
|
|
648
649
|
if (!(c != null && (u || ("quadTerms" in c ? c.linearTerms.size > 0 || c.quadTerms.size > 0 : "terms" in c && c.terms.size > 0)))) {
|
|
649
650
|
let t = await this.check(e, i), n = {}, r = {};
|
|
650
|
-
for (let [e, i] of Object.entries(t.values)) typeof i == "boolean" ? (
|
|
651
|
+
for (let [e, i] of Object.entries(t.values)) typeof i == "boolean" ? (C(n, e, +!!i), C(r, e, i)) : C(n, e, i);
|
|
651
652
|
let a = t.status === "Sat", o = a ? c?.constant ?? 0 : null, s = t.runTime ?? (performance.now() - l) / 1e3;
|
|
652
653
|
if (i.onProgress && !i.signal?.aborted && i.onProgress({
|
|
653
654
|
elapsedTime: s,
|
|
@@ -673,7 +674,7 @@ var j = class {
|
|
|
673
674
|
...a && Object.keys(r).length > 0 ? { boolValues: r } : {}
|
|
674
675
|
};
|
|
675
676
|
}
|
|
676
|
-
let d = await
|
|
677
|
+
let d = await x(i), { Context: f } = d;
|
|
677
678
|
if (i.signal?.aborted) return {
|
|
678
679
|
status: "Unknown",
|
|
679
680
|
terminationStatus: "Interrupted",
|
|
@@ -684,18 +685,18 @@ var j = class {
|
|
|
684
685
|
};
|
|
685
686
|
let p = performance.now(), m = new f(`opt_${Date.now()}_${Math.random().toString(36).substring(2, 7)}`), h = new m.Optimize(), g = this.createContextTranslator(m), _ = e.variables || [], v = e.boolVars || [], y = e.constraints || [], b = e.logicalConstraints || [];
|
|
686
687
|
this.addVariableBounds(h, _, g);
|
|
687
|
-
let
|
|
688
|
+
let S = [];
|
|
688
689
|
for (let e of y) {
|
|
689
|
-
let t = g.translateConstraint(e,
|
|
690
|
+
let t = g.translateConstraint(e, S);
|
|
690
691
|
h.add(t);
|
|
691
692
|
}
|
|
692
693
|
for (let e of b) {
|
|
693
|
-
let t = "expr" in e ? e.expr : e, n = g.translateBoolExpr(t,
|
|
694
|
+
let t = "expr" in e ? e.expr : e, n = g.translateBoolExpr(t, S);
|
|
694
695
|
h.add(n);
|
|
695
696
|
}
|
|
696
|
-
let
|
|
697
|
-
for (let e of
|
|
698
|
-
let
|
|
697
|
+
let w = "quadTerms" in c ? g.translateQuadExpr(c, S) : g.translateLinExpr(c, S);
|
|
698
|
+
for (let e of S) h.add(e);
|
|
699
|
+
let T = s === "Maximize", O = T ? h.maximize(w) : h.minimize(w);
|
|
699
700
|
if (i.signal?.aborted) return {
|
|
700
701
|
status: "Unknown",
|
|
701
702
|
terminationStatus: "Interrupted",
|
|
@@ -704,22 +705,22 @@ var j = class {
|
|
|
704
705
|
values: {},
|
|
705
706
|
runTime: (performance.now() - p) / 1e3
|
|
706
707
|
};
|
|
707
|
-
let
|
|
708
|
-
if (
|
|
708
|
+
let k = (await this.runZ3CheckWithErrorGuard(h, d)).toString(), A = (performance.now() - p) / 1e3;
|
|
709
|
+
if (k === "sat") {
|
|
709
710
|
let e = h.model(), t = {}, n = {};
|
|
710
711
|
for (let n of _) {
|
|
711
712
|
let r = g.getVarAst(n), i = e.eval(r, !0);
|
|
712
|
-
|
|
713
|
+
C(t, n.name, g.parseAstValue(i));
|
|
713
714
|
}
|
|
714
715
|
for (let r of v) {
|
|
715
716
|
let i = g.getBoolVarAst(r), a = e.eval(i, !0)?.toString?.();
|
|
716
717
|
if (a !== "true" && a !== "false") throw Error(`Z3 model evaluation returned non-boolean AST value for BoolVar "${r.name}": "${String(a)}".`);
|
|
717
718
|
let o = a === "true";
|
|
718
|
-
|
|
719
|
+
C(t, r.name, +!!o), C(n, r.name, o);
|
|
719
720
|
}
|
|
720
|
-
let r = g.parseAstValue(e.eval(
|
|
721
|
-
if (
|
|
722
|
-
let o =
|
|
721
|
+
let r = g.parseAstValue(e.eval(w, !0)), a = T ? "getUpper" : "getLower";
|
|
722
|
+
if (T ? typeof h.getUpper != "function" : typeof h.getLower != "function") throw Error(`Z3 Optimize instance is missing "${a}" required to verify objective boundedness.`);
|
|
723
|
+
let o = T ? h.getUpper(O) : h.getLower(O);
|
|
723
724
|
if (o == null || typeof o.toString != "function") throw Error(`Z3 Optimize "${a}" returned an invalid bound AST.`);
|
|
724
725
|
let s = o.toString(), c = !1, l = !1;
|
|
725
726
|
s.includes("oo") ? c = !0 : s.includes("epsilon") && (l = !0);
|
|
@@ -760,39 +761,41 @@ var j = class {
|
|
|
760
761
|
...Object.keys(n).length > 0 ? { boolValues: n } : {}
|
|
761
762
|
});
|
|
762
763
|
}
|
|
763
|
-
return
|
|
764
|
-
elapsedTime:
|
|
765
|
-
elapsedSeconds:
|
|
764
|
+
return k === "unsat" ? (i.onProgress && i.onProgress({
|
|
765
|
+
elapsedTime: A,
|
|
766
|
+
elapsedSeconds: A
|
|
766
767
|
}), {
|
|
767
768
|
status: "Infeasible",
|
|
768
769
|
terminationStatus: "Infeasible",
|
|
769
770
|
hasPrimalSolution: !1,
|
|
770
771
|
objectiveValue: null,
|
|
771
772
|
values: {},
|
|
772
|
-
runTime:
|
|
773
|
-
}) :
|
|
774
|
-
elapsedTime:
|
|
775
|
-
elapsedSeconds:
|
|
773
|
+
runTime: A
|
|
774
|
+
}) : k === "unknown" ? (i.onProgress && i.onProgress({
|
|
775
|
+
elapsedTime: A,
|
|
776
|
+
elapsedSeconds: A
|
|
776
777
|
}), {
|
|
777
778
|
status: "Unknown",
|
|
778
779
|
terminationStatus: "Unknown",
|
|
779
780
|
hasPrimalSolution: !1,
|
|
780
781
|
objectiveValue: null,
|
|
781
782
|
values: {},
|
|
782
|
-
runTime:
|
|
783
|
+
runTime: A
|
|
783
784
|
}) : {
|
|
784
785
|
status: "Error",
|
|
785
786
|
terminationStatus: "Error",
|
|
786
787
|
hasPrimalSolution: !1,
|
|
787
788
|
objectiveValue: null,
|
|
788
789
|
values: {},
|
|
789
|
-
runTime:
|
|
790
|
+
runTime: A
|
|
790
791
|
};
|
|
791
792
|
}
|
|
792
|
-
};
|
|
793
|
-
function
|
|
794
|
-
|
|
793
|
+
}, k;
|
|
794
|
+
function A(e) {
|
|
795
|
+
e !== void 0 && D(e);
|
|
796
|
+
let t = e ? E(void 0, e) : void 0;
|
|
797
|
+
(k?.z3JsUrl !== t?.z3JsUrl || k?.z3WasmUrl !== t?.z3WasmUrl) && h(), k = t, i("z3", (e) => new O(E(k, e)));
|
|
795
798
|
}
|
|
796
|
-
|
|
799
|
+
A();
|
|
797
800
|
//#endregion
|
|
798
|
-
export {
|
|
801
|
+
export { O as Z3Solver, b as ensureInitZ3Loaded, g as isZ3Loaded, S as killZ3Threads, x as loadZ3, p as notifyZ3WorkerError, v as probeAssetUrl, f as registerZ3ErrorHandler, A as registerZ3Solver, h as resetZ3LoaderCache, y as resolveZ3AssetUrls, _ as validateZ3BrowserEnvironment };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WaSHI: Pure algebraic core exports without side-effect solver registration.
|
|
3
|
+
* Used by both browser/default (`dist/washi.js`) and Node.js (`dist/washi.node.js`) entries.
|
|
4
|
+
*/
|
|
5
|
+
export { Model, type ModelOptions, type BoundsOptions, type BinaryOptions, type IndicatorOptions, type ConstraintItem, type KeyCollection, type LogicalConstraint, deriveBigMForLe, deriveBigMForGe, validateUserBigM, buildIndicatorLinearization, linearizeModelForMip, type LinearizationResult, maximize, minimize, type ObjectiveExpr, type ObjectiveSpec, Var, type VarOptions, LinExpr, QuadExpr, type Expr, type NonlinearAtom, type NonlinearTerm, type DotTerm, type DotVarContainer, type DotCoeffContainer, type SumTerm, type SumContainer, type ExtremumTerm, type ExtremumArg, type QuadTerm, sum, dot, abs, max, min, at, Constraint, BoolVar, BoolExpr, BoolOp, GlobalConstraint, type GlobalConstraintSpec, type DiscreteExprOperand, type DisjointTask, type CumulativeTask, type LogicElement, type LogicInput, and, or, not, implies, xor, distinct, disjoint, cumulative, allowed, parseExpr, parseConstraint, expr, type ParsedExpr, type ExprResolver, type ExprContainerLeaf, type ExprRecordContainer, type ExprMapperFn, type ExprInterpolation, generateLpString, buildLpSymbolMaps, isLpExportResult, sanitizeIdentifier, type LpModelData, type LpSymbolMaps, type LpExportResult, type VerifyOptions, type ViolationType, type VerificationViolation, type VerificationSummary, type VerificationReport, } from "./modeler/core.js";
|
|
6
|
+
export { normalizeSense, type VarType, type OptimizationSense, type ComparisonSense, type SolverStatus, type TerminationStatus, type SolveProgressEvent, type SolveOptions, type SolverSolution, type CheckResult, type ColumnDefinition, } from "./modeler/types.js";
|
|
7
|
+
export { solveColumnGeneration, solveBenders, type ColumnProposal, type PricingContext, type ColumnGenerationIterationInfo, type ColumnGenerationOptions, type ColumnGenerationResult, type BendersCut, type BendersSubproblemContext, type BendersSubproblemResult, type BendersIterationInfo, type BendersOptions, type BendersResult, } from "./decomposition/index.js";
|
|
8
|
+
export { type Solver, type SolverOptions, type SolverResult, type SolverCheckResult, type SolverCapabilities, type SolveModelData, type CheckModelData, type LogicalConstraintItem, } from "./modeler/solvers/types.js";
|
|
9
|
+
export { MockSolver, type MockSolverOptions } from "./modeler/solvers/mock.js";
|
|
10
|
+
export { registerSolver, getSolver, setDefaultSolver, listAvailableSolvers, } from "./modeler/solvers/registry.js";
|
|
11
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,KAAK,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,QAAQ,EACR,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,GAAG,EACH,KAAK,UAAU,EACf,OAAO,EACP,QAAQ,EACR,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,EAAE,EACF,UAAU,EACV,OAAO,EACP,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,GAAG,EACH,EAAE,EACF,GAAG,EACH,OAAO,EACP,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,EACP,SAAS,EACT,eAAe,EACf,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,cAAc,EACd,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE/E,OAAO,EACL,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,+BAA+B,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* Domain-pure algebraic modeling with WebAssembly (HiGHS, Pumpkin, Z3, GLPK) and pluggable solvers.
|
|
5
5
|
* Supports LP (Linear Programming), MIP (Mixed-Integer Programming), QP (Quadratic Programming), CP (Constraint Programming), and SMT.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { type Solver, type SolverOptions, type SolverResult, type SolverCheckResult, type SolverCapabilities, type SolveModelData, type CheckModelData, type LogicalConstraintItem, MockSolver, type MockSolverOptions, registerSolver, getSolver, setDefaultSolver, listAvailableSolvers, } from "./modeler/solvers/index.js";
|
|
7
|
+
export * from "./core.js";
|
|
8
|
+
import "./modeler/solvers/highs.js";
|
|
9
|
+
import "./modeler/solvers/pumpkin.js";
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,WAAW,CAAC;AAG1B,OAAO,4BAA4B,CAAC;AACpC,OAAO,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { Model, type ModelOptions, type BoundsOptions, type BinaryOptions, type IndicatorOptions, type ConstraintItem, type KeyCollection, type LogicalConstraint, } from "./model.js";
|
|
2
|
+
export { deriveBigMForLe, deriveBigMForGe, validateUserBigM, buildIndicatorLinearization } from "./big-m.js";
|
|
3
|
+
export { linearizeModelForMip, type LinearizationResult } from "./linearizer.js";
|
|
4
|
+
export { maximize, minimize, type ObjectiveExpr, type ObjectiveSpec, } from "./objective.js";
|
|
5
|
+
export { Var, type VarOptions } from "./variable.js";
|
|
6
|
+
export { LinExpr, type Expr, type NonlinearAtom, type NonlinearTerm, type DotTerm, type DotVarContainer, type DotCoeffContainer, type SumTerm, type SumContainer, type ExtremumTerm, type ExtremumArg, sum, dot, abs, max, min, at, } from "./expression.js";
|
|
7
|
+
export { QuadExpr, type QuadTerm } from "./quad-expr.js";
|
|
8
|
+
export { Constraint } from "./constraint.js";
|
|
9
|
+
export { BoolVar, BoolExpr, BoolOp, GlobalConstraint, type GlobalConstraintSpec, type DiscreteExprOperand, type DisjointTask, type CumulativeTask, type LogicElement, type LogicInput, and, or, not, implies, xor, distinct, disjoint, cumulative, allowed, } from "./boolean-expr.js";
|
|
10
|
+
export { parseExpr, parseConstraint, expr, type ParsedExpr, type ExprResolver, type ExprContainerLeaf, type ExprRecordContainer, type ExprMapperFn, type ExprInterpolation, } from "./parser.js";
|
|
11
|
+
export { generateLpString, buildLpSymbolMaps, isLpExportResult, sanitizeIdentifier, type LpModelData, type LpSymbolMaps, type LpExportResult, } from "./lp-writer.js";
|
|
12
|
+
export { type VerifyOptions, type ViolationType, type VerificationViolation, type VerificationSummary, type VerificationReport, } from "./solution-validator.js";
|
|
13
|
+
export type { VarType, OptimizationSense, ComparisonSense, SolverStatus, TerminationStatus, SolveProgressEvent, SolveOptions, SolverSolution, CheckResult, ColumnDefinition, } from "./types.js";
|
|
14
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/modeler/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,OAAO,EACP,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,EAAE,GACH,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,GAAG,EACH,EAAE,EACF,GAAG,EACH,OAAO,EACP,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,GACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,SAAS,EACT,eAAe,EACf,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { deriveBigMForLe, deriveBigMForGe, validateUserBigM, buildIndicatorLinearization } from "./big-m.js";
|
|
3
|
-
export { linearizeModelForMip, type LinearizationResult } from "./linearizer.js";
|
|
4
|
-
export { maximize, minimize, type ObjectiveExpr, type ObjectiveSpec, } from "./objective.js";
|
|
5
|
-
export { Var, type VarOptions } from "./variable.js";
|
|
6
|
-
export { LinExpr, type Expr, type NonlinearAtom, type NonlinearTerm, type DotTerm, type DotVarContainer, type DotCoeffContainer, type SumTerm, type SumContainer, type ExtremumTerm, type ExtremumArg, sum, dot, abs, max, min, at, } from "./expression.js";
|
|
7
|
-
export { QuadExpr, type QuadTerm } from "./quad-expr.js";
|
|
8
|
-
export { Constraint } from "./constraint.js";
|
|
9
|
-
export { BoolVar, BoolExpr, BoolOp, GlobalConstraint, type GlobalConstraintSpec, type DiscreteExprOperand, type DisjointTask, type CumulativeTask, type LogicElement, type LogicInput, and, or, not, implies, xor, distinct, disjoint, cumulative, allowed, } from "./boolean-expr.js";
|
|
10
|
-
export { parseExpr, parseConstraint, expr, type ParsedExpr, type ExprResolver, type ExprContainerLeaf, type ExprRecordContainer, type ExprMapperFn, type ExprInterpolation, } from "./parser.js";
|
|
11
|
-
export { generateLpString, buildLpSymbolMaps, isLpExportResult, sanitizeIdentifier, type LpModelData, type LpSymbolMaps, type LpExportResult, } from "./lp-writer.js";
|
|
12
|
-
export { type VerifyOptions, type ViolationType, type VerificationViolation, type VerificationSummary, type VerificationReport, } from "./solution-validator.js";
|
|
13
|
-
export type { VarType, OptimizationSense, ComparisonSense, SolverStatus, TerminationStatus, SolveProgressEvent, SolveOptions, SolverSolution, CheckResult, ColumnDefinition, } from "./types.js";
|
|
1
|
+
export * from "./core.js";
|
|
14
2
|
export * from "./solvers/index.js";
|
|
15
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modeler/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modeler/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAG1B,cAAc,oBAAoB,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { QuadExpr } from "./quad-expr.js";
|
|
|
6
6
|
import { Constraint } from "./constraint.js";
|
|
7
7
|
import { BoolVar, BoolExpr } from "./boolean-expr.js";
|
|
8
8
|
import { type ParsedExpr } from "./parser.js";
|
|
9
|
-
import {
|
|
9
|
+
import type { Solver } from "./solvers/types.js";
|
|
10
10
|
import { type VerifyOptions, type VerificationReport } from "./solution-validator.js";
|
|
11
11
|
import { type BendersOptions, type BendersResult, type ColumnGenerationOptions, type ColumnGenerationResult } from "../decomposition/index.js";
|
|
12
12
|
/**
|