( expr: Expression )
| 2656 | if (a.nops !== b.nops) return false; |
| 2657 | // The elements are not indexed |
| 2658 | const has: (x: Expression) => boolean = (x) => |
| 2659 | b.ops.some((y) => x.isSame(y)); |
| 2660 | return a.ops.every(has); |
| 2661 | }, |
| 2662 | collection: { |
| 2663 | ...SET_BASE_HANDLERS, |
| 2664 | // A set is not indexable |
| 2665 | at: undefined, |
| 2666 | indexWhere: undefined, |
| 2667 | // A comprehension computes its elements on demand |
| 2668 | isLazy: (expr) => |
| 2669 | isFunction(expr) && parseSetComprehension(expr.ops) !== null, |
| 2670 | count: (expr) => { |
| 2671 | if (!isFunction(expr)) return 0; |
| 2672 | const comp = parseSetComprehension(expr.ops); |
| 2673 | if (comp === null) return expr.nops; |
| 2674 | // Cardinality of the comprehension: number of distinct substituted |
| 2675 | // bodies. Symbolic or infinite domains are not enumerable: undefined. |
| 2676 | return enumerateSetComprehension(comp)?.length; |
| 2677 | }, |
| 2678 | isEmpty: (expr) => { |
| 2679 | if (!isFunction(expr)) return true; |
no test coverage detected