Ocas

Latest version: v0.26.0

Safety actively analyzes 993455 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 7

1.1

(验收标准 <10 秒)/ **Integer factorization**: `number_theory::factor`
with trial division, Pollard's rho (Brent variant), Pollard's $p-1$,
Williams' $p+1$, and Lenstra's ECM (Suyama parametrization, Montgomery
curves, stage 1). The top-level `factor_integer` escalates methods until
fully factored; a 30-digit semiprime factors in ~1.1 s in release mode
(acceptance target <10 s).
- **数论函数**:`euler_phi`、`moebius_mu`、`divisor_tau`、
`divisor_sigma(k)`、`liouville_lambda`(基于分解式)/
**Number-theory functions**: `euler_phi`, `moebius_mu`, `divisor_tau`,
`divisor_sigma(k)`, `liouville_lambda` (from the prime factorization).
- **离散对数**:`dlog_bsgs`(小步大步)与 `dlog_pohlig_hellman`
(阶分解 + 子群 BSGS + CRT 合并)/ **Discrete logarithms**:
`dlog_bsgs` (baby-step giant-step) and `dlog_pohlig_hellman`
(order factorization, subgroup BSGS, CRT merge).
- **模多项式 GCD(Brown)**:`ocas_poly::gcd::modular::gcd_modular_z`
为 $\mathbb{Z}[x]$ 提供多素数模 GCD——单模像 + CRT 对称重构 +
试除验证,消除了朴素伪余式 GCD 在 $\deg \gtrsim 16$ 时的系数爆炸;
可处理 100 位系数的 50 次多项式 / **Modular polynomial GCD (Brown)**:
`ocas_poly::gcd::modular::gcd_modular_z` computes univariate integer GCDs
via monic modular images, CRT with symmetric reconstruction, and exact
trial division, eliminating the coefficient explosion of the naive
pseudo-remainder GCD for $\deg \gtrsim 16$; handles degree-50 inputs with
100-digit coefficients.
- **多元模 GCD 多素数化**:`gcd_modular`(二元)重写为完整 Brown
算法——主变量内容分离、monic 化求值-插值像、多素数 CRT +
有理重构(经 `rational_reconstruction`)、全次数试除验证与
坏素数跳过 / **Multivariate modular GCD, multi-prime**: the bivariate
`gcd_modular` was rewritten as the full Brown algorithm — content
separation in the main variable, monic evaluation-interpolation images,
multi-prime CRT with rational reconstruction, full-degree trial division,
and bad-prime skipping.
- **Python 绑定**:`ocas.factorint`、`isprime`、`isprime_u64`、
`nextprime`、`discrete_log`、`crt`、`jacobi_symbol`、`totient`、
`mobius`、`divisor_count`、`divisor_sigma`、`liouville_lambda`
(任意精度 Python int 直收)/ **Python bindings**: `ocas.factorint`,
`isprime`, `isprime_u64`, `nextprime`, `discrete_log`, `crt`,
`jacobi_symbol`, `totient`, `mobius`, `divisor_count`, `divisor_sigma`,
`liouville_lambda` (arbitrary-precision Python ints).
- **C 绑定**:`ocas_ntheory_*`(factorint/isprime/nextprime/
discrete_log/crt/jacobi/totient/mobius/divisor_count/divisor_sigma/
liouville,十进制字符串进出),`include/ocas.h` 同步并新增
`ocas.hpp` 的 `ocas::ntheory` RAII 包装 / **C bindings**: `ocas_ntheory_*`
(decimal strings in/out), `include/ocas.h` synced, plus `ocas::ntheory`
RAII wrappers in `ocas.hpp`.

Fixed / 修复

- **有理重构隐藏性能炸弹**:`rational_reconstruction` 内部的整数平方根
在奇数和处提前退出牛顿迭代,随后从 $n$ 逐个减一校正至 $\sqrt n$
(30 位模数约 52 秒/次);现改用后端原生 `Integer::sqrt()` /
**Latent performance bomb in rational reconstruction**: the hand-rolled
integer square root broke out of Newton iteration early on odd sums and
then decremented from $n$ down to $\sqrt n$ one step at a time (~52 s per
call for 30-digit moduli); it now uses the backend-native
`Integer::sqrt()`.
- **SymPy 对比脚本参数顺序**:`correctness` 测试 `check` 模式的子命令
与参数顺序颠倒(该模式此前无调用方,属潜伏 bug);同时新增
`nt_factorint`/`nt_isprime`/`nt_nextprime`/`nt_totient`/`nt_mobius`/
`nt_divisor_count`/`nt_divisor_sigma`/`nt_liouville`/`nt_discrete_log`/
`nt_crt`/`nt_jacobi` 数论对比任务 / **SymPy comparison script argument
order**: the `check` mode of the correctness harness passed the subcommand
last (latent bug — the mode had no callers); also adds `nt_*` number-theory
comparison tasks.

测试 / Tests

- ocas-domain 数论单元测试与 doctest 全绿;BPSW 对抗 Carmichael 数与
base-2 强伪素数;proptest 交叉验证三种素性判定一致 /
Unit tests and doctests green; BPSW adversarial coverage of Carmichael
numbers and base-2 strong pseudoprimes; proptest cross-checks of all three
primality tests.
- `ocas-tests/tests/correctness/ntheory.rs`:每个子模块 ≥ 20 例与
SymPy `ntheory` 交叉验证 / `correctness/ntheory.rs`: ≥ 20 cross-checked
cases per submodule against SymPy `ntheory`.
- Python:`tests/python/test_ntheory.py` 46 项;C API:12 项新
(共 80 项)/ Python: 46 tests; C API: 12 new (80 total).

---

0.26.0

Added / 新增

- **打包单项式 F5 快通道(u128 SWAR)**:`ocas-poly/src/groebner/packed.rs` + `f5_fp_packed`。n_vars ≤ 8 且全部输入指数 < 2¹⁵ 的 ℤ_p 理想走打包管线:单项式为 8×16 位 SWAR `PackedMono`(变量 0 在最高域,整数比较即 Lex),指数加法/整除/lcm/支持掩码均为单条 u128 运算;注册表键为 Copy 值(命中零克隆、零堆分配);打包签名 `PackedSig` 与 syzygy 桶集。超界理想自动回落 i64 路径(旧路径原样保留) / **SWAR-packed monomial F5 fast path**: u128 packed monomials (add/divide/lcm/support-mask in single u128 ops), Copy-key registration with zero cloning, packed signatures and syzygy buckets; out-of-contract ideals fall back to the i64 path.
- **echelon 改造**:`LabeledFpRow` 系数 i64 → i32(乘积放宽至 i64 运算);两阶段消去免克隆——pass-1 主元移入只读 `pivot_store`(`PivotLoc::{Store,Row}`),Phase A 并行只读归约、Phase B 串行收尾认领新主元,行序与纯串行逐位一致;矩阵容量按 `selected.len() * 4` 预分配 / **Echelon rework**: i32 row coefficients, clone-free two-phase echelonization (pass-1 pivots moved to a read-only store), capacity preallocation.
- **grevlex 基准变体**:`ocas-tests::systems` 新增序泛型 `cyclic_q_with_order`/`cyclic_fp_with_order` 及 `cyclic_q_grevlex`/`cyclic_fp_grevlex` 包装;criterion 组 `f5_cyclic_fp13_grevlex`(n=5,6)与 `f5_cyclic_7_fp13_grevlex` 计时测试。msolve 的 cyclic 基准为 grevlex,本轮对标以此为准 / **Grevlex benchmark variants** and order-generic cyclic generators; msolve's cyclic references are grevlex, so grevlex is the alignment baseline.
- **修复 Graded 单项式序的度方向(预存在 bug)**:`Grevlex`/`Grlex`/`WeightOrder`/`BlockOrder` 的度/权重比较方向反置(低度视为更大、常数项最大,并非合法单项式序),导致 grevlex 下 buchberger/f4/f5 全部产生错误基(例:cyclic-7 grevlex 坍缩为 `{Πxᵢ−1}`)。已按 Cox–Little–O'Shea Def. 2.4 修正方向,`MatrixOrder::elimination_order` 与 fglm 同时对齐 / **Fixed inverted degree/weight direction in graded monomial orders** (pre-existing): grevlex computations were silently wrong (e.g. cyclic-7 collapsed to `{Πxᵢ−1}`); now standard CLO 2.4.

Tests / 测试

- `packed.rs` 9 项 SWAR 单元测试:pack/unpack 往返、add/sub(含跨域借位链)、divides/lcm/support_mask 与手写参考实现对拍,覆盖 1–8 变量与 15 位边界值(32766/32767)。
- `correctness/groebner.rs` 新增 `f5_fp_packed_fallback_nvars_gt_8`(9 变量回落)、`f5_fp_packed_fallback_exp_overflow`(x⁷⁰⁰⁰⁰ 回落,断言基为 `{y−1, x⁷⁰⁰⁰⁰−1}`)、`f5_fp_packed_deterministic`(cyclic-4 ℤ₁₃ 三连算逐项相等);既有 cyclic fp13 系列与 `multi_modular_matches_f5_random`(FiniteField 像)自动走打包路径,作为等价性回归。
- 版本号升至 0.26.0。

Performance / 性能(实测,见 `docs/planning/BENCHMARK_RESULTS_CN.md` §0.26.0)

- G2 cyclic-6 ℤ₁₃:Lex 中位数 1.415 s → **936 ms**(1.51×);grevlex 中位数 73.6 ms → **55.6 ms**(msolve 0.04 s 的 ~1.4×)。
- G3 cyclic-7 ℤ₁₃:grevlex 单轮 **5.755 s**(209 基元素,msolve ~1 s 的 ~5.8×);Lex 单轮与基线对比见基准文档。

---

0.25.0

Added / 新增

- **多素数 Gröbner 基(MultiModular)**:`ocas-poly/src/groebner/multi_modular.rs` 为 ℚ 理想提供多素数策略——通分得 primitive ℤ 理想、并行 F5 计算幸运素数像(`[2³⁰, 2³¹)` 素数,走 i64 快通道)、按首项单项式理想包含筛选、CRT + 有理重构、ℚ 精确验证;累积素数 > 16 时改用无迹线性 p-adic Hensel 提升(`hensel_lift_groebner`,monic 基上无需求逆),64 素数仍失败则回落 ℚ F5 / **Multi-modular Gröbner bases**: parallel F5 over lucky primes with CRT + rational reconstruction, exact ℚ verification, a trace-free linear p-adic Hensel lift, and a fallback to exact ℚ F5.
- **`Algorithm::MultiModular` 变体与 Auto 路由**:`groebner_basis(.., Algorithm::Auto)` 对 ℚ 理想自动走 multi-modular 管线(内部 `Any` 判定),有限域等其它域维持 F4 路径;Python 绑定接受 `"multi_modular" | "multimodular" | "mm"`,C 绑定 `algorithm=4` / **`Algorithm::MultiModular` variant and Auto routing**: ℚ ideals take the multi-modular pipeline under `Auto`; Python accepts `multi_modular`/`multimodular`/`mm`, C FFI maps `algorithm=4`.
- **F5 性能(cyclic-6 ℤ₁₃ 单轮 2.63 s → ~1.5 s)**:`find_reducer_fp` 线性扫描替换为 `DivisorIndex`(支持掩码分桶);syzygy 集合按支持掩码分桶(`contains` 从 O(syzygies) 降到 submask 枚举);矩阵行构造并行化(rayon);echelon 二次消去两阶段化(pass-1 主元并行消去 + 串行收尾,结果与纯串行逐位一致);行注册 fused + 栈缓冲避免逐项堆分配 / **F5 speedups**: DivisorIndex reducer queries, bucketed syzygy membership, parallel row construction, two-phase parallel echelonization (bit-identical to sequential), fused allocation-free row registration.
- **模 GCD 并行化**:`gcd_modular_z` 与 `modular_gcd_x` 的素数循环按批并行计算模像,主线程维持原有增量重构与验证流程 / **Parallel modular GCD**: prime-image batches computed with rayon in both univariate and multivariate Brown GCD drivers.
- **共享系统生成器**:`ocas-tests/src/systems.rs` 提供 `cyclic_q/cyclic_fp/katsura_q/katsura_fp`,benches 与测试去重;新增 katsura-6/7 基准与 `f5_cyclic_fp13`(n=3..6)、`multi_modular_cyclic_q`(n=3..5)criterion 组 / **Shared system generators**: `ocas-tests::systems` with cyclic/katsura over ℚ and ℤ_p; new criterion groups.
- **`qmpoly_to_primitive_zmpoly` 泛型化**(`pub(crate)`,任意单项式序)供 multi-modular 管线复用 / **`qmpoly_to_primitive_zmpoly` generalized** over `O: MonomialOrder`.
- **`p < 2³¹` 运行时守卫**:f4/f5 的 ℤ_p 快通道仅在素数小于 2³¹ 时启用,大素数回落通用域路径(此前 `prime_u64() as i64` 静默溢出) / **`p < 2³¹` guards** on the ℤ_p fast paths (previously a silent `as i64` overflow).

Tests / 测试

- `groebner::multi_modular` 7 项单元测试:CRT+RR 重构、坏素数跳过、cyclic-2..4 与 f5 逐项一致、有理系数重构、Hensel 提升(含人工不一致素数返回 `None`)。
- `correctness/groebner.rs` 新增 `algorithm_multi_modular_variant_routes`、`auto_routes_multi_modular_for_q`、`multi_modular_matches_f5_random`(确定性种子 100 个随机 ℚ 理想与 F5 逐项相等)。
- `groebner_f5_cyclic_6_fp13` 断言收紧至 < 2.0 s;cyclic-7 改为基准标记(可解 + `is_groebner_basis`,不设硬时限)。
- 版本号升至 0.25.0。

---

0.24.0

Added / 新增

- **启发式积分模块**(`ocas-calc/src/integral/heuristic.rs`):新增四种积分技术,接入 `try_risch_or_fallback` 调度链(在 `special_integrate` 和 `fallback` 之间):
- **分部积分**(LIATE/ILATE 启发式):`try_parts` 函数,对 `∫ u·v' dx` 型乘积按 LIATE 优先级选取 `u`(对数→反三角→代数→三角→指数),递归计算,最多 2 层深度。
- **三角换元**:`try_trig_substitution` 函数,直接匹配 `√(a²−x²)`、`√(a²+x²)`、`√(x²−a²)` 及其倒数形式,返回已知原函数(`asin`、`asinh`、`acosh` 等)。
- **Weierstrass 换元**(`t = tan(u/2)`):`try_weierstrass` 函数,对 `sin(u)` 和 `cos(u)` 的有理函数进行万能换元。
- **Euler 换元**:`try_euler_substitution` 函数,匹配 `√(ax²+bx+c)` 模式(占位,返回 `None`)。
- **Heuristic integration module** (`ocas-calc/src/integral/heuristic.rs`): four new integration techniques wired into `try_risch_or_fallback` (between `special_integrate` and `fallback`):
- **Integration by parts** (LIATE heuristic): `try_parts`, max 2-level recursion depth.
- **Trigonometric substitution**: direct pattern-matched antiderivatives for `√(a²±x²)` and `√(x²−a²)` forms.
- **Weierstrass substitution** (`t = tan(u/2)`): `try_weierstrass` for trig-rational integrands.
- **Euler substitution**: `try_euler_substitution` for `√(ax²+bx+c)` (placeholder, returns `None`).

- **`integrate_heuristic` 公共 API**:`ocas_calc::integrate_heuristic(ctx, expr, var)` 包装启发式积分,失败时返回 `Integral(...)` / **`integrate_heuristic` public API**: `ocas_calc::integrate_heuristic(ctx, expr, var)` wrapper.

- **DoubleF64 双精度浮点类型**(`ocas-domain/src/double_float.rs`):Dekker/Knuth 双双精度算术(~31 位扩展精度,~84 位二进制尾数),包括:
- 核心算术:`TwoSum`、`TwoProd`(FMA 优先)、`add`/`sub`/`mul`/`div`、`powi`。
- 超越函数:`sin`、`cos`、`tan`、`exp`、`ln`、`sqrt`。
- `EvaluationDomain` + `PowfExtension` trait 实现。
- `Display`、标准 ops traits、`DoubleF64Domain` newtype。
- **DoubleF64 double-precision float** (`ocas-domain/src/double_float.rs`): Dekker/Knuth double-float arithmetic (~31 decimal digits, ~84 binary bits), including:
- Core arithmetic: `TwoSum`, `TwoProd` (FMA-preferred), `add`/`sub`/`mul`/`div`, `powi`.
- Transcendental functions: `sin`, `cos`, `tan`, `exp`, `ln`, `sqrt`.
- `EvaluationDomain` + `PowfExtension` trait implementations.
- `Display`, standard ops traits, `DoubleF64Domain` newtype.

- **Python 绑定**:`DoubleF64` 类(算术、超越函数)和 `Expression.integrate_heuristic()` 方法 / **Python bindings**: `DoubleF64` class and `Expression.integrate_heuristic()`.
- **C 绑定**:`ocas_expr_integrate_heuristic` 函数 / **C bindings**: `ocas_expr_integrate_heuristic`.

Tests / 测试

- 11 个启发式积分测试通过:分部积分(`x·exp(x)`、`x·sin(x)`、`x²·sin(x)`、`log(x)`、`x·log(x)`)、三角换元(`1/√(1-x²)`)、Weierstrass、反面测试。
- 14 个 DoubleF64 测试通过:算术、精度增益、`powi`、`sqrt`、`exp`、`ln`、`sin`/`cos`、`Domain` trait。
- 13 个 `EvaluationDomain` 测试通过(含 DoubleF64)。
- 11 heuristic integration tests passing: parts (x·exp(x), x·sin(x), x²·sin(x), log(x), x·log(x)), trig sub (1/√(1-x²)), Weierstrass, negative tests.
- 14 DoubleF64 tests passing: arithmetic, precision gain, powi, sqrt, exp, ln, sin/cos, Domain trait.
- 13 EvaluationDomain tests passing (including DoubleF64).

---

0.23.0

Added / 新增

- **Gröbner 基与代数几何工具**:完整的理想运算库,包括理想成员判定、和、积、商(Rabinowitsch 技巧)、饱和、交集运算 / **Gröbner basis and algebraic geometry tools**: complete ideal arithmetic library including membership testing, sum, product, quotient (Rabinowitsch trick), saturation, and intersection.

- **消元序与消元**:`MatrixOrder` 矩阵序实现,支持 `elimination_order` 构造和 `eliminate()` 消元函数(基于 Lex GB 过滤)/ **Elimination orders**: `MatrixOrder` matrix ordering with `elimination_order` constructor and `eliminate()` function via Lex GB filtering.

- **零维求解**:`solve_polynomial_system` 基于 Sturm 定理的数值根隔离,返回实数解和解的分类(零维/正维/无解)/ **Zero-dimensional solving**: `solve_polynomial_system` with Sturm-based numerical root isolation, returning real solutions classified as zero-dimensional/positive-dimensional/empty.

- **准素分解**:`primary_decomposition` 通过 Lex GB 中一元多项式的因式分解和饱和分离准素分量 / **Primary decomposition**: `primary_decomposition` via univariate polynomial factoring in Lex GB and saturation separation of primary components.

- **根式计算**:`ideal_radical` 零维用无平方分解,正维用 Jacobian 饱和法 (√I = I : h^∞) / **Radical computation**: `ideal_radical` with squarefree decomposition (zero-dim) and Jacobian saturation √I = I : h^∞ (positive-dim).

- **完整 Hilbert 级数**:`hilbert_function`、`dimension`、`degree`、`hilbert_polynomial`(Lagrange 插值)/ **Complete Hilbert series**: `hilbert_function`, `dimension`, `degree`, `hilbert_polynomial` (Lagrange interpolation).

- **有理根定理**:`check_rational_roots` 完整枚举常数项/首项系数因子 / **Rational root theorem**: `check_rational_roots` with complete divisor enumeration.

- **Python 多变量多项式**:`MultivariatePolynomial` 类,接受字典格式 `{(2,0): 1, (0,2): 1}` 输入 / **Python multivariate polynomial**: `MultivariatePolynomial` class accepting dict-format `{(2,0): 1, (0,2): 1}` input.

- **C FFI 绑定**:`ocas_groebner_basis`、`ocas_ideal_contains`、`ocas_solve_system`、`ocas_eliminate` 等函数 / **C FFI bindings**: `ocas_groebner_basis`, `ocas_ideal_contains`, `ocas_solve_system`, `ocas_eliminate`, etc.

- **变量扩展/收缩**:`extend_vars` 和 `drop_variable` 用于消元后的变量投影 / **Variable extension/contraction**: `extend_vars` and `drop_variable` for post-elimination variable projection.

Fixed / 修复

- **`MatrixOrder::cmp` 排序方向**:移除错误的 `.reverse()`,高权单项式现在正确比较为 Greater / **`MatrixOrder::cmp` sort direction**: removed erroneous `.reverse()` so higher-weight monomials correctly compare as Greater.

测试 / Tests

- 212 单元测试通过,clippy `-D warnings` 干净 / 212 unit tests passing, clippy `-D warnings` clean.
- 新增 3 个 Hilbert 多项式测试 / 3 new Hilbert polynomial tests.

---

0.22.0

Added / 新增

- **图同构正则标号引擎**:`ocas_atom::tensor::graph` 实现 McKay 细化-个体化
搜索(1-WL 邻居签名细化 + 路径不变量剪枝 + 自同构轨道剪枝),为张量规范
化提供独立于指标命名的唯一规范形 / **Graph canonical labelling**:
`tensor::graph` implements McKay refinement-individualisation search
(1-WL neighbour-signature refinement, path-invariant pruning, automorphism-
orbit pruning), providing label-independent unique canonical forms for
tensor canonicalisation.

- **张量表达式规范化**:`ocas_atom::tensor::canon` 将张量乘积编码为图、通过
图同构引擎求规范标号并重建为含规范哑指标名的表达式;支持对称/反对称槽位
子集的多项序重排 / **Tensor expression canonicalisation**:
`tensor::canon` encodes tensor products into graphs, canonicalises via the
graph-isomorphism engine, and reconstructs expressions with canonical dummy
names; supports slot-subset symmetric/antisymmetric reordering.

- **张量对称性规格**:`ocas_atom::tensor::spec` 提供 `SymmetrySpec`
(symmetric/antisymmetric 子集、cyclic)与 `TensorRegistry`
(张量名→对称性 + 指标组)注册机制 / **Tensor symmetry specs**:
`tensor::spec` provides `SymmetrySpec` (symmetric/antisymmetric subsets,
cyclic) and `TensorRegistry` (name→symmetry + index groups).

- **哑指标管理**:`ocas_atom::tensor::dummy::refresh_dummies` 将张量表达式
中的哑指标按维度组重命名为 `d0`, `d1`, … / **Dummy index management**:
`tensor::dummy::refresh_dummies` renames dummy indices per dimension group
to `d0`, `d1`, ….

- **Young 投影子**:`ocas_atom::tensor::young::young_project` 按 Young 盘
对张量槽位进行显式置换和展开(行对称化 + 列反对称化)/ **Young projector**:
`tensor::young::young_project` performs explicit permutation-sum expansion
of tensor slots according to a Young tableau (row symmetrisation + column
antisymmetrisation).

- **回溯模式匹配**:`ocas_rewrite::matcher` 的 AC 匹配器从贪心策略升级为全
回溯搜索,支持 Add/Mul/Fun 参数列表内任意位置的序列通配符(`x__`, `x___`),
并增加回溯预算上限防病态组合爆炸 / **Backtracking matcher**:
`ocas_rewrite::matcher` upgraded from greedy to full backtracking search for
AC contexts; sequence wildcards (`x__`, `x___`) now supported at any position
in Add/Mul/Fun argument lists; backtrack budget prevents pathological blow-up.

- **多模式替换**:`ocas_rewrite::replace` 提供 `replace_once`、
`replace_all`、`replace_all_multiple`,支持条件守卫和遍历方向配置 /
**Multi-pattern replacement**: `ocas_rewrite::replace` provides
`replace_once`, `replace_all`, `replace_all_multiple` with condition guards
and traversal direction settings.

- **Transformer::Partition**:`ocas_rewrite::transformer::partition_expr`
实现多重集分拆组合器(exact / collect_in_last / repeat 三种模式),
配套 `ocas_rewrite::combinatorics::partitions` 分拆枚举 /
**Transformer::Partition**: `transformer::partition_expr` implements the
multiset partition combinator with exact / collect_in_last / repeat modes,
backed by `combinatorics::partitions`.

- **Python 绑定**:`ocas.canonicalize_tensors`、`ocas.young_project`、
`ocas.refresh_dummies` 三个新函数 / **Python bindings**: three new
functions `canonicalize_tensors`, `young_project`, `refresh_dummies`.

- **C 绑定**:`ocas_tensor_canonicalize`、`ocas_young_project`、
`ocas_tensor_refresh_dummies` 三个新函数 + `ocas.hpp` RAII 封装 /
**C bindings**: three new functions `ocas_tensor_canonicalize`,
`ocas_young_project`, `ocas_tensor_refresh_dummies` + `ocas.hpp` RAII
wrappers.

Changed / 变更

- `ocas_atom::tensor::tensor.rs` 拆分为目录模块 `tensor/`(`mod`,
`graph`, `spec`, `canon`, `dummy`, `young`)/ tensor.rs split into
directory module `tensor/`.
- `ocas_rewrite::transformer` 新增 `partition_expr` 函数 /
`partition_expr` function added to `transformer`.
- `ocas_rewrite::egraph` 模块从死代码状态恢复接线(`[cfg(feature="egg")]`
)/ egraph module wired into public API (was dead code).

---

Page 1 of 7

© 2026 Safety CLI Cybersecurity Inc. All Rights Reserved.