78 using Pred = Then<SemanticSetMap, PredPost>;
80 template <
class Map,
class Node>
81 static constexpr bool apply(Pred
const& p,
Map const& m, Node
const& n)
83 if constexpr (ValueCheck<SemanticSetMap>::apply(p.pre, m, n)) {
84 return ValueCheck<PredPost>::apply(p.post, m, n);
104 using Pred = Then<SemanticSetMap, PredPost>;
106 template <
class Map,
class Node>
107 static constexpr bool apply(Pred
const& p,
Map const& m, Node
const& n)
109 if constexpr (InnerCheck<SemanticSetMap>::apply(p.pre, m, n)) {
110 return InnerCheck<PredPost>::apply(p.post, m, n);
157 template <
class Map,
class Node>
158 static inline bool apply(
Pred p,
Map const& m, Node n)
160 if constexpr (Negated) {
163 switch (m.semanticSetPropagationCriteria()) {
164 case ufo::impl::SemanticSetPropagationCriteria::MIN:
165 case ufo::impl::SemanticSetPropagationCriteria::MAX:
166 case ufo::impl::SemanticSetPropagationCriteria::NONE:
167 return m.semantics(n.index()).
contains(p.label);
169 case ufo::impl::SemanticSetPropagationCriteria::S_MIN:
170 case ufo::impl::SemanticSetPropagationCriteria::S_MAX:
171 return p.label == (m.semanticSetSummary(n.index()).label & p.label);
216 template <
class Map,
class Node>
217 static inline bool apply(
Pred p,
Map const& m, Node n)
219 if constexpr (Negated) {
222 switch (m.semanticSetPropagationCriteria()) {
223 case ufo::impl::SemanticSetPropagationCriteria::MIN:
224 case ufo::impl::SemanticSetPropagationCriteria::MAX:
225 case ufo::impl::SemanticSetPropagationCriteria::NONE:
226 return m.anySemantics(n.index(), p.tags.begin(), p.tags.end());
228 case ufo::impl::SemanticSetPropagationCriteria::S_MIN:
229 case ufo::impl::SemanticSetPropagationCriteria::S_MAX:
230 auto summary_label = m.semanticSetSummary(n.index()).label;
231 for (
auto tag : p.tags) {
232 auto labelset = m.labels(tag);
233 for (
auto labels : labelset) {
234 for (
auto l = labels.lower(); l <= labels.upper(); ++l) {
235 if (l == (summary_label & l)) {
267 template <
class Map,
class Node>
268 static inline bool apply(
Pred p,
Map const& m, Node n)
270 if constexpr (Negated) {
271 return !m.anySemantics(n.index(),
272 SemanticRangeSet(p.labels.begin(), p.labels.end()));
274 return m.anySemantics(n.index(),
275 SemanticRangeSet(p.labels.begin(), p.labels.end()));
284 template <
class Map,
class Node>
285 static inline bool apply(
Pred p,
Map const& m, Node n)
287 if constexpr (Negated) {
290 switch (m.semanticSetPropagationCriteria()) {
291 case ufo::impl::SemanticSetPropagationCriteria::MIN:
292 case ufo::impl::SemanticSetPropagationCriteria::MAX:
293 case ufo::impl::SemanticSetPropagationCriteria::NONE:
294 return m.anySemantics(n.index(),
295 SemanticRangeSet(p.labels.begin(), p.labels.end()));
297 case ufo::impl::SemanticSetPropagationCriteria::S_MIN:
298 case ufo::impl::SemanticSetPropagationCriteria::S_MAX:
299 auto summary_label = m.semanticSetSummary(n.index()).label;
300 for (
auto l : p.labels) {
301 if (l == (summary_label & l)) {
350 template <
class Map,
class Node>
351 static inline bool apply(
Pred p,
Map const& m, Node n)
353 if constexpr (Negated) {
356 switch (m.semanticSetPropagationCriteria()) {
357 case ufo::impl::SemanticSetPropagationCriteria::MIN:
358 case ufo::impl::SemanticSetPropagationCriteria::MAX:
359 case ufo::impl::SemanticSetPropagationCriteria::NONE:
360 return m.allSemantics(n.index(), p.tags.begin(), p.tags.end());
362 case ufo::impl::SemanticSetPropagationCriteria::S_MIN:
363 case ufo::impl::SemanticSetPropagationCriteria::S_MAX:
364 auto summary_label = m.semanticSetSummary(n.index()).label;
365 for (
auto tag : p.tags) {
366 auto labelset = m.labels(tag);
367 for (
auto labels : labelset) {
368 for (
auto l = labels.lower(); l <= labels.upper(); ++l) {
369 if (l != (summary_label & l)) {
401 template <
class Map,
class Node>
402 static inline bool apply(
Pred p,
Map const& m, Node n)
404 if constexpr (Negated) {
405 return !m.allSemantics(n.index(),
406 SemanticRangeSet(p.labels.begin(), p.labels.end()));
408 return m.allSemantics(n.index(),
409 SemanticRangeSet(p.labels.begin(), p.labels.end()));
418 template <
class Map,
class Node>
419 static inline bool apply(
Pred p,
Map const& m, Node n)
421 if constexpr (Negated) {
424 switch (m.semanticSetPropagationCriteria()) {
425 case ufo::impl::SemanticSetPropagationCriteria::MIN:
426 case ufo::impl::SemanticSetPropagationCriteria::MAX:
427 case ufo::impl::SemanticSetPropagationCriteria::NONE:
428 return m.allSemantics(n.index(),
429 SemanticRangeSet(p.labels.begin(), p.labels.end()));
431 case ufo::impl::SemanticSetPropagationCriteria::S_MIN:
432 case ufo::impl::SemanticSetPropagationCriteria::S_MAX:
433 auto summary_label = m.semanticSetSummary(n.index()).label;
434 for (
auto l : p.labels) {
435 if (l != (summary_label & l)) {
484 template <
class Map,
class Node>
485 static inline bool apply(
Pred p,
Map const& m, Node n)
487 if constexpr (Negated) {
490 switch (m.semanticSetPropagationCriteria()) {
491 case ufo::impl::SemanticSetPropagationCriteria::MIN:
492 case ufo::impl::SemanticSetPropagationCriteria::MAX:
493 case ufo::impl::SemanticSetPropagationCriteria::NONE:
494 return m.noneSemantics(n.index(), p.tags.begin(), p.tags.end());
496 case ufo::impl::SemanticSetPropagationCriteria::S_MIN:
497 case ufo::impl::SemanticSetPropagationCriteria::S_MAX:
return true;
523 template <
class Map,
class Node>
524 static inline bool apply(
Pred p,
Map const& m, Node n)
526 if constexpr (Negated) {
527 return !m.noneSemantics(n.index(),
528 SemanticRangeSet(p.labels.begin(), p.labels.end()));
530 return m.noneSemantics(n.index(),
531 SemanticRangeSet(p.labels.begin(), p.labels.end()));
540 template <
class Map,
class Node>
541 static inline bool apply(
Pred p,
Map const& m, Node n)
543 if constexpr (Negated) {
546 switch (m.semanticSetPropagationCriteria()) {
547 case ufo::impl::SemanticSetPropagationCriteria::MIN:
548 case ufo::impl::SemanticSetPropagationCriteria::MAX:
549 case ufo::impl::SemanticSetPropagationCriteria::NONE:
550 return m.noneSemantics(n.index(),
551 SemanticRangeSet(p.labels.begin(), p.labels.end()));
553 case ufo::impl::SemanticSetPropagationCriteria::S_MIN:
554 case ufo::impl::SemanticSetPropagationCriteria::S_MAX:
return true;