Architecture

oCAS is organized as a Cargo workspace of 12 public crates (plus ocas-tests for integration tests and benchmarks) with strict downward layering. Each crate may only depend on lower-level crates; no reverse or cyclic dependencies are permitted.

LevelcrateResponsibility
5 Bindingsocas, ocas-py, ocas-cRust, Python, C/C++ public API
4 Applicationocas-calc, ocas-eval, ocas-parseCalculus, evaluation, parsing
3 Symbol engineocas-atom, ocas-rewriteAtom, converters, pattern matching, e-graph
2 Algebra kernelocas-domain, ocas-polyDomains, polynomials, number theory
1 Numerical backendocas-coreGMP encapsulation (the FLINT backend lives in ocas-poly)
0 Runtimeocas-coreArena, errors, thread pool, FFI

Notable modules

ocas-poly::factor — Polynomial factorization using Hensel lifting and finite-field techniques. Supports square-free decomposition and full factorization over the integers and rationals.

ocas-poly::groebner — Gröbner basis computation with three algorithms: Buchberger, F4 (production default), and F5 (signature-based). Supports configurable monomial orders (Lex, Grevlex, WeightOrder, BlockOrder) and FGLM conversion for zero-dimensional ideals.

ocas-poly::roots — Real root isolation for univariate polynomials.

ocas-tests::correctness — Cross-validation framework with 201 #[test] tests across 19 mathematical modules (as of 0.24.0), comparing oCAS results against SymPy, SageMath, and Symbolica.

See ARCHITECTURE_EN.md in the repository for the full design document.