( expr: Expression, filter: (elem: Expression) => boolean )
| 1561 | // Three-valued: `x ∈ col ∧ x ∉ s1 ∧ x ∉ s2 ∧ …` with Kleene |
| 1562 | // combination — indeterminate member tests yield `undefined`, not a |
| 1563 | // spurious definitive answer. |
| 1564 | contains: (expr, x) => { |
| 1565 | if (!isFunction(expr)) return undefined; |
| 1566 | const [col, ...others] = expr.ops; |
| 1567 | return kleeneAnd([ |
| 1568 | col.contains(x), |
| 1569 | ...others.map((set) => kleeneNot(set.contains(x))), |
| 1570 | ]); |
| 1571 | }, |
| 1572 | count: (expr) => differenceCount(expr, memberOf), |
| 1573 | // Finite when the first set is finite, whatever the other sets are. |
| 1574 | isFinite: (expr) => { |
| 1575 | if (!isFunction(expr)) return undefined; |
| 1576 | if (expr.ops[0]?.isFiniteCollection === true) return true; |
| 1577 | const count = differenceCount(expr, memberOf); |
no test coverage detected