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

Function rationalIterator

src/compute-engine/library/sets.ts:1456–1479  ·  view source on GitHub ↗
(
  self: Expression,
  options?: { sign?: '+' | '-' | '+-'; includeZero?: boolean }
)

Source from the content-addressed store, hash-verified

1454 } else if (isValuelessCollectionTyped(val)) {
1455 // Third copy of the exclusion rule (see `isExcludedByKleene` and the
1456 // eager fold in `setMinus`): a valueless collection-typed operand
1457 // excludes its unknown MEMBERS, so the conjunct is undecided rather
1458 // than the scalar disequality below.
1459 conjunct = undefined;
1460 } else {
1461 conjunct = notEqualKleene(ce, x, val);
1462 }
1463 if (conjunct === false) return false;
1464 if (conjunct === undefined) result = undefined;
1465 }
1466 return result;
1467 }
1468
1469 // 2. The collection's `contains` handler
1470 if (typeof collection.contains === 'function') {
1471 const result = collection.contains(x);
1472 if (result === true) return true;
1473 if (result === false) return false;
1474 }
1475
1476 // 2b. Range/Interval queries with a symbolic element: mirror the
1477 // assume-side decomposition (`assumeElementOfSet` cases 2 & 3, design
1478 // §3.2/§5.1c) — a type conjunct plus one bound conjunct per finite
1479 // numeric endpoint, with infinite endpoints skipped exactly as
1480 // `assumeBound` skips them. Facts stored decomposed thus answer queries
1481 // decomposed. Symbolic endpoints yield an indeterminate conjunct (the
1482 // assume side drops them, so no stored fact can entail the bound).

Callers 1

sets.tsFile · 0.85

Calls 4

cantorEnumerateRationalsFunction · 0.90
numberMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected