| 802 | } |
| 803 | } |
| 804 | void p_array_bool_element2d(FlatZincSpace& s, const ConExpr& ce, |
| 805 | AST::Node* ann) { |
| 806 | bool isConstant = true; |
| 807 | AST::Array* a = ce[2]->getArray(); |
| 808 | for (int i=a->a.size(); i--;) { |
| 809 | if (!a->a[i]->isBool()) { |
| 810 | isConstant = false; |
| 811 | break; |
| 812 | } |
| 813 | } |
| 814 | IntVar selector0 = s.arg2IntVar(ce[0]); |
| 815 | IntVar selector1 = s.arg2IntVar(ce[1]); |
| 816 | IntSet idxset0 = s.arg2intset(ce[3]); |
| 817 | IntSet idxset1 = s.arg2intset(ce[4]); |
| 818 | |
| 819 | int w = idxset1.size(); |
| 820 | int s1off = idxset1.min(); |
| 821 | int h = idxset0.size(); |
| 822 | int s0off = idxset0.min(); |
| 823 | |
| 824 | if (isConstant) { |
| 825 | IntSharedArray sia = s.arg2boolsharedarray(ce[2], 0); |
| 826 | element(s, sia, selector1, -s1off, w, selector0, -s0off, h, s.arg2BoolVar(ce[5]), s.ann2ipl(ann)); |
| 827 | } else { |
| 828 | BoolVarArgs iv = s.arg2boolvarargs(ce[2], 0); |
| 829 | element(s, iv, selector1, -s1off, w, selector0, -s0off, h, s.arg2BoolVar(ce[5]), s.ann2ipl(ann)); |
| 830 | } |
| 831 | } |
| 832 | |
| 833 | /* coercion constraints */ |
| 834 | void p_bool2int(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) { |
nothing calls this directly
no test coverage detected