@ohtaman/washi 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +100 -107
- package/README.md +98 -105
- package/README.zh-CN.md +101 -108
- package/dist/browser/highs-worker.js +21 -3
- package/dist/browser/loader-CtaDHef_.js +273 -0
- package/dist/browser/solvers/glpk.js +433 -286
- package/dist/browser/solvers/glpk.min.js +1 -1
- package/dist/browser/solvers/z3.js +1002 -981
- package/dist/browser/solvers/z3.min.js +2 -2
- package/dist/browser/washi.js +2129 -676
- package/dist/browser/washi.min.js +4 -4
- package/dist/lib/highs-worker.js +21 -3
- package/dist/lib/loader-DmNC_UNk.js +279 -0
- package/dist/lib/registry-BEfvpZW3.js +951 -0
- package/dist/lib/solvers/glpk.js +201 -90
- package/dist/lib/solvers/z3.js +399 -259
- package/dist/lib/washi.js +1627 -988
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modeler/big-m.d.ts +75 -0
- package/dist/types/modeler/big-m.d.ts.map +1 -0
- package/dist/types/modeler/boolean-expr.d.ts +103 -14
- package/dist/types/modeler/boolean-expr.d.ts.map +1 -1
- package/dist/types/modeler/constraint.d.ts +36 -9
- package/dist/types/modeler/constraint.d.ts.map +1 -1
- package/dist/types/modeler/expression.d.ts +113 -28
- package/dist/types/modeler/expression.d.ts.map +1 -1
- package/dist/types/modeler/index.d.ts +10 -6
- package/dist/types/modeler/index.d.ts.map +1 -1
- package/dist/types/modeler/lp-writer.d.ts +27 -2
- package/dist/types/modeler/lp-writer.d.ts.map +1 -1
- package/dist/types/modeler/model.d.ts +478 -131
- package/dist/types/modeler/model.d.ts.map +1 -1
- package/dist/types/modeler/objective.d.ts +59 -0
- package/dist/types/modeler/objective.d.ts.map +1 -0
- package/dist/types/modeler/parser.d.ts +34 -10
- package/dist/types/modeler/parser.d.ts.map +1 -1
- package/dist/types/modeler/quad-expr.d.ts +26 -7
- package/dist/types/modeler/quad-expr.d.ts.map +1 -1
- package/dist/types/modeler/solution-validator.d.ts +93 -0
- package/dist/types/modeler/solution-validator.d.ts.map +1 -0
- package/dist/types/modeler/solvers/glpk/solver.d.ts +26 -2
- package/dist/types/modeler/solvers/glpk/solver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/loader.d.ts +36 -11
- package/dist/types/modeler/solvers/highs/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/solver.d.ts +11 -4
- package/dist/types/modeler/solvers/highs/solver.d.ts.map +1 -1
- package/dist/types/modeler/solvers/highs/worker-client.d.ts.map +1 -1
- package/dist/types/modeler/solvers/mock.d.ts +14 -5
- package/dist/types/modeler/solvers/mock.d.ts.map +1 -1
- package/dist/types/modeler/solvers/types.d.ts +71 -11
- package/dist/types/modeler/solvers/types.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/loader.d.ts +2 -3
- package/dist/types/modeler/solvers/z3/loader.d.ts.map +1 -1
- package/dist/types/modeler/solvers/z3/solver.d.ts +15 -5
- package/dist/types/modeler/solvers/z3/solver.d.ts.map +1 -1
- package/dist/types/modeler/types.d.ts +59 -1
- package/dist/types/modeler/types.d.ts.map +1 -1
- package/dist/types/modeler/validation.d.ts +56 -0
- package/dist/types/modeler/validation.d.ts.map +1 -0
- package/dist/types/modeler/variable.d.ts +48 -14
- package/dist/types/modeler/variable.d.ts.map +1 -1
- package/docs/examples/diet-sensitivity.md +90 -0
- package/docs/examples/ecommerce-coupons.md +106 -0
- package/docs/examples/index.md +53 -0
- package/docs/examples/knapsack.md +60 -0
- package/docs/examples/portfolio-qp.md +83 -0
- package/docs/examples/production.md +51 -0
- package/docs/examples/shift-scheduling.md +175 -0
- package/docs/examples/smt-security.md +74 -0
- package/docs/examples/transportation.md +90 -0
- package/docs/examples/unsat-core.md +64 -0
- package/docs/getting-started/ai-agents.md +267 -0
- package/docs/getting-started/cross-origin.md +87 -0
- package/docs/getting-started/index.md +116 -0
- package/docs/getting-started/runtimes.md +227 -0
- package/docs/guide/constraints.md +177 -0
- package/docs/guide/expressions.md +204 -0
- package/docs/guide/objectives.md +170 -0
- package/docs/guide/unsat-core.md +147 -0
- package/docs/guide/variables.md +188 -0
- package/docs/ja/getting-started/ai-agents.md +266 -0
- package/docs/solvers/custom-solver.md +525 -0
- package/docs/solvers/glpk.md +66 -0
- package/docs/solvers/highs.md +93 -0
- package/docs/solvers/index.md +42 -0
- package/docs/solvers/z3.md +78 -0
- package/docs/zh/getting-started/ai-agents.md +266 -0
- package/llms-full.txt +3249 -0
- package/llms.txt +197 -0
- package/package.json +18 -5
- package/skills/washi/SKILL.md +197 -0
- package/dist/browser/loader-CVt4CloI.js +0 -58
- package/dist/lib/async-mutex-Duo4jwzn.js +0 -195
- package/dist/lib/constraint-BRuB3ooC.js +0 -90
- package/dist/lib/loader-Dti0v9yC.js +0 -50
- package/dist/lib/registry-DksqCSjI.js +0 -32
package/dist/types/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Domain-pure algebraic modeling with WebAssembly (HiGHS, Z3, GLPK) and pluggable solvers.
|
|
5
5
|
* Supports LP (Linear Programming), MIP (Mixed-Integer Programming), QP (Quadratic Programming), and SMT.
|
|
6
6
|
*/
|
|
7
|
-
export { Model, type ModelOptions, type BoundsOptions, Var, type VarOptions, LinExpr, QuadExpr, type Expr, type QuadTerm, sum, dot, Constraint, BoolVar, BoolExpr, BoolOp, and, or, not, implies, xor, parseExpr, parseConstraint, expr,
|
|
8
|
-
export { normalizeSense, type VarType, type OptimizationSense, type ComparisonSense, type SolverStatus, type SolveOptions, type SolverSolution, } from "./modeler/types.js";
|
|
9
|
-
export { type Solver, type SolverOptions, type SolverResult, type SolverCheckResult, type SolverCapabilities, HighsSolver, HiGHS, MockSolver, registerSolver, getSolver, setDefaultSolver, listAvailableSolvers, } from "./modeler/solvers/index.js";
|
|
10
|
-
export { getHighs, solveLpWithHighs, setHighsWasmUrl, getHighsWasmUrl,
|
|
7
|
+
export { Model, type ModelOptions, type BoundsOptions, type BinaryOptions, type IndicatorOptions, type ConstraintItem, type KeyCollection, deriveBigMForLe, deriveBigMForGe, validateUserBigM, buildIndicatorLinearization, validateModelIntegrity, maximize, minimize, type ObjectiveExpr, type ObjectiveSpec, Var, type VarOptions, LinExpr, QuadExpr, type Expr, type DotTerm, type DotVarContainer, type DotCoeffContainer, type QuadTerm, sum, dot, Constraint, BoolVar, BoolExpr, BoolOp, type LogicElement, type LogicInput, and, or, not, implies, xor, parseExpr, parseConstraint, expr, type ParsedExpr, type ExprResolver, generateLpString, buildLpSymbolMaps, isLpExportResult, sanitizeIdentifier, type LpModelData, type LpSymbolMaps, type LpExportResult, validateModelSolution, type SolutionValidationOptions, type ViolationType, type SolutionViolation, type SolutionValidationSummary, type SolutionValidationReport, } from "./modeler/index.js";
|
|
8
|
+
export { normalizeSense, type VarType, type OptimizationSense, type ComparisonSense, type SolverStatus, type TerminationStatus, type SolveProgressEvent, type SolveOptions, type SolverSolution, type CheckResult, } from "./modeler/types.js";
|
|
9
|
+
export { type Solver, type SolverOptions, type SolverResult, type SolverCheckResult, type SolverCapabilities, type SolveModelData, type CheckModelData, type LogicalConstraintItem, HighsSolver, HiGHS, MockSolver, type MockSolverOptions, registerSolver, getSolver, setDefaultSolver, listAvailableSolvers, } from "./modeler/solvers/index.js";
|
|
10
|
+
export { getHighs, solveLpWithHighs, setHighsWasmUrl, getHighsWasmUrl, } from "./modeler/solvers/highs/index.js";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,GAAG,EACH,KAAK,UAAU,EACf,OAAO,EACP,QAAQ,EACR,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,GAAG,EACH,GAAG,EACH,UAAU,EACV,OAAO,EACP,QAAQ,EACR,MAAM,EACN,GAAG,EACH,EAAE,EACF,GAAG,EACH,OAAO,EACP,GAAG,EACH,SAAS,EACT,eAAe,EACf,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,EACL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,sBAAsB,EACtB,QAAQ,EACR,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,GAAG,EACH,KAAK,UAAU,EACf,OAAO,EACP,QAAQ,EACR,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,GAAG,EACH,GAAG,EACH,UAAU,EACV,OAAO,EACP,QAAQ,EACR,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,GAAG,EACH,EAAE,EACF,GAAG,EACH,OAAO,EACP,GAAG,EACH,SAAS,EACT,eAAe,EACf,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,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,GACjB,MAAM,oBAAoB,CAAC;AAI5B,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,EAC1B,WAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LinExpr } from "./expression.js";
|
|
2
|
+
import { Var } from "./variable.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for indicator constraints with Big-M linearization.
|
|
5
|
+
*/
|
|
6
|
+
export interface IndicatorOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The binary variable value (0 or 1) that activates the constraint.
|
|
9
|
+
* Defaults to 1 (i.e. constraint holds when binVar == 1).
|
|
10
|
+
*/
|
|
11
|
+
activeValue?: 0 | 1;
|
|
12
|
+
/**
|
|
13
|
+
* Explicit Big-M scalar value override.
|
|
14
|
+
* If omitted, WaSHI automatically derives a safe, tight Big-M from the
|
|
15
|
+
* linear expression terms and finite variable bounds.
|
|
16
|
+
* If provided, it must be a finite positive number.
|
|
17
|
+
*
|
|
18
|
+
* Note: The user is responsible for ensuring that a custom M is sufficiently
|
|
19
|
+
* large to avoid truncating valid solutions while small enough to maintain
|
|
20
|
+
* numerical stability.
|
|
21
|
+
*/
|
|
22
|
+
M?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Base name for generated linear constraints.
|
|
25
|
+
*/
|
|
26
|
+
name?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Validates a user-supplied Big-M override value.
|
|
30
|
+
* Must be a finite positive number (> 0).
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateUserBigM(M: number, constraintName: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Derives a sufficient, tight Big-M value for a "<=" linear inequality:
|
|
35
|
+
* lhs <= rhs (or terms <= effectiveRhs)
|
|
36
|
+
*
|
|
37
|
+
* When the indicator variable is inactive, the relaxed constraint becomes:
|
|
38
|
+
* terms <= effectiveRhs + M
|
|
39
|
+
*
|
|
40
|
+
* For the constraint to be trivially satisfied over all domain values x in [lb, ub]:
|
|
41
|
+
* effectiveRhs + M >= max(terms) <=> M >= max(terms) - effectiveRhs
|
|
42
|
+
*
|
|
43
|
+
* Therefore, the safe tight non-negative Big-M is:
|
|
44
|
+
* M = max(0, max(terms) - effectiveRhs)
|
|
45
|
+
*
|
|
46
|
+
* Fails with an actionable error if any variable lacks a required finite bound
|
|
47
|
+
* or if finite arithmetic overflows.
|
|
48
|
+
*/
|
|
49
|
+
export declare function deriveBigMForLe(lhs: LinExpr, rhs: number, constraintName: string): number;
|
|
50
|
+
/**
|
|
51
|
+
* Derives a sufficient, tight Big-M value for a ">=" linear inequality:
|
|
52
|
+
* lhs >= rhs (or terms >= effectiveRhs)
|
|
53
|
+
*
|
|
54
|
+
* When the indicator variable is inactive, the relaxed constraint becomes:
|
|
55
|
+
* terms >= effectiveRhs - M
|
|
56
|
+
*
|
|
57
|
+
* For the constraint to be trivially satisfied over all domain values x in [lb, ub]:
|
|
58
|
+
* effectiveRhs - M <= min(terms) <=> M >= effectiveRhs - min(terms)
|
|
59
|
+
*
|
|
60
|
+
* Therefore, the safe tight non-negative Big-M is:
|
|
61
|
+
* M = max(0, effectiveRhs - min(terms))
|
|
62
|
+
*
|
|
63
|
+
* Fails with an actionable error if any variable lacks a required finite bound
|
|
64
|
+
* or if finite arithmetic overflows.
|
|
65
|
+
*/
|
|
66
|
+
export declare function deriveBigMForGe(lhs: LinExpr, rhs: number, constraintName: string): number;
|
|
67
|
+
/**
|
|
68
|
+
* Constructs the linearized LHS and RHS for a single directional indicator constraint
|
|
69
|
+
* and verifies that all resulting coefficients and shifted RHS values remain finite.
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildIndicatorLinearization(binVar: Var, lhs: LinExpr, sense: "<=" | ">=", rhs: number, activeVal: 0 | 1, M: number, constraintName: string): {
|
|
72
|
+
lhs: LinExpr;
|
|
73
|
+
rhs: number;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=big-m.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"big-m.d.ts","sourceRoot":"","sources":["../../../src/modeler/big-m.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEpB;;;;;;;;;OASG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAMxE;AA6CD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GACrB,MAAM,CAyDR;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GACrB,MAAM,CAyDR;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,GAAG,EACX,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,GAAG,IAAI,EAClB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,CAAC,GAAG,CAAC,EAChB,CAAC,EAAE,MAAM,EACT,cAAc,EAAE,MAAM,GACrB;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAsF/B"}
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Constraint } from "./constraint.js";
|
|
2
|
+
import type { LinExpr } from "./expression.js";
|
|
3
|
+
import type { QuadExpr } from "./quad-expr.js";
|
|
2
4
|
export type LogicalOpType = "and" | "or" | "not" | "implies" | "xor" | "eq";
|
|
3
5
|
export type LogicElement = BoolExpr | Constraint;
|
|
6
|
+
export type LogicInput = LogicElement | LinExpr | QuadExpr;
|
|
4
7
|
/**
|
|
5
|
-
* Base abstract class for Boolean expressions
|
|
8
|
+
* Base abstract class for propositional / SMT Boolean expressions (`BoolVar` and `BoolOp`).
|
|
9
|
+
*
|
|
10
|
+
* **Solver capability note**: Registering `BoolExpr` constraints on a `Model` requires an
|
|
11
|
+
* SMT-capable solver such as Z3 (`{ solver: "z3" }`); LP/MIP solvers (HiGHS, GLPK) throw an Error.
|
|
6
12
|
*/
|
|
7
13
|
export declare abstract class BoolExpr {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
/** Logical conjunction (`this AND other`). Requires a `BoolVar`, `BoolExpr`, or comparison `Constraint`. */
|
|
15
|
+
and(other: LogicInput): BoolOp;
|
|
16
|
+
/** Logical disjunction (`this OR other`). Requires a `BoolVar`, `BoolExpr`, or comparison `Constraint`. */
|
|
17
|
+
or(other: LogicInput): BoolOp;
|
|
18
|
+
/** Logical implication (`this => consequent`). Requires a `BoolVar`, `BoolExpr`, or comparison `Constraint`. */
|
|
19
|
+
implies(consequent: LogicInput): BoolOp;
|
|
20
|
+
/** Logical exclusive-or (`this XOR other`). Requires a `BoolVar`, `BoolExpr`, or comparison `Constraint`. */
|
|
21
|
+
xor(other: LogicInput): BoolOp;
|
|
22
|
+
/** Logical negation (`NOT this`). */
|
|
12
23
|
not(): BoolOp;
|
|
13
24
|
}
|
|
14
25
|
/**
|
|
15
|
-
* Boolean variable (
|
|
26
|
+
* Propositional Boolean variable (`true` / `false`) for SAT / SMT modeling.
|
|
27
|
+
* Created via `m.bool(...)` and solved/checked with an SMT-capable solver (`{ solver: "z3" }`).
|
|
28
|
+
* For 0-1 arithmetic variables in LP/MIP, use `m.binary(...)` instead.
|
|
16
29
|
*/
|
|
17
30
|
export declare class BoolVar extends BoolExpr {
|
|
18
31
|
readonly id: number;
|
|
@@ -22,17 +35,93 @@ export declare class BoolVar extends BoolExpr {
|
|
|
22
35
|
toString(): string;
|
|
23
36
|
}
|
|
24
37
|
/**
|
|
25
|
-
* Compound Boolean operator AST node (
|
|
38
|
+
* Compound Boolean operator AST node (`and`, `or`, `not`, `implies`, `xor`).
|
|
26
39
|
*/
|
|
27
40
|
export declare class BoolOp extends BoolExpr {
|
|
28
41
|
readonly op: LogicalOpType;
|
|
29
42
|
readonly children: LogicElement[];
|
|
30
|
-
constructor(op: LogicalOpType, children:
|
|
43
|
+
constructor(op: LogicalOpType, children: LogicInput[]);
|
|
31
44
|
toString(): string;
|
|
32
45
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Logical conjunction (`e1 AND e2 AND ...`) over `BoolVar`, `BoolExpr`, or linear comparison `Constraint`s.
|
|
48
|
+
*
|
|
49
|
+
* **Solver capability note**: Logical constraints require an SMT-capable solver such as Z3
|
|
50
|
+
* (`new Model("...", { solver: "z3" })` after `import "@ohtaman/washi/solvers/z3"`).
|
|
51
|
+
* LP/MIP solvers (HiGHS, GLPK) throw an Error if logical constraints are present.
|
|
52
|
+
* Passing an unconstrained arithmetic expression (`LinExpr` / `QuadExpr`) throws an Error.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const m = new Model("AndExample", { solver: "z3" });
|
|
57
|
+
* const a = m.bool("a");
|
|
58
|
+
* const x = m.integer("x", { lb: 0, ub: 20 });
|
|
59
|
+
* m.constraint(and(a, expr`${x} >= 10`), "both_active");
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function and(...exprs: LogicInput[]): BoolOp;
|
|
63
|
+
/**
|
|
64
|
+
* Logical disjunction (`e1 OR e2 OR ...`) over `BoolVar`, `BoolExpr`, or linear comparison `Constraint`s.
|
|
65
|
+
*
|
|
66
|
+
* **Solver capability note**: Logical constraints require an SMT-capable solver such as Z3
|
|
67
|
+
* (`new Model("...", { solver: "z3" })` after `import "@ohtaman/washi/solvers/z3"`).
|
|
68
|
+
* LP/MIP solvers (HiGHS, GLPK) throw an Error if logical constraints are present.
|
|
69
|
+
* Passing an unconstrained arithmetic expression (`LinExpr` / `QuadExpr`) throws an Error.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const m = new Model("OrExample", { solver: "z3" });
|
|
74
|
+
* const x = m.integer("x", { lb: 0, ub: 20 });
|
|
75
|
+
* m.constraint(or(expr`${x} <= 5`, expr`${x} >= 15`), "disjoint_range");
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function or(...exprs: LogicInput[]): BoolOp;
|
|
79
|
+
/**
|
|
80
|
+
* Logical negation (`NOT e`) of a `BoolVar`, `BoolExpr`, or linear comparison `Constraint`.
|
|
81
|
+
*
|
|
82
|
+
* **Solver capability note**: Logical constraints require an SMT-capable solver such as Z3
|
|
83
|
+
* (`new Model("...", { solver: "z3" })` after `import "@ohtaman/washi/solvers/z3"`).
|
|
84
|
+
* LP/MIP solvers (HiGHS, GLPK) throw an Error if logical constraints are present.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const m = new Model("NotExample", { solver: "z3" });
|
|
89
|
+
* const blocked = m.bool("blocked");
|
|
90
|
+
* m.constraint(not(blocked), "must_not_be_blocked");
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function not(expr: LogicInput): BoolOp;
|
|
94
|
+
/**
|
|
95
|
+
* Logical implication (`antecedent => consequent`) over `BoolVar`, `BoolExpr`, or linear comparison `Constraint`s.
|
|
96
|
+
*
|
|
97
|
+
* **Solver capability note**: Logical constraints require an SMT-capable solver such as Z3
|
|
98
|
+
* (`new Model("...", { solver: "z3" })` after `import "@ohtaman/washi/solvers/z3"`).
|
|
99
|
+
* LP/MIP solvers (HiGHS, GLPK) throw an Error if logical constraints are present
|
|
100
|
+
* (for LP/MIP 0-1 Big-M indicator constraints, use `m.indicator(binVar, constraint)` instead).
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const m = new Model("ImpliesExample", { solver: "z3" });
|
|
105
|
+
* const vip = m.bool("vip");
|
|
106
|
+
* const discount = m.integer("discount", { lb: 0, ub: 50 });
|
|
107
|
+
* m.constraint(implies(vip, expr`${discount} >= 20`), "vip_min_discount");
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export declare function implies(antecedent: LogicInput, consequent: LogicInput): BoolOp;
|
|
111
|
+
/**
|
|
112
|
+
* Logical exclusive-or (`e1 XOR e2 ...`) over `BoolVar`, `BoolExpr`, or linear comparison `Constraint`s.
|
|
113
|
+
*
|
|
114
|
+
* **Solver capability note**: Logical constraints require an SMT-capable solver such as Z3
|
|
115
|
+
* (`new Model("...", { solver: "z3" })` after `import "@ohtaman/washi/solvers/z3"`).
|
|
116
|
+
* LP/MIP solvers (HiGHS, GLPK) throw an Error if logical constraints are present.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* const m = new Model("XorExample", { solver: "z3" });
|
|
121
|
+
* const shiftA = m.bool("shiftA");
|
|
122
|
+
* const shiftB = m.bool("shiftB");
|
|
123
|
+
* m.constraint(xor(shiftA, shiftB), "exactly_one_shift");
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare function xor(...exprs: LogicInput[]): BoolOp;
|
|
38
127
|
//# sourceMappingURL=boolean-expr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean-expr.d.ts","sourceRoot":"","sources":["../../../src/modeler/boolean-expr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"boolean-expr.d.ts","sourceRoot":"","sources":["../../../src/modeler/boolean-expr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC;AAE5E,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAC;AAqB3D;;;;;GAKG;AACH,8BAAsB,QAAQ;IAC5B,4GAA4G;IACrG,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEpC;IAED,2GAA2G;IACpG,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEnC;IAED,gHAAgH;IACzG,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAE7C;IAED,6GAA6G;IACtG,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEpC;IAED,qCAAqC;IAC9B,GAAG,IAAI,MAAM,CAEnB;CACF;AAED;;;;GAIG;AACH,qBAAa,OAAQ,SAAQ,QAAQ;IACnC,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,GAAG,IAAI,CAAQ;IAEpC,YAAY,IAAI,CAAC,EAAE,MAAM,EAIxB;IAED,QAAQ,IAAI,MAAM,CAEjB;CACF;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC,SAAgB,EAAE,EAAE,aAAa,CAAC;IAClC,SAAgB,QAAQ,EAAE,YAAY,EAAE,CAAC;IAEzC,YAAY,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,EAIpD;IAED,QAAQ,IAAI,MAAM,CAKjB;CACF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,GAAG,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAGlD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,EAAE,CAAC,GAAG,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAGjD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAE5C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAE9E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,GAAG,CAAC,GAAG,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAGlD"}
|
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
import type { ComparisonSense } from "./types.js";
|
|
2
2
|
import type { LinExpr } from "./expression.js";
|
|
3
|
-
import { BoolOp, type
|
|
3
|
+
import { BoolOp, type LogicInput } from "./boolean-expr.js";
|
|
4
4
|
/**
|
|
5
5
|
* Represents a linear constraint: lhs (terms) <=, >=, or == rhs (constant)
|
|
6
6
|
*/
|
|
7
7
|
export declare class Constraint {
|
|
8
|
+
readonly kind: "constraint";
|
|
8
9
|
readonly id: number;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
private _lhs;
|
|
11
|
+
private _sense;
|
|
12
|
+
private _rhs;
|
|
13
|
+
private _name;
|
|
14
|
+
hasExplicitName: boolean;
|
|
15
|
+
ownerModel: {
|
|
16
|
+
notifyMutation?: () => void;
|
|
17
|
+
} | null;
|
|
13
18
|
/** Slack value after solve */
|
|
14
19
|
slack: number | null;
|
|
15
20
|
/** Dual value (shadow price) after solve */
|
|
16
21
|
dual: number | null;
|
|
17
22
|
constructor(lhs: LinExpr, sense: ComparisonSense, rhs: number, name?: string);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
get lhs(): LinExpr;
|
|
24
|
+
set lhs(value: LinExpr);
|
|
25
|
+
get sense(): ComparisonSense;
|
|
26
|
+
set sense(value: ComparisonSense);
|
|
27
|
+
get rhs(): number;
|
|
28
|
+
set rhs(value: number);
|
|
29
|
+
get name(): string;
|
|
30
|
+
set name(value: string);
|
|
31
|
+
/** @internal Assigns a model-scoped name and explicit flag without triggering setter mutation notifications */
|
|
32
|
+
_assignModelName(name: string, hasExplicitName: boolean): void;
|
|
33
|
+
and(other: LogicInput): BoolOp;
|
|
34
|
+
or(other: LogicInput): BoolOp;
|
|
35
|
+
implies(consequent: LogicInput): BoolOp;
|
|
36
|
+
xor(other: LogicInput): BoolOp;
|
|
22
37
|
not(): BoolOp;
|
|
38
|
+
add(_other: unknown): never;
|
|
39
|
+
sub(_other: unknown): never;
|
|
40
|
+
mul(_other: unknown): never;
|
|
41
|
+
div(_other: unknown): never;
|
|
42
|
+
neg(): never;
|
|
43
|
+
le(_rhs: unknown, _name?: string): never;
|
|
44
|
+
ge(_rhs: unknown, _name?: string): never;
|
|
45
|
+
eq(_rhs: unknown, _name?: string): never;
|
|
46
|
+
get value(): never;
|
|
47
|
+
get constant(): never;
|
|
48
|
+
clone(): Constraint;
|
|
23
49
|
toString(): string;
|
|
24
50
|
}
|
|
51
|
+
export declare function isConstraint(val: unknown): val is Constraint;
|
|
25
52
|
//# sourceMappingURL=constraint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constraint.d.ts","sourceRoot":"","sources":["../../../src/modeler/constraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"constraint.d.ts","sourceRoot":"","sources":["../../../src/modeler/constraint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI5D;;GAEG;AACH,qBAAa,UAAU;IACrB,SAAgB,IAAI,EAAG,YAAY,CAAU;IAC7C,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,KAAK,CAAS;IACf,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,IAAI,CAAQ;IACjE,8BAA8B;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IACnC,4CAA4C;IACrC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAElC,YACE,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,EAcd;IAED,IAAI,GAAG,IAAI,OAAO,CAEjB;IAED,IA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AAK,IAAI,UAAU,CAOzB;IAED,QAAQ,IAAI,MAAM,CAGjB;CACF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,UAAU,CAS5D"}
|
|
@@ -5,6 +5,7 @@ import { QuadExpr } from "./quad-expr.js";
|
|
|
5
5
|
* Represents a linear expression: c0 + c1*x1 + c2*x2 + ...
|
|
6
6
|
*/
|
|
7
7
|
export declare class LinExpr {
|
|
8
|
+
readonly kind: "linear";
|
|
8
9
|
terms: Map<Var, number>;
|
|
9
10
|
constant: number;
|
|
10
11
|
constructor(terms?: Map<Var, number>, constant?: number);
|
|
@@ -17,13 +18,13 @@ export declare class LinExpr {
|
|
|
17
18
|
*/
|
|
18
19
|
add(other: QuadExpr): QuadExpr;
|
|
19
20
|
add(other: LinExpr | Var | number): LinExpr;
|
|
20
|
-
add(other: QuadExpr | LinExpr | Var | number): LinExpr | QuadExpr;
|
|
21
|
+
add(other: QuadExpr | LinExpr | Var | number | Constraint): LinExpr | QuadExpr;
|
|
21
22
|
/**
|
|
22
23
|
* Subtract another expression, variable, or number
|
|
23
24
|
*/
|
|
24
25
|
sub(other: QuadExpr): QuadExpr;
|
|
25
26
|
sub(other: LinExpr | Var | number): LinExpr;
|
|
26
|
-
sub(other: QuadExpr | LinExpr | Var | number): LinExpr | QuadExpr;
|
|
27
|
+
sub(other: QuadExpr | LinExpr | Var | number | Constraint): LinExpr | QuadExpr;
|
|
27
28
|
/**
|
|
28
29
|
* Multiply this expression by a scalar coefficient, variable, or expression
|
|
29
30
|
*/
|
|
@@ -31,11 +32,11 @@ export declare class LinExpr {
|
|
|
31
32
|
mul(v: Var): QuadExpr;
|
|
32
33
|
mul(other: LinExpr): LinExpr | QuadExpr;
|
|
33
34
|
mul(other: QuadExpr): QuadExpr;
|
|
34
|
-
mul(operand: number | Var | LinExpr | QuadExpr): LinExpr | QuadExpr;
|
|
35
|
+
mul(operand: number | Var | LinExpr | QuadExpr | Constraint): LinExpr | QuadExpr;
|
|
35
36
|
/**
|
|
36
|
-
* Divide this expression by a non-zero scalar
|
|
37
|
+
* Divide this expression by a non-zero scalar or constant-only expression
|
|
37
38
|
*/
|
|
38
|
-
div(
|
|
39
|
+
div(divisor: number | LinExpr | QuadExpr | Constraint): LinExpr;
|
|
39
40
|
/**
|
|
40
41
|
* Negate this expression
|
|
41
42
|
*/
|
|
@@ -44,26 +45,24 @@ export declare class LinExpr {
|
|
|
44
45
|
* Compute the numerical value of this expression using current variable values
|
|
45
46
|
*/
|
|
46
47
|
get value(): number | null;
|
|
47
|
-
/**
|
|
48
|
-
* Helper value accessor for expression
|
|
49
|
-
*/
|
|
50
|
-
getValue(): number | null;
|
|
51
48
|
/**
|
|
52
49
|
* Create constraint: this <= rhs
|
|
53
50
|
*/
|
|
54
|
-
le(rhs: number | Var | LinExpr, name?: string): Constraint;
|
|
55
|
-
lessThanOrEqual(rhs: number | Var | LinExpr, name?: string): Constraint;
|
|
51
|
+
le(rhs: number | Var | LinExpr | QuadExpr | Constraint, name?: string): Constraint;
|
|
56
52
|
/**
|
|
57
53
|
* Create constraint: this >= rhs
|
|
58
54
|
*/
|
|
59
|
-
ge(rhs: number | Var | LinExpr, name?: string): Constraint;
|
|
60
|
-
greaterThanOrEqual(rhs: number | Var | LinExpr, name?: string): Constraint;
|
|
55
|
+
ge(rhs: number | Var | LinExpr | QuadExpr | Constraint, name?: string): Constraint;
|
|
61
56
|
/**
|
|
62
57
|
* Create constraint: this == rhs
|
|
63
58
|
*/
|
|
64
|
-
eq(rhs: number | Var | LinExpr, name?: string): Constraint;
|
|
65
|
-
equalTo(rhs: number | Var | LinExpr, name?: string): Constraint;
|
|
59
|
+
eq(rhs: number | Var | LinExpr | QuadExpr | Constraint, name?: string): Constraint;
|
|
66
60
|
private toConstraint;
|
|
61
|
+
and(_other: unknown): never;
|
|
62
|
+
or(_other: unknown): never;
|
|
63
|
+
implies(_consequent: unknown): never;
|
|
64
|
+
xor(_other: unknown): never;
|
|
65
|
+
not(): never;
|
|
67
66
|
toString(): string;
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
@@ -71,20 +70,106 @@ export declare class LinExpr {
|
|
|
71
70
|
*/
|
|
72
71
|
export type Expr = LinExpr | QuadExpr;
|
|
73
72
|
/**
|
|
74
|
-
* Sum an
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* -
|
|
73
|
+
* Sum an `Iterable` of `Var` / `LinExpr` / `number` items, an `Iterable` with a mapping function,
|
|
74
|
+
* or a numeric count `n` with an index mapper `(0 .. n - 1)` into a single `LinExpr`.
|
|
75
|
+
*
|
|
76
|
+
* **Formulation notes**:
|
|
77
|
+
* - Produces a linear expression (`LinExpr`).
|
|
78
|
+
* - Passing comparison `Constraint`s (`<=`, `>=`, `==`) or non-linear `QuadExpr` terms throws an Error
|
|
79
|
+
* (quadratic terms are supported in objectives only via `expr` or `.mul()`).
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const m = new Model("SumExample");
|
|
84
|
+
* const x = m.continuous(3, { lb: 0, prefix: "x" });
|
|
85
|
+
* const byItem = m.integer(["desk", "chair"] as const, { lb: 0 });
|
|
86
|
+
*
|
|
87
|
+
* // Sum an array or iterable directly
|
|
88
|
+
* m.constraint(expr`${sum(x)} <= 100`, "total_x");
|
|
89
|
+
* m.constraint(expr`${sum(Object.values(byItem))} <= 50`, "total_items");
|
|
90
|
+
*
|
|
91
|
+
* // Sum with a mapper or over a count range (0..2)
|
|
92
|
+
* const weighted = sum(3, (i) => expr`${i + 1} * ${x[i]}`);
|
|
93
|
+
* m.objective(maximize(weighted));
|
|
94
|
+
* ```
|
|
79
95
|
*/
|
|
80
|
-
export declare function sum(count: number, mapFn: (index: number) => LinExpr | Var | number): LinExpr;
|
|
81
|
-
export declare function sum<T = any>(items: Iterable<T>, mapFn?: (item: T, index: number) => LinExpr | Var | number): LinExpr;
|
|
96
|
+
export declare function sum(count: number, mapFn: (index: number) => LinExpr | QuadExpr | Constraint | Var | number): LinExpr;
|
|
97
|
+
export declare function sum<T = any>(items: Iterable<T>, mapFn?: (item: T, index: number) => LinExpr | QuadExpr | Constraint | Var | number): LinExpr;
|
|
98
|
+
export type DotTerm = Var | LinExpr;
|
|
99
|
+
export type DotVarContainer<R extends string | number = string | number, C extends string | number = string | number> = ReadonlyArray<DotTerm> | {
|
|
100
|
+
readonly [K in R]: DotTerm;
|
|
101
|
+
} | ReadonlyArray<ReadonlyArray<DotTerm>> | ReadonlyArray<{
|
|
102
|
+
readonly [K in C]: DotTerm;
|
|
103
|
+
}> | {
|
|
104
|
+
readonly [K in R]: ReadonlyArray<DotTerm>;
|
|
105
|
+
} | {
|
|
106
|
+
readonly [K in R]: {
|
|
107
|
+
readonly [L in C]: DotTerm;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export type DotCoeffContainer<R extends string | number = string | number, C extends string | number = string | number> = ReadonlyArray<number> | {
|
|
111
|
+
readonly [K in R]: number;
|
|
112
|
+
} | ReadonlyArray<ReadonlyArray<number>> | ReadonlyArray<{
|
|
113
|
+
readonly [K in C]: number;
|
|
114
|
+
}> | {
|
|
115
|
+
readonly [K in R]: ReadonlyArray<number>;
|
|
116
|
+
} | {
|
|
117
|
+
readonly [K in R]: {
|
|
118
|
+
readonly [L in C]: number;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
type NoSymbolKeys<T> = {
|
|
122
|
+
readonly [Symbol.iterator]?: never;
|
|
123
|
+
} & ({
|
|
124
|
+
readonly [s: symbol]: never;
|
|
125
|
+
} | {
|
|
126
|
+
readonly [S in Extract<keyof T, symbol>]?: never;
|
|
127
|
+
});
|
|
128
|
+
type DotRecordLeafMap<T, Leaf> = object & {
|
|
129
|
+
readonly [K in keyof T]: Leaf;
|
|
130
|
+
} & NoSymbolKeys<T>;
|
|
131
|
+
type DotRecordShape<T, Leaf, Inner = never> = object & {
|
|
132
|
+
readonly [K in keyof T]: Leaf | ReadonlyArray<Leaf> | DotRecordLeafMap<T[K], Leaf> | DotRecordLeafMap<Inner, Leaf>;
|
|
133
|
+
} & NoSymbolKeys<T>;
|
|
134
|
+
type DotContainerArg<T, Leaf, Inner = never> = ReadonlyArray<Leaf> | ReadonlyArray<ReadonlyArray<Leaf>> | ReadonlyArray<DotRecordLeafMap<T[number & keyof T], Leaf>> | DotRecordShape<T, Leaf, Inner>;
|
|
82
135
|
/**
|
|
83
|
-
* Compute the
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* - dot(vars,
|
|
87
|
-
* - dot(costMatrix, flowMatrix)
|
|
136
|
+
* Compute the inner product (linear combination `LinExpr`) of numeric coefficients and
|
|
137
|
+
* `Var` / `LinExpr` containers across 1D arrays, 2D matrices (`number[][]` / `Var[][]`),
|
|
138
|
+
* plain records (`Record<K, ...>`), and mixed Array/Record containers in either operand order:
|
|
139
|
+
* - `dot(coeffs, vars)` or `dot(vars, coeffs)`
|
|
140
|
+
* - `dot(costMatrix, flowMatrix)`
|
|
141
|
+
*
|
|
142
|
+
* **Formulation notes**:
|
|
143
|
+
* - Produces a linear expression (`LinExpr`) and validates matching array lengths / record keys and finite coefficients.
|
|
144
|
+
* - Does not accept arbitrary `Iterable`s (use `sum()` for general iterables) or non-linear `QuadExpr` / `Constraint` operands
|
|
145
|
+
* (quadratic variable-by-variable terms are supported in objectives only via `expr` or `.mul()`).
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const m = new Model("DotExample");
|
|
150
|
+
* const vec = m.continuous(3, { lb: 0, prefix: "v" });
|
|
151
|
+
* const qty = m.integer(["desk", "chair"] as const, { lb: 0 });
|
|
152
|
+
* const grid = m.binary(2, 2, { prefix: "g" });
|
|
153
|
+
*
|
|
154
|
+
* // 1D array, Record, and 2D matrix inner products
|
|
155
|
+
* m.constraint(expr`${dot([2, 4, 6], vec)} <= 60`, "vec_limit");
|
|
156
|
+
* m.constraint(expr`${dot({ desk: 1, chair: 2 }, qty)} <= 40`, "wood_cap");
|
|
157
|
+
* m.objective(
|
|
158
|
+
* maximize(
|
|
159
|
+
* expr`${dot({ desk: 30, chair: 50 }, qty)} - ${dot(
|
|
160
|
+
* [
|
|
161
|
+
* [5, 8],
|
|
162
|
+
* [3, 6],
|
|
163
|
+
* ],
|
|
164
|
+
* grid
|
|
165
|
+
* )}`
|
|
166
|
+
* )
|
|
167
|
+
* );
|
|
168
|
+
* ```
|
|
88
169
|
*/
|
|
89
|
-
export declare function dot(
|
|
170
|
+
export declare function dot<C = DotCoeffContainer, V = DotVarContainer, CI = never, VI = never>(coeffs: C & (Record<any, CI> | unknown) & DotContainerArg<C, number, CI>, vars: V & (Record<any, VI> | unknown) & DotContainerArg<V, DotTerm, VI>): LinExpr;
|
|
171
|
+
export declare function dot<V = DotVarContainer, C = DotCoeffContainer, VI = never, CI = never>(vars: V & (Record<any, VI> | unknown) & DotContainerArg<V, DotTerm, VI>, coeffs: C & (Record<any, CI> | unknown) & DotContainerArg<C, number, CI>): LinExpr;
|
|
172
|
+
export declare function dot(coeffs: DotCoeffContainer<any, any>, vars: DotVarContainer<any, any>): LinExpr;
|
|
173
|
+
export declare function dot(vars: DotVarContainer<any, any>, coeffs: DotCoeffContainer<any, any>): LinExpr;
|
|
174
|
+
export {};
|
|
90
175
|
//# sourceMappingURL=expression.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/modeler/expression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/modeler/expression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,UAAU,EAAgB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE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GAClC,OAAO,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
export { Model, type ModelOptions, type BoundsOptions, type IndicatorOptions } from "./model.js";
|
|
1
|
+
export { Model, type ModelOptions, type BoundsOptions, type BinaryOptions, type IndicatorOptions, type ConstraintItem, type KeyCollection, } from "./model.js";
|
|
2
|
+
export { deriveBigMForLe, deriveBigMForGe, validateUserBigM, buildIndicatorLinearization } from "./big-m.js";
|
|
3
|
+
export { validateModelIntegrity } from "./validation.js";
|
|
4
|
+
export { maximize, minimize, type ObjectiveExpr, type ObjectiveSpec, } from "./objective.js";
|
|
2
5
|
export { Var, type VarOptions } from "./variable.js";
|
|
3
|
-
export { LinExpr, type Expr, sum, dot } from "./expression.js";
|
|
6
|
+
export { LinExpr, type Expr, type DotTerm, type DotVarContainer, type DotCoeffContainer, sum, dot, } from "./expression.js";
|
|
4
7
|
export { QuadExpr, type QuadTerm } from "./quad-expr.js";
|
|
5
8
|
export { Constraint } from "./constraint.js";
|
|
6
|
-
export { BoolVar, BoolExpr, BoolOp, and, or, not, implies, xor, } from "./boolean-expr.js";
|
|
7
|
-
export { parseExpr, parseConstraint, expr,
|
|
8
|
-
export { generateLpString, type LpModelData, type LpExportResult } from "./lp-writer.js";
|
|
9
|
-
export
|
|
9
|
+
export { BoolVar, BoolExpr, BoolOp, type LogicElement, type LogicInput, and, or, not, implies, xor, } from "./boolean-expr.js";
|
|
10
|
+
export { parseExpr, parseConstraint, expr, type ParsedExpr, type ExprResolver, } from "./parser.js";
|
|
11
|
+
export { generateLpString, buildLpSymbolMaps, isLpExportResult, sanitizeIdentifier, type LpModelData, type LpSymbolMaps, type LpExportResult, } from "./lp-writer.js";
|
|
12
|
+
export { validateModelSolution, type SolutionValidationOptions, type ViolationType, type SolutionViolation, type SolutionValidationSummary, type SolutionValidationReport, } from "./solution-validator.js";
|
|
13
|
+
export type { VarType, OptimizationSense, ComparisonSense, SolverStatus, TerminationStatus, SolveProgressEvent, SolveOptions, SolverSolution, CheckResult, } from "./types.js";
|
|
10
14
|
export * from "./solvers/index.js";
|
|
11
15
|
export { getHighs, solveLpWithHighs, setHighsWasmUrl, getHighsWasmUrl } from "./solvers/highs/index.js";
|
|
12
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modeler/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modeler/index.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,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAC7G,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,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,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,GAAG,EACH,GAAG,GACJ,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,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,GAAG,EACH,EAAE,EACF,GAAG,EACH,OAAO,EACP,GAAG,GACJ,MAAM,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