Google OR-Tools: ortools/flatzinc/parser.tab.cc Source File
49#define YYBISON 30802
52#define YYBISON_VERSION "3.8.2"
55#define YYSKELETON_NAME "yacc.c"
58#define YYPURE 2
61#define YYPUSH 0
64#define YYPULL 1
67#define YYSTYPE ORFZ_STYPE
69#define yyparse orfz_parse
70#define yylex orfz_lex
71#define yyerror orfz_error
72#define yydebug orfz_debug
73#define yynerrs orfz_nerrs
77#define YY_CAST(Type, Val) static_cast<Type>(Val)
78#define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type>(Val)
80#define YY_CAST(Type, Val) ((Type)(Val))
81#define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val))
92#define YY_NULLPTR ((void*)0)
170#line 49 "ortools/flatzinc/parser.yy"
174#include "absl/log/check.h"
175#include "absl/strings/match.h"
176#include "absl/strings/str_format.h"
203#if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
238#define UINT_LEAST8_MAX 255
239#define UINT_LEAST16_MAX 65535
242#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
244#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && \
245 UINT_LEAST8_MAX <= INT_MAX)
247#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
253#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
255#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && \
256 UINT_LEAST16_MAX <= INT_MAX)
258#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
265#if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
266#define YYPTRDIFF_T __PTRDIFF_TYPE__
267#define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
272#define YYPTRDIFF_T ptrdiff_t
273#define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
275#define YYPTRDIFF_T long
276#define YYPTRDIFF_MAXIMUM LONG_MAX
282#define YYSIZE_T __SIZE_TYPE__
285#elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
289#define YYSIZE_T unsigned
293#define YYSIZE_MAXIMUM \
295 (YYPTRDIFF_MAXIMUM < YY_CAST(YYSIZE_T, -1) ? YYPTRDIFF_MAXIMUM \
298#define YYSIZEOF(X) YY_CAST(YYPTRDIFF_T, sizeof(X))
307#if defined YYENABLE_NLS && YYENABLE_NLS
310#define YY_(Msgid) dgettext("bison-runtime", Msgid)
314#define YY_(Msgid) Msgid
319#if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
320#define YY_ATTRIBUTE_PURE __attribute__((__pure__))
322#define YY_ATTRIBUTE_PURE
326#ifndef YY_ATTRIBUTE_UNUSED
327#if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
328#define YY_ATTRIBUTE_UNUSED __attribute__((__unused__))
330#define YY_ATTRIBUTE_UNUSED
335#if !defined lint || defined __GNUC__
336#define YY_USE(E) ((void)(E))
342#if defined __GNUC__ && !defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
343#if __GNUC__ * 100 + __GNUC_MINOR__ < 407
344#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
345 _Pragma("GCC diagnostic push") \
346 _Pragma("GCC diagnostic ignored \"-Wuninitialized\"")
348#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
349 _Pragma("GCC diagnostic push") \
350 _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
351 _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
353#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
355#define YY_INITIAL_VALUE(Value) Value
357#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
358#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
359#define YY_IGNORE_MAYBE_UNINITIALIZED_END
362#define YY_INITIAL_VALUE(Value)
365#if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__
366#define YY_IGNORE_USELESS_CAST_BEGIN \
367 _Pragma("GCC diagnostic push") \
368 _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"")
369#define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop")
371#ifndef YY_IGNORE_USELESS_CAST_BEGIN
372#define YY_IGNORE_USELESS_CAST_BEGIN
373#define YY_IGNORE_USELESS_CAST_END
376#define YY_ASSERT(E) ((void)(0 && (E)))
385#define YYSTACK_ALLOC __builtin_alloca
386#elif defined __BUILTIN_VA_ARG_INCR
389#define YYSTACK_ALLOC __alloca
394#define YYSTACK_ALLOC alloca
395#if !defined _ALLOCA_H && !defined EXIT_SUCCESS
408#define YYSTACK_FREE(Ptr) \
412#ifndef YYSTACK_ALLOC_MAXIMUM
417#define YYSTACK_ALLOC_MAXIMUM 4032
420#define YYSTACK_ALLOC YYMALLOC
421#define YYSTACK_FREE YYFREE
422#ifndef YYSTACK_ALLOC_MAXIMUM
423#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
425#if (defined __cplusplus && !defined EXIT_SUCCESS && \
426 !((defined YYMALLOC || defined malloc) && \
427 (defined YYFREE || defined free)))
434#define YYMALLOC malloc
435#if !defined malloc && !defined EXIT_SUCCESS
440#define YYFREE free
441#if !defined free && !defined EXIT_SUCCESS
448#if (!defined yyoverflow && \
449 (!defined __cplusplus || \
450 (defined ORFZ_STYPE_IS_TRIVIAL && ORFZ_STYPE_IS_TRIVIAL)))
459#define YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1)
463#define YYSTACK_BYTES(N) \
464 ((N) * (YYSIZEOF(yy_state_t) + YYSIZEOF(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
466#define YYCOPY_NEEDED 1
473#define YYSTACK_RELOCATE(Stack_alloc, Stack) \
476 YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \
477 Stack = &yyptr->Stack_alloc; \
478 yynewbytes = yystacksize * YYSIZEOF(*Stack) + YYSTACK_GAP_MAXIMUM; \
484#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
488#if defined __GNUC__ && 1 < __GNUC__
489#define YYCOPY(Dst, Src, Count) \
490 __builtin_memcpy(Dst, Src, YY_CAST(YYSIZE_T, (Count)) * sizeof(*(Src)))
492#define YYCOPY(Dst, Src, Count) \
495 for (yyi = 0; yyi < (Count); yyi++) (Dst)[yyi] = (Src)[yyi]; \
502#define YYFINAL 3
504#define YYLAST 292
507#define YYNTOKENS 32
509#define YYNNTS 32
511#define YYNRULES 101
513#define YYNSTATES 233
516#define YYMAXUTOK 276
520#define YYTRANSLATE(YYX) \
521 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
528 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 23, 24, 2, 2, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 22,
531 2, 29, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 27, 2, 28, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 30, 2, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
541 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21};
546 0, 118, 118, 125, 129, 130, 135, 138, 139, 142, 143, 144, 145, 148, 149,
547 152, 153, 160, 161, 164, 183, 198, 209, 224, 235, 250, 300, 385, 386, 389,
548 390, 391, 394, 398, 404, 405, 406, 409, 414, 429, 450, 451, 452, 453, 460,
549 461, 462, 463, 470, 471, 476, 477, 478, 481, 482, 485, 486, 487, 492, 493,
550 496, 497, 498, 503, 504, 505, 510, 511, 514, 515, 521, 525, 531, 532, 535,
551 549, 550, 553, 554, 555, 556, 557, 562, 588, 605, 653, 662, 666, 669, 670,
552 673, 674, 679, 680, 681, 695, 704, 710, 739, 748, 756, 767};
556#define YY_ACCESSING_SYMBOL(State) YY_CAST(yysymbol_kind_t, yystos[State])
565static const char* const yytname[] = {"\"end of file\"",
603 "predicate_array_argument",
605 "variable_or_constant_declarations",
606 "variable_or_constant_declaration",
636#define YYPACT_NINF (-192)
638#define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF)
640#define YYTABLE_NINF (-19)
642#define yytable_value_is_error(Yyn) 0
647 -192, 29, 7, -192, -15, 24, 41, 20, -192, 66, -192, 69,
648 -192, -192, -192, 115, 87, 90, 116, 113, 152, -192, -192, -192,
649 153, 54, 49, 178, 12, 166, 179, 177, -192, 172, 9, -192,
650 -192, 180, 181, -192, 182, 183, 175, 87, 184, 185, 186, 187,
651 -192, -192, 190, 113, 189, -192, -192, 193, 113, -192, -192, 191,
652 156, -192, -192, 58, 192, -192, 49, 195, 198, 199, 47, -192,
653 194, -192, 14, 83, 83, 83, -192, 100, 188, 203, 196, -192,
654 200, -192, -192, 197, -192, -192, 22, -192, 91, 205, -192, 201,
655 -192, 122, 113, 124, -192, -192, -192, 207, -192, 154, 96, 113,
656 -192, 219, 209, 220, -192, 221, 141, -192, 213, 206, -192, 27,
657 -192, 214, 216, 222, 208, -192, -192, 113, 155, -192, 120, -192,
658 83, 218, 100, 223, -192, 157, -192, 144, -192, -192, 67, 77,
659 -192, 224, 225, -192, 145, -192, 211, 226, 227, 147, 141, -192,
660 -192, 229, -192, -192, 142, 212, 100, -192, -192, 87, 228, 87,
661 230, 231, 232, -192, 233, -192, -192, -192, 234, -192, -192, -192,
662 -192, -192, 237, 217, 238, 235, 239, 240, -192, -192, 245, -192,
663 246, -192, -192, -192, -192, -192, 32, 37, 70, 105, 241, 242,
664 243, 244, -192, 135, 91, 108, 126, -192, 159, -192, 161, 247,
665 -192, -192, 163, -192, -192, 165, -192, 91, -192, 249, 174, -192,
672 5, 0, 0, 1, 0, 0, 0, 73, 4, 0, 3, 0, 40, 48, 41, 0, 0, 0,
673 0, 0, 0, 50, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 55, 56, 0, 54,
674 17, 0, 0, 87, 0, 0, 0, 0, 0, 8, 0, 0, 44, 45, 0, 0, 0, 42,
675 49, 0, 0, 43, 87, 0, 0, 72, 2, 0, 0, 6, 0, 0, 0, 0, 0, 87,
676 0, 53, 0, 0, 0, 0, 99, 0, 16, 0, 0, 13, 0, 7, 9, 0, 46, 47,
677 28, 57, 0, 77, 79, 82, 78, 0, 0, 0, 76, 101, 100, 92, 93, 94, 0, 0,
678 86, 0, 0, 0, 10, 0, 0, 25, 63, 68, 67, 0, 19, 0, 0, 34, 38, 35,
679 85, 0, 0, 33, 0, 87, 0, 0, 0, 0, 98, 0, 89, 0, 15, 14, 0, 0,
680 27, 0, 0, 66, 0, 80, 0, 0, 0, 0, 0, 84, 81, 74, 75, 90, 0, 0,
681 0, 97, 91, 0, 0, 0, 0, 0, 0, 64, 0, 65, 83, 36, 0, 37, 32, 95,
682 96, 88, 0, 0, 0, 0, 0, 0, 69, 39, 0, 11, 0, 87, 87, 87, 12, 87,
683 0, 0, 0, 31, 0, 0, 0, 0, 26, 0, 0, 0, 0, 21, 0, 71, 0, 61,
684 60, 23, 0, 59, 30, 0, 20, 0, 24, 0, 0, 22, 29, 70, 0, 58, 62};
688 -192, -192, -192, -192, 215, -192, -192, 98, -192, -192, -192,
689 -192, 38, -108, 104, 106, 107, -7, -50, 236, -192, 25,
690 -191, -192, -192, -192, -192, -72, -56, 118, -76, -192};
694 0, 1, 2, 6, 44, 45, 82, 83, 7, 20, 115, 206, 128, 129, 21, 22,
695 23, 46, 34, 35, 218, 219, 120, 214, 25, 40, 99, 100, 60, 137, 138, 41};
701 24, 70, 74, 108, 101, 102, 144, 8, 4, 29, -18, -18, -18, -18, -18,
702 90, 48, 213, 5, 49, -18, -18, -18, 11, 12, -18, 13, 14, -18, 3,
703 50, 79, 229, 15, 56, 16, 64, -18, 17, 79, 57, 18, 51, 92, 9,
704 32, 178, 33, 130, 79, 19, 114, 42, 12, 79, 13, 14, 139, 147, 38,
705 158, 202, 15, 10, 43, 80, 203, 17, 39, 148, 18, 12, 56, 13, 14,
706 157, 81, 153, 89, 19, 15, 12, 165, 13, 14, 17, 181, 79, 18, 26,
707 15, 12, 167, 13, 14, 17, 27, 19, 18, 204, 15, 93, 94, 95, 96,
708 17, 30, 19, 18, 116, 97, 117, 118, 98, 103, 104, 105, 19, 103, 104,
709 105, 119, 79, 106, 136, 28, 107, 106, 215, 216, 107, 32, 31, 33, 205,
710 166, 217, 198, 199, 200, 123, 201, 124, 125, 123, 56, 124, 125, 131, 132,
711 126, 156, 127, 32, 220, 33, 127, 212, 182, 123, 184, 124, 125, 211, 76,
712 77, 179, 162, 78, 56, 56, 127, 56, 79, 36, 164, 173, 134, 177, 37,
713 154, 135, 162, 155, 56, 163, 223, 222, 226, 224, 154, 227, 52, 228, 215,
714 216, 47, 53, 54, 55, 58, 59, 63, 68, 61, 62, 69, 140, 65, 71,
715 66, 72, 67, 109, 75, 86, 87, 88, 84, 110, 112, 121, 91, 133, 111,
716 113, 80, 141, 122, 145, 142, 143, 149, 146, 150, 152, 159, 191, 151, 174,
717 180, 161, 171, 172, 175, 176, 79, 168, 221, 169, 170, 231, 160, 0, 183,
718 193, 185, 186, 187, 194, 195, 188, 189, 190, 192, 196, 197, 230, 207, 208,
723 7, 51, 58, 79, 76, 77, 114, 22, 1, 16, 3, 4, 5, 6, 7, 71,
724 4, 208, 11, 7, 13, 14, 15, 3, 4, 18, 6, 7, 21, 0, 18, 17,
725 223, 13, 25, 15, 43, 30, 18, 17, 31, 21, 30, 29, 20, 18, 154, 20,
726 98, 17, 30, 29, 3, 4, 17, 6, 7, 107, 31, 5, 132, 29, 13, 22,
727 15, 7, 29, 18, 14, 119, 21, 4, 25, 6, 7, 131, 18, 127, 31, 30,
728 13, 4, 15, 6, 7, 18, 162, 17, 21, 23, 13, 4, 15, 6, 7, 18,
729 27, 30, 21, 29, 13, 18, 19, 20, 21, 18, 16, 30, 21, 18, 27, 20,
730 21, 30, 18, 19, 20, 30, 18, 19, 20, 30, 17, 27, 28, 10, 30, 27,
731 20, 21, 30, 18, 16, 20, 29, 142, 28, 193, 194, 195, 18, 197, 20, 21,
732 18, 25, 20, 21, 24, 25, 28, 31, 30, 18, 28, 20, 30, 207, 165, 18,
733 167, 20, 21, 28, 8, 9, 24, 25, 12, 25, 25, 30, 25, 17, 22, 31,
734 31, 23, 31, 26, 25, 27, 25, 28, 25, 28, 25, 28, 25, 28, 25, 28,
735 26, 28, 20, 21, 18, 18, 21, 27, 20, 20, 27, 16, 22, 22, 16, 109,
736 24, 20, 25, 18, 26, 25, 23, 20, 18, 18, 26, 16, 20, 16, 28, 16,
737 28, 28, 7, 18, 27, 16, 10, 10, 18, 27, 18, 27, 18, 20, 16, 28,
738 28, 18, 18, 18, 18, 18, 17, 143, 210, 143, 143, 226, 134, -1, 26, 20,
739 26, 26, 26, 20, 20, 28, 28, 26, 26, 20, 20, 18, 27, 27, 27, 27,
740 -1, -1, 27, -1, 28, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1,
746 0, 33, 34, 0, 1, 11, 35, 40, 22, 20, 22, 3, 4, 6, 7, 13, 15, 18,
747 21, 30, 41, 46, 47, 48, 49, 56, 23, 27, 10, 49, 16, 16, 18, 20, 50, 51,
748 22, 26, 5, 14, 57, 63, 3, 15, 36, 37, 49, 18, 4, 7, 18, 30, 26, 18,
749 21, 27, 25, 31, 20, 20, 60, 22, 22, 27, 49, 24, 25, 26, 16, 16, 50, 20,
750 18, 51, 60, 23, 8, 9, 12, 17, 7, 18, 38, 39, 26, 36, 20, 18, 18, 31,
751 60, 28, 29, 18, 19, 20, 21, 27, 30, 58, 59, 59, 59, 18, 19, 20, 27, 30,
752 62, 25, 16, 28, 20, 28, 29, 42, 18, 20, 21, 30, 54, 16, 27, 18, 20, 21,
753 28, 30, 44, 45, 50, 24, 25, 16, 23, 27, 28, 61, 62, 50, 39, 18, 10, 10,
754 45, 16, 27, 31, 50, 18, 18, 16, 27, 50, 25, 28, 31, 60, 59, 18, 61, 18,
755 25, 28, 31, 15, 49, 15, 46, 47, 48, 18, 18, 31, 28, 18, 18, 31, 45, 24,
756 28, 62, 49, 26, 49, 26, 26, 26, 28, 28, 26, 20, 26, 20, 20, 20, 20, 20,
757 60, 60, 60, 60, 29, 29, 29, 29, 43, 27, 27, 27, 27, 28, 50, 54, 55, 20,
758 21, 28, 52, 53, 28, 44, 28, 25, 28, 27, 25, 28, 28, 54, 18, 53, 28};
762 0, 32, 33, 34, 34, 34, 35, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39,
763 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 43, 43, 43, 44, 44,
764 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 49,
765 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 54, 54,
766 54, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59,
767 59, 60, 60, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63};
772 0, 2, 5, 3, 3, 0, 5, 3, 1, 3, 4, 8, 9, 1, 3, 3, 1, 3, 0, 6, 15,
773 14, 15, 14, 15, 6, 13, 2, 0, 4, 3, 0, 3, 1, 1, 1, 3, 3, 1, 4, 1, 1,
774 3, 3, 3, 3, 5, 5, 1, 3, 1, 1, 1, 3, 1, 1, 1, 4, 3, 1, 1, 1, 4,
775 1, 3, 3, 2, 1, 1, 4, 3, 1, 3, 0, 6, 3, 1, 1, 1, 1, 3, 3, 1, 4,
780#define yyerrok (yyerrstatus = 0)
781#define yyclearin (yychar = ORFZ_EMPTY)
783#define YYACCEPT goto yyacceptlab
784#define YYABORT goto yyabortlab
785#define YYERROR goto yyerrorlab
786#define YYNOMEM goto yyexhaustedlab
788#define YYRECOVERING() (!!yyerrstatus)
790#define YYBACKUP(Token, Value) \
792 if (yychar == ORFZ_EMPTY) { \
799 yyerror(context, model, ok, scanner, \
807#define YYERRCODE ORFZ_UNDEF
819 if (yydebug) YYFPRINTF Args; \
822#define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
825 YYFPRINTF(stderr, "%s ", Title); \
826 yy_symbol_print(stderr, Kind, Value, context, model, ok, scanner); \
827 YYFPRINTF(stderr, "\n"); \
835static void yy_symbol_value_print(
855static void yy_symbol_print(FILE* yyo, yysymbol_kind_t yykind,
856 YYSTYPE const* const yyvaluep,
860 YYFPRINTF(yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm",
863 yy_symbol_value_print(yyo, yykind, yyvaluep, context, model, ok, scanner);
873 YYFPRINTF(stderr, "Stack now");
874 for (; yybottom <= yytop; yybottom++) {
876 YYFPRINTF(stderr, " %d", yybot);
881#define YY_STACK_PRINT(Bottom, Top) \
883 if (yydebug) yy_stack_print((Bottom), (Top)); \
890static void yy_reduce_print(yy_state_t* yyssp, YYSTYPE* yyvsp, int yyrule,
894 int yylno = yyrline[yyrule];
895 int yynrhs = yyr2[yyrule];
897 YYFPRINTF(stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1,
900 for (yyi = 0; yyi < yynrhs; yyi++) {
901 YYFPRINTF(stderr, " $%d = ", yyi + 1);
903 &yyvsp[(yyi + 1) - (yynrhs)], context, model, ok, scanner);
908#define YY_REDUCE_PRINT(Rule) \
911 yy_reduce_print(yyssp, yyvsp, Rule, context, model, ok, scanner); \
918#define YYDPRINTF(Args) ((void)0)
919#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
920#define YY_STACK_PRINT(Bottom, Top)
921#define YY_REDUCE_PRINT(Rule)
926#define YYINITDEPTH 200
937#define YYMAXDEPTH 10000
961 int yyxbegin = yyn < 0 ? -yyn : 0;
963 int yychecklim = YYLAST - yyn + 1;
966 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
971 else if (yycount == yyargn)
977 if (yyarg && yycount == 0 && 0 < yyargn) yyarg[0] = YYSYMBOL_YYEMPTY;
982#if defined __GLIBC__ && defined _STRING_H
983#define yystrlen(S) (YY_CAST(YYPTRDIFF_T, strlen(S)))
995#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1000static char* yystpcpy(char* yydest, const char* yysrc) {
1023 for (;;) switch (*++yyp) {
1026 goto do_not_strip_quotes;
1030 goto do_not_strip_quotes;
1036 if (yyres) yyres[yyn] = *yyp;
1041 if (yyres) yyres[yyn] = '\0';
1048 return yystpcpy(yyres, yystr) - yyres;
1083 if (yyarg) yyarg[yycount] = yyctx->yytoken;
1125 YYCASE_(1, YY_("syntax error, unexpected %s"));
1126 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1127 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1128 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1131 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1137 yysize = yystrlen(yyformat) - 2 * yycount + 1;
1140 for (yyi = 0; yyi < yycount; ++yyi) {
1149 if (*yymsg_alloc < yysize) {
1150 *yymsg_alloc = 2 * yysize;
1162 while ((*yyp = *yyformat) != '\0')
1163 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) {
1246 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1248#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1254 YYDPRINTF((stderr, "Starting parse\n"));
1256 yychar = ORFZ_EMPTY;
1272 YYDPRINTF((stderr, "Entering state %d\n", yystate));
1279 if (yyss + yystacksize - 1 <= yyssp)
1280#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1299 yyoverflow(YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF(*yyssp),
1300 &yyvs1, yysize * YYSIZEOF(*yyvsp), &yystacksize);
1323 yyssp = yyss + yysize - 1;
1324 yyvsp = yyvs + yysize - 1;
1328 (stderr, "Stack size increased to %ld\n", YY_CAST(long, yystacksize)));
1331 if (yyss + yystacksize - 1 <= yyssp) YYABORT;
1347 yyn = yypact[yystate];
1354 YYDPRINTF((stderr, "Reading a token\n"));
1361 YYDPRINTF((stderr, "Now at end of input.\n"));
1378 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault;
1388 if (yyerrstatus) yyerrstatus--;
1406 if (yyn == 0) goto yyerrlab;
1414 yylen = yyr2[yyn];
1424 yyval = yyvsp[1 - yylen];
1429#line 129 "ortools/flatzinc/parser.yy"
1433#line 1595 "parser.tab.cc"
1438#line 164 "ortools/flatzinc/parser.yy"
1443 const std::string& identifier = (yyvsp[-3].string_value);
1444 const Domain& assignment = (yyvsp[0].domain);
1445 std::vector<Annotation>* const annotations = (yyvsp[-2].annotations);
1449 context->domain_map[identifier] = assignment;
1451 const int64_t value = assignment.values.front();
1452 CHECK(domain.Contains(value));
1453 context->integer_map[identifier] = value;
1457#line 1619 "parser.tab.cc"
1463#line 184 "ortools/flatzinc/parser.yy"
1465 std::vector<Annotation>* const annotations = (yyvsp[-4].annotations);
1467 CHECK_EQ((yyvsp[-12].integer_value), 1)
1468 << "Only [1..n] array are supported here.";
1469 const int64_t num_constants = (yyvsp[-10].integer_value);
1470 const std::string& identifier = (yyvsp[-5].string_value);
1471 const std::vector<int64_t>* const assignments = (yyvsp[-1].integers);
1472 CHECK(assignments != nullptr);
1473 CHECK_EQ(num_constants, assignments->size());
1479#line 1638 "parser.tab.cc"
1484#line 199 "ortools/flatzinc/parser.yy"
1486 std::vector<Annotation>* const annotations = (yyvsp[-3].annotations);
1488 CHECK_EQ((yyvsp[-11].integer_value), 1)
1489 << "Only [1..n] array are supported here.";
1490 const int64_t num_constants = (yyvsp[-9].integer_value);
1491 CHECK_EQ(num_constants, 0) << "Empty arrays should have a size of 0";
1492 const std::string& identifier = (yyvsp[-4].string_value);
1493 context->integer_array_map[identifier] = std::vector<int64_t>();
1496#line 1653 "parser.tab.cc"
1502#line 210 "ortools/flatzinc/parser.yy"
1504 std::vector<Annotation>* const annotations = (yyvsp[-4].annotations);
1506 CHECK_EQ((yyvsp[-12].integer_value), 1)
1507 << "Only [1..n] array are supported here.";
1508 const int64_t num_constants = (yyvsp[-10].integer_value);
1509 const std::string& identifier = (yyvsp[-5].string_value);
1510 const std::vector<double>* const assignments = (yyvsp[-1].doubles);
1511 CHECK(assignments != nullptr);
1512 CHECK_EQ(num_constants, assignments->size());
1518#line 1672 "parser.tab.cc"
1523#line 225 "ortools/flatzinc/parser.yy"
1525 std::vector<Annotation>* const annotations = (yyvsp[-3].annotations);
1527 CHECK_EQ((yyvsp[-11].integer_value), 1)
1528 << "Only [1..n] array are supported here.";
1529 const int64_t num_constants = (yyvsp[-9].integer_value);
1530 CHECK_EQ(num_constants, 0) << "Empty arrays should have a size of 0";
1531 const std::string& identifier = (yyvsp[-4].string_value);
1532 context->float_array_map[identifier] = std::vector<double>();
1535#line 1687 "parser.tab.cc"
1541#line 236 "ortools/flatzinc/parser.yy"
1544 CHECK_EQ((yyvsp[-12].integer_value), 1)
1545 << "Only [1..n] array are supported here.";
1546 const int64_t num_domains = (yyvsp[-10].integer_value);
1548 const std::string& identifier = (yyvsp[-5].string_value);
1549 const std::vector<Domain>* const assignments = (yyvsp[-1].domains);
1550 const std::vector<Annotation>* const annotations =
1552 CHECK(assignments != nullptr);
1553 CHECK_EQ(num_domains, assignments->size());
1558#line 1706 "parser.tab.cc"
1563#line 250 "ortools/flatzinc/parser.yy"
1570 const std::string& identifier = (yyvsp[-2].string_value);
1571 std::vector<Annotation>* const annotations = (yyvsp[-1].annotations);
1573 const bool introduced = ContainsId(annotations, "var_is_introduced") ||
1574 absl::StartsWith(identifier, "X_INTRODUCED");
1576 if (!assignment.defined) {
1577 var = model->AddVariable(identifier, domain, introduced);
1579 } else if (assignment.variable == nullptr) {
1582 const double value = assignment.float_value;
1585 } else if (assignment.is_domain) {
1592 var = model->AddVariable(identifier, assignment.domain, introduced,
1601 var->Merge(identifier, domain, introduced);
1607 if (ContainsId(annotations, "output_var")) {
1613#line 1761 "parser.tab.cc"
1619#line 301 "ortools/flatzinc/parser.yy"
1624 CHECK_EQ((yyvsp[-10].integer_value), 1);
1625 const int64_t num_vars = (yyvsp[-8].integer_value);
1627 const std::string& identifier = (yyvsp[-2].string_value);
1628 std::vector<Annotation>* const annotations = (yyvsp[-1].annotations);
1629 std::vector<VarRefOrValue>* const assignments =
1631 CHECK(assignments == nullptr || assignments->size() == num_vars);
1632 const bool introduced = ContainsId(annotations, "var_is_introduced") ||
1633 absl::StartsWith(identifier, "X_INTRODUCED");
1635 std::vector<Variable*> vars(num_vars, nullptr);
1637 for (int i = 0; i < num_vars; ++i) {
1638 const std::string var_name =
1639 absl::StrFormat("%s[%d]", identifier, i + 1);
1640 if (assignments == nullptr) {
1641 vars[i] = model->AddVariable(var_name, domain, introduced);
1642 } else if ((*assignments)[i].variable == nullptr) {
1643 if ((*assignments)[i].is_float) {
1645 const double value = (*assignments)[i].float_value;
1648 } else if ((*assignments)[i].is_domain) {
1655 vars[i] = model->AddVariable(var_name, (*assignments)[i].domain,
1656 introduced, domain.is_a_set);
1659 const int64_t value = (*assignments)[i].value;
1660 CHECK(domain.Contains(value));
1665 Variable* const var = (*assignments)[i].variable;
1668 vars[i]->Merge(var_name, domain, introduced);
1679 if (annotations != nullptr) {
1680 for (int i = 0; i < annotations->size(); ++i) {
1681 const Annotation& ann = (*annotations)[i];
1688 std::vector<SolutionOutputSpecs::Bounds> bounds;
1689 for (int a = 0; a < list.annotations.size(); ++a) {
1693 bound.interval_min, bound.interval_max));
1703#line 1848 "parser.tab.cc"
1707#line 385 "ortools/flatzinc/parser.yy"
1709 (yyval.var_or_value) = (yyvsp[0].var_or_value);
1711#line 1854 "parser.tab.cc"
1715#line 386 "ortools/flatzinc/parser.yy"
1719#line 1860 "parser.tab.cc"
1723#line 389 "ortools/flatzinc/parser.yy"
1727#line 1866 "parser.tab.cc"
1731#line 390 "ortools/flatzinc/parser.yy"
1735#line 1872 "parser.tab.cc"
1739#line 391 "ortools/flatzinc/parser.yy"
1743#line 1878 "parser.tab.cc"
1747#line 394 "ortools/flatzinc/parser.yy"
1752#line 1887 "parser.tab.cc"
1756#line 398 "ortools/flatzinc/parser.yy"
1761#line 1896 "parser.tab.cc"
1765#line 404 "ortools/flatzinc/parser.yy"
1769#line 1902 "parser.tab.cc"
1773#line 405 "ortools/flatzinc/parser.yy"
1777#line 1908 "parser.tab.cc"
1781#line 406 "ortools/flatzinc/parser.yy"
1784 (yyvsp[-2].integer_value), (yyvsp[0].integer_value)));
1786#line 1916 "parser.tab.cc"
1790#line 409 "ortools/flatzinc/parser.yy"
1792 CHECK((yyvsp[-1].integers) != nullptr);
1795 delete (yyvsp[-1].integers);
1797#line 1926 "parser.tab.cc"
1801#line 414 "ortools/flatzinc/parser.yy"
1804 const std::string& id = (yyvsp[0].string_value);
1805 if (context->integer_map.contains(id)) {
1808 } else if (context->float_map.contains(id)) {
1811 } else if (context->variable_map.contains(id)) {
1815 LOG(ERROR) << "Unknown symbol " << id;
1820#line 1946 "parser.tab.cc"
1824#line 429 "ortools/flatzinc/parser.yy"
1827 const std::string& id = (yyvsp[-3].string_value);
1828 const int64_t value = (yyvsp[-1].integer_value);
1839 LOG(ERROR) << "Unknown symbol " << id;
1844#line 1970 "parser.tab.cc"
1848#line 450 "ortools/flatzinc/parser.yy"
1852#line 1976 "parser.tab.cc"
1856#line 451 "ortools/flatzinc/parser.yy"
1860#line 1982 "parser.tab.cc"
1864#line 452 "ortools/flatzinc/parser.yy"
1867 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
1869#line 1988 "parser.tab.cc"
1873#line 453 "ortools/flatzinc/parser.yy"
1875 CHECK((yyvsp[-1].integers) != nullptr);
1877 delete (yyvsp[-1].integers);
1879#line 1998 "parser.tab.cc"
1883#line 460 "ortools/flatzinc/parser.yy"
1887#line 2004 "parser.tab.cc"
1891#line 461 "ortools/flatzinc/parser.yy"
1895#line 2010 "parser.tab.cc"
1899#line 462 "ortools/flatzinc/parser.yy"
1902 (yyvsp[0].integer_value));
1904#line 2016 "parser.tab.cc"
1908#line 463 "ortools/flatzinc/parser.yy"
1910 CHECK((yyvsp[-1].integers) != nullptr);
1913 delete (yyvsp[-1].integers);
1915#line 2026 "parser.tab.cc"
1919#line 470 "ortools/flatzinc/parser.yy"
1923#line 2032 "parser.tab.cc"
1927#line 471 "ortools/flatzinc/parser.yy"
1930 (yyvsp[0].double_value));
1932#line 2040 "parser.tab.cc"
1936#line 476 "ortools/flatzinc/parser.yy"
1938 (yyval.domain) = (yyvsp[0].domain);
1940#line 2046 "parser.tab.cc"
1944#line 477 "ortools/flatzinc/parser.yy"
1946 (yyval.domain) = (yyvsp[0].domain);
1948#line 2052 "parser.tab.cc"
1952#line 478 "ortools/flatzinc/parser.yy"
1954 (yyval.domain) = (yyvsp[0].domain);
1956#line 2058 "parser.tab.cc"
1960#line 481 "ortools/flatzinc/parser.yy"
1962 (yyval.integers) = (yyvsp[-2].integers);
1963 (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1965#line 2064 "parser.tab.cc"
1969#line 482 "ortools/flatzinc/parser.yy"
1971 (yyval.integers) = new std::vector<int64_t>();
1972 (yyval.integers)->emplace_back((yyvsp[0].integer_value));
1974#line 2070 "parser.tab.cc"
1978#line 485 "ortools/flatzinc/parser.yy"
1980 (yyval.integer_value) = (yyvsp[0].integer_value);
1982#line 2076 "parser.tab.cc"
1986#line 486 "ortools/flatzinc/parser.yy"
1990#line 2082 "parser.tab.cc"
1994#line 487 "ortools/flatzinc/parser.yy"
2000#line 2090 "parser.tab.cc"
2004#line 492 "ortools/flatzinc/parser.yy"
2006 (yyval.doubles) = (yyvsp[-2].doubles);
2007 (yyval.doubles)->emplace_back((yyvsp[0].double_value));
2009#line 2096 "parser.tab.cc"
2013#line 493 "ortools/flatzinc/parser.yy"
2015 (yyval.doubles) = new std::vector<double>();
2016 (yyval.doubles)->emplace_back((yyvsp[0].double_value));
2018#line 2102 "parser.tab.cc"
2022#line 496 "ortools/flatzinc/parser.yy"
2024 (yyval.double_value) = (yyvsp[0].double_value);
2026#line 2108 "parser.tab.cc"
2030#line 497 "ortools/flatzinc/parser.yy"
2034#line 2114 "parser.tab.cc"
2038#line 498 "ortools/flatzinc/parser.yy"
2044#line 2122 "parser.tab.cc"
2048#line 503 "ortools/flatzinc/parser.yy"
2052#line 2128 "parser.tab.cc"
2056#line 504 "ortools/flatzinc/parser.yy"
2059 Domain::Interval((yyvsp[-2].integer_value), (yyvsp[0].integer_value));
2061#line 2134 "parser.tab.cc"
2065#line 505 "ortools/flatzinc/parser.yy"
2067 CHECK((yyvsp[-1].integers) != nullptr);
2069 delete (yyvsp[-1].integers);
2071#line 2144 "parser.tab.cc"
2075#line 510 "ortools/flatzinc/parser.yy"
2079#line 2150 "parser.tab.cc"
2083#line 511 "ortools/flatzinc/parser.yy"
2087#line 2158 "parser.tab.cc"
2091#line 514 "ortools/flatzinc/parser.yy"
2096#line 2164 "parser.tab.cc"
2100#line 515 "ortools/flatzinc/parser.yy"
2106#line 2173 "parser.tab.cc"
2110#line 521 "ortools/flatzinc/parser.yy"
2112 (yyval.domains) = (yyvsp[-2].domains);
2113 (yyval.domains)->emplace_back((yyvsp[0].domain));
2115#line 2182 "parser.tab.cc"
2119#line 525 "ortools/flatzinc/parser.yy"
2121 (yyval.domains) = new std::vector<Domain>();
2122 (yyval.domains)->emplace_back((yyvsp[0].domain));
2124#line 2188 "parser.tab.cc"
2129#line 535 "ortools/flatzinc/parser.yy"
2131 const std::string& identifier = (yyvsp[-4].string_value);
2132 CHECK((yyvsp[-2].args) != nullptr) << "Missing argument in constraint";
2133 const std::vector<Argument>& arguments = *(yyvsp[-2].args);
2134 std::vector<Annotation>* const annotations = (yyvsp[0].annotations);
2137 ContainsId(annotations, "domain"),
2138 ContainsId(annotations, "symmetry_breaking"),
2139 ContainsId(annotations, "redundant"));
2141 delete (yyvsp[-2].args);
2143#line 2205 "parser.tab.cc"
2147#line 549 "ortools/flatzinc/parser.yy"
2149 (yyval.args) = (yyvsp[-2].args);
2150 (yyval.args)->emplace_back((yyvsp[0].arg));
2152#line 2211 "parser.tab.cc"
2156#line 550 "ortools/flatzinc/parser.yy"
2158 (yyval.args) = new std::vector<Argument>();
2159 (yyval.args)->emplace_back((yyvsp[0].arg));
2161#line 2217 "parser.tab.cc"
2165#line 553 "ortools/flatzinc/parser.yy"
2169#line 2223 "parser.tab.cc"
2173#line 554 "ortools/flatzinc/parser.yy"
2177#line 2229 "parser.tab.cc"
2181#line 555 "ortools/flatzinc/parser.yy"
2185#line 2235 "parser.tab.cc"
2189#line 556 "ortools/flatzinc/parser.yy"
2192 (yyvsp[0].integer_value));
2194#line 2241 "parser.tab.cc"
2198#line 557 "ortools/flatzinc/parser.yy"
2200 CHECK((yyvsp[-1].integers) != nullptr);
2202 delete (yyvsp[-1].integers);
2204#line 2251 "parser.tab.cc"
2208#line 562 "ortools/flatzinc/parser.yy"
2210 const std::string& id = (yyvsp[0].string_value);
2211 if (context->integer_map.contains(id)) {
2215 } else if (context->float_map.contains(id)) {
2216 const double d = context->float_map.at(id);
2219 const auto& double_values = context->float_array_map.at(id);
2221 } else if (context->variable_map.contains(id)) {
2225 } else if (context->domain_map.contains(id)) {
2230 << "Unknown identifier: " << id;
2231 const std::vector<Domain>& d = context->domain_array_map.at(id);
2235#line 2282 "parser.tab.cc"
2239#line 588 "ortools/flatzinc/parser.yy"
2241 const std::string& id = (yyvsp[-3].string_value);
2242 const int64_t index = (yyvsp[-1].integer_value);
2247 (yyval.arg) =
2251 << "Unknown identifier: " << id;
2256#line 2304 "parser.tab.cc"
2260#line 605 "ortools/flatzinc/parser.yy"
2262 std::vector<VarRefOrValue>* const arguments =
2264 CHECK(arguments != nullptr);
2265 bool has_variables = false;
2267 for (int i = 0; i < arguments->size(); ++i) {
2268 if ((*arguments)[i].variable != nullptr) {
2271 if ((*arguments)[i].is_float) {
2276 std::vector<Variable*> vars;
2277 vars.reserve(arguments->size());
2278 for (int i = 0; i < arguments->size(); ++i) {
2280 if (data.variable != nullptr) {
2281 vars.push_back(data.variable);
2282 } else if (!data.is_float) {
2290 std::vector<double> values;
2291 values.reserve(arguments->size());
2294 values.push_back(data.float_value);
2296 values.push_back(data.value);
2301 std::vector<int64_t> values;
2302 values.reserve(arguments->size());
2304 values.push_back(data.value);
2310#line 2357 "parser.tab.cc"
2314#line 653 "ortools/flatzinc/parser.yy"
2318#line 2365 "parser.tab.cc"
2322#line 662 "ortools/flatzinc/parser.yy"
2324 (yyval.annotations) = (yyvsp[-2].annotations) != nullptr
2326 : new std::vector<Annotation>();
2327 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2329#line 2374 "parser.tab.cc"
2333#line 666 "ortools/flatzinc/parser.yy"
2337#line 2380 "parser.tab.cc"
2341#line 669 "ortools/flatzinc/parser.yy"
2343 (yyval.annotations) = (yyvsp[-2].annotations);
2344 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2346#line 2386 "parser.tab.cc"
2350#line 670 "ortools/flatzinc/parser.yy"
2352 (yyval.annotations) = new std::vector<Annotation>();
2353 (yyval.annotations)->emplace_back((yyvsp[0].annotation));
2355#line 2392 "parser.tab.cc"
2359#line 673 "ortools/flatzinc/parser.yy"
2362 (yyvsp[0].integer_value));
2364#line 2398 "parser.tab.cc"
2368#line 674 "ortools/flatzinc/parser.yy"
2370 CHECK((yyvsp[-1].integers) != nullptr);
2373 delete (yyvsp[-1].integers);
2375#line 2408 "parser.tab.cc"
2379#line 679 "ortools/flatzinc/parser.yy"
2383#line 2414 "parser.tab.cc"
2387#line 680 "ortools/flatzinc/parser.yy"
2391#line 2420 "parser.tab.cc"
2395#line 681 "ortools/flatzinc/parser.yy"
2397 const std::string& id = (yyvsp[0].string_value);
2403 } else if (context->integer_map.contains(id)) {
2413#line 2439 "parser.tab.cc"
2417#line 695 "ortools/flatzinc/parser.yy"
2419 std::vector<Annotation>* const annotations = (yyvsp[-1].annotations);
2420 if (annotations != nullptr) {
2422 (yyvsp[-3].string_value), std::move(*annotations));
2428#line 2453 "parser.tab.cc"
2432#line 704 "ortools/flatzinc/parser.yy"
2435 << "Unknown identifier: " << (yyvsp[-3].string_value);
2440#line 2464 "parser.tab.cc"
2444#line 710 "ortools/flatzinc/parser.yy"
2446 std::vector<Annotation>* const annotations = (yyvsp[-1].annotations);
2447 if (annotations != nullptr && !annotations->empty()) {
2448 bool all_integers = true;
2450 for (const Annotation& ann : *annotations) {
2455 std::vector<int64_t> values;
2456 for (const Annotation& ann : *annotations) {
2457 values.push_back(ann.interval_min);
2461 std::vector<Variable*> vars;
2462 for (const Annotation& ann : *annotations) {
2463 vars.push_back(ann.variables[0]);
2475#line 2498 "parser.tab.cc"
2479#line 739 "ortools/flatzinc/parser.yy"
2483#line 2506 "parser.tab.cc"
2487#line 748 "ortools/flatzinc/parser.yy"
2489 if ((yyvsp[-1].annotations) != nullptr) {
2490 model->Satisfy(std::move(*(yyvsp[-1].annotations)));
2493 model->Satisfy(std::vector<Annotation>());
2496#line 2519 "parser.tab.cc"
2500#line 756 "ortools/flatzinc/parser.yy"
2504 : model->AddConstant((yyvsp[0].arg).Value());
2505 if ((yyvsp[-2].annotations) != nullptr) {
2506 model->Minimize(obj_var, std::move(*(yyvsp[-2].annotations)));
2509 model->Minimize(obj_var, std::vector<Annotation>());
2512#line 2535 "parser.tab.cc"
2516#line 767 "ortools/flatzinc/parser.yy"
2520 : model->AddConstant((yyvsp[0].arg).Value());
2521 if ((yyvsp[-2].annotations) != nullptr) {
2522 model->Maximize(obj_var, std::move(*(yyvsp[-2].annotations)));
2525 model->Maximize(obj_var, std::vector<Annotation>());
2528#line 2551 "parser.tab.cc"
2531#line 2555 "parser.tab.cc"
2560 const int yyi = yypgoto[yylhs] + *yyssp;
2561 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2580 char const* yymsgp = YY_("syntax error");
2581 int yysyntax_error_status;
2582 yysyntax_error_status = yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2583 if (yysyntax_error_status == 0)
2585 else if (yysyntax_error_status == -1) {
2589 yysyntax_error_status = yysyntax_error(&yymsg_alloc, &yymsg, &yyctx);
2593 yymsg_alloc = sizeof yymsgbuf;
2594 yysyntax_error_status = YYENOMEM;
2597 yyerror(context, model, ok, scanner, yymsgp);
2610 yydestruct("Error: discarding", yytoken, &yylval, context, model, ok,
2645 yyn = yypact[yystate];
2655 if (yyssp == yyss) YYABORT;
2692 yyerror(context, model, ok, scanner, YY_("memory exhausted"));
2704 yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, context,
2723#line 779 "ortools/flatzinc/parser.yy"
void AddConstraint(absl::string_view id, std::vector< Argument > arguments, bool is_domain, bool symmetry, bool redundant)
Variable * AddVariable(absl::string_view name, const Domain &domain, bool defined, bool set_is_fixed=false)
Variable * AddFloatConstant(double value)
void AddOutput(SolutionOutputSpecs output)
void Maximize(Variable *obj, std::vector< Annotation > search_annotations)
void Satisfy(std::vector< Annotation > search_annotations)
void Minimize(Variable *obj, std::vector< Annotation > search_annotations)
Variable * AddConstant(int64_t value)
const T & Lookup(const std::vector< T > &v, int index)
int64_t ConvertAsIntegerOrDie(double d)
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
Definition parser.tab.cc:631
static YYPTRDIFF_T yystrlen(const char *yystr)
Definition parser.tab.cc:986
const T & Lookup(const std::vector< T > &v, int index)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition parser.tab.cc:358
#define YYMAXDEPTH
Definition parser.tab.cc:937
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner)
Definition parser.tab.cc:1178
#define YYSTACK_FREE
Definition parser.tab.cc:421
static const yytype_int8 yytranslate[]
Definition parser.tab.cc:527
yysymbol_kind_t
Definition parser.tab.cc:98
@ YYSYMBOL_integer
Definition parser.tab.cc:153
@ YYSYMBOL_25_
Definition parser.tab.cc:125
@ YYSYMBOL_YYUNDEF
Definition parser.tab.cc:102
@ YYSYMBOL_const_literals
Definition parser.tab.cc:157
@ YYSYMBOL_optional_var_or_value_array
Definition parser.tab.cc:145
@ YYSYMBOL_float_domain
Definition parser.tab.cc:150
@ YYSYMBOL_var_or_value_array
Definition parser.tab.cc:146
@ YYSYMBOL_var_or_value
Definition parser.tab.cc:147
@ YYSYMBOL_DVALUE
Definition parser.tab.cc:121
@ YYSYMBOL_SVALUE
Definition parser.tab.cc:119
@ YYSYMBOL_26_
Definition parser.tab.cc:126
@ YYSYMBOL_YYerror
Definition parser.tab.cc:101
@ YYSYMBOL_SET
Definition parser.tab.cc:113
@ YYSYMBOL_IVALUE
Definition parser.tab.cc:118
@ YYSYMBOL_predicate
Definition parser.tab.cc:135
@ YYSYMBOL_SATISFY
Definition parser.tab.cc:112
@ YYSYMBOL_29_
Definition parser.tab.cc:129
@ YYSYMBOL_TOKEN_FLOAT
Definition parser.tab.cc:106
@ YYSYMBOL_28_
Definition parser.tab.cc:128
@ YYSYMBOL_variable_or_constant_declarations
Definition parser.tab.cc:140
@ YYSYMBOL_annotation
Definition parser.tab.cc:164
@ YYSYMBOL_predicate_arguments
Definition parser.tab.cc:136
@ YYSYMBOL_constraints
Definition parser.tab.cc:158
@ YYSYMBOL_variable_or_constant_declaration
Definition parser.tab.cc:142
@ YYSYMBOL_annotations
Definition parser.tab.cc:162
@ YYSYMBOL_floats
Definition parser.tab.cc:154
@ YYSYMBOL_model
Definition parser.tab.cc:133
@ YYSYMBOL_integers
Definition parser.tab.cc:152
@ YYSYMBOL_solve
Definition parser.tab.cc:165
@ YYSYMBOL_arguments
Definition parser.tab.cc:160
@ YYSYMBOL_optional_var_or_value
Definition parser.tab.cc:144
@ YYSYMBOL_predicate_array_argument
Definition parser.tab.cc:138
@ YYSYMBOL_annotation_arguments
Definition parser.tab.cc:163
@ YYSYMBOL_DOTDOT
Definition parser.tab.cc:116
@ YYSYMBOL_TOKEN_INT
Definition parser.tab.cc:107
@ YYSYMBOL_VAR
Definition parser.tab.cc:115
@ YYSYMBOL_set_domain
Definition parser.tab.cc:149
@ YYSYMBOL_TOKEN_BOOL
Definition parser.tab.cc:104
@ YYSYMBOL_constraint
Definition parser.tab.cc:159
@ YYSYMBOL_MINIMIZE
Definition parser.tab.cc:109
@ YYSYMBOL_ARRAY
Definition parser.tab.cc:103
@ YYSYMBOL_float
Definition parser.tab.cc:155
@ YYSYMBOL_predicate_argument
Definition parser.tab.cc:137
@ YYSYMBOL_COLONCOLON
Definition parser.tab.cc:117
@ YYSYMBOL_const_literal
Definition parser.tab.cc:156
@ YYSYMBOL_predicate_ints
Definition parser.tab.cc:139
@ YYSYMBOL_YYACCEPT
Definition parser.tab.cc:132
@ YYSYMBOL_30_
Definition parser.tab.cc:130
@ YYSYMBOL_23_
Definition parser.tab.cc:123
@ YYSYMBOL_domain
Definition parser.tab.cc:151
@ YYSYMBOL_YYEOF
Definition parser.tab.cc:100
@ YYSYMBOL_OF
Definition parser.tab.cc:110
@ YYSYMBOL_22_
Definition parser.tab.cc:122
@ YYSYMBOL_24_
Definition parser.tab.cc:124
@ YYSYMBOL_27_
Definition parser.tab.cc:127
@ YYSYMBOL_argument
Definition parser.tab.cc:161
@ YYSYMBOL_YYEMPTY
Definition parser.tab.cc:99
@ YYSYMBOL_IDENTIFIER
Definition parser.tab.cc:120
@ YYSYMBOL_predicates
Definition parser.tab.cc:134
@ YYSYMBOL_int_domain
Definition parser.tab.cc:148
@ YYSYMBOL_PREDICATE
Definition parser.tab.cc:111
@ YYSYMBOL_31_
Definition parser.tab.cc:131
@ YYSYMBOL_CONSTRAINT
Definition parser.tab.cc:105
@ YYSYMBOL_MAXIMIZE
Definition parser.tab.cc:108
@ YYSYMBOL_SOLVE
Definition parser.tab.cc:114
#define yyerrok
Definition parser.tab.cc:780
#define YY_ASSERT(E)
Definition parser.tab.cc:376
#define YY_(Msgid)
Definition parser.tab.cc:314
#define YYNOMEM
Definition parser.tab.cc:786
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition parser.tab.cc:359
static const yytype_int8 yydefact[]
Definition parser.tab.cc:671
#define YYNSTATES
Definition parser.tab.cc:513
#define YYSTYPE
Definition parser.tab.cc:67
#define YY_IGNORE_USELESS_CAST_END
Definition parser.tab.cc:373
short yytype_int16
Definition parser.tab.cc:227
#define YYABORT
Definition parser.tab.cc:784
#define YYSTACK_BYTES(N)
Definition parser.tab.cc:463
yytype_uint8 yy_state_t
Definition parser.tab.cc:301
#define YY_REDUCE_PRINT(Rule)
Definition parser.tab.cc:921
#define YY_CAST(Type, Val)
Definition parser.tab.cc:80
static const yytype_int16 yypact[]
Definition parser.tab.cc:646
#define yylex
Definition parser.tab.cc:70
static const yytype_uint8 yydefgoto[]
Definition parser.tab.cc:693
#define YY_NULLPTR
Definition parser.tab.cc:92
#define YYFINAL
Definition parser.tab.cc:502
#define YY_ACCESSING_SYMBOL(State)
Definition parser.tab.cc:556
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition parser.tab.cc:919
static const yytype_int16 yypgoto[]
Definition parser.tab.cc:687
#define YY_INITIAL_VALUE(Value)
Definition parser.tab.cc:355
static YYPTRDIFF_T yytnamerr(char *yyres, const char *yystr)
Definition parser.tab.cc:1019
#define yyparse
Definition parser.tab.cc:69
#define YYNTOKENS
Definition parser.tab.cc:507
unsigned char yytype_uint8
Definition parser.tab.cc:248
#define YY_STACK_PRINT(Bottom, Top)
Definition parser.tab.cc:920
#define YYSIZE_T
Definition parser.tab.cc:289
#define YYSTACK_ALLOC_MAXIMUM
Definition parser.tab.cc:423
#define yydebug
Definition parser.tab.cc:72
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition parser.tab.cc:372
static const yytype_int8 yyr2[]
Definition parser.tab.cc:771
#define YYPTRDIFF_T
Definition parser.tab.cc:275
#define yynerrs
Definition parser.tab.cc:73
static const yytype_int16 yytable[]
Definition parser.tab.cc:700
#define YYACCEPT
Definition parser.tab.cc:783
#define yytable_value_is_error(Yyn)
Definition parser.tab.cc:642
@ YYENOMEM
Definition parser.tab.cc:778
#define YYTRANSLATE(YYX)
Definition parser.tab.cc:520
static const yytype_int8 yystos[]
Definition parser.tab.cc:745
#define YY_ATTRIBUTE_UNUSED
Definition parser.tab.cc:330
static const char *const yytname[]
Definition parser.tab.cc:565
static int yypcontext_expected_tokens(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn)
Definition parser.tab.cc:952
static const yytype_int8 yyr1[]
Definition parser.tab.cc:761
static char * yystpcpy(char *yydest, const char *yysrc)
Definition parser.tab.cc:1000
int yy_state_fast_t
Definition parser.tab.cc:304
unsigned short yytype_uint16
Definition parser.tab.cc:259
#define YYLAST
Definition parser.tab.cc:504
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition parser.tab.cc:473
#define yypact_value_is_default(Yyn)
Definition parser.tab.cc:638
#define YYINITDEPTH
Definition parser.tab.cc:926
static int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn)
Definition parser.tab.cc:1054
signed char yytype_int8
Definition parser.tab.cc:219
#define YYERROR
Definition parser.tab.cc:785
#define YYSIZEOF(X)
Definition parser.tab.cc:298
static const yytype_int16 yycheck[]
Definition parser.tab.cc:722
#define YYSTACK_ALLOC
Definition parser.tab.cc:420
#define YYDPRINTF(Args)
Definition parser.tab.cc:918
#define YY_USE(E)
Definition parser.tab.cc:336
#define yyerror
Definition parser.tab.cc:71
static int yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx)
Definition parser.tab.cc:1103
static Annotation String(absl::string_view str)
static Annotation FunctionCall(absl::string_view id)
static Annotation FunctionCallWithArguments(absl::string_view id, std::vector< Annotation > args)
static Annotation Empty()
static Annotation AnnotationList(std::vector< Annotation > list)
static Annotation IntegerList(const std::vector< int64_t > &values)
static Annotation VarRefArray(std::vector< Variable * > variables)
static Annotation Identifier(absl::string_view id)
static Annotation VarRef(Variable *var)
static Annotation IntegerValue(int64_t value)
static Annotation Interval(int64_t interval_min, int64_t interval_max)
static Argument FloatList(std::vector< double > floats)
static Argument FloatValue(double value)
static Argument VoidArgument()
static Argument IntegerValue(int64_t value)
static Argument Interval(int64_t imin, int64_t imax)
static Argument FromDomain(const Domain &domain)
static Argument IntegerList(std::vector< int64_t > values)
static Argument VarRef(Variable *var)
static Argument DomainList(std::vector< Domain > domains)
static Argument VarRefArray(std::vector< Variable * > vars)
static Domain AllFloats()
static Domain IntegerList(std::vector< int64_t > values)
static Domain IntegerValue(int64_t value)
static Domain FloatValue(double value)
static Domain EmptyDomain()
static Domain FloatInterval(double lb, double ub)
static Domain SetOfBoolean()
static Domain Interval(int64_t included_min, int64_t included_max)
static Domain SetOfAllInt64()
static Domain SetOfInterval(int64_t included_min, int64_t included_max)
static Domain SetOfIntegerList(std::vector< int64_t > values)
static SolutionOutputSpecs MultiDimensionalArray(absl::string_view name, std::vector< Bounds > bounds, std::vector< Variable * > flat_variables, bool display_as_boolean)
static SolutionOutputSpecs SingleVariable(absl::string_view name, Variable *variable, bool display_as_boolean)
static VarRefOrValue VarRef(Variable *var)
static VarRefOrValue DomainValue(Domain domain)
static VarRefOrValue FloatValue(double value)
static VarRefOrValue Undefined()
static VarRefOrValue Value(int64_t value)
bool IsFunctionCallWithIdentifier(absl::string_view identifier) const
std::vector< Annotation > annotations
std::vector< int64_t > values
bool Contains(int64_t value) const
std::vector< double > * doubles
std::vector< Annotation > * annotations
std::vector< int64_t > * integers
std::vector< Domain > * domains
std::vector< Argument > * args
std::vector< VarRefOrValue > * var_or_value_array
VarRefOrValue var_or_value
absl::flat_hash_map< std::string, std::vector< Variable * > > variable_array_map
absl::flat_hash_map< std::string, Domain > domain_map
absl::flat_hash_map< std::string, int64_t > integer_map
absl::flat_hash_map< std::string, std::vector< double > > float_array_map
absl::flat_hash_map< std::string, Variable * > variable_map
absl::flat_hash_map< std::string, std::vector< Domain > > domain_array_map
absl::flat_hash_map< std::string, double > float_map
absl::flat_hash_map< std::string, std::vector< int64_t > > integer_array_map
bool Merge(absl::string_view other_name, const Domain &other_domain, bool other_temporary)
Definition parser.tab.cc:941
yysymbol_kind_t yytoken
Definition parser.tab.cc:943
yy_state_t * yyssp
Definition parser.tab.cc:942
Definition parser.tab.cc:453
YYSTYPE yyvs_alloc
Definition parser.tab.cc:455
yy_state_t yyss_alloc
Definition parser.tab.cc:454