| 135 | |
| 136 | // --- run SymPy batch ------------------------------------------------------- |
| 137 | function runSymPyAll(): Record<string, any> { |
| 138 | const by: Record<string, any> = {}; |
| 139 | try { |
| 140 | const out = execFileSync(PYTHON, [join(__dirname, 'run_sympy.py')], { encoding: 'utf8', timeout: 600000 }); |
| 141 | for (const line of out.trim().split('\n')) { try { const o = JSON.parse(line); if (o.id) by[o.id] = o; } catch {} } |
| 142 | } catch (e: any) { console.error('sympy batch failed:', (e.message || e).toString().split('\n')[0]); } |
| 143 | return by; |
| 144 | } |
| 145 | |
| 146 | // --- run Wolfram (Mathematica) batch --------------------------------------- |
| 147 | // Each case's `ce` MathJSON is translated to Wolfram Language (no positivity |