| 781 | } |
| 782 | } |
| 783 | void p_array_bool_element_offset(FlatZincSpace& s, const ConExpr& ce, |
| 784 | AST::Node* ann) { |
| 785 | bool isConstant = true; |
| 786 | AST::Array* a = ce[2]->getArray(); |
| 787 | for (int i=a->a.size(); i--;) { |
| 788 | if (!a->a[i]->isBool()) { |
| 789 | isConstant = false; |
| 790 | break; |
| 791 | } |
| 792 | } |
| 793 | IntVar selector = s.arg2IntVar(ce[0]); |
| 794 | int offset = ce[1]->getInt(); |
| 795 | rel(s, selector >= offset); |
| 796 | if (isConstant) { |
| 797 | IntSharedArray sia = s.arg2boolsharedarray(ce[2]); |
| 798 | element(s, sia, selector, -offset, s.arg2BoolVar(ce[3]), s.ann2ipl(ann)); |
| 799 | } else { |
| 800 | BoolVarArgs iv = s.arg2boolvarargs(ce[2]); |
| 801 | element(s, iv, selector, -offset, s.arg2BoolVar(ce[3]), s.ann2ipl(ann)); |
| 802 | } |
| 803 | } |
| 804 | void p_array_bool_element2d(FlatZincSpace& s, const ConExpr& ce, |
| 805 | AST::Node* ann) { |
| 806 | bool isConstant = true; |
nothing calls this directly
no test coverage detected