termSubsumedBy returns true when cand is subsumed by sub, meaning sub |= cand (cand is "more specific"). In a disjunction this makes cand redundant: disj(sub, cand) = sub. Only applies when neither term contains a status func. Example: sub=A, cand=A&&B → every model satisfying A&&B also satisfies A
(cand, sub ConditionNode)
| 190 | // Example: sub=A, cand=A&&B → every model satisfying A&&B also satisfies A, |
| 191 | // so A already covers A&&B in a disjunction. |
| 192 | func termSubsumedBy(cand, sub ConditionNode) bool { |
| 193 | if nodesEqual(cand, sub) { |
| 194 | return false // identical terms are handled by dedup, not subsumption |
| 195 | } |
| 196 | if containsStatusFunc(cand) || containsStatusFunc(sub) { |
| 197 | return false |
| 198 | } |
| 199 | for _, ct := range collectAndTerms(cand) { |
| 200 | if nodesEqual(ct, sub) { |
| 201 | return true |
| 202 | } |
| 203 | } |
| 204 | return false |
| 205 | } |
| 206 | |
| 207 | // --- node-specific optimisers ------------------------------------------------ |
| 208 |
no test coverage detected