594 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 23, 24, 2, 2, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 22,
597 2, 29, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 27, 2, 28, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 30, 2, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
607 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
713 -184, 16, 7, -184, 34, 24, 87, 20, -184, 52, -184, 96,
714 -184, -184, -184, 125, 90, 166, 167, 157, 128, -184, -184, -184,
715 150, 25, 48, 168, 27, 158, 169, 164, -184, 161, 97, -184,
716 -184, 170, 171, -184, 172, 173, 162, 90, 174, 175, 176, 177,
717 -184, -184, 180, 157, 179, -184, -184, 183, 157, -184, -184, 181,
718 134, -184, -184, 22, 182, -184, 48, 185, 188, 189, 114, -184,
719 184, -184, -10, 86, 86, 86, -184, 137, 178, 193, 186, -184,
720 190, -184, -184, 187, -184, -184, 36, -184, 94, 195, -184, 165,
721 -184, 116, 157, 65, -184, -184, -184, 197, -184, 98, 99, -184,
722 209, 199, 208, -184, 210, 142, -184, 203, 194, -184, 29, -184,
723 204, 205, -184, 198, -184, -184, 18, -184, 122, -184, 86, 206,
724 137, 211, -184, 74, -184, -184, -184, 70, 80, -184, 212, 213,
725 -184, 136, -184, 200, 214, 142, -184, -184, 216, -184, -184, 154,
726 207, 137, -184, 90, 201, 90, 215, 217, 218, -184, 219, -184,
727 -184, 220, -184, -184, -184, -184, 223, 222, 224, 225, 226, 231,
728 -184, -184, 232, -184, 233, -184, -184, -184, -184, -184, 42, 50,
729 53, 63, 227, 228, 229, 230, -184, 44, 94, 138, 120, -184,
730 140, -184, 144, 234, -184, -184, 145, -184, -184, 146, -184, 94,
731 -184, 221, 160, -184, -184, -184, 235, -184, -184};
737 5, 0, 0, 1, 0, 0, 0, 71, 4, 0, 3, 0, 38, 46, 39, 0, 0, 0, 0,
738 0, 0, 48, 49, 50, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 0, 52, 17, 0,
739 0, 85, 0, 0, 0, 0, 0, 8, 0, 0, 42, 43, 0, 0, 0, 40, 47, 0, 0,
740 41, 85, 0, 0, 70, 2, 0, 0, 6, 0, 0, 0, 0, 0, 85, 0, 51, 0, 0,
741 0, 0, 96, 0, 16, 0, 0, 13, 0, 7, 9, 0, 44, 45, 28, 55, 0, 75, 77,
742 80, 76, 0, 0, 0, 74, 98, 97, 89, 90, 91, 0, 84, 0, 0, 0, 10, 0, 0,
743 25, 61, 66, 65, 0, 19, 0, 0, 34, 36, 35, 83, 0, 33, 0, 85, 0, 0, 0,
744 0, 95, 0, 87, 15, 14, 0, 0, 27, 0, 0, 64, 0, 78, 0, 0, 0, 82, 79,
745 72, 73, 88, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 62, 0, 63, 81, 0, 32,
746 92, 93, 86, 0, 0, 0, 0, 0, 0, 67, 37, 0, 11, 0, 85, 85, 85, 12, 85,
747 0, 0, 0, 31, 0, 0, 0, 0, 26, 0, 0, 0, 0, 21, 0, 69, 0, 59, 58,
748 23, 0, 57, 30, 0, 20, 0, 24, 0, 0, 22, 29, 68, 0, 56, 60};
765 24, 70, 74, 107, 101, 102, 141, 79, 4, 29, -18, -18, -18, -18, -18,
766 90, 3, 205, 5, 92, -18, -18, -18, 11, 12, -18, 13, 14, -18, 80,
767 38, 48, 221, 15, 49, 16, 64, -18, 17, 39, 81, 18, 170, 149, 9,
768 50, 150, 32, 128, 33, 19, 42, 12, 79, 13, 14, 8, 51, 153, 79,
769 144, 15, 32, 43, 33, 113, 17, 79, 145, 18, 79, 194, 203, 152, 12,
770 26, 13, 14, 19, 195, 79, 173, 196, 15, 12, 159, 13, 14, 17, 129,
771 130, 18, 197, 15, 12, 161, 13, 14, 17, 157, 19, 18, 158, 15, 93,
772 94, 95, 96, 17, 10, 19, 18, 115, 97, 116, 117, 98, 103, 104, 105,
773 19, 132, 56, 27, 118, 133, 106, 134, 57, 190, 191, 192, 160, 193, 122,
774 28, 123, 124, 122, 56, 123, 124, 76, 77, 125, 89, 78, 56, 212, 204,
775 36, 79, 174, 151, 176, 103, 104, 105, 207, 208, 122, 56, 123, 124, 106,
776 56, 209, 167, 214, 215, 218, 149, 216, 219, 220, 32, 37, 33, 171, 157,
777 207, 208, 30, 31, 52, 54, 47, 53, 55, 63, 58, 59, 121, 68, 61,
778 62, 69, 85, 65, 71, 66, 72, 67, 108, 75, 86, 87, 88, 84, 109,
779 111, 120, 91, 131, 110, 112, 80, 138, 139, 142, 140, 143, 146, 147, 154,
780 148, 137, 175, 168, 156, 165, 166, 169, 79, 213, 172, 155, 223, 0, 222,
781 162, 177, 183, 178, 179, 185, 186, 180, 181, 182, 184, 187, 188, 189, 199,
782 200, 201, 202, 73, 163, 0, 217, 0, 224, 164};
785 7, 51, 58, 79, 76, 77, 113, 17, 1, 16, 3, 4, 5, 6, 7, 71,
786 0, 200, 11, 29, 13, 14, 15, 3, 4, 18, 6, 7, 21, 7, 5, 4,
787 215, 13, 7, 15, 43, 30, 18, 14, 18, 21, 149, 25, 20, 18, 28, 18,
788 98, 20, 30, 3, 4, 17, 6, 7, 22, 30, 130, 17, 31, 13, 18, 15,
789 20, 29, 18, 17, 118, 21, 17, 29, 28, 129, 4, 23, 6, 7, 30, 29,
790 17, 157, 29, 13, 4, 15, 6, 7, 18, 24, 25, 21, 29, 13, 4, 15,
791 6, 7, 18, 25, 30, 21, 28, 13, 18, 19, 20, 21, 18, 22, 30, 21,
792 18, 27, 20, 21, 30, 18, 19, 20, 30, 23, 25, 27, 30, 27, 27, 28,
793 31, 185, 186, 187, 139, 189, 18, 10, 20, 21, 18, 25, 20, 21, 8, 9,
794 28, 31, 12, 25, 28, 199, 22, 17, 159, 31, 161, 18, 19, 20, 20, 21,
795 18, 25, 20, 21, 27, 25, 28, 31, 28, 25, 25, 25, 28, 28, 28, 18,
796 26, 20, 24, 25, 20, 21, 16, 16, 26, 21, 18, 18, 27, 27, 20, 20,
797 27, 16, 22, 22, 16, 66, 24, 20, 25, 18, 26, 25, 23, 20, 18, 18,
798 26, 16, 20, 16, 28, 16, 28, 28, 7, 18, 10, 16, 10, 27, 18, 18,
799 18, 27, 108, 26, 28, 18, 18, 18, 18, 17, 202, 28, 132, 218, -1, 18,
800 140, 26, 20, 26, 26, 20, 20, 28, 28, 26, 26, 20, 20, 20, 27, 27,
801 27, 27, 56, 140, -1, 27, -1, 28, 140};
806 0, 33, 34, 0, 1, 11, 35, 40, 22, 20, 22, 3, 4, 6, 7, 13, 15, 18, 21,
807 30, 41, 46, 47, 48, 49, 56, 23, 27, 10, 49, 16, 16, 18, 20, 50, 51, 22, 26,
808 5, 14, 57, 63, 3, 15, 36, 37, 49, 18, 4, 7, 18, 30, 26, 18, 21, 27, 25,
809 31, 20, 20, 60, 22, 22, 27, 49, 24, 25, 26, 16, 16, 50, 20, 18, 51, 60, 23,
810 8, 9, 12, 17, 7, 18, 38, 39, 26, 36, 20, 18, 18, 31, 60, 28, 29, 18, 19,
811 20, 21, 27, 30, 58, 59, 59, 59, 18, 19, 20, 27, 62, 25, 16, 28, 20, 28, 29,
812 42, 18, 20, 21, 30, 54, 16, 27, 18, 20, 21, 28, 44, 45, 50, 24, 25, 16, 23,
813 27, 28, 61, 62, 39, 18, 10, 10, 45, 16, 27, 31, 50, 18, 18, 27, 25, 28, 31,
814 60, 59, 18, 61, 18, 25, 28, 15, 49, 15, 46, 47, 48, 18, 18, 31, 28, 18, 45,
815 24, 28, 62, 49, 26, 49, 26, 26, 26, 28, 28, 26, 20, 26, 20, 20, 20, 20, 20,
816 60, 60, 60, 60, 29, 29, 29, 29, 43, 27, 27, 27, 27, 28, 50, 54, 55, 20, 21,
817 28, 52, 53, 28, 44, 28, 25, 28, 27, 25, 28, 28, 54, 18, 53, 28};
821 0, 32, 33, 34, 34, 34, 35, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39,
822 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44,
823 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 49, 49, 49,
824 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54,
825 55, 55, 56, 56, 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60,
826 60, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63};
831 0, 2, 5, 3, 3, 0, 5, 3, 1, 3, 4, 8, 9, 1, 3, 3, 1, 3, 0, 6,
832 15, 14, 15, 14, 15, 6, 13, 2, 0, 4, 3, 0, 3, 1, 1, 1, 1, 4, 1, 1,
833 3, 3, 3, 3, 5, 5, 1, 3, 1, 1, 1, 3, 1, 1, 1, 4, 3, 1, 1, 1,
834 4, 1, 3, 3, 2, 1, 1, 4, 3, 1, 3, 0, 6, 3, 1, 1, 1, 1, 3, 3,
835 1, 4, 3, 2, 3, 0, 3, 1, 3, 1, 1, 1, 4, 4, 3, 2, 3, 4, 4};
1275 int yyerrstatus = 0;
1304 char* yymsg = yymsgbuf;
1307#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1313 YYDPRINTF((stderr,
"Starting parse\n"));
1331 YYDPRINTF((stderr,
"Entering state %d\n", yystate));
1338 if (yyss + yystacksize - 1 <= yyssp)
1339#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1346#if defined yyoverflow
1358 yyoverflow(
YY_(
"memory exhausted"), &yyss1, yysize *
YYSIZEOF(*yyssp),
1359 &yyvs1, yysize *
YYSIZEOF(*yyvsp), &yystacksize);
1377#undef YYSTACK_RELOCATE
1382 yyssp = yyss + yysize - 1;
1383 yyvsp = yyvs + yysize - 1;
1387 (stderr,
"Stack size increased to %ld\n",
YY_CAST(
long, yystacksize)));
1390 if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
1413 YYDPRINTF((stderr,
"Reading a token\n"));
1420 YYDPRINTF((stderr,
"Now at end of input.\n"));
1437 if (yyn < 0 ||
YYLAST < yyn ||
yycheck[yyn] != yytoken)
goto yydefault;
1447 if (yyerrstatus) yyerrstatus--;
1465 if (yyn == 0)
goto yyerrlab;
1483 yyval = yyvsp[1 - yylen];
1488#line 113 "parser.yy"
1492#line 1655 "parser.tab.cc"
1497#line 148 "parser.yy"
1502 const std::string& identifier = (yyvsp[-3].
string_value);
1504 std::vector<Annotation>*
const annotations = (yyvsp[-2].
annotations);
1508 context->domain_map[identifier] = assignment;
1516#line 1679 "parser.tab.cc"
1522#line 168 "parser.yy"
1524 std::vector<Annotation>*
const annotations = (yyvsp[-4].
annotations);
1526 CHECK_EQ((yyvsp[-12].integer_value), 1)
1527 <<
"Only [1..n] array are supported here.";
1529 const std::string& identifier = (yyvsp[-5].
string_value);
1530 const std::vector<int64_t>*
const assignments = (yyvsp[-1].
integers);
1531 CHECK(assignments !=
nullptr);
1532 CHECK_EQ(num_constants, assignments->size());
1534 context->integer_array_map[identifier] = *assignments;
1538#line 1698 "parser.tab.cc"
1543#line 183 "parser.yy"
1545 std::vector<Annotation>*
const annotations = (yyvsp[-3].
annotations);
1547 CHECK_EQ((yyvsp[-11].integer_value), 1)
1548 <<
"Only [1..n] array are supported here.";
1550 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1551 const std::string& identifier = (yyvsp[-4].
string_value);
1552 context->integer_array_map[identifier] = std::vector<int64_t>();
1555#line 1713 "parser.tab.cc"
1561#line 194 "parser.yy"
1563 std::vector<Annotation>*
const annotations = (yyvsp[-4].
annotations);
1565 CHECK_EQ((yyvsp[-12].integer_value), 1)
1566 <<
"Only [1..n] array are supported here.";
1568 const std::string& identifier = (yyvsp[-5].
string_value);
1569 const std::vector<double>*
const assignments = (yyvsp[-1].
doubles);
1570 CHECK(assignments !=
nullptr);
1571 CHECK_EQ(num_constants, assignments->size());
1573 context->float_array_map[identifier] = *assignments;
1577#line 1732 "parser.tab.cc"
1582#line 209 "parser.yy"
1584 std::vector<Annotation>*
const annotations = (yyvsp[-3].
annotations);
1586 CHECK_EQ((yyvsp[-11].integer_value), 1)
1587 <<
"Only [1..n] array are supported here.";
1589 CHECK_EQ(num_constants, 0) <<
"Empty arrays should have a size of 0";
1590 const std::string& identifier = (yyvsp[-4].
string_value);
1591 context->float_array_map[identifier] = std::vector<double>();
1594#line 1747 "parser.tab.cc"
1600#line 220 "parser.yy"
1603 CHECK_EQ((yyvsp[-12].integer_value), 1)
1604 <<
"Only [1..n] array are supported here.";
1607 const std::string& identifier = (yyvsp[-5].
string_value);
1608 const std::vector<Domain>*
const assignments = (yyvsp[-1].
domains);
1609 const std::vector<Annotation>*
const annotations =
1611 CHECK(assignments !=
nullptr);
1612 CHECK_EQ(num_constants, assignments->size());
1614 if (!AllDomainsHaveOneValue(*assignments)) {
1615 context->domain_array_map[identifier] = *assignments;
1618 std::vector<int64_t> values(num_constants);
1619 for (
int i = 0; i < num_constants; ++i) {
1620 values[i] = (*assignments)[i].values.front();
1623 context->integer_array_map[identifier] = values;
1628#line 1777 "parser.tab.cc"
1633#line 245 "parser.yy"
1640 const std::string& identifier = (yyvsp[-2].
string_value);
1641 std::vector<Annotation>*
const annotations = (yyvsp[-1].
annotations);
1643 const bool introduced = ContainsId(annotations,
"var_is_introduced") ||
1644 absl::StartsWith(identifier,
"X_INTRODUCED");
1647 var =
model->AddVariable(identifier, domain, introduced);
1648 }
else if (assignment.
variable ==
nullptr) {
1654 var->
Merge(identifier, domain, introduced);
1660 if (ContainsId(annotations,
"output_var")) {
1666#line 1815 "parser.tab.cc"
1672#line 279 "parser.yy"
1677 CHECK_EQ((yyvsp[-10].integer_value), 1);
1680 const std::string& identifier = (yyvsp[-2].
string_value);
1681 std::vector<Annotation>*
const annotations = (yyvsp[-1].
annotations);
1682 std::vector<VarRefOrValue>*
const assignments =
1684 CHECK(assignments ==
nullptr || assignments->size() == num_vars);
1685 const bool introduced = ContainsId(annotations,
"var_is_introduced") ||
1686 absl::StartsWith(identifier,
"X_INTRODUCED");
1688 std::vector<Variable*> vars(num_vars,
nullptr);
1690 for (
int i = 0; i < num_vars; ++i) {
1691 const std::string var_name =
1692 absl::StrFormat(
"%s[%d]", identifier, i + 1);
1693 if (assignments ==
nullptr) {
1694 vars[i] =
model->AddVariable(var_name, domain, introduced);
1695 }
else if ((*assignments)[i].variable ==
nullptr) {
1696 if ((*assignments)[i].is_float) {
1698 const double value = (*assignments)[i].float_value;
1704 const int64_t
value = (*assignments)[i].value;
1711 CHECK(
var !=
nullptr);
1713 vars[i]->Merge(var_name, domain, introduced);
1719 context->variable_array_map[identifier] = vars;
1724 if (annotations !=
nullptr) {
1725 for (
int i = 0; i < annotations->size(); ++i) {
1733 std::vector<SolutionOutputSpecs::Bounds> bounds;
1737 bounds.emplace_back(SolutionOutputSpecs::Bounds(
1748#line 1894 "parser.tab.cc"
1752#line 355 "parser.yy"
1756#line 1900 "parser.tab.cc"
1760#line 356 "parser.yy"
1764#line 1906 "parser.tab.cc"
1768#line 359 "parser.yy"
1772#line 1912 "parser.tab.cc"
1776#line 360 "parser.yy"
1780#line 1918 "parser.tab.cc"
1784#line 361 "parser.yy"
1788#line 1924 "parser.tab.cc"
1792#line 364 "parser.yy"
1797#line 1933 "parser.tab.cc"
1801#line 368 "parser.yy"
1806#line 1942 "parser.tab.cc"
1810#line 374 "parser.yy"
1814#line 1948 "parser.tab.cc"
1818#line 375 "parser.yy"
1822#line 1954 "parser.tab.cc"
1826#line 376 "parser.yy"
1830 if (
context->integer_map.contains(
id)) {
1833 }
else if (
context->float_map.contains(
id)) {
1836 }
else if (
context->variable_map.contains(
id)) {
1840 LOG(ERROR) <<
"Unknown symbol " << id;
1845#line 1974 "parser.tab.cc"
1849#line 391 "parser.yy"
1854 if (
context->integer_array_map.contains(
id)) {
1857 }
else if (
context->float_array_map.contains(
id)) {
1860 }
else if (
context->variable_array_map.contains(
id)) {
1864 LOG(ERROR) <<
"Unknown symbol " << id;
1869#line 1998 "parser.tab.cc"
1873#line 412 "parser.yy"
1877#line 2004 "parser.tab.cc"
1881#line 413 "parser.yy"
1885#line 2010 "parser.tab.cc"
1889#line 414 "parser.yy"
1894#line 2016 "parser.tab.cc"
1898#line 415 "parser.yy"
1900 CHECK((yyvsp[-1].integers) !=
nullptr);
1904#line 2026 "parser.tab.cc"
1908#line 422 "parser.yy"
1912#line 2032 "parser.tab.cc"
1916#line 423 "parser.yy"
1920#line 2038 "parser.tab.cc"
1924#line 424 "parser.yy"
1927 (yyvsp[0].integer_value));
1929#line 2044 "parser.tab.cc"
1933#line 425 "parser.yy"
1935 CHECK((yyvsp[-1].integers) !=
nullptr);
1940#line 2054 "parser.tab.cc"
1944#line 432 "parser.yy"
1948#line 2060 "parser.tab.cc"
1952#line 433 "parser.yy"
1955 (yyvsp[0].double_value));
1957#line 2068 "parser.tab.cc"
1961#line 438 "parser.yy"
1963 (yyval.
domain) = (yyvsp[0].domain);
1965#line 2074 "parser.tab.cc"
1969#line 439 "parser.yy"
1971 (yyval.
domain) = (yyvsp[0].domain);
1973#line 2080 "parser.tab.cc"
1977#line 440 "parser.yy"
1979 (yyval.
domain) = (yyvsp[0].domain);
1981#line 2086 "parser.tab.cc"
1985#line 443 "parser.yy"
1987 (yyval.
integers) = (yyvsp[-2].integers);
1988 (yyval.
integers)->emplace_back((yyvsp[0].integer_value));
1990#line 2092 "parser.tab.cc"
1994#line 444 "parser.yy"
1996 (yyval.
integers) =
new std::vector<int64_t>();
1997 (yyval.
integers)->emplace_back((yyvsp[0].integer_value));
1999#line 2098 "parser.tab.cc"
2003#line 447 "parser.yy"
2007#line 2104 "parser.tab.cc"
2011#line 448 "parser.yy"
2015#line 2110 "parser.tab.cc"
2019#line 449 "parser.yy"
2025#line 2118 "parser.tab.cc"
2029#line 454 "parser.yy"
2031 (yyval.
doubles) = (yyvsp[-2].doubles);
2032 (yyval.
doubles)->emplace_back((yyvsp[0].double_value));
2034#line 2124 "parser.tab.cc"
2038#line 455 "parser.yy"
2040 (yyval.
doubles) =
new std::vector<double>();
2041 (yyval.
doubles)->emplace_back((yyvsp[0].double_value));
2043#line 2130 "parser.tab.cc"
2047#line 458 "parser.yy"
2051#line 2136 "parser.tab.cc"
2055#line 459 "parser.yy"
2059#line 2142 "parser.tab.cc"
2063#line 460 "parser.yy"
2069#line 2150 "parser.tab.cc"
2073#line 465 "parser.yy"
2077#line 2156 "parser.tab.cc"
2081#line 466 "parser.yy"
2086#line 2162 "parser.tab.cc"
2090#line 467 "parser.yy"
2092 CHECK((yyvsp[-1].integers) !=
nullptr);
2096#line 2172 "parser.tab.cc"
2100#line 472 "parser.yy"
2104#line 2178 "parser.tab.cc"
2108#line 473 "parser.yy"
2112#line 2186 "parser.tab.cc"
2116#line 476 "parser.yy"
2121#line 2192 "parser.tab.cc"
2125#line 477 "parser.yy"
2131#line 2201 "parser.tab.cc"
2135#line 483 "parser.yy"
2137 (yyval.
domains) = (yyvsp[-2].domains);
2138 (yyval.
domains)->emplace_back((yyvsp[0].domain));
2140#line 2210 "parser.tab.cc"
2144#line 487 "parser.yy"
2146 (yyval.
domains) =
new std::vector<Domain>();
2147 (yyval.
domains)->emplace_back((yyvsp[0].domain));
2149#line 2216 "parser.tab.cc"
2154#line 497 "parser.yy"
2156 const std::string& identifier = (yyvsp[-4].
string_value);
2157 CHECK((yyvsp[-2].args) !=
nullptr) <<
"Missing argument in constraint";
2158 const std::vector<Argument>& arguments = *(yyvsp[-2].
args);
2159 std::vector<Annotation>*
const annotations = (yyvsp[0].
annotations);
2161 model->AddConstraint(identifier, arguments,
2162 ContainsId(annotations,
"domain"));
2164 delete (yyvsp[-2].
args);
2166#line 2231 "parser.tab.cc"
2170#line 509 "parser.yy"
2172 (yyval.
args) = (yyvsp[-2].args);
2173 (yyval.
args)->emplace_back((yyvsp[0].arg));
2175#line 2237 "parser.tab.cc"
2179#line 510 "parser.yy"
2181 (yyval.
args) =
new std::vector<Argument>();
2182 (yyval.
args)->emplace_back((yyvsp[0].arg));
2184#line 2243 "parser.tab.cc"
2188#line 513 "parser.yy"
2192#line 2249 "parser.tab.cc"
2196#line 514 "parser.yy"
2200#line 2255 "parser.tab.cc"
2204#line 515 "parser.yy"
2208#line 2261 "parser.tab.cc"
2212#line 516 "parser.yy"
2215 (yyvsp[0].integer_value));
2217#line 2267 "parser.tab.cc"
2221#line 517 "parser.yy"
2223 CHECK((yyvsp[-1].integers) !=
nullptr);
2227#line 2277 "parser.tab.cc"
2231#line 522 "parser.yy"
2234 if (
context->integer_map.contains(
id)) {
2236 }
else if (
context->integer_array_map.contains(
id)) {
2238 }
else if (
context->float_map.contains(
id)) {
2239 const double d =
context->float_map.at(
id);
2241 }
else if (
context->float_array_map.contains(
id)) {
2242 const auto& double_values =
context->float_array_map.at(
id);
2244 }
else if (
context->variable_map.contains(
id)) {
2246 }
else if (
context->variable_array_map.contains(
id)) {
2248 }
else if (
context->domain_map.contains(
id)) {
2252 CHECK(
context->domain_array_map.contains(
id))
2253 <<
"Unknown identifier: " << id;
2254 const std::vector<Domain>& d =
context->domain_array_map.at(
id);
2258#line 2308 "parser.tab.cc"
2262#line 548 "parser.yy"
2266 if (
context->integer_array_map.contains(
id)) {
2269 }
else if (
context->variable_array_map.contains(
id)) {
2273 CHECK(
context->domain_array_map.contains(
id))
2274 <<
"Unknown identifier: " << id;
2279#line 2330 "parser.tab.cc"
2283#line 565 "parser.yy"
2285 std::vector<VarRefOrValue>*
const arguments =
2287 CHECK(arguments !=
nullptr);
2288 bool has_variables =
false;
2289 bool has_floats =
false;
2290 for (
int i = 0; i < arguments->size(); ++i) {
2291 if ((*arguments)[i].variable !=
nullptr) {
2292 has_variables =
true;
2294 if ((*arguments)[i].is_float) {
2298 if (has_variables) {
2299 std::vector<Variable*> vars;
2300 vars.reserve(arguments->size());
2301 for (
int i = 0; i < arguments->size(); ++i) {
2306 vars.push_back(
model->AddConstant(data.
value));
2312 }
else if (has_floats) {
2313 std::vector<double> values;
2314 values.reserve(arguments->size());
2316 if (data.is_float) {
2317 values.push_back(data.float_value);
2319 values.push_back(data.value);
2324 std::vector<int64_t> values;
2325 values.reserve(arguments->size());
2327 values.push_back(data.value);
2333#line 2383 "parser.tab.cc"
2337#line 613 "parser.yy"
2341#line 2391 "parser.tab.cc"
2345#line 622 "parser.yy"
2347 (yyval.
annotations) = (yyvsp[-2].annotations) !=
nullptr
2349 :
new std::vector<Annotation>();
2350 (yyval.
annotations)->emplace_back((yyvsp[0].annotation));
2352#line 2400 "parser.tab.cc"
2356#line 626 "parser.yy"
2360#line 2406 "parser.tab.cc"
2364#line 629 "parser.yy"
2367 (yyval.
annotations)->emplace_back((yyvsp[0].annotation));
2369#line 2412 "parser.tab.cc"
2373#line 630 "parser.yy"
2375 (yyval.
annotations) =
new std::vector<Annotation>();
2376 (yyval.
annotations)->emplace_back((yyvsp[0].annotation));
2378#line 2418 "parser.tab.cc"
2382#line 633 "parser.yy"
2385 (yyvsp[0].integer_value));
2387#line 2424 "parser.tab.cc"
2391#line 634 "parser.yy"
2395#line 2430 "parser.tab.cc"
2399#line 635 "parser.yy"
2403#line 2436 "parser.tab.cc"
2407#line 636 "parser.yy"
2410 if (
context->variable_map.contains(
id)) {
2412 }
else if (
context->variable_array_map.contains(
id)) {
2415 }
else if (
context->integer_map.contains(
id)) {
2418 }
else if (
context->integer_array_map.contains(
id)) {
2425#line 2455 "parser.tab.cc"
2429#line 650 "parser.yy"
2431 std::vector<Annotation>*
const annotations = (yyvsp[-1].
annotations);
2432 if (annotations !=
nullptr) {
2434 (yyvsp[-3].string_value), std::move(*annotations));
2440#line 2469 "parser.tab.cc"
2444#line 659 "parser.yy"
2452#line 2480 "parser.tab.cc"
2456#line 665 "parser.yy"
2458 std::vector<Annotation>*
const annotations = (yyvsp[-1].
annotations);
2459 if (annotations !=
nullptr && !annotations->empty()) {
2460 bool all_integers =
true;
2461 bool all_vars =
true;
2467 std::vector<int64_t> values;
2469 values.push_back(ann.interval_min);
2472 }
else if (all_vars) {
2473 std::vector<Variable*> vars;
2475 vars.push_back(ann.variables[0]);
2487#line 2514 "parser.tab.cc"
2491#line 694 "parser.yy"
2495#line 2522 "parser.tab.cc"
2499#line 703 "parser.yy"
2501 if ((yyvsp[-1].annotations) !=
nullptr) {
2502 model->Satisfy(std::move(*(yyvsp[-1].annotations)));
2505 model->Satisfy(std::vector<Annotation>());
2508#line 2535 "parser.tab.cc"
2512#line 711 "parser.yy"
2515 ? (yyvsp[0].arg).Var()
2516 :
model->AddConstant((yyvsp[0].arg).Value());
2517 if ((yyvsp[-2].annotations) !=
nullptr) {
2518 model->Minimize(obj_var, std::move(*(yyvsp[-2].annotations)));
2521 model->Minimize(obj_var, std::vector<Annotation>());
2524#line 2551 "parser.tab.cc"
2528#line 722 "parser.yy"
2531 ? (yyvsp[0].arg).Var()
2532 :
model->AddConstant((yyvsp[0].arg).Value());
2533 if ((yyvsp[-2].annotations) !=
nullptr) {
2534 model->Maximize(obj_var, std::move(*(yyvsp[-2].annotations)));
2537 model->Maximize(obj_var, std::vector<Annotation>());
2540#line 2567 "parser.tab.cc"
2543#line 2571 "parser.tab.cc"
2572 const int yyi =
yypgoto[yylhs] + *yyssp;
2573 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
2592 char const* yymsgp =
YY_(
"syntax error");
2593 int yysyntax_error_status;
2594 yysyntax_error_status =
yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2595 if (yysyntax_error_status == 0)
2597 else if (yysyntax_error_status == -1) {
2601 yysyntax_error_status =
yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2605 yymsg_alloc =
sizeof yymsgbuf;
2614 if (yyerrstatus == 3) {
2670 model, ok, scanner);
2717 model, ok, scanner);
2723 while (yyssp != yyss) {
2725 model, ok, scanner);