MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / signFromAssumedPart

Function signFromAssumedPart

src/compute-engine/library/complex.ts:29–40  ·  view source on GitHub ↗
(
  ce: ComputeEngine,
  op: Expression,
  part: SubjectPart
)

Source from the content-addressed store, hash-verified

27 * when the operand is a symbol with no value, look up assumed bounds for the
28 * corresponding subject (e.g. `im:tau` after `assume(Im(tau) > 0)`) and
29 * derive the sign from them (docs/fungrim/FUNGRIM-PLAN-3-ASSUMPTIONS.md §5.1b).
30 *
31 * Reads the fact index directly (never `ask()`), so it works inside
32 * `verify()`. Returns `undefined` when the facts don't entail a sign.
33 */
34export function signFromAssumedPart(
35 ce: ComputeEngine,
36 op: Expression,
37 part: SubjectPart
38): Sign | undefined {
39 if (!isSymbol(op) || op.value !== undefined) return undefined;
40 // Fast gate: engines with no assumptions do no index work.
41 if (!hasAssumptions(ce)) return undefined;
42 return signFromBounds(
43 getInequalityBoundsFromAssumptions(ce, { symbol: op.symbol, part })

Callers 2

arithmetic.tsFile · 0.90
complex.tsFile · 0.85

Calls 4

isSymbolFunction · 0.90
hasAssumptionsFunction · 0.90
signFromBoundsFunction · 0.90

Tested by

no test coverage detected