Place `X`/`Y` (Pell coordinates) into a caller-order tuple of arity `n`.
( ce: ComputeEngine, X: Expression, Y: Expression, xIdx: number, yIdx: number )
| 303 | if (coef[j] === 0n) continue; |
| 304 | terms.push(ce.function('Multiply', [ce.number(coef[j]), params[j]])); |
| 305 | } |
| 306 | if (terms.length === 0) return ce.number(0); |
| 307 | if (terms.length === 1) return terms[0]; |
| 308 | return ce.function('Add', terms); |
| 309 | } |
| 310 | |
| 311 | // |
| 312 | // ─── Exact confirmation & membership ──────────────────────────────────────── |
| 313 | // |
| 314 | |
| 315 | /** Substitute integer values and confirm the residual is exactly zero. */ |
| 316 | function confirm( |
| 317 | ce: ComputeEngine, |
| 318 | residual: Expression, |
| 319 | unknowns: string[], |