Polynomial root enclosures and bounded-observation feasible regions, with outward intervals, automatic Jacobians, Krawczyk contraction and explicit unresolved coverage.

moon run cmd/demo
node scripts/build.mjs
node bin/rootcover.mjs examples/geometry.json
node bin/rootcover.mjs examples/calibration.json
node bin/rootcover.mjs examples/equilibrium.json
node scripts/serve.mjs| 模式 | 输入 | 返回 |
|---|---|---|
| roots(默认) | 1…6个变量、等数量多项式、有限初始盒 | 区间Jacobian、Krawczyk排除/收缩、严格唯一解域、根包围与未决区域 |
| feasibility | 1…6个变量、1…32个多项式观测带、有限初始盒 | SIVIA区域划分、整盒可行证据、未决外包围、分辨率/资源状态 |
| 使用者/问题 | 输入和操作 | 已验证结果 |
|---|---|---|
| 几何工具开发者求区域内圆线全部交点 | geometry.json:x²+y²−2=0、y−x=0,[-1.5,1.5]² | 两个唯一解盒包含(-1,-1)、(1,1),无未决 |
| 标定软件开发者处理非单调响应和容差 | calibration.json:x³−3x+1=0先查[-2.5,2.5],再限[0,1];另可加入±0.125响应带 | 精确模式3个分支,限范围后1个;全范围观测带得到29个整盒可行盒、12个未决盒,达到0.001分辨率 |
| 定位工具开发者处理有界测量误差 | noisy_localization.json:三个基站距离平方带约束两个坐标,范围[0,2]² | 19个整盒可行盒、40个未决盒,未决宽度达到1/64;(1,1)被保留 |
moon add LMK-ai-nb/rootcover@0.2.0| 接口 | 功能 |
|---|---|
| interval / Interval运算 | binary64向外舍入区间 |
| parse_polynomial / validate_system | 明确语法、节点和模型边界 |
| enclose / assess / solve | 方程/Jacobian区间、单盒判定与根域搜索 |
| validate_constraints / classify_constraints / pave | 非方观测带模型、整盒判定和可行域内外包围 |
| decode_request / decode_feasibility_request / solve_json | 严格版本化请求,字符串接口按mode分派 |
python scripts/verify.py --browser
# 具备本机C工具链时:
python scripts/verify.py --native --browserpub suberror RootError {
Invalid(String)
}pub(all) enum Assessment {
Excluded(String)
Unique(Certificate)
Contracted(Array[Interval])
Undecided(String)
}pub(all) struct FeasibilityRequest {
model : ConstraintModel
box : Array[Interval]
options : Options
}pub(all) struct Interval {
lo : Double
hi : Double
}pub(all) struct PavingResult {
inside : Array[FeasibleBox]
unresolved : Array[UnresolvedBox]
complete : Bool
resolution_met : Bool
assessments : Int
excluded : Int
splits : Int
}pub(all) struct SolveResult {
roots : Array[RootBox]
unresolved : Array[UnresolvedBox]
complete : Bool
tolerance_met : Bool
assessments : Int
excluded : Int
contractions : Int
splits : Int
}fn classify_constraints(model : ConstraintModel, box : Array[Interval]) -> FeasibilityAssessment raise RootErrorfn next_up(x : Double) -> Doublefn pave(model : ConstraintModel, initial : Array[Interval], options : Options) -> PavingResult raise RootErrorInstall
Download zipPolynomial root enclosures and bounded-observation feasible regions, with outward intervals, automatic Jacobians, Krawczyk contraction and explicit unresolved coverage.