| 841 | } |
| 842 | |
| 843 | void p_int_in(FlatZincSpace& s, const ConExpr& ce, AST::Node *) { |
| 844 | IntSet d = s.arg2intset(ce[1]); |
| 845 | if (ce[0]->isBoolVar()) { |
| 846 | IntSetRanges dr(d); |
| 847 | Iter::Ranges::Singleton sr(0,1); |
| 848 | Iter::Ranges::Inter<IntSetRanges,Iter::Ranges::Singleton> i(dr,sr); |
| 849 | IntSet d01(i); |
| 850 | if (d01.size() == 0) { |
| 851 | s.fail(); |
| 852 | } else { |
| 853 | rel(s, s.arg2BoolVar(ce[0]), IRT_GQ, d01.min()); |
| 854 | rel(s, s.arg2BoolVar(ce[0]), IRT_LQ, d01.max()); |
| 855 | } |
| 856 | } else { |
| 857 | dom(s, s.arg2IntVar(ce[0]), d); |
| 858 | } |
| 859 | } |
| 860 | void p_int_in_reif(FlatZincSpace& s, const ConExpr& ce, AST::Node *) { |
| 861 | IntSet d = s.arg2intset(ce[1]); |
| 862 | if (ce[0]->isBoolVar()) { |
nothing calls this directly
no test coverage detected