| 761 | } |
| 762 | } |
| 763 | void p_array_bool_element(FlatZincSpace& s, const ConExpr& ce, |
| 764 | AST::Node* ann) { |
| 765 | bool isConstant = true; |
| 766 | AST::Array* a = ce[1]->getArray(); |
| 767 | for (int i=a->a.size(); i--;) { |
| 768 | if (!a->a[i]->isBool()) { |
| 769 | isConstant = false; |
| 770 | break; |
| 771 | } |
| 772 | } |
| 773 | IntVar selector = s.arg2IntVar(ce[0]); |
| 774 | rel(s, selector > 0); |
| 775 | if (isConstant) { |
| 776 | IntSharedArray sia = s.arg2boolsharedarray(ce[1], 1); |
| 777 | element(s, sia, selector, s.arg2BoolVar(ce[2]), s.ann2ipl(ann)); |
| 778 | } else { |
| 779 | BoolVarArgs iv = s.arg2boolvarargs(ce[1], 1); |
| 780 | element(s, iv, selector, s.arg2BoolVar(ce[2]), s.ann2ipl(ann)); |
| 781 | } |
| 782 | } |
| 783 | void p_array_bool_element_offset(FlatZincSpace& s, const ConExpr& ce, |
| 784 | AST::Node* ann) { |
| 785 | bool isConstant = true; |
nothing calls this directly
no test coverage detected