| 1011 | } |
| 1012 | |
| 1013 | void |
| 1014 | FlatZincSpace::postConstraints(std::vector<ConExpr*>& ces) { |
| 1015 | ConExprOrder ceo; |
| 1016 | std::sort(ces.begin(), ces.end(), ceo); |
| 1017 | |
| 1018 | for (unsigned int i=0; i<ces.size(); i++) { |
| 1019 | const ConExpr& ce = *ces[i]; |
| 1020 | try { |
| 1021 | registry().post(*this, ce); |
| 1022 | } catch (Gecode::Exception& e) { |
| 1023 | throw FlatZinc::Error("Gecode", e.what(), ce.ann); |
| 1024 | } catch (AST::TypeError& e) { |
| 1025 | throw FlatZinc::Error("Type error", e.what(), ce.ann); |
| 1026 | } |
| 1027 | delete ces[i]; |
| 1028 | ces[i] = nullptr; |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | void flattenAnnotations(AST::Array* ann, std::vector<AST::Node*>& out) { |
| 1033 | for (unsigned int i=0; i<ann->a.size(); i++) { |