GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/parser/smt2/Smt2Parser.c Lines: 3353 4613 72.7 %
Date: 2021-09-29 Branches: 2574 5665 45.4 %

Line Exec Source
1
/** \file
2
 *  This C source file was generated by $ANTLR version 3.4
3
 *
4
 *     -  From the grammar source file : /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g
5
 *     -                            On : 2021-09-29 01:05:27
6
 *     -                for the parser : Smt2ParserParser
7
 *
8
 * Editing it, at least manually, is not wise.
9
 *
10
 * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
11
 *
12
 *
13
*/
14
// [The "BSD license"]
15
// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
16
// http://www.temporal-wave.com
17
// http://www.linkedin.com/in/jimidle
18
//
19
// All rights reserved.
20
//
21
// Redistribution and use in source and binary forms, with or without
22
// modification, are permitted provided that the following conditions
23
// are met:
24
// 1. Redistributions of source code must retain the above copyright
25
//    notice, this list of conditions and the following disclaimer.
26
// 2. Redistributions in binary form must reproduce the above copyright
27
//    notice, this list of conditions and the following disclaimer in the
28
//    documentation and/or other materials provided with the distribution.
29
// 3. The name of the author may not be used to endorse or promote products
30
//    derived from this software without specific prior written permission.
31
//
32
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
33
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
34
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
35
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
36
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
37
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
39
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
41
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
43
44
/* =============================================================================
45
 * This is what the grammar programmer asked us to put at the top of every file.
46
 */
47
48
/* ****************************************************************************
49
 * This file is part of the cvc5 project.
50
 *
51
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
52
 * in the top-level source directory and their institutional affiliations.
53
 * All rights reserved.  See the file COPYING in the top-level source
54
 * directory for licensing information.
55
 * ****************************************************************************
56
 */
57
58
/* End of Header action.
59
 * =============================================================================
60
 */
61
62
/* -----------------------------------------
63
 * Include the ANTLR3 generated header file.
64
 */
65
#include    "Smt2Parser.h"
66
67
68
#include <set>
69
#include <sstream>
70
#include <string>
71
#include <unordered_set>
72
#include <vector>
73
74
#include "api/cpp/cvc5.h"
75
#include "base/output.h"
76
#include "options/set_language.h"
77
#include "parser/antlr_input.h"
78
#include "parser/parser.h"
79
#include "parser/smt2/smt2.h"
80
#include "util/floatingpoint_size.h"
81
#include "util/hash.h"
82
83
using namespace cvc5;
84
using namespace cvc5::parser;
85
86
/* These need to be macros so they can refer to the PARSER macro, which
87
 * will be defined by ANTLR *after* this section. (If they were functions,
88
 * PARSER would be undefined.) */
89
#undef PARSER_STATE
90
#define PARSER_STATE ((Smt2*)PARSER->super)
91
#undef SOLVER
92
#define SOLVER PARSER_STATE->getSolver()
93
#undef SYM_MAN
94
#define SYM_MAN PARSER_STATE->getSymbolManager()
95
#undef MK_TERM
96
#define MK_TERM SOLVER->mkTerm
97
#define UNSUPPORTED PARSER_STATE->unimplementedFeature
98
99
100
/* ----------------------------------------- */
101
102
103
104
105
106
/* MACROS that hide the C interface implementations from the
107
 * generated code, which makes it a little more understandable to the human eye.
108
 * I am very much against using C pre-processor macros for function calls and bits
109
 * of code as you cannot see what is happening when single stepping in debuggers
110
 * and so on. The exception (in my book at least) is for generated code, where you are
111
 * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
112
 * hides some indirect calls, but is always referring to the input stream. This is
113
 * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
114
 * the runtime interfaces without changing the generated code too often, without
115
 * confusing the reader of the generated output, who may not wish to know the gory
116
 * details of the interface inheritance.
117
 */
118
119
#define		CTX	ctx
120
121
/* Aids in accessing scopes for grammar programmers
122
 */
123
#undef	SCOPE_TYPE
124
#undef	SCOPE_STACK
125
#undef	SCOPE_TOP
126
#define	SCOPE_TYPE(scope)   pSmt2Parser_##scope##_SCOPE
127
#define SCOPE_STACK(scope)  pSmt2Parser_##scope##Stack
128
#define	SCOPE_TOP(scope)    ctx->pSmt2Parser_##scope##Top
129
#define	SCOPE_SIZE(scope)		ctx->pSmt2Parser_##scope##Stack_limit
130
#define SCOPE_INSTANCE(scope, i)	(ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))
131
132
/* Macros for accessing things in the parser
133
 */
134
135
#undef	    PARSER
136
#undef	    RECOGNIZER
137
#undef	    HAVEPARSEDRULE
138
#undef		MEMOIZE
139
#undef	    INPUT
140
#undef	    STRSTREAM
141
#undef	    HASEXCEPTION
142
#undef	    EXCEPTION
143
#undef	    MATCHT
144
#undef	    MATCHANYT
145
#undef	    FOLLOWSTACK
146
#undef	    FOLLOWPUSH
147
#undef	    FOLLOWPOP
148
#undef	    PRECOVER
149
#undef	    PREPORTERROR
150
#undef	    LA
151
#undef	    LT
152
#undef	    CONSTRUCTEX
153
#undef	    CONSUME
154
#undef	    MARK
155
#undef	    REWIND
156
#undef	    REWINDLAST
157
#undef	    PERRORRECOVERY
158
#undef	    HASFAILED
159
#undef	    FAILEDFLAG
160
#undef	    RECOVERFROMMISMATCHEDSET
161
#undef	    RECOVERFROMMISMATCHEDELEMENT
162
#undef		INDEX
163
#undef      ADAPTOR
164
#undef		SEEK
165
#undef	    RULEMEMO
166
#undef		DBG
167
168
#define	    PARSER				ctx->pParser
169
#define	    RECOGNIZER				PARSER->rec
170
#define	    PSRSTATE				RECOGNIZER->state
171
#define	    HAVEPARSEDRULE(r)			RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
172
#define	    MEMOIZE(ri,si)			RECOGNIZER->memoize(RECOGNIZER, ri, si)
173
#define	    INPUT				PARSER->tstream
174
#define	    STRSTREAM				INPUT
175
#define	    ISTREAM				INPUT->istream
176
#define	    INDEX()				ISTREAM->index(INPUT->istream)
177
#define	    HASEXCEPTION()			(PSRSTATE->error == ANTLR3_TRUE)
178
#define	    EXCEPTION				PSRSTATE->exception
179
#define	    MATCHT(t, fs)			RECOGNIZER->match(RECOGNIZER, t, fs)
180
#define	    MATCHANYT()				RECOGNIZER->matchAny(RECOGNIZER)
181
#define	    FOLLOWSTACK				PSRSTATE->following
182
#ifdef  SKIP_FOLLOW_SETS
183
#define	    FOLLOWPUSH(x)
184
#define	    FOLLOWPOP()
185
#else
186
#define	    FOLLOWPUSH(x)			FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
187
#define	    FOLLOWPOP()				FOLLOWSTACK->pop(FOLLOWSTACK)
188
#endif
189
#define	    PRECOVER()				RECOGNIZER->recover(RECOGNIZER)
190
#define	    PREPORTERROR()			RECOGNIZER->reportError(RECOGNIZER)
191
#define	    LA(n)				INPUT->istream->_LA(ISTREAM, n)
192
#define	    LT(n)				INPUT->_LT(INPUT, n)
193
#define	    CONSTRUCTEX()			RECOGNIZER->exConstruct(RECOGNIZER)
194
#define	    CONSUME()				ISTREAM->consume(ISTREAM)
195
#define	    MARK()				ISTREAM->mark(ISTREAM)
196
#define	    REWIND(m)				ISTREAM->rewind(ISTREAM, m)
197
#define	    REWINDLAST()			ISTREAM->rewindLast(ISTREAM)
198
#define	    SEEK(n)				ISTREAM->seek(ISTREAM, n)
199
#define	    PERRORRECOVERY			PSRSTATE->errorRecovery
200
#define	    FAILEDFLAG				PSRSTATE->failed
201
#define	    HASFAILED()				(FAILEDFLAG == ANTLR3_TRUE)
202
#define	    BACKTRACKING			PSRSTATE->backtracking
203
#define	    RECOVERFROMMISMATCHEDSET(s)		RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
204
#define	    RECOVERFROMMISMATCHEDELEMENT(e)	RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
205
#define     ADAPTOR                         ctx->adaptor
206
#define		RULEMEMO						PSRSTATE->ruleMemo
207
#define		DBG								RECOGNIZER->debugger
208
209
210
#define		TOKTEXT(tok, txt)				tok, (pANTLR3_UINT8)txt
211
212
/* The 4 tokens defined below may well clash with your own #defines or token types. If so
213
 * then for the present you must use different names for your defines as these are hard coded
214
 * in the code generator. It would be better not to use such names internally, and maybe
215
 * we can change this in a forthcoming release. I deliberately do not #undef these
216
 * here as this will at least give you a redefined error somewhere if they clash.
217
 */
218
#define	    UP	    ANTLR3_TOKEN_UP
219
#define	    DOWN    ANTLR3_TOKEN_DOWN
220
#define	    EOR	    ANTLR3_TOKEN_EOR
221
#define	    INVALID ANTLR3_TOKEN_INVALID
222
223
224
/* =============================================================================
225
 * Functions to create and destroy scopes. First come the rule scopes, followed
226
 * by the global declared scopes.
227
 */
228
229
230
231
/* ============================================================================= */
232
233
/* =============================================================================
234
 * Start of recognizer
235
 */
236
237
238
/** \brief Table of all token names in symbolic order, mainly used for
239
 *         error reporting.
240
 */
241
pANTLR3_UINT8   Smt2ParserTokenNames[107+4]
242
     = {
243
        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
244
        (pANTLR3_UINT8) "<EOR>",
245
        (pANTLR3_UINT8) "<DOWN>",
246
        (pANTLR3_UINT8) "<UP>",
247
        (pANTLR3_UINT8) "ALPHA",
248
        (pANTLR3_UINT8) "ASSERT_TOK",
249
        (pANTLR3_UINT8) "ASSUME_TOK",
250
        (pANTLR3_UINT8) "AS_TOK",
251
        (pANTLR3_UINT8) "ATTRIBUTE_INST_ADD_TO_POOL_TOK",
252
        (pANTLR3_UINT8) "ATTRIBUTE_INST_LEVEL",
253
        (pANTLR3_UINT8) "ATTRIBUTE_NAMED_TOK",
254
        (pANTLR3_UINT8) "ATTRIBUTE_NO_PATTERN_TOK",
255
        (pANTLR3_UINT8) "ATTRIBUTE_PATTERN_TOK",
256
        (pANTLR3_UINT8) "ATTRIBUTE_POOL_TOK",
257
        (pANTLR3_UINT8) "ATTRIBUTE_QUANTIFIER_ID_TOK",
258
        (pANTLR3_UINT8) "ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK",
259
        (pANTLR3_UINT8) "ATTRIBUTE_TOK",
260
        (pANTLR3_UINT8) "BINARY_LITERAL",
261
        (pANTLR3_UINT8) "BLOCK_MODEL_TOK",
262
        (pANTLR3_UINT8) "BLOCK_MODEL_VALUES_TOK",
263
        (pANTLR3_UINT8) "CHAR_TOK",
264
        (pANTLR3_UINT8) "CHECK_SAT_ASSUMING_TOK",
265
        (pANTLR3_UINT8) "CHECK_SAT_TOK",
266
        (pANTLR3_UINT8) "CHECK_SYNTH_TOK",
267
        (pANTLR3_UINT8) "COMMENT",
268
        (pANTLR3_UINT8) "COMPREHENSION_TOK",
269
        (pANTLR3_UINT8) "CONSTRAINT_TOK",
270
        (pANTLR3_UINT8) "CONST_TOK",
271
        (pANTLR3_UINT8) "DECIMAL_LITERAL",
272
        (pANTLR3_UINT8) "DECLARE_CODATATYPES_2_5_TOK",
273
        (pANTLR3_UINT8) "DECLARE_CODATATYPES_TOK",
274
        (pANTLR3_UINT8) "DECLARE_CODATATYPE_TOK",
275
        (pANTLR3_UINT8) "DECLARE_CONST_TOK",
276
        (pANTLR3_UINT8) "DECLARE_DATATYPES_2_5_TOK",
277
        (pANTLR3_UINT8) "DECLARE_DATATYPES_TOK",
278
        (pANTLR3_UINT8) "DECLARE_DATATYPE_TOK",
279
        (pANTLR3_UINT8) "DECLARE_FUNS_TOK",
280
        (pANTLR3_UINT8) "DECLARE_FUN_TOK",
281
        (pANTLR3_UINT8) "DECLARE_HEAP",
282
        (pANTLR3_UINT8) "DECLARE_POOL",
283
        (pANTLR3_UINT8) "DECLARE_PREDS_TOK",
284
        (pANTLR3_UINT8) "DECLARE_SORTS_TOK",
285
        (pANTLR3_UINT8) "DECLARE_SORT_TOK",
286
        (pANTLR3_UINT8) "DECLARE_VAR_TOK",
287
        (pANTLR3_UINT8) "DEFINE_CONST_TOK",
288
        (pANTLR3_UINT8) "DEFINE_FUNS_REC_TOK",
289
        (pANTLR3_UINT8) "DEFINE_FUN_REC_TOK",
290
        (pANTLR3_UINT8) "DEFINE_FUN_TOK",
291
        (pANTLR3_UINT8) "DEFINE_SORT_TOK",
292
        (pANTLR3_UINT8) "DEFINE_TOK",
293
        (pANTLR3_UINT8) "DIGIT",
294
        (pANTLR3_UINT8) "ECHO_TOK",
295
        (pANTLR3_UINT8) "EMP_TOK",
296
        (pANTLR3_UINT8) "EXISTS_TOK",
297
        (pANTLR3_UINT8) "EXIT_TOK",
298
        (pANTLR3_UINT8) "FORALL_TOK",
299
        (pANTLR3_UINT8) "GET_ABDUCT_TOK",
300
        (pANTLR3_UINT8) "GET_ASSERTIONS_TOK",
301
        (pANTLR3_UINT8) "GET_ASSIGNMENT_TOK",
302
        (pANTLR3_UINT8) "GET_DIFFICULTY_TOK",
303
        (pANTLR3_UINT8) "GET_INFO_TOK",
304
        (pANTLR3_UINT8) "GET_INTERPOL_TOK",
305
        (pANTLR3_UINT8) "GET_MODEL_TOK",
306
        (pANTLR3_UINT8) "GET_OPTION_TOK",
307
        (pANTLR3_UINT8) "GET_PROOF_TOK",
308
        (pANTLR3_UINT8) "GET_QE_DISJUNCT_TOK",
309
        (pANTLR3_UINT8) "GET_QE_TOK",
310
        (pANTLR3_UINT8) "GET_UNSAT_ASSUMPTIONS_TOK",
311
        (pANTLR3_UINT8) "GET_UNSAT_CORE_TOK",
312
        (pANTLR3_UINT8) "GET_VALUE_TOK",
313
        (pANTLR3_UINT8) "HEX_DIGIT",
314
        (pANTLR3_UINT8) "HEX_LITERAL",
315
        (pANTLR3_UINT8) "HO_ARROW_TOK",
316
        (pANTLR3_UINT8) "HO_LAMBDA_TOK",
317
        (pANTLR3_UINT8) "INCLUDE_TOK",
318
        (pANTLR3_UINT8) "INDEX_TOK",
319
        (pANTLR3_UINT8) "INTEGER_LITERAL",
320
        (pANTLR3_UINT8) "INV_CONSTRAINT_TOK",
321
        (pANTLR3_UINT8) "KEYWORD",
322
        (pANTLR3_UINT8) "LET_TOK",
323
        (pANTLR3_UINT8) "LPAREN_TOK",
324
        (pANTLR3_UINT8) "MATCH_TOK",
325
        (pANTLR3_UINT8) "NUMERAL",
326
        (pANTLR3_UINT8) "PAR_TOK",
327
        (pANTLR3_UINT8) "POP_TOK",
328
        (pANTLR3_UINT8) "PUSH_TOK",
329
        (pANTLR3_UINT8) "QUOTED_SYMBOL",
330
        (pANTLR3_UINT8) "RESET_ASSERTIONS_TOK",
331
        (pANTLR3_UINT8) "RESET_TOK",
332
        (pANTLR3_UINT8) "RPAREN_TOK",
333
        (pANTLR3_UINT8) "SET_FEATURE_TOK",
334
        (pANTLR3_UINT8) "SET_INFO_TOK",
335
        (pANTLR3_UINT8) "SET_LOGIC_TOK",
336
        (pANTLR3_UINT8) "SET_OPTION_TOK",
337
        (pANTLR3_UINT8) "SIMPLE_SYMBOL",
338
        (pANTLR3_UINT8) "SIMPLIFY_TOK",
339
        (pANTLR3_UINT8) "STRING_LITERAL",
340
        (pANTLR3_UINT8) "SYGUS_CONSTANT_TOK",
341
        (pANTLR3_UINT8) "SYGUS_VARIABLE_TOK",
342
        (pANTLR3_UINT8) "SYMBOL_CHAR",
343
        (pANTLR3_UINT8) "SYMBOL_CHAR_NOUNDERSCORE_NOATTRIBUTE",
344
        (pANTLR3_UINT8) "SYNTH_FUN_TOK",
345
        (pANTLR3_UINT8) "SYNTH_INV_TOK",
346
        (pANTLR3_UINT8) "TESTER_TOK",
347
        (pANTLR3_UINT8) "TUPLE_CONST_TOK",
348
        (pANTLR3_UINT8) "TUPLE_PROJECT_TOK",
349
        (pANTLR3_UINT8) "TUPLE_SEL_TOK",
350
        (pANTLR3_UINT8) "UNTERMINATED_QUOTED_SYMBOL",
351
        (pANTLR3_UINT8) "UPDATE_TOK",
352
        (pANTLR3_UINT8) "WHITESPACE",
353
        (pANTLR3_UINT8) "'\\\\'"
354
       };
355
356
357
358
// Forward declare the locally static matching functions we have generated.
359
//
360
static
361
 cvc5::api::Term
362
	parseExpr    (pSmt2Parser ctx);
363
static
364
 cvc5::Command*
365
	parseCommand    (pSmt2Parser ctx);
366
static
367
 cvc5::Command*
368
	parseSygus    (pSmt2Parser ctx);
369
static
370
 void
371
	command    (pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd);
372
static
373
 std::unique_ptr<cvc5::Command>
374
	sygusCommand    (pSmt2Parser ctx);
375
static
376
 void
377
	sygusGrammar    (pSmt2Parser ctx, cvc5::api::Grammar*& ret, const std::vector<cvc5::api::Term>& sygusVars, const std::string& fun);
378
static
379
 void
380
	setInfoInternal    (pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd);
381
static
382
 void
383
	setOptionInternal    (pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd);
384
static
385
 void
386
	smt25Command    (pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd);
387
static
388
 void
389
	extendedCommand    (pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd);
390
static
391
 void
392
	datatypeDefCommand    (pSmt2Parser ctx, bool isCo, std::unique_ptr<cvc5::Command>* cmd);
393
static
394
 void
395
	datatypesDefCommand    (pSmt2Parser ctx, bool isCo, std::unique_ptr<cvc5::Command>* cmd);
396
static
397
 void
398
	datatypesDef    (pSmt2Parser ctx, bool isCo, const std::vector<std::string>& dnames, const std::vector<int>& arities, std::unique_ptr<cvc5::Command>* cmd);
399
static
400
 void
401
	simpleSymbolicExprNoKeyword    (pSmt2Parser ctx, std::string& s);
402
static
403
 void
404
	keyword    (pSmt2Parser ctx, std::string& s);
405
static
406
 void
407
	simpleSymbolicExpr    (pSmt2Parser ctx, std::string& s);
408
static
409
 void
410
	symbolicExpr    (pSmt2Parser ctx, cvc5::api::Term& sexpr);
411
static
412
 void
413
	term    (pSmt2Parser ctx, cvc5::api::Term& expr, cvc5::api::Term& expr2);
414
static
415
 void
416
	termNonVariable    (pSmt2Parser ctx, cvc5::api::Term& expr, cvc5::api::Term& expr2);
417
static
418
 void
419
	qualIdentifier    (pSmt2Parser ctx, cvc5::ParseOp& p);
420
static
421
 void
422
	identifier    (pSmt2Parser ctx, cvc5::ParseOp& p);
423
static
424
 void
425
	termAtomic    (pSmt2Parser ctx, cvc5::api::Term& atomTerm);
426
static
427
 void
428
	attribute    (pSmt2Parser ctx, cvc5::api::Term& expr, cvc5::api::Term& retExpr);
429
static
430
 void
431
	termList    (pSmt2Parser ctx, std::vector<cvc5::api::Term>& formulas, cvc5::api::Term& expr);
432
static
433
 void
434
	str    (pSmt2Parser ctx, std::string& s, bool fsmtlib);
435
static
436
 void
437
	quantOp    (pSmt2Parser ctx, cvc5::api::Kind& kind);
438
static
439
 void
440
	functionName    (pSmt2Parser ctx, std::string& name, cvc5::parser::DeclarationCheck check);
441
static
442
 void
443
	sortList    (pSmt2Parser ctx, std::vector<cvc5::api::Sort>& sorts);
444
static
445
 void
446
	nonemptySortList    (pSmt2Parser ctx, std::vector<cvc5::api::Sort>& sorts);
447
static
448
 void
449
	sortedVarList    (pSmt2Parser ctx, std::vector<std::pair<std::string, cvc5::api::Sort> >& sortedVars);
450
static
451
 void
452
	boundVarList    (pSmt2Parser ctx, cvc5::api::Term& expr);
453
static
454
 void
455
	sortName    (pSmt2Parser ctx, std::string& name, cvc5::parser::DeclarationCheck check);
456
static
457
 void
458
	sortSymbol    (pSmt2Parser ctx, cvc5::api::Sort& t, cvc5::parser::DeclarationCheck check);
459
static
460
 void
461
	symbolList    (pSmt2Parser ctx, std::vector<std::string>& names, cvc5::parser::DeclarationCheck check, cvc5::parser::SymbolType type);
462
static
463
 void
464
	symbol    (pSmt2Parser ctx, std::string& id, cvc5::parser::DeclarationCheck check, cvc5::parser::SymbolType type);
465
static
466
 void
467
	nonemptyNumeralList    (pSmt2Parser ctx, std::vector<uint64_t>& numerals);
468
static
469
 void
470
	datatypeDef    (pSmt2Parser ctx, bool isCo, std::vector<cvc5::api::DatatypeDecl>& datatypes, std::vector< cvc5::api::Sort >& params);
471
static
472
 void
473
	constructorDef    (pSmt2Parser ctx, cvc5::api::DatatypeDecl& type);
474
static
475
 void
476
	selector    (pSmt2Parser ctx, cvc5::api::DatatypeConstructorDecl& ctor);
477
static void	Smt2ParserFree(pSmt2Parser ctx);
478
static void     Smt2ParserReset (pSmt2Parser ctx);
479
480
/* For use in tree output where we are accumulating rule labels via label += ruleRef
481
 * we need a function that knows how to free a return scope when the list is destroyed.
482
 * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
483
 */
484
static	void ANTLR3_CDECL freeScope(void * scope)
485
{
486
    ANTLR3_FREE(scope);
487
}
488
489
/** \brief Name of the grammar file that generated this code
490
 */
491
static const char fileName[] = "/barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g";
492
493
/** \brief Return the name of the grammar file that generated this code.
494
 */
495
static const char * getGrammarFileName()
496
{
497
	return fileName;
498
}
499
/** \brief Create a new Smt2Parser parser and return a context for it.
500
 *
501
 * \param[in] instream Pointer to an input stream interface.
502
 *
503
 * \return Pointer to new parser context upon success.
504
 */
505
ANTLR3_API pSmt2Parser
506
4029
Smt2ParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
507
{
508
	// See if we can create a new parser with the standard constructor
509
	//
510
4029
	return Smt2ParserNewSSD(instream, NULL);
511
}
512
513
/** \brief Create a new Smt2Parser parser and return a context for it.
514
 *
515
 * \param[in] instream Pointer to an input stream interface.
516
 *
517
 * \return Pointer to new parser context upon success.
518
 */
519
ANTLR3_API pSmt2Parser
520
4029
Smt2ParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
521
{
522
    pSmt2Parser ctx;	    /* Context structure we will build and return   */
523
524
4029
    ctx	= (pSmt2Parser) ANTLR3_CALLOC(1, sizeof(Smt2Parser));
525
526
4029
    if	(ctx == NULL)
527
    {
528
		// Failed to allocate memory for parser context
529
		//
530
        return  NULL;
531
    }
532
533
    /* -------------------------------------------------------------------
534
     * Memory for basic structure is allocated, now to fill in
535
     * the base ANTLR3 structures. We initialize the function pointers
536
     * for the standard ANTLR3 parser function set, but upon return
537
     * from here, the programmer may set the pointers to provide custom
538
     * implementations of each function.
539
     *
540
     * We don't use the macros defined in Smt2Parser.h here, in order that you can get a sense
541
     * of what goes where.
542
     */
543
544
    /* Create a base parser/recognizer, using the supplied token stream
545
     */
546
4029
    ctx->pParser	    = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
547
    /* Install the implementation of our Smt2Parser interface
548
     */
549
4029
    ctx->parseExpr	= parseExpr;
550
4029
    ctx->parseCommand	= parseCommand;
551
4029
    ctx->parseSygus	= parseSygus;
552
4029
    ctx->command	= command;
553
4029
    ctx->sygusCommand	= sygusCommand;
554
4029
    ctx->sygusGrammar	= sygusGrammar;
555
4029
    ctx->setInfoInternal	= setInfoInternal;
556
4029
    ctx->setOptionInternal	= setOptionInternal;
557
4029
    ctx->smt25Command	= smt25Command;
558
4029
    ctx->extendedCommand	= extendedCommand;
559
4029
    ctx->datatypeDefCommand	= datatypeDefCommand;
560
4029
    ctx->datatypesDefCommand	= datatypesDefCommand;
561
4029
    ctx->datatypesDef	= datatypesDef;
562
4029
    ctx->simpleSymbolicExprNoKeyword	= simpleSymbolicExprNoKeyword;
563
4029
    ctx->keyword	= keyword;
564
4029
    ctx->simpleSymbolicExpr	= simpleSymbolicExpr;
565
4029
    ctx->symbolicExpr	= symbolicExpr;
566
4029
    ctx->term	= term;
567
4029
    ctx->termNonVariable	= termNonVariable;
568
4029
    ctx->qualIdentifier	= qualIdentifier;
569
4029
    ctx->identifier	= identifier;
570
4029
    ctx->termAtomic	= termAtomic;
571
4029
    ctx->attribute	= attribute;
572
4029
    ctx->termList	= termList;
573
4029
    ctx->str	= str;
574
4029
    ctx->quantOp	= quantOp;
575
4029
    ctx->functionName	= functionName;
576
4029
    ctx->sortList	= sortList;
577
4029
    ctx->nonemptySortList	= nonemptySortList;
578
4029
    ctx->sortedVarList	= sortedVarList;
579
4029
    ctx->boundVarList	= boundVarList;
580
4029
    ctx->sortName	= sortName;
581
4029
    ctx->sortSymbol	= sortSymbol;
582
4029
    ctx->symbolList	= symbolList;
583
4029
    ctx->symbol	= symbol;
584
4029
    ctx->nonemptyNumeralList	= nonemptyNumeralList;
585
4029
    ctx->datatypeDef	= datatypeDef;
586
4029
    ctx->constructorDef	= constructorDef;
587
4029
    ctx->selector	= selector;
588
4029
    ctx->free			= Smt2ParserFree;
589
4029
    ctx->reset			= Smt2ParserReset;
590
4029
    ctx->getGrammarFileName	= getGrammarFileName;
591
592
    /* Install the scope pushing methods.
593
     */
594
595
    /* Install the token table
596
     */
597
4029
    PSRSTATE->tokenNames   = Smt2ParserTokenNames;
598
599
600
    /* Return the newly built parser to the caller
601
     */
602
4029
    return  ctx;
603
}
604
605
static void
606
Smt2ParserReset (pSmt2Parser ctx)
607
{
608
    RECOGNIZER->reset(RECOGNIZER);
609
}
610
611
/** Free the parser resources
612
 */
613
 static void
614
4029
 Smt2ParserFree(pSmt2Parser ctx)
615
 {
616
    /* Free any scope memory
617
     */
618
619
	// Free this parser
620
	//
621
4029
    ctx->pParser->free(ctx->pParser);
622
623
624
4029
    ANTLR3_FREE(ctx);
625
626
    /* Everything is released, so we can return
627
     */
628
4029
    return;
629
 }
630
631
/** Return token names used by this
632
parser
633
634
 *
635
 * The returned pointer is used as an index into the token names table (using the token
636
 * number as the index).
637
 *
638
 * \return Pointer to first char * in the table.
639
 */
640
static pANTLR3_UINT8    *getTokenNames()
641
{
642
        return Smt2ParserTokenNames;
643
}
644
645
646
/* Declare the bitsets
647
 */
648
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_parseExpr117  */
649
static	ANTLR3_BITWORD FOLLOW_term_in_parseExpr117_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
650
static  ANTLR3_BITSET_LIST FOLLOW_term_in_parseExpr117	= { FOLLOW_term_in_parseExpr117_bits, 1	};
651
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_parseExpr124  */
652
static	ANTLR3_BITWORD FOLLOW_EOF_in_parseExpr124_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
653
static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_parseExpr124	= { FOLLOW_EOF_in_parseExpr124_bits, 1	};
654
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_parseCommand153  */
655
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_parseCommand153_bits[]	= { ANTLR3_UINT64_LIT(0xFF4BF7FDC06C0020), ANTLR3_UINT64_LIT(0x00000000F9B0003F) };
656
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_parseCommand153	= { FOLLOW_LPAREN_TOK_in_parseCommand153_bits, 2	};
657
/** Bitset defining follow set for error recovery in rule state: FOLLOW_command_in_parseCommand155  */
658
static	ANTLR3_BITWORD FOLLOW_command_in_parseCommand155_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
659
static  ANTLR3_BITSET_LIST FOLLOW_command_in_parseCommand155	= { FOLLOW_command_in_parseCommand155_bits, 2	};
660
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_parseCommand158  */
661
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_parseCommand158_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
662
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_parseCommand158	= { FOLLOW_RPAREN_TOK_in_parseCommand158_bits, 1	};
663
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_parseCommand171  */
664
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_parseCommand171_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000400) };
665
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_parseCommand171	= { FOLLOW_LPAREN_TOK_in_parseCommand171_bits, 2	};
666
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INCLUDE_TOK_in_parseCommand173  */
667
static	ANTLR3_BITWORD FOLLOW_INCLUDE_TOK_in_parseCommand173_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000100000000) };
668
static  ANTLR3_BITSET_LIST FOLLOW_INCLUDE_TOK_in_parseCommand173	= { FOLLOW_INCLUDE_TOK_in_parseCommand173_bits, 2	};
669
/** Bitset defining follow set for error recovery in rule state: FOLLOW_str_in_parseCommand175  */
670
static	ANTLR3_BITWORD FOLLOW_str_in_parseCommand175_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
671
static  ANTLR3_BITSET_LIST FOLLOW_str_in_parseCommand175	= { FOLLOW_str_in_parseCommand175_bits, 2	};
672
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_parseCommand178  */
673
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_parseCommand178_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
674
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_parseCommand178	= { FOLLOW_RPAREN_TOK_in_parseCommand178_bits, 1	};
675
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_parseCommand191  */
676
static	ANTLR3_BITWORD FOLLOW_EOF_in_parseCommand191_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
677
static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_parseCommand191	= { FOLLOW_EOF_in_parseCommand191_bits, 1	};
678
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_parseSygus220  */
679
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_parseSygus220_bits[]	= { ANTLR3_UINT64_LIT(0xFF4BFFFDC4EC0060), ANTLR3_UINT64_LIT(0x00000060FDB0203F) };
680
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_parseSygus220	= { FOLLOW_LPAREN_TOK_in_parseSygus220_bits, 2	};
681
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sygusCommand_in_parseSygus224  */
682
static	ANTLR3_BITWORD FOLLOW_sygusCommand_in_parseSygus224_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
683
static  ANTLR3_BITSET_LIST FOLLOW_sygusCommand_in_parseSygus224	= { FOLLOW_sygusCommand_in_parseSygus224_bits, 2	};
684
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_parseSygus226  */
685
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_parseSygus226_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
686
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_parseSygus226	= { FOLLOW_RPAREN_TOK_in_parseSygus226_bits, 1	};
687
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_parseSygus232  */
688
static	ANTLR3_BITWORD FOLLOW_EOF_in_parseSygus232_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
689
static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_parseSygus232	= { FOLLOW_EOF_in_parseSygus232_bits, 1	};
690
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SET_LOGIC_TOK_in_command260  */
691
static	ANTLR3_BITWORD FOLLOW_SET_LOGIC_TOK_in_command260_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
692
static  ANTLR3_BITSET_LIST FOLLOW_SET_LOGIC_TOK_in_command260	= { FOLLOW_SET_LOGIC_TOK_in_command260_bits, 2	};
693
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_command262  */
694
static	ANTLR3_BITWORD FOLLOW_symbol_in_command262_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
695
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_command262	= { FOLLOW_symbol_in_command262_bits, 1	};
696
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SET_INFO_TOK_in_command281  */
697
static	ANTLR3_BITWORD FOLLOW_SET_INFO_TOK_in_command281_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000004000) };
698
static  ANTLR3_BITSET_LIST FOLLOW_SET_INFO_TOK_in_command281	= { FOLLOW_SET_INFO_TOK_in_command281_bits, 2	};
699
/** Bitset defining follow set for error recovery in rule state: FOLLOW_setInfoInternal_in_command283  */
700
static	ANTLR3_BITWORD FOLLOW_setInfoInternal_in_command283_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
701
static  ANTLR3_BITSET_LIST FOLLOW_setInfoInternal_in_command283	= { FOLLOW_setInfoInternal_in_command283_bits, 1	};
702
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_INFO_TOK_in_command296  */
703
static	ANTLR3_BITWORD FOLLOW_GET_INFO_TOK_in_command296_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000004000) };
704
static  ANTLR3_BITSET_LIST FOLLOW_GET_INFO_TOK_in_command296	= { FOLLOW_GET_INFO_TOK_in_command296_bits, 2	};
705
/** Bitset defining follow set for error recovery in rule state: FOLLOW_KEYWORD_in_command298  */
706
static	ANTLR3_BITWORD FOLLOW_KEYWORD_in_command298_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
707
static  ANTLR3_BITSET_LIST FOLLOW_KEYWORD_in_command298	= { FOLLOW_KEYWORD_in_command298_bits, 1	};
708
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SET_OPTION_TOK_in_command316  */
709
static	ANTLR3_BITWORD FOLLOW_SET_OPTION_TOK_in_command316_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000004000) };
710
static  ANTLR3_BITSET_LIST FOLLOW_SET_OPTION_TOK_in_command316	= { FOLLOW_SET_OPTION_TOK_in_command316_bits, 2	};
711
/** Bitset defining follow set for error recovery in rule state: FOLLOW_setOptionInternal_in_command318  */
712
static	ANTLR3_BITWORD FOLLOW_setOptionInternal_in_command318_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
713
static  ANTLR3_BITSET_LIST FOLLOW_setOptionInternal_in_command318	= { FOLLOW_setOptionInternal_in_command318_bits, 1	};
714
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_OPTION_TOK_in_command331  */
715
static	ANTLR3_BITWORD FOLLOW_GET_OPTION_TOK_in_command331_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000004000) };
716
static  ANTLR3_BITSET_LIST FOLLOW_GET_OPTION_TOK_in_command331	= { FOLLOW_GET_OPTION_TOK_in_command331_bits, 2	};
717
/** Bitset defining follow set for error recovery in rule state: FOLLOW_KEYWORD_in_command333  */
718
static	ANTLR3_BITWORD FOLLOW_KEYWORD_in_command333_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
719
static  ANTLR3_BITSET_LIST FOLLOW_KEYWORD_in_command333	= { FOLLOW_KEYWORD_in_command333_bits, 1	};
720
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_SORT_TOK_in_command351  */
721
static	ANTLR3_BITWORD FOLLOW_DECLARE_SORT_TOK_in_command351_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
722
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_SORT_TOK_in_command351	= { FOLLOW_DECLARE_SORT_TOK_in_command351_bits, 2	};
723
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_command363  */
724
static	ANTLR3_BITWORD FOLLOW_symbol_in_command363_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
725
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_command363	= { FOLLOW_symbol_in_command363_bits, 2	};
726
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_command378  */
727
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_command378_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
728
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_command378	= { FOLLOW_INTEGER_LITERAL_in_command378_bits, 1	};
729
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_SORT_TOK_in_command396  */
730
static	ANTLR3_BITWORD FOLLOW_DEFINE_SORT_TOK_in_command396_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
731
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_SORT_TOK_in_command396	= { FOLLOW_DEFINE_SORT_TOK_in_command396_bits, 2	};
732
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_command404  */
733
static	ANTLR3_BITWORD FOLLOW_symbol_in_command404_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
734
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_command404	= { FOLLOW_symbol_in_command404_bits, 2	};
735
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_command417  */
736
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_command417_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042400000) };
737
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_command417	= { FOLLOW_LPAREN_TOK_in_command417_bits, 2	};
738
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbolList_in_command419  */
739
static	ANTLR3_BITWORD FOLLOW_symbolList_in_command419_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
740
static  ANTLR3_BITSET_LIST FOLLOW_symbolList_in_command419	= { FOLLOW_symbolList_in_command419_bits, 2	};
741
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_command422  */
742
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_command422_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
743
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_command422	= { FOLLOW_RPAREN_TOK_in_command422_bits, 2	};
744
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_command434  */
745
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_command434_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
746
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_command434	= { FOLLOW_sortSymbol_in_command434_bits, 1	};
747
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_FUN_TOK_in_command453  */
748
static	ANTLR3_BITWORD FOLLOW_DECLARE_FUN_TOK_in_command453_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
749
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_FUN_TOK_in_command453	= { FOLLOW_DECLARE_FUN_TOK_in_command453_bits, 2	};
750
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_command461  */
751
static	ANTLR3_BITWORD FOLLOW_symbol_in_command461_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
752
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_command461	= { FOLLOW_symbol_in_command461_bits, 2	};
753
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_command474  */
754
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_command474_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042410000) };
755
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_command474	= { FOLLOW_LPAREN_TOK_in_command474_bits, 2	};
756
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortList_in_command476  */
757
static	ANTLR3_BITWORD FOLLOW_sortList_in_command476_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
758
static  ANTLR3_BITSET_LIST FOLLOW_sortList_in_command476	= { FOLLOW_sortList_in_command476_bits, 2	};
759
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_command479  */
760
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_command479_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
761
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_command479	= { FOLLOW_RPAREN_TOK_in_command479_bits, 2	};
762
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_command485  */
763
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_command485_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
764
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_command485	= { FOLLOW_sortSymbol_in_command485_bits, 1	};
765
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_FUN_TOK_in_command504  */
766
static	ANTLR3_BITWORD FOLLOW_DEFINE_FUN_TOK_in_command504_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
767
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_FUN_TOK_in_command504	= { FOLLOW_DEFINE_FUN_TOK_in_command504_bits, 2	};
768
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_command512  */
769
static	ANTLR3_BITWORD FOLLOW_symbol_in_command512_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
770
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_command512	= { FOLLOW_symbol_in_command512_bits, 2	};
771
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_command525  */
772
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_command525_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
773
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_command525	= { FOLLOW_LPAREN_TOK_in_command525_bits, 2	};
774
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortedVarList_in_command527  */
775
static	ANTLR3_BITWORD FOLLOW_sortedVarList_in_command527_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
776
static  ANTLR3_BITSET_LIST FOLLOW_sortedVarList_in_command527	= { FOLLOW_sortedVarList_in_command527_bits, 2	};
777
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_command530  */
778
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_command530_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
779
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_command530	= { FOLLOW_RPAREN_TOK_in_command530_bits, 2	};
780
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_command536  */
781
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_command536_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
782
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_command536	= { FOLLOW_sortSymbol_in_command536_bits, 2	};
783
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_command549  */
784
static	ANTLR3_BITWORD FOLLOW_term_in_command549_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
785
static  ANTLR3_BITSET_LIST FOLLOW_term_in_command549	= { FOLLOW_term_in_command549_bits, 1	};
786
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_DATATYPE_TOK_in_command562  */
787
static	ANTLR3_BITWORD FOLLOW_DECLARE_DATATYPE_TOK_in_command562_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
788
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_DATATYPE_TOK_in_command562	= { FOLLOW_DECLARE_DATATYPE_TOK_in_command562_bits, 2	};
789
/** Bitset defining follow set for error recovery in rule state: FOLLOW_datatypeDefCommand_in_command564  */
790
static	ANTLR3_BITWORD FOLLOW_datatypeDefCommand_in_command564_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
791
static  ANTLR3_BITSET_LIST FOLLOW_datatypeDefCommand_in_command564	= { FOLLOW_datatypeDefCommand_in_command564_bits, 1	};
792
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_DATATYPES_TOK_in_command571  */
793
static	ANTLR3_BITWORD FOLLOW_DECLARE_DATATYPES_TOK_in_command571_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
794
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_DATATYPES_TOK_in_command571	= { FOLLOW_DECLARE_DATATYPES_TOK_in_command571_bits, 2	};
795
/** Bitset defining follow set for error recovery in rule state: FOLLOW_datatypesDefCommand_in_command573  */
796
static	ANTLR3_BITWORD FOLLOW_datatypesDefCommand_in_command573_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
797
static  ANTLR3_BITSET_LIST FOLLOW_datatypesDefCommand_in_command573	= { FOLLOW_datatypesDefCommand_in_command573_bits, 1	};
798
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_VALUE_TOK_in_command586  */
799
static	ANTLR3_BITWORD FOLLOW_GET_VALUE_TOK_in_command586_bits[]	= { ANTLR3_UINT64_LIT(0xFFFFFFFFFFFFFFF0), ANTLR3_UINT64_LIT(0x00007FFFFFFFFFFF) };
800
static  ANTLR3_BITSET_LIST FOLLOW_GET_VALUE_TOK_in_command586	= { FOLLOW_GET_VALUE_TOK_in_command586_bits, 2	};
801
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_command596  */
802
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_command596_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
803
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_command596	= { FOLLOW_LPAREN_TOK_in_command596_bits, 2	};
804
/** Bitset defining follow set for error recovery in rule state: FOLLOW_termList_in_command598  */
805
static	ANTLR3_BITWORD FOLLOW_termList_in_command598_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
806
static  ANTLR3_BITSET_LIST FOLLOW_termList_in_command598	= { FOLLOW_termList_in_command598_bits, 2	};
807
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_command601  */
808
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_command601_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
809
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_command601	= { FOLLOW_RPAREN_TOK_in_command601_bits, 1	};
810
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_command617  */
811
static	ANTLR3_BITWORD FOLLOW_set_in_command617_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
812
static  ANTLR3_BITSET_LIST FOLLOW_set_in_command617	= { FOLLOW_set_in_command617_bits, 1	};
813
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_ASSIGNMENT_TOK_in_command644  */
814
static	ANTLR3_BITWORD FOLLOW_GET_ASSIGNMENT_TOK_in_command644_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
815
static  ANTLR3_BITSET_LIST FOLLOW_GET_ASSIGNMENT_TOK_in_command644	= { FOLLOW_GET_ASSIGNMENT_TOK_in_command644_bits, 1	};
816
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSERT_TOK_in_command664  */
817
static	ANTLR3_BITWORD FOLLOW_ASSERT_TOK_in_command664_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
818
static  ANTLR3_BITSET_LIST FOLLOW_ASSERT_TOK_in_command664	= { FOLLOW_ASSERT_TOK_in_command664_bits, 2	};
819
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_command678  */
820
static	ANTLR3_BITWORD FOLLOW_term_in_command678_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
821
static  ANTLR3_BITSET_LIST FOLLOW_term_in_command678	= { FOLLOW_term_in_command678_bits, 1	};
822
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHECK_SAT_TOK_in_command697  */
823
static	ANTLR3_BITWORD FOLLOW_CHECK_SAT_TOK_in_command697_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020002), ANTLR3_UINT64_LIT(0x0000090140411080) };
824
static  ANTLR3_BITSET_LIST FOLLOW_CHECK_SAT_TOK_in_command697	= { FOLLOW_CHECK_SAT_TOK_in_command697_bits, 2	};
825
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_command713  */
826
static	ANTLR3_BITWORD FOLLOW_term_in_command713_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
827
static  ANTLR3_BITSET_LIST FOLLOW_term_in_command713	= { FOLLOW_term_in_command713_bits, 1	};
828
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHECK_SAT_ASSUMING_TOK_in_command754  */
829
static	ANTLR3_BITWORD FOLLOW_CHECK_SAT_ASSUMING_TOK_in_command754_bits[]	= { ANTLR3_UINT64_LIT(0xFFFFFFFFFFFFFFF0), ANTLR3_UINT64_LIT(0x00007FFFFFFFFFFF) };
830
static  ANTLR3_BITSET_LIST FOLLOW_CHECK_SAT_ASSUMING_TOK_in_command754	= { FOLLOW_CHECK_SAT_ASSUMING_TOK_in_command754_bits, 2	};
831
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_command764  */
832
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_command764_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
833
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_command764	= { FOLLOW_LPAREN_TOK_in_command764_bits, 2	};
834
/** Bitset defining follow set for error recovery in rule state: FOLLOW_termList_in_command766  */
835
static	ANTLR3_BITWORD FOLLOW_termList_in_command766_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
836
static  ANTLR3_BITSET_LIST FOLLOW_termList_in_command766	= { FOLLOW_termList_in_command766_bits, 2	};
837
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_command769  */
838
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_command769_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
839
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_command769	= { FOLLOW_RPAREN_TOK_in_command769_bits, 1	};
840
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_command785  */
841
static	ANTLR3_BITWORD FOLLOW_set_in_command785_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
842
static  ANTLR3_BITSET_LIST FOLLOW_set_in_command785	= { FOLLOW_set_in_command785_bits, 1	};
843
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_ASSERTIONS_TOK_in_command812  */
844
static	ANTLR3_BITWORD FOLLOW_GET_ASSERTIONS_TOK_in_command812_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
845
static  ANTLR3_BITSET_LIST FOLLOW_GET_ASSERTIONS_TOK_in_command812	= { FOLLOW_GET_ASSERTIONS_TOK_in_command812_bits, 1	};
846
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_PROOF_TOK_in_command832  */
847
static	ANTLR3_BITWORD FOLLOW_GET_PROOF_TOK_in_command832_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
848
static  ANTLR3_BITSET_LIST FOLLOW_GET_PROOF_TOK_in_command832	= { FOLLOW_GET_PROOF_TOK_in_command832_bits, 1	};
849
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_UNSAT_ASSUMPTIONS_TOK_in_command852  */
850
static	ANTLR3_BITWORD FOLLOW_GET_UNSAT_ASSUMPTIONS_TOK_in_command852_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
851
static  ANTLR3_BITSET_LIST FOLLOW_GET_UNSAT_ASSUMPTIONS_TOK_in_command852	= { FOLLOW_GET_UNSAT_ASSUMPTIONS_TOK_in_command852_bits, 1	};
852
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_UNSAT_CORE_TOK_in_command872  */
853
static	ANTLR3_BITWORD FOLLOW_GET_UNSAT_CORE_TOK_in_command872_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
854
static  ANTLR3_BITSET_LIST FOLLOW_GET_UNSAT_CORE_TOK_in_command872	= { FOLLOW_GET_UNSAT_CORE_TOK_in_command872_bits, 1	};
855
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_DIFFICULTY_TOK_in_command892  */
856
static	ANTLR3_BITWORD FOLLOW_GET_DIFFICULTY_TOK_in_command892_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
857
static  ANTLR3_BITSET_LIST FOLLOW_GET_DIFFICULTY_TOK_in_command892	= { FOLLOW_GET_DIFFICULTY_TOK_in_command892_bits, 1	};
858
/** Bitset defining follow set for error recovery in rule state: FOLLOW_PUSH_TOK_in_command912  */
859
static	ANTLR3_BITWORD FOLLOW_PUSH_TOK_in_command912_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000001000) };
860
static  ANTLR3_BITSET_LIST FOLLOW_PUSH_TOK_in_command912	= { FOLLOW_PUSH_TOK_in_command912_bits, 2	};
861
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_command930  */
862
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_command930_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
863
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_command930	= { FOLLOW_INTEGER_LITERAL_in_command930_bits, 1	};
864
/** Bitset defining follow set for error recovery in rule state: FOLLOW_POP_TOK_in_command954  */
865
static	ANTLR3_BITWORD FOLLOW_POP_TOK_in_command954_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000001000) };
866
static  ANTLR3_BITSET_LIST FOLLOW_POP_TOK_in_command954	= { FOLLOW_POP_TOK_in_command954_bits, 2	};
867
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_command972  */
868
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_command972_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
869
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_command972	= { FOLLOW_INTEGER_LITERAL_in_command972_bits, 1	};
870
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EXIT_TOK_in_command1006  */
871
static	ANTLR3_BITWORD FOLLOW_EXIT_TOK_in_command1006_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
872
static  ANTLR3_BITSET_LIST FOLLOW_EXIT_TOK_in_command1006	= { FOLLOW_EXIT_TOK_in_command1006_bits, 1	};
873
/** Bitset defining follow set for error recovery in rule state: FOLLOW_smt25Command_in_command1025  */
874
static	ANTLR3_BITWORD FOLLOW_smt25Command_in_command1025_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
875
static  ANTLR3_BITSET_LIST FOLLOW_smt25Command_in_command1025	= { FOLLOW_smt25Command_in_command1025_bits, 1	};
876
/** Bitset defining follow set for error recovery in rule state: FOLLOW_extendedCommand_in_command1039  */
877
static	ANTLR3_BITWORD FOLLOW_extendedCommand_in_command1039_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
878
static  ANTLR3_BITSET_LIST FOLLOW_extendedCommand_in_command1039	= { FOLLOW_extendedCommand_in_command1039_bits, 1	};
879
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SIMPLE_SYMBOL_in_command1059  */
880
static	ANTLR3_BITWORD FOLLOW_SIMPLE_SYMBOL_in_command1059_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
881
static  ANTLR3_BITSET_LIST FOLLOW_SIMPLE_SYMBOL_in_command1059	= { FOLLOW_SIMPLE_SYMBOL_in_command1059_bits, 1	};
882
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_VAR_TOK_in_sygusCommand1093  */
883
static	ANTLR3_BITWORD FOLLOW_DECLARE_VAR_TOK_in_sygusCommand1093_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
884
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_VAR_TOK_in_sygusCommand1093	= { FOLLOW_DECLARE_VAR_TOK_in_sygusCommand1093_bits, 2	};
885
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sygusCommand1101  */
886
static	ANTLR3_BITWORD FOLLOW_symbol_in_sygusCommand1101_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
887
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sygusCommand1101	= { FOLLOW_symbol_in_sygusCommand1101_bits, 2	};
888
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sygusCommand1114  */
889
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sygusCommand1114_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
890
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sygusCommand1114	= { FOLLOW_sortSymbol_in_sygusCommand1114_bits, 1	};
891
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SYNTH_FUN_TOK_in_sygusCommand1135  */
892
static	ANTLR3_BITWORD FOLLOW_SYNTH_FUN_TOK_in_sygusCommand1135_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
893
static  ANTLR3_BITSET_LIST FOLLOW_SYNTH_FUN_TOK_in_sygusCommand1135	= { FOLLOW_SYNTH_FUN_TOK_in_sygusCommand1135_bits, 2	};
894
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SYNTH_INV_TOK_in_sygusCommand1147  */
895
static	ANTLR3_BITWORD FOLLOW_SYNTH_INV_TOK_in_sygusCommand1147_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
896
static  ANTLR3_BITSET_LIST FOLLOW_SYNTH_INV_TOK_in_sygusCommand1147	= { FOLLOW_SYNTH_INV_TOK_in_sygusCommand1147_bits, 2	};
897
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sygusCommand1167  */
898
static	ANTLR3_BITWORD FOLLOW_symbol_in_sygusCommand1167_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
899
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sygusCommand1167	= { FOLLOW_symbol_in_sygusCommand1167_bits, 2	};
900
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusCommand1174  */
901
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusCommand1174_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
902
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusCommand1174	= { FOLLOW_LPAREN_TOK_in_sygusCommand1174_bits, 2	};
903
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortedVarList_in_sygusCommand1176  */
904
static	ANTLR3_BITWORD FOLLOW_sortedVarList_in_sygusCommand1176_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
905
static  ANTLR3_BITSET_LIST FOLLOW_sortedVarList_in_sygusCommand1176	= { FOLLOW_sortedVarList_in_sygusCommand1176_bits, 2	};
906
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusCommand1179  */
907
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusCommand1179_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000080040410000) };
908
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusCommand1179	= { FOLLOW_RPAREN_TOK_in_sygusCommand1179_bits, 2	};
909
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sygusCommand1187  */
910
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sygusCommand1187_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
911
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sygusCommand1187	= { FOLLOW_sortSymbol_in_sygusCommand1187_bits, 2	};
912
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sygusGrammar_in_sygusCommand1239  */
913
static	ANTLR3_BITWORD FOLLOW_sygusGrammar_in_sygusCommand1239_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
914
static  ANTLR3_BITSET_LIST FOLLOW_sygusGrammar_in_sygusCommand1239	= { FOLLOW_sygusGrammar_in_sygusCommand1239_bits, 1	};
915
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CONSTRAINT_TOK_in_sygusCommand1267  */
916
static	ANTLR3_BITWORD FOLLOW_CONSTRAINT_TOK_in_sygusCommand1267_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
917
static  ANTLR3_BITSET_LIST FOLLOW_CONSTRAINT_TOK_in_sygusCommand1267	= { FOLLOW_CONSTRAINT_TOK_in_sygusCommand1267_bits, 2	};
918
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ASSUME_TOK_in_sygusCommand1273  */
919
static	ANTLR3_BITWORD FOLLOW_ASSUME_TOK_in_sygusCommand1273_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
920
static  ANTLR3_BITSET_LIST FOLLOW_ASSUME_TOK_in_sygusCommand1273	= { FOLLOW_ASSUME_TOK_in_sygusCommand1273_bits, 2	};
921
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_sygusCommand1289  */
922
static	ANTLR3_BITWORD FOLLOW_term_in_sygusCommand1289_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
923
static  ANTLR3_BITSET_LIST FOLLOW_term_in_sygusCommand1289	= { FOLLOW_term_in_sygusCommand1289_bits, 1	};
924
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INV_CONSTRAINT_TOK_in_sygusCommand1308  */
925
static	ANTLR3_BITWORD FOLLOW_INV_CONSTRAINT_TOK_in_sygusCommand1308_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
926
static  ANTLR3_BITSET_LIST FOLLOW_INV_CONSTRAINT_TOK_in_sygusCommand1308	= { FOLLOW_INV_CONSTRAINT_TOK_in_sygusCommand1308_bits, 2	};
927
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sygusCommand1316  */
928
static	ANTLR3_BITWORD FOLLOW_symbol_in_sygusCommand1316_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000080040400000) };
929
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sygusCommand1316	= { FOLLOW_symbol_in_sygusCommand1316_bits, 2	};
930
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHECK_SYNTH_TOK_in_sygusCommand1340  */
931
static	ANTLR3_BITWORD FOLLOW_CHECK_SYNTH_TOK_in_sygusCommand1340_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
932
static  ANTLR3_BITSET_LIST FOLLOW_CHECK_SYNTH_TOK_in_sygusCommand1340	= { FOLLOW_CHECK_SYNTH_TOK_in_sygusCommand1340_bits, 1	};
933
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SET_FEATURE_TOK_in_sygusCommand1358  */
934
static	ANTLR3_BITWORD FOLLOW_SET_FEATURE_TOK_in_sygusCommand1358_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000004000) };
935
static  ANTLR3_BITSET_LIST FOLLOW_SET_FEATURE_TOK_in_sygusCommand1358	= { FOLLOW_SET_FEATURE_TOK_in_sygusCommand1358_bits, 2	};
936
/** Bitset defining follow set for error recovery in rule state: FOLLOW_keyword_in_sygusCommand1360  */
937
static	ANTLR3_BITWORD FOLLOW_keyword_in_sygusCommand1360_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620020), ANTLR3_UINT64_LIT(0x00000801F9F150B9) };
938
static  ANTLR3_BITSET_LIST FOLLOW_keyword_in_sygusCommand1360	= { FOLLOW_keyword_in_sygusCommand1360_bits, 2	};
939
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbolicExpr_in_sygusCommand1363  */
940
static	ANTLR3_BITWORD FOLLOW_symbolicExpr_in_sygusCommand1363_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
941
static  ANTLR3_BITSET_LIST FOLLOW_symbolicExpr_in_sygusCommand1363	= { FOLLOW_symbolicExpr_in_sygusCommand1363_bits, 1	};
942
/** Bitset defining follow set for error recovery in rule state: FOLLOW_command_in_sygusCommand1376  */
943
static	ANTLR3_BITWORD FOLLOW_command_in_sygusCommand1376_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
944
static  ANTLR3_BITSET_LIST FOLLOW_command_in_sygusCommand1376	= { FOLLOW_command_in_sygusCommand1376_bits, 1	};
945
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1404  */
946
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1404_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
947
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1404	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1404_bits, 2	};
948
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1419  */
949
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1419_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
950
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1419	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1419_bits, 2	};
951
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sygusGrammar1421  */
952
static	ANTLR3_BITWORD FOLLOW_symbol_in_sygusGrammar1421_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
953
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sygusGrammar1421	= { FOLLOW_symbol_in_sygusGrammar1421_bits, 2	};
954
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sygusGrammar1428  */
955
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sygusGrammar1428_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
956
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sygusGrammar1428	= { FOLLOW_sortSymbol_in_sygusGrammar1428_bits, 2	};
957
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1453  */
958
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1453_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
959
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1453	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1453_bits, 2	};
960
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusGrammar1469  */
961
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusGrammar1469_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
962
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusGrammar1469	= { FOLLOW_RPAREN_TOK_in_sygusGrammar1469_bits, 2	};
963
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusGrammar1486  */
964
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusGrammar1486_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
965
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusGrammar1486	= { FOLLOW_RPAREN_TOK_in_sygusGrammar1486_bits, 2	};
966
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1497  */
967
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1497_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
968
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1497	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1497_bits, 2	};
969
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1507  */
970
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1507_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
971
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1507	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1507_bits, 2	};
972
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sygusGrammar1513  */
973
static	ANTLR3_BITWORD FOLLOW_symbol_in_sygusGrammar1513_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
974
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sygusGrammar1513	= { FOLLOW_symbol_in_sygusGrammar1513_bits, 2	};
975
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sygusGrammar1516  */
976
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sygusGrammar1516_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
977
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sygusGrammar1516	= { FOLLOW_sortSymbol_in_sygusGrammar1516_bits, 2	};
978
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1529  */
979
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1529_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
980
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1529	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1529_bits, 2	};
981
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_sygusGrammar1543  */
982
static	ANTLR3_BITWORD FOLLOW_term_in_sygusGrammar1543_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090142411080) };
983
static  ANTLR3_BITSET_LIST FOLLOW_term_in_sygusGrammar1543	= { FOLLOW_term_in_sygusGrammar1543_bits, 2	};
984
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1556  */
985
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1556_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000200000000) };
986
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1556	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1556_bits, 2	};
987
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SYGUS_CONSTANT_TOK_in_sygusGrammar1558  */
988
static	ANTLR3_BITWORD FOLLOW_SYGUS_CONSTANT_TOK_in_sygusGrammar1558_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
989
static  ANTLR3_BITSET_LIST FOLLOW_SYGUS_CONSTANT_TOK_in_sygusGrammar1558	= { FOLLOW_SYGUS_CONSTANT_TOK_in_sygusGrammar1558_bits, 2	};
990
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sygusGrammar1560  */
991
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sygusGrammar1560_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
992
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sygusGrammar1560	= { FOLLOW_sortSymbol_in_sygusGrammar1560_bits, 2	};
993
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusGrammar1563  */
994
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusGrammar1563_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090142411080) };
995
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusGrammar1563	= { FOLLOW_RPAREN_TOK_in_sygusGrammar1563_bits, 2	};
996
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sygusGrammar1575  */
997
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sygusGrammar1575_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000400000000) };
998
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sygusGrammar1575	= { FOLLOW_LPAREN_TOK_in_sygusGrammar1575_bits, 2	};
999
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SYGUS_VARIABLE_TOK_in_sygusGrammar1577  */
1000
static	ANTLR3_BITWORD FOLLOW_SYGUS_VARIABLE_TOK_in_sygusGrammar1577_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1001
static  ANTLR3_BITSET_LIST FOLLOW_SYGUS_VARIABLE_TOK_in_sygusGrammar1577	= { FOLLOW_SYGUS_VARIABLE_TOK_in_sygusGrammar1577_bits, 2	};
1002
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sygusGrammar1579  */
1003
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sygusGrammar1579_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1004
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sygusGrammar1579	= { FOLLOW_sortSymbol_in_sygusGrammar1579_bits, 2	};
1005
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusGrammar1582  */
1006
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusGrammar1582_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090142411080) };
1007
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusGrammar1582	= { FOLLOW_RPAREN_TOK_in_sygusGrammar1582_bits, 2	};
1008
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusGrammar1597  */
1009
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusGrammar1597_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1010
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusGrammar1597	= { FOLLOW_RPAREN_TOK_in_sygusGrammar1597_bits, 2	};
1011
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusGrammar1603  */
1012
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusGrammar1603_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1013
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusGrammar1603	= { FOLLOW_RPAREN_TOK_in_sygusGrammar1603_bits, 2	};
1014
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sygusGrammar1618  */
1015
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sygusGrammar1618_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1016
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sygusGrammar1618	= { FOLLOW_RPAREN_TOK_in_sygusGrammar1618_bits, 1	};
1017
/** Bitset defining follow set for error recovery in rule state: FOLLOW_KEYWORD_in_setInfoInternal1639  */
1018
static	ANTLR3_BITWORD FOLLOW_KEYWORD_in_setInfoInternal1639_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620020), ANTLR3_UINT64_LIT(0x00000801F9F150B9) };
1019
static  ANTLR3_BITSET_LIST FOLLOW_KEYWORD_in_setInfoInternal1639	= { FOLLOW_KEYWORD_in_setInfoInternal1639_bits, 2	};
1020
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbolicExpr_in_setInfoInternal1641  */
1021
static	ANTLR3_BITWORD FOLLOW_symbolicExpr_in_setInfoInternal1641_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1022
static  ANTLR3_BITSET_LIST FOLLOW_symbolicExpr_in_setInfoInternal1641	= { FOLLOW_symbolicExpr_in_setInfoInternal1641_bits, 1	};
1023
/** Bitset defining follow set for error recovery in rule state: FOLLOW_keyword_in_setOptionInternal1667  */
1024
static	ANTLR3_BITWORD FOLLOW_keyword_in_setOptionInternal1667_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620020), ANTLR3_UINT64_LIT(0x00000801F9F150B9) };
1025
static  ANTLR3_BITSET_LIST FOLLOW_keyword_in_setOptionInternal1667	= { FOLLOW_keyword_in_setOptionInternal1667_bits, 2	};
1026
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbolicExpr_in_setOptionInternal1670  */
1027
static	ANTLR3_BITWORD FOLLOW_symbolicExpr_in_setOptionInternal1670_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1028
static  ANTLR3_BITSET_LIST FOLLOW_symbolicExpr_in_setOptionInternal1670	= { FOLLOW_symbolicExpr_in_setOptionInternal1670_bits, 1	};
1029
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_CONST_TOK_in_smt25Command1702  */
1030
static	ANTLR3_BITWORD FOLLOW_DECLARE_CONST_TOK_in_smt25Command1702_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1031
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_CONST_TOK_in_smt25Command1702	= { FOLLOW_DECLARE_CONST_TOK_in_smt25Command1702_bits, 2	};
1032
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_smt25Command1710  */
1033
static	ANTLR3_BITWORD FOLLOW_symbol_in_smt25Command1710_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1034
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_smt25Command1710	= { FOLLOW_symbol_in_smt25Command1710_bits, 2	};
1035
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_smt25Command1723  */
1036
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_smt25Command1723_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1037
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_smt25Command1723	= { FOLLOW_sortSymbol_in_smt25Command1723_bits, 1	};
1038
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_MODEL_TOK_in_smt25Command1743  */
1039
static	ANTLR3_BITWORD FOLLOW_GET_MODEL_TOK_in_smt25Command1743_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1040
static  ANTLR3_BITSET_LIST FOLLOW_GET_MODEL_TOK_in_smt25Command1743	= { FOLLOW_GET_MODEL_TOK_in_smt25Command1743_bits, 1	};
1041
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ECHO_TOK_in_smt25Command1764  */
1042
static	ANTLR3_BITWORD FOLLOW_ECHO_TOK_in_smt25Command1764_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620022), ANTLR3_UINT64_LIT(0x00000801F9F050B9) };
1043
static  ANTLR3_BITSET_LIST FOLLOW_ECHO_TOK_in_smt25Command1764	= { FOLLOW_ECHO_TOK_in_smt25Command1764_bits, 2	};
1044
/** Bitset defining follow set for error recovery in rule state: FOLLOW_simpleSymbolicExpr_in_smt25Command1772  */
1045
static	ANTLR3_BITWORD FOLLOW_simpleSymbolicExpr_in_smt25Command1772_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1046
static  ANTLR3_BITSET_LIST FOLLOW_simpleSymbolicExpr_in_smt25Command1772	= { FOLLOW_simpleSymbolicExpr_in_smt25Command1772_bits, 1	};
1047
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RESET_TOK_in_smt25Command1808  */
1048
static	ANTLR3_BITWORD FOLLOW_RESET_TOK_in_smt25Command1808_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1049
static  ANTLR3_BITSET_LIST FOLLOW_RESET_TOK_in_smt25Command1808	= { FOLLOW_RESET_TOK_in_smt25Command1808_bits, 1	};
1050
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RESET_ASSERTIONS_TOK_in_smt25Command1826  */
1051
static	ANTLR3_BITWORD FOLLOW_RESET_ASSERTIONS_TOK_in_smt25Command1826_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1052
static  ANTLR3_BITSET_LIST FOLLOW_RESET_ASSERTIONS_TOK_in_smt25Command1826	= { FOLLOW_RESET_ASSERTIONS_TOK_in_smt25Command1826_bits, 1	};
1053
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_FUN_REC_TOK_in_smt25Command1838  */
1054
static	ANTLR3_BITWORD FOLLOW_DEFINE_FUN_REC_TOK_in_smt25Command1838_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1055
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_FUN_REC_TOK_in_smt25Command1838	= { FOLLOW_DEFINE_FUN_REC_TOK_in_smt25Command1838_bits, 2	};
1056
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_smt25Command1850  */
1057
static	ANTLR3_BITWORD FOLLOW_symbol_in_smt25Command1850_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1058
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_smt25Command1850	= { FOLLOW_symbol_in_smt25Command1850_bits, 2	};
1059
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_smt25Command1863  */
1060
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_smt25Command1863_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1061
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_smt25Command1863	= { FOLLOW_LPAREN_TOK_in_smt25Command1863_bits, 2	};
1062
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortedVarList_in_smt25Command1865  */
1063
static	ANTLR3_BITWORD FOLLOW_sortedVarList_in_smt25Command1865_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1064
static  ANTLR3_BITSET_LIST FOLLOW_sortedVarList_in_smt25Command1865	= { FOLLOW_sortedVarList_in_smt25Command1865_bits, 2	};
1065
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_smt25Command1868  */
1066
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_smt25Command1868_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1067
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_smt25Command1868	= { FOLLOW_RPAREN_TOK_in_smt25Command1868_bits, 2	};
1068
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_smt25Command1874  */
1069
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_smt25Command1874_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1070
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_smt25Command1874	= { FOLLOW_sortSymbol_in_smt25Command1874_bits, 2	};
1071
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_smt25Command1887  */
1072
static	ANTLR3_BITWORD FOLLOW_term_in_smt25Command1887_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1073
static  ANTLR3_BITSET_LIST FOLLOW_term_in_smt25Command1887	= { FOLLOW_term_in_smt25Command1887_bits, 1	};
1074
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_FUNS_REC_TOK_in_smt25Command1900  */
1075
static	ANTLR3_BITWORD FOLLOW_DEFINE_FUNS_REC_TOK_in_smt25Command1900_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1076
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_FUNS_REC_TOK_in_smt25Command1900	= { FOLLOW_DEFINE_FUNS_REC_TOK_in_smt25Command1900_bits, 2	};
1077
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_smt25Command1912  */
1078
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_smt25Command1912_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1079
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_smt25Command1912	= { FOLLOW_LPAREN_TOK_in_smt25Command1912_bits, 2	};
1080
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_smt25Command1920  */
1081
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_smt25Command1920_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1082
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_smt25Command1920	= { FOLLOW_LPAREN_TOK_in_smt25Command1920_bits, 2	};
1083
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_smt25Command1928  */
1084
static	ANTLR3_BITWORD FOLLOW_symbol_in_smt25Command1928_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1085
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_smt25Command1928	= { FOLLOW_symbol_in_smt25Command1928_bits, 2	};
1086
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_smt25Command1945  */
1087
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_smt25Command1945_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1088
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_smt25Command1945	= { FOLLOW_LPAREN_TOK_in_smt25Command1945_bits, 2	};
1089
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortedVarList_in_smt25Command1947  */
1090
static	ANTLR3_BITWORD FOLLOW_sortedVarList_in_smt25Command1947_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1091
static  ANTLR3_BITSET_LIST FOLLOW_sortedVarList_in_smt25Command1947	= { FOLLOW_sortedVarList_in_smt25Command1947_bits, 2	};
1092
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_smt25Command1950  */
1093
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_smt25Command1950_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1094
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_smt25Command1950	= { FOLLOW_RPAREN_TOK_in_smt25Command1950_bits, 2	};
1095
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_smt25Command1958  */
1096
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_smt25Command1958_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1097
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_smt25Command1958	= { FOLLOW_sortSymbol_in_smt25Command1958_bits, 2	};
1098
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_smt25Command1975  */
1099
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_smt25Command1975_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1100
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_smt25Command1975	= { FOLLOW_RPAREN_TOK_in_smt25Command1975_bits, 2	};
1101
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_smt25Command1988  */
1102
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_smt25Command1988_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1103
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_smt25Command1988	= { FOLLOW_RPAREN_TOK_in_smt25Command1988_bits, 2	};
1104
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_smt25Command1994  */
1105
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_smt25Command1994_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1106
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_smt25Command1994	= { FOLLOW_LPAREN_TOK_in_smt25Command1994_bits, 2	};
1107
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_smt25Command2012  */
1108
static	ANTLR3_BITWORD FOLLOW_term_in_smt25Command2012_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090142411080) };
1109
static  ANTLR3_BITSET_LIST FOLLOW_term_in_smt25Command2012	= { FOLLOW_term_in_smt25Command2012_bits, 2	};
1110
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_smt25Command2032  */
1111
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_smt25Command2032_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1112
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_smt25Command2032	= { FOLLOW_RPAREN_TOK_in_smt25Command2032_bits, 1	};
1113
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_CODATATYPE_TOK_in_extendedCommand2063  */
1114
static	ANTLR3_BITWORD FOLLOW_DECLARE_CODATATYPE_TOK_in_extendedCommand2063_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1115
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_CODATATYPE_TOK_in_extendedCommand2063	= { FOLLOW_DECLARE_CODATATYPE_TOK_in_extendedCommand2063_bits, 2	};
1116
/** Bitset defining follow set for error recovery in rule state: FOLLOW_datatypeDefCommand_in_extendedCommand2065  */
1117
static	ANTLR3_BITWORD FOLLOW_datatypeDefCommand_in_extendedCommand2065_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1118
static  ANTLR3_BITSET_LIST FOLLOW_datatypeDefCommand_in_extendedCommand2065	= { FOLLOW_datatypeDefCommand_in_extendedCommand2065_bits, 1	};
1119
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_CODATATYPES_TOK_in_extendedCommand2072  */
1120
static	ANTLR3_BITWORD FOLLOW_DECLARE_CODATATYPES_TOK_in_extendedCommand2072_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1121
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_CODATATYPES_TOK_in_extendedCommand2072	= { FOLLOW_DECLARE_CODATATYPES_TOK_in_extendedCommand2072_bits, 2	};
1122
/** Bitset defining follow set for error recovery in rule state: FOLLOW_datatypesDefCommand_in_extendedCommand2074  */
1123
static	ANTLR3_BITWORD FOLLOW_datatypesDefCommand_in_extendedCommand2074_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1124
static  ANTLR3_BITSET_LIST FOLLOW_datatypesDefCommand_in_extendedCommand2074	= { FOLLOW_datatypesDefCommand_in_extendedCommand2074_bits, 1	};
1125
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_SORTS_TOK_in_extendedCommand2089  */
1126
static	ANTLR3_BITWORD FOLLOW_DECLARE_SORTS_TOK_in_extendedCommand2089_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1127
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_SORTS_TOK_in_extendedCommand2089	= { FOLLOW_DECLARE_SORTS_TOK_in_extendedCommand2089_bits, 2	};
1128
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2101  */
1129
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2101_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1130
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2101	= { FOLLOW_LPAREN_TOK_in_extendedCommand2101_bits, 2	};
1131
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2109  */
1132
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2109_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042400000) };
1133
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2109	= { FOLLOW_symbol_in_extendedCommand2109_bits, 2	};
1134
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2131  */
1135
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2131_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1136
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2131	= { FOLLOW_RPAREN_TOK_in_extendedCommand2131_bits, 1	};
1137
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_FUNS_TOK_in_extendedCommand2144  */
1138
static	ANTLR3_BITWORD FOLLOW_DECLARE_FUNS_TOK_in_extendedCommand2144_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1139
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_FUNS_TOK_in_extendedCommand2144	= { FOLLOW_DECLARE_FUNS_TOK_in_extendedCommand2144_bits, 2	};
1140
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2158  */
1141
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2158_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1142
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2158	= { FOLLOW_LPAREN_TOK_in_extendedCommand2158_bits, 2	};
1143
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2166  */
1144
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2166_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1145
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2166	= { FOLLOW_LPAREN_TOK_in_extendedCommand2166_bits, 2	};
1146
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2168  */
1147
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2168_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1148
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2168	= { FOLLOW_symbol_in_extendedCommand2168_bits, 2	};
1149
/** Bitset defining follow set for error recovery in rule state: FOLLOW_nonemptySortList_in_extendedCommand2185  */
1150
static	ANTLR3_BITWORD FOLLOW_nonemptySortList_in_extendedCommand2185_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1151
static  ANTLR3_BITSET_LIST FOLLOW_nonemptySortList_in_extendedCommand2185	= { FOLLOW_nonemptySortList_in_extendedCommand2185_bits, 2	};
1152
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2188  */
1153
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2188_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1154
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2188	= { FOLLOW_RPAREN_TOK_in_extendedCommand2188_bits, 2	};
1155
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2209  */
1156
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2209_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1157
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2209	= { FOLLOW_RPAREN_TOK_in_extendedCommand2209_bits, 1	};
1158
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_PREDS_TOK_in_extendedCommand2221  */
1159
static	ANTLR3_BITWORD FOLLOW_DECLARE_PREDS_TOK_in_extendedCommand2221_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1160
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_PREDS_TOK_in_extendedCommand2221	= { FOLLOW_DECLARE_PREDS_TOK_in_extendedCommand2221_bits, 2	};
1161
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2235  */
1162
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2235_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1163
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2235	= { FOLLOW_LPAREN_TOK_in_extendedCommand2235_bits, 2	};
1164
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2243  */
1165
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2243_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1166
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2243	= { FOLLOW_LPAREN_TOK_in_extendedCommand2243_bits, 2	};
1167
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2245  */
1168
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2245_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042410000) };
1169
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2245	= { FOLLOW_symbol_in_extendedCommand2245_bits, 2	};
1170
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortList_in_extendedCommand2262  */
1171
static	ANTLR3_BITWORD FOLLOW_sortList_in_extendedCommand2262_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1172
static  ANTLR3_BITSET_LIST FOLLOW_sortList_in_extendedCommand2262	= { FOLLOW_sortList_in_extendedCommand2262_bits, 2	};
1173
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2265  */
1174
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2265_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1175
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2265	= { FOLLOW_RPAREN_TOK_in_extendedCommand2265_bits, 2	};
1176
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2286  */
1177
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2286_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1178
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2286	= { FOLLOW_RPAREN_TOK_in_extendedCommand2286_bits, 1	};
1179
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_TOK_in_extendedCommand2299  */
1180
static	ANTLR3_BITWORD FOLLOW_DEFINE_TOK_in_extendedCommand2299_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1181
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_TOK_in_extendedCommand2299	= { FOLLOW_DEFINE_TOK_in_extendedCommand2299_bits, 2	};
1182
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2316  */
1183
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2316_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1184
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2316	= { FOLLOW_symbol_in_extendedCommand2316_bits, 2	};
1185
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2333  */
1186
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2333_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1187
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2333	= { FOLLOW_term_in_extendedCommand2333_bits, 1	};
1188
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2357  */
1189
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2357_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1190
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2357	= { FOLLOW_LPAREN_TOK_in_extendedCommand2357_bits, 2	};
1191
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2365  */
1192
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2365_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1193
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2365	= { FOLLOW_symbol_in_extendedCommand2365_bits, 2	};
1194
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortedVarList_in_extendedCommand2382  */
1195
static	ANTLR3_BITWORD FOLLOW_sortedVarList_in_extendedCommand2382_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1196
static  ANTLR3_BITSET_LIST FOLLOW_sortedVarList_in_extendedCommand2382	= { FOLLOW_sortedVarList_in_extendedCommand2382_bits, 2	};
1197
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2385  */
1198
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2385_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1199
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2385	= { FOLLOW_RPAREN_TOK_in_extendedCommand2385_bits, 2	};
1200
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2401  */
1201
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2401_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1202
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2401	= { FOLLOW_term_in_extendedCommand2401_bits, 1	};
1203
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_CONST_TOK_in_extendedCommand2427  */
1204
static	ANTLR3_BITWORD FOLLOW_DEFINE_CONST_TOK_in_extendedCommand2427_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1205
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_CONST_TOK_in_extendedCommand2427	= { FOLLOW_DEFINE_CONST_TOK_in_extendedCommand2427_bits, 2	};
1206
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2435  */
1207
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2435_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1208
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2435	= { FOLLOW_symbol_in_extendedCommand2435_bits, 2	};
1209
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_extendedCommand2448  */
1210
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_extendedCommand2448_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1211
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_extendedCommand2448	= { FOLLOW_sortSymbol_in_extendedCommand2448_bits, 2	};
1212
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2455  */
1213
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2455_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1214
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2455	= { FOLLOW_term_in_extendedCommand2455_bits, 1	};
1215
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SIMPLIFY_TOK_in_extendedCommand2469  */
1216
static	ANTLR3_BITWORD FOLLOW_SIMPLIFY_TOK_in_extendedCommand2469_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1217
static  ANTLR3_BITSET_LIST FOLLOW_SIMPLIFY_TOK_in_extendedCommand2469	= { FOLLOW_SIMPLIFY_TOK_in_extendedCommand2469_bits, 2	};
1218
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2477  */
1219
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2477_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1220
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2477	= { FOLLOW_term_in_extendedCommand2477_bits, 1	};
1221
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_QE_TOK_in_extendedCommand2490  */
1222
static	ANTLR3_BITWORD FOLLOW_GET_QE_TOK_in_extendedCommand2490_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1223
static  ANTLR3_BITSET_LIST FOLLOW_GET_QE_TOK_in_extendedCommand2490	= { FOLLOW_GET_QE_TOK_in_extendedCommand2490_bits, 2	};
1224
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2498  */
1225
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2498_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1226
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2498	= { FOLLOW_term_in_extendedCommand2498_bits, 1	};
1227
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_QE_DISJUNCT_TOK_in_extendedCommand2511  */
1228
static	ANTLR3_BITWORD FOLLOW_GET_QE_DISJUNCT_TOK_in_extendedCommand2511_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1229
static  ANTLR3_BITSET_LIST FOLLOW_GET_QE_DISJUNCT_TOK_in_extendedCommand2511	= { FOLLOW_GET_QE_DISJUNCT_TOK_in_extendedCommand2511_bits, 2	};
1230
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2519  */
1231
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2519_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1232
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2519	= { FOLLOW_term_in_extendedCommand2519_bits, 1	};
1233
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_ABDUCT_TOK_in_extendedCommand2532  */
1234
static	ANTLR3_BITWORD FOLLOW_GET_ABDUCT_TOK_in_extendedCommand2532_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1235
static  ANTLR3_BITSET_LIST FOLLOW_GET_ABDUCT_TOK_in_extendedCommand2532	= { FOLLOW_GET_ABDUCT_TOK_in_extendedCommand2532_bits, 2	};
1236
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2540  */
1237
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2540_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1238
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2540	= { FOLLOW_symbol_in_extendedCommand2540_bits, 2	};
1239
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2547  */
1240
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2547_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
1241
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2547	= { FOLLOW_term_in_extendedCommand2547_bits, 2	};
1242
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sygusGrammar_in_extendedCommand2562  */
1243
static	ANTLR3_BITWORD FOLLOW_sygusGrammar_in_extendedCommand2562_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1244
static  ANTLR3_BITSET_LIST FOLLOW_sygusGrammar_in_extendedCommand2562	= { FOLLOW_sygusGrammar_in_extendedCommand2562_bits, 1	};
1245
/** Bitset defining follow set for error recovery in rule state: FOLLOW_GET_INTERPOL_TOK_in_extendedCommand2582  */
1246
static	ANTLR3_BITWORD FOLLOW_GET_INTERPOL_TOK_in_extendedCommand2582_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1247
static  ANTLR3_BITSET_LIST FOLLOW_GET_INTERPOL_TOK_in_extendedCommand2582	= { FOLLOW_GET_INTERPOL_TOK_in_extendedCommand2582_bits, 2	};
1248
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2590  */
1249
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2590_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1250
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2590	= { FOLLOW_symbol_in_extendedCommand2590_bits, 2	};
1251
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2597  */
1252
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2597_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
1253
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2597	= { FOLLOW_term_in_extendedCommand2597_bits, 2	};
1254
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sygusGrammar_in_extendedCommand2612  */
1255
static	ANTLR3_BITWORD FOLLOW_sygusGrammar_in_extendedCommand2612_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1256
static  ANTLR3_BITSET_LIST FOLLOW_sygusGrammar_in_extendedCommand2612	= { FOLLOW_sygusGrammar_in_extendedCommand2612_bits, 1	};
1257
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_HEAP_in_extendedCommand2632  */
1258
static	ANTLR3_BITWORD FOLLOW_DECLARE_HEAP_in_extendedCommand2632_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1259
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_HEAP_in_extendedCommand2632	= { FOLLOW_DECLARE_HEAP_in_extendedCommand2632_bits, 2	};
1260
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2634  */
1261
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2634_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1262
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2634	= { FOLLOW_LPAREN_TOK_in_extendedCommand2634_bits, 2	};
1263
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_extendedCommand2640  */
1264
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_extendedCommand2640_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1265
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_extendedCommand2640	= { FOLLOW_sortSymbol_in_extendedCommand2640_bits, 2	};
1266
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_extendedCommand2647  */
1267
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_extendedCommand2647_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1268
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_extendedCommand2647	= { FOLLOW_sortSymbol_in_extendedCommand2647_bits, 2	};
1269
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2660  */
1270
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2660_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1271
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2660	= { FOLLOW_RPAREN_TOK_in_extendedCommand2660_bits, 1	};
1272
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECLARE_POOL_in_extendedCommand2666  */
1273
static	ANTLR3_BITWORD FOLLOW_DECLARE_POOL_in_extendedCommand2666_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1274
static  ANTLR3_BITSET_LIST FOLLOW_DECLARE_POOL_in_extendedCommand2666	= { FOLLOW_DECLARE_POOL_in_extendedCommand2666_bits, 2	};
1275
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_extendedCommand2674  */
1276
static	ANTLR3_BITWORD FOLLOW_symbol_in_extendedCommand2674_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1277
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_extendedCommand2674	= { FOLLOW_symbol_in_extendedCommand2674_bits, 2	};
1278
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_extendedCommand2687  */
1279
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_extendedCommand2687_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1280
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_extendedCommand2687	= { FOLLOW_sortSymbol_in_extendedCommand2687_bits, 2	};
1281
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2694  */
1282
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2694_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090142411080) };
1283
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2694	= { FOLLOW_LPAREN_TOK_in_extendedCommand2694_bits, 2	};
1284
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_extendedCommand2702  */
1285
static	ANTLR3_BITWORD FOLLOW_term_in_extendedCommand2702_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090142411080) };
1286
static  ANTLR3_BITSET_LIST FOLLOW_term_in_extendedCommand2702	= { FOLLOW_term_in_extendedCommand2702_bits, 2	};
1287
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2720  */
1288
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2720_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1289
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2720	= { FOLLOW_RPAREN_TOK_in_extendedCommand2720_bits, 1	};
1290
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BLOCK_MODEL_TOK_in_extendedCommand2732  */
1291
static	ANTLR3_BITWORD FOLLOW_BLOCK_MODEL_TOK_in_extendedCommand2732_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1292
static  ANTLR3_BITSET_LIST FOLLOW_BLOCK_MODEL_TOK_in_extendedCommand2732	= { FOLLOW_BLOCK_MODEL_TOK_in_extendedCommand2732_bits, 1	};
1293
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BLOCK_MODEL_VALUES_TOK_in_extendedCommand2747  */
1294
static	ANTLR3_BITWORD FOLLOW_BLOCK_MODEL_VALUES_TOK_in_extendedCommand2747_bits[]	= { ANTLR3_UINT64_LIT(0xFFFFFFFFFFFFFFF0), ANTLR3_UINT64_LIT(0x00007FFFFFFFFFFF) };
1295
static  ANTLR3_BITSET_LIST FOLLOW_BLOCK_MODEL_VALUES_TOK_in_extendedCommand2747	= { FOLLOW_BLOCK_MODEL_VALUES_TOK_in_extendedCommand2747_bits, 2	};
1296
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_extendedCommand2757  */
1297
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_extendedCommand2757_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1298
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_extendedCommand2757	= { FOLLOW_LPAREN_TOK_in_extendedCommand2757_bits, 2	};
1299
/** Bitset defining follow set for error recovery in rule state: FOLLOW_termList_in_extendedCommand2759  */
1300
static	ANTLR3_BITWORD FOLLOW_termList_in_extendedCommand2759_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1301
static  ANTLR3_BITSET_LIST FOLLOW_termList_in_extendedCommand2759	= { FOLLOW_termList_in_extendedCommand2759_bits, 2	};
1302
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_extendedCommand2762  */
1303
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_extendedCommand2762_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1304
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_extendedCommand2762	= { FOLLOW_RPAREN_TOK_in_extendedCommand2762_bits, 1	};
1305
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_extendedCommand2778  */
1306
static	ANTLR3_BITWORD FOLLOW_set_in_extendedCommand2778_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1307
static  ANTLR3_BITSET_LIST FOLLOW_set_in_extendedCommand2778	= { FOLLOW_set_in_extendedCommand2778_bits, 1	};
1308
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_datatypeDefCommand2814  */
1309
static	ANTLR3_BITWORD FOLLOW_symbol_in_datatypeDefCommand2814_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1310
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_datatypeDefCommand2814	= { FOLLOW_symbol_in_datatypeDefCommand2814_bits, 2	};
1311
/** Bitset defining follow set for error recovery in rule state: FOLLOW_datatypesDef_in_datatypeDefCommand2821  */
1312
static	ANTLR3_BITWORD FOLLOW_datatypesDef_in_datatypeDefCommand2821_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1313
static  ANTLR3_BITSET_LIST FOLLOW_datatypesDef_in_datatypeDefCommand2821	= { FOLLOW_datatypesDef_in_datatypeDefCommand2821_bits, 1	};
1314
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDefCommand2844  */
1315
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDefCommand2844_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1316
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDefCommand2844	= { FOLLOW_LPAREN_TOK_in_datatypesDefCommand2844_bits, 2	};
1317
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDefCommand2852  */
1318
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDefCommand2852_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1319
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDefCommand2852	= { FOLLOW_LPAREN_TOK_in_datatypesDefCommand2852_bits, 2	};
1320
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_datatypesDefCommand2854  */
1321
static	ANTLR3_BITWORD FOLLOW_symbol_in_datatypesDefCommand2854_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
1322
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_datatypesDefCommand2854	= { FOLLOW_symbol_in_datatypesDefCommand2854_bits, 2	};
1323
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_datatypesDefCommand2859  */
1324
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_datatypesDefCommand2859_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1325
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_datatypesDefCommand2859	= { FOLLOW_INTEGER_LITERAL_in_datatypesDefCommand2859_bits, 2	};
1326
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDefCommand2861  */
1327
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDefCommand2861_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1328
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDefCommand2861	= { FOLLOW_RPAREN_TOK_in_datatypesDefCommand2861_bits, 2	};
1329
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDefCommand2876  */
1330
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDefCommand2876_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1331
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDefCommand2876	= { FOLLOW_RPAREN_TOK_in_datatypesDefCommand2876_bits, 2	};
1332
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDefCommand2880  */
1333
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDefCommand2880_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1334
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDefCommand2880	= { FOLLOW_LPAREN_TOK_in_datatypesDefCommand2880_bits, 2	};
1335
/** Bitset defining follow set for error recovery in rule state: FOLLOW_datatypesDef_in_datatypesDefCommand2884  */
1336
static	ANTLR3_BITWORD FOLLOW_datatypesDef_in_datatypesDefCommand2884_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1337
static  ANTLR3_BITSET_LIST FOLLOW_datatypesDef_in_datatypesDefCommand2884	= { FOLLOW_datatypesDef_in_datatypesDefCommand2884_bits, 2	};
1338
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDefCommand2889  */
1339
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDefCommand2889_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1340
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDefCommand2889	= { FOLLOW_RPAREN_TOK_in_datatypesDefCommand2889_bits, 1	};
1341
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDef2918  */
1342
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDef2918_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000090000) };
1343
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDef2918	= { FOLLOW_LPAREN_TOK_in_datatypesDef2918_bits, 2	};
1344
/** Bitset defining follow set for error recovery in rule state: FOLLOW_PAR_TOK_in_datatypesDef2928  */
1345
static	ANTLR3_BITWORD FOLLOW_PAR_TOK_in_datatypesDef2928_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1346
static  ANTLR3_BITSET_LIST FOLLOW_PAR_TOK_in_datatypesDef2928	= { FOLLOW_PAR_TOK_in_datatypesDef2928_bits, 2	};
1347
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDef2932  */
1348
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDef2932_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042400000) };
1349
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDef2932	= { FOLLOW_LPAREN_TOK_in_datatypesDef2932_bits, 2	};
1350
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_datatypesDef2942  */
1351
static	ANTLR3_BITWORD FOLLOW_symbol_in_datatypesDef2942_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042400000) };
1352
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_datatypesDef2942	= { FOLLOW_symbol_in_datatypesDef2942_bits, 2	};
1353
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDef2970  */
1354
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDef2970_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1355
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDef2970	= { FOLLOW_RPAREN_TOK_in_datatypesDef2970_bits, 2	};
1356
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDef2980  */
1357
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDef2980_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1358
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDef2980	= { FOLLOW_LPAREN_TOK_in_datatypesDef2980_bits, 2	};
1359
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDef2990  */
1360
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDef2990_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1361
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDef2990	= { FOLLOW_LPAREN_TOK_in_datatypesDef2990_bits, 2	};
1362
/** Bitset defining follow set for error recovery in rule state: FOLLOW_constructorDef_in_datatypesDef2992  */
1363
static	ANTLR3_BITWORD FOLLOW_constructorDef_in_datatypesDef2992_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1364
static  ANTLR3_BITSET_LIST FOLLOW_constructorDef_in_datatypesDef2992	= { FOLLOW_constructorDef_in_datatypesDef2992_bits, 2	};
1365
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDef2995  */
1366
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDef2995_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1367
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDef2995	= { FOLLOW_RPAREN_TOK_in_datatypesDef2995_bits, 2	};
1368
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDef3006  */
1369
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDef3006_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1370
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDef3006	= { FOLLOW_RPAREN_TOK_in_datatypesDef3006_bits, 2	};
1371
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypesDef3026  */
1372
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypesDef3026_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1373
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypesDef3026	= { FOLLOW_LPAREN_TOK_in_datatypesDef3026_bits, 2	};
1374
/** Bitset defining follow set for error recovery in rule state: FOLLOW_constructorDef_in_datatypesDef3028  */
1375
static	ANTLR3_BITWORD FOLLOW_constructorDef_in_datatypesDef3028_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1376
static  ANTLR3_BITSET_LIST FOLLOW_constructorDef_in_datatypesDef3028	= { FOLLOW_constructorDef_in_datatypesDef3028_bits, 2	};
1377
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDef3031  */
1378
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDef3031_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1379
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDef3031	= { FOLLOW_RPAREN_TOK_in_datatypesDef3031_bits, 2	};
1380
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypesDef3046  */
1381
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypesDef3046_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
1382
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypesDef3046	= { FOLLOW_RPAREN_TOK_in_datatypesDef3046_bits, 2	};
1383
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_simpleSymbolicExprNoKeyword3071  */
1384
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_simpleSymbolicExprNoKeyword3071_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1385
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_simpleSymbolicExprNoKeyword3071	= { FOLLOW_INTEGER_LITERAL_in_simpleSymbolicExprNoKeyword3071_bits, 1	};
1386
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECIMAL_LITERAL_in_simpleSymbolicExprNoKeyword3083  */
1387
static	ANTLR3_BITWORD FOLLOW_DECIMAL_LITERAL_in_simpleSymbolicExprNoKeyword3083_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1388
static  ANTLR3_BITSET_LIST FOLLOW_DECIMAL_LITERAL_in_simpleSymbolicExprNoKeyword3083	= { FOLLOW_DECIMAL_LITERAL_in_simpleSymbolicExprNoKeyword3083_bits, 1	};
1389
/** Bitset defining follow set for error recovery in rule state: FOLLOW_HEX_LITERAL_in_simpleSymbolicExprNoKeyword3095  */
1390
static	ANTLR3_BITWORD FOLLOW_HEX_LITERAL_in_simpleSymbolicExprNoKeyword3095_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1391
static  ANTLR3_BITSET_LIST FOLLOW_HEX_LITERAL_in_simpleSymbolicExprNoKeyword3095	= { FOLLOW_HEX_LITERAL_in_simpleSymbolicExprNoKeyword3095_bits, 1	};
1392
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BINARY_LITERAL_in_simpleSymbolicExprNoKeyword3107  */
1393
static	ANTLR3_BITWORD FOLLOW_BINARY_LITERAL_in_simpleSymbolicExprNoKeyword3107_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1394
static  ANTLR3_BITSET_LIST FOLLOW_BINARY_LITERAL_in_simpleSymbolicExprNoKeyword3107	= { FOLLOW_BINARY_LITERAL_in_simpleSymbolicExprNoKeyword3107_bits, 1	};
1395
/** Bitset defining follow set for error recovery in rule state: FOLLOW_str_in_simpleSymbolicExprNoKeyword3119  */
1396
static	ANTLR3_BITWORD FOLLOW_str_in_simpleSymbolicExprNoKeyword3119_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1397
static  ANTLR3_BITSET_LIST FOLLOW_str_in_simpleSymbolicExprNoKeyword3119	= { FOLLOW_str_in_simpleSymbolicExprNoKeyword3119_bits, 1	};
1398
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_simpleSymbolicExprNoKeyword3126  */
1399
static	ANTLR3_BITWORD FOLLOW_symbol_in_simpleSymbolicExprNoKeyword3126_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1400
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_simpleSymbolicExprNoKeyword3126	= { FOLLOW_symbol_in_simpleSymbolicExprNoKeyword3126_bits, 1	};
1401
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_simpleSymbolicExprNoKeyword3135  */
1402
static	ANTLR3_BITWORD FOLLOW_set_in_simpleSymbolicExprNoKeyword3135_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1403
static  ANTLR3_BITSET_LIST FOLLOW_set_in_simpleSymbolicExprNoKeyword3135	= { FOLLOW_set_in_simpleSymbolicExprNoKeyword3135_bits, 1	};
1404
/** Bitset defining follow set for error recovery in rule state: FOLLOW_KEYWORD_in_keyword3337  */
1405
static	ANTLR3_BITWORD FOLLOW_KEYWORD_in_keyword3337_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1406
static  ANTLR3_BITSET_LIST FOLLOW_KEYWORD_in_keyword3337	= { FOLLOW_KEYWORD_in_keyword3337_bits, 1	};
1407
/** Bitset defining follow set for error recovery in rule state: FOLLOW_simpleSymbolicExprNoKeyword_in_simpleSymbolicExpr3357  */
1408
static	ANTLR3_BITWORD FOLLOW_simpleSymbolicExprNoKeyword_in_simpleSymbolicExpr3357_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1409
static  ANTLR3_BITSET_LIST FOLLOW_simpleSymbolicExprNoKeyword_in_simpleSymbolicExpr3357	= { FOLLOW_simpleSymbolicExprNoKeyword_in_simpleSymbolicExpr3357_bits, 1	};
1410
/** Bitset defining follow set for error recovery in rule state: FOLLOW_KEYWORD_in_simpleSymbolicExpr3364  */
1411
static	ANTLR3_BITWORD FOLLOW_KEYWORD_in_simpleSymbolicExpr3364_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1412
static  ANTLR3_BITSET_LIST FOLLOW_KEYWORD_in_simpleSymbolicExpr3364	= { FOLLOW_KEYWORD_in_simpleSymbolicExpr3364_bits, 1	};
1413
/** Bitset defining follow set for error recovery in rule state: FOLLOW_simpleSymbolicExpr_in_symbolicExpr3385  */
1414
static	ANTLR3_BITWORD FOLLOW_simpleSymbolicExpr_in_symbolicExpr3385_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1415
static  ANTLR3_BITSET_LIST FOLLOW_simpleSymbolicExpr_in_symbolicExpr3385	= { FOLLOW_simpleSymbolicExpr_in_symbolicExpr3385_bits, 1	};
1416
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_symbolicExpr3398  */
1417
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_symbolicExpr3398_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620020), ANTLR3_UINT64_LIT(0x00000801FBF150B9) };
1418
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_symbolicExpr3398	= { FOLLOW_LPAREN_TOK_in_symbolicExpr3398_bits, 2	};
1419
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbolicExpr_in_symbolicExpr3406  */
1420
static	ANTLR3_BITWORD FOLLOW_symbolicExpr_in_symbolicExpr3406_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620020), ANTLR3_UINT64_LIT(0x00000801FBF150B9) };
1421
static  ANTLR3_BITSET_LIST FOLLOW_symbolicExpr_in_symbolicExpr3406	= { FOLLOW_symbolicExpr_in_symbolicExpr3406_bits, 2	};
1422
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_symbolicExpr3414  */
1423
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_symbolicExpr3414_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1424
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_symbolicExpr3414	= { FOLLOW_RPAREN_TOK_in_symbolicExpr3414_bits, 1	};
1425
/** Bitset defining follow set for error recovery in rule state: FOLLOW_termNonVariable_in_term3439  */
1426
static	ANTLR3_BITWORD FOLLOW_termNonVariable_in_term3439_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1427
static  ANTLR3_BITSET_LIST FOLLOW_termNonVariable_in_term3439	= { FOLLOW_termNonVariable_in_term3439_bits, 1	};
1428
/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualIdentifier_in_term3451  */
1429
static	ANTLR3_BITWORD FOLLOW_qualIdentifier_in_term3451_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1430
static  ANTLR3_BITSET_LIST FOLLOW_qualIdentifier_in_term3451	= { FOLLOW_qualIdentifier_in_term3451_bits, 1	};
1431
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3479  */
1432
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3479_bits[]	= { ANTLR3_UINT64_LIT(0x00A0000000000000) };
1433
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3479	= { FOLLOW_LPAREN_TOK_in_termNonVariable3479_bits, 1	};
1434
/** Bitset defining follow set for error recovery in rule state: FOLLOW_quantOp_in_termNonVariable3481  */
1435
static	ANTLR3_BITWORD FOLLOW_quantOp_in_termNonVariable3481_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1436
static  ANTLR3_BITSET_LIST FOLLOW_quantOp_in_termNonVariable3481	= { FOLLOW_quantOp_in_termNonVariable3481_bits, 2	};
1437
/** Bitset defining follow set for error recovery in rule state: FOLLOW_boundVarList_in_termNonVariable3494  */
1438
static	ANTLR3_BITWORD FOLLOW_boundVarList_in_termNonVariable3494_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1439
static  ANTLR3_BITSET_LIST FOLLOW_boundVarList_in_termNonVariable3494	= { FOLLOW_boundVarList_in_termNonVariable3494_bits, 2	};
1440
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3501  */
1441
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3501_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1442
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3501	= { FOLLOW_term_in_termNonVariable3501_bits, 2	};
1443
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3504  */
1444
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3504_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1445
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3504	= { FOLLOW_RPAREN_TOK_in_termNonVariable3504_bits, 1	};
1446
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3516  */
1447
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3516_bits[]	= { ANTLR3_UINT64_LIT(0x0000000002000000) };
1448
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3516	= { FOLLOW_LPAREN_TOK_in_termNonVariable3516_bits, 1	};
1449
/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMPREHENSION_TOK_in_termNonVariable3518  */
1450
static	ANTLR3_BITWORD FOLLOW_COMPREHENSION_TOK_in_termNonVariable3518_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1451
static  ANTLR3_BITSET_LIST FOLLOW_COMPREHENSION_TOK_in_termNonVariable3518	= { FOLLOW_COMPREHENSION_TOK_in_termNonVariable3518_bits, 2	};
1452
/** Bitset defining follow set for error recovery in rule state: FOLLOW_boundVarList_in_termNonVariable3530  */
1453
static	ANTLR3_BITWORD FOLLOW_boundVarList_in_termNonVariable3530_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1454
static  ANTLR3_BITSET_LIST FOLLOW_boundVarList_in_termNonVariable3530	= { FOLLOW_boundVarList_in_termNonVariable3530_bits, 2	};
1455
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3543  */
1456
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3543_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1457
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3543	= { FOLLOW_term_in_termNonVariable3543_bits, 2	};
1458
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3552  */
1459
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3552_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1460
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3552	= { FOLLOW_term_in_termNonVariable3552_bits, 2	};
1461
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3561  */
1462
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3561_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1463
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3561	= { FOLLOW_RPAREN_TOK_in_termNonVariable3561_bits, 1	};
1464
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3567  */
1465
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3567_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1466
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3567	= { FOLLOW_LPAREN_TOK_in_termNonVariable3567_bits, 2	};
1467
/** Bitset defining follow set for error recovery in rule state: FOLLOW_qualIdentifier_in_termNonVariable3569  */
1468
static	ANTLR3_BITWORD FOLLOW_qualIdentifier_in_termNonVariable3569_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1469
static  ANTLR3_BITSET_LIST FOLLOW_qualIdentifier_in_termNonVariable3569	= { FOLLOW_qualIdentifier_in_termNonVariable3569_bits, 2	};
1470
/** Bitset defining follow set for error recovery in rule state: FOLLOW_termList_in_termNonVariable3576  */
1471
static	ANTLR3_BITWORD FOLLOW_termList_in_termNonVariable3576_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1472
static  ANTLR3_BITSET_LIST FOLLOW_termList_in_termNonVariable3576	= { FOLLOW_termList_in_termNonVariable3576_bits, 2	};
1473
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3579  */
1474
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3579_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1475
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3579	= { FOLLOW_RPAREN_TOK_in_termNonVariable3579_bits, 1	};
1476
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3597  */
1477
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3597_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000008000) };
1478
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3597	= { FOLLOW_LPAREN_TOK_in_termNonVariable3597_bits, 2	};
1479
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LET_TOK_in_termNonVariable3606  */
1480
static	ANTLR3_BITWORD FOLLOW_LET_TOK_in_termNonVariable3606_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1481
static  ANTLR3_BITSET_LIST FOLLOW_LET_TOK_in_termNonVariable3606	= { FOLLOW_LET_TOK_in_termNonVariable3606_bits, 2	};
1482
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3608  */
1483
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3608_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1484
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3608	= { FOLLOW_LPAREN_TOK_in_termNonVariable3608_bits, 2	};
1485
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3626  */
1486
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3626_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1487
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3626	= { FOLLOW_LPAREN_TOK_in_termNonVariable3626_bits, 2	};
1488
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_termNonVariable3628  */
1489
static	ANTLR3_BITWORD FOLLOW_symbol_in_termNonVariable3628_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1490
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_termNonVariable3628	= { FOLLOW_symbol_in_termNonVariable3628_bits, 2	};
1491
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3639  */
1492
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3639_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1493
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3639	= { FOLLOW_term_in_termNonVariable3639_bits, 2	};
1494
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3650  */
1495
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3650_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1496
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3650	= { FOLLOW_RPAREN_TOK_in_termNonVariable3650_bits, 2	};
1497
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3693  */
1498
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3693_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1499
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3693	= { FOLLOW_RPAREN_TOK_in_termNonVariable3693_bits, 2	};
1500
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3699  */
1501
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3699_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1502
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3699	= { FOLLOW_term_in_termNonVariable3699_bits, 2	};
1503
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3706  */
1504
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3706_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1505
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3706	= { FOLLOW_RPAREN_TOK_in_termNonVariable3706_bits, 1	};
1506
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3724  */
1507
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3724_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
1508
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3724	= { FOLLOW_LPAREN_TOK_in_termNonVariable3724_bits, 2	};
1509
/** Bitset defining follow set for error recovery in rule state: FOLLOW_MATCH_TOK_in_termNonVariable3726  */
1510
static	ANTLR3_BITWORD FOLLOW_MATCH_TOK_in_termNonVariable3726_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1511
static  ANTLR3_BITSET_LIST FOLLOW_MATCH_TOK_in_termNonVariable3726	= { FOLLOW_MATCH_TOK_in_termNonVariable3726_bits, 2	};
1512
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3728  */
1513
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3728_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1514
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3728	= { FOLLOW_term_in_termNonVariable3728_bits, 2	};
1515
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3737  */
1516
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3737_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1517
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3737	= { FOLLOW_LPAREN_TOK_in_termNonVariable3737_bits, 2	};
1518
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3758  */
1519
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3758_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1520
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3758	= { FOLLOW_LPAREN_TOK_in_termNonVariable3758_bits, 2	};
1521
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3760  */
1522
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3760_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1523
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3760	= { FOLLOW_LPAREN_TOK_in_termNonVariable3760_bits, 2	};
1524
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3762  */
1525
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3762_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042400000) };
1526
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3762	= { FOLLOW_term_in_termNonVariable3762_bits, 2	};
1527
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_termNonVariable3786  */
1528
static	ANTLR3_BITWORD FOLLOW_symbol_in_termNonVariable3786_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042400000) };
1529
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_termNonVariable3786	= { FOLLOW_symbol_in_termNonVariable3786_bits, 2	};
1530
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3810  */
1531
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3810_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1532
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3810	= { FOLLOW_RPAREN_TOK_in_termNonVariable3810_bits, 2	};
1533
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3812  */
1534
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3812_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1535
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3812	= { FOLLOW_term_in_termNonVariable3812_bits, 2	};
1536
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3825  */
1537
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3825_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1538
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3825	= { FOLLOW_RPAREN_TOK_in_termNonVariable3825_bits, 2	};
1539
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3842  */
1540
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3842_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1541
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3842	= { FOLLOW_LPAREN_TOK_in_termNonVariable3842_bits, 2	};
1542
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_termNonVariable3844  */
1543
static	ANTLR3_BITWORD FOLLOW_symbol_in_termNonVariable3844_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1544
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_termNonVariable3844	= { FOLLOW_symbol_in_termNonVariable3844_bits, 2	};
1545
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3857  */
1546
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3857_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1547
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3857	= { FOLLOW_term_in_termNonVariable3857_bits, 2	};
1548
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3870  */
1549
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3870_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1550
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3870	= { FOLLOW_RPAREN_TOK_in_termNonVariable3870_bits, 2	};
1551
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3883  */
1552
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3883_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1553
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3883	= { FOLLOW_RPAREN_TOK_in_termNonVariable3883_bits, 2	};
1554
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3885  */
1555
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3885_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1556
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3885	= { FOLLOW_RPAREN_TOK_in_termNonVariable3885_bits, 1	};
1557
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3901  */
1558
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3901_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000010000) };
1559
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3901	= { FOLLOW_LPAREN_TOK_in_termNonVariable3901_bits, 1	};
1560
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_TOK_in_termNonVariable3903  */
1561
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_TOK_in_termNonVariable3903_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1562
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_TOK_in_termNonVariable3903	= { FOLLOW_ATTRIBUTE_TOK_in_termNonVariable3903_bits, 2	};
1563
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3905  */
1564
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3905_bits[]	= { ANTLR3_UINT64_LIT(0x000000000000FF00), ANTLR3_UINT64_LIT(0x0000000000004000) };
1565
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3905	= { FOLLOW_term_in_termNonVariable3905_bits, 2	};
1566
/** Bitset defining follow set for error recovery in rule state: FOLLOW_attribute_in_termNonVariable3914  */
1567
static	ANTLR3_BITWORD FOLLOW_attribute_in_termNonVariable3914_bits[]	= { ANTLR3_UINT64_LIT(0x000000000000FF00), ANTLR3_UINT64_LIT(0x0000000002004000) };
1568
static  ANTLR3_BITSET_LIST FOLLOW_attribute_in_termNonVariable3914	= { FOLLOW_attribute_in_termNonVariable3914_bits, 2	};
1569
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3932  */
1570
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3932_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1571
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3932	= { FOLLOW_RPAREN_TOK_in_termNonVariable3932_bits, 1	};
1572
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3950  */
1573
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3950_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000200) };
1574
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3950	= { FOLLOW_LPAREN_TOK_in_termNonVariable3950_bits, 2	};
1575
/** Bitset defining follow set for error recovery in rule state: FOLLOW_HO_LAMBDA_TOK_in_termNonVariable3952  */
1576
static	ANTLR3_BITWORD FOLLOW_HO_LAMBDA_TOK_in_termNonVariable3952_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1577
static  ANTLR3_BITSET_LIST FOLLOW_HO_LAMBDA_TOK_in_termNonVariable3952	= { FOLLOW_HO_LAMBDA_TOK_in_termNonVariable3952_bits, 2	};
1578
/** Bitset defining follow set for error recovery in rule state: FOLLOW_boundVarList_in_termNonVariable3964  */
1579
static	ANTLR3_BITWORD FOLLOW_boundVarList_in_termNonVariable3964_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1580
static  ANTLR3_BITSET_LIST FOLLOW_boundVarList_in_termNonVariable3964	= { FOLLOW_boundVarList_in_termNonVariable3964_bits, 2	};
1581
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable3971  */
1582
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable3971_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1583
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable3971	= { FOLLOW_term_in_termNonVariable3971_bits, 2	};
1584
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3974  */
1585
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3974_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1586
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3974	= { FOLLOW_RPAREN_TOK_in_termNonVariable3974_bits, 1	};
1587
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable3986  */
1588
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable3986_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000010000000000) };
1589
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable3986	= { FOLLOW_LPAREN_TOK_in_termNonVariable3986_bits, 2	};
1590
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TUPLE_CONST_TOK_in_termNonVariable3988  */
1591
static	ANTLR3_BITWORD FOLLOW_TUPLE_CONST_TOK_in_termNonVariable3988_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1592
static  ANTLR3_BITSET_LIST FOLLOW_TUPLE_CONST_TOK_in_termNonVariable3988	= { FOLLOW_TUPLE_CONST_TOK_in_termNonVariable3988_bits, 2	};
1593
/** Bitset defining follow set for error recovery in rule state: FOLLOW_termList_in_termNonVariable3990  */
1594
static	ANTLR3_BITWORD FOLLOW_termList_in_termNonVariable3990_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1595
static  ANTLR3_BITSET_LIST FOLLOW_termList_in_termNonVariable3990	= { FOLLOW_termList_in_termNonVariable3990_bits, 2	};
1596
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable3993  */
1597
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable3993_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1598
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable3993	= { FOLLOW_RPAREN_TOK_in_termNonVariable3993_bits, 1	};
1599
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termNonVariable4003  */
1600
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termNonVariable4003_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000020000000000) };
1601
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termNonVariable4003	= { FOLLOW_LPAREN_TOK_in_termNonVariable4003_bits, 2	};
1602
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TUPLE_PROJECT_TOK_in_termNonVariable4005  */
1603
static	ANTLR3_BITWORD FOLLOW_TUPLE_PROJECT_TOK_in_termNonVariable4005_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1604
static  ANTLR3_BITSET_LIST FOLLOW_TUPLE_PROJECT_TOK_in_termNonVariable4005	= { FOLLOW_TUPLE_PROJECT_TOK_in_termNonVariable4005_bits, 2	};
1605
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termNonVariable4007  */
1606
static	ANTLR3_BITWORD FOLLOW_term_in_termNonVariable4007_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1607
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termNonVariable4007	= { FOLLOW_term_in_termNonVariable4007_bits, 2	};
1608
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termNonVariable4010  */
1609
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termNonVariable4010_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1610
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termNonVariable4010	= { FOLLOW_RPAREN_TOK_in_termNonVariable4010_bits, 1	};
1611
/** Bitset defining follow set for error recovery in rule state: FOLLOW_termAtomic_in_termNonVariable4026  */
1612
static	ANTLR3_BITWORD FOLLOW_termAtomic_in_termNonVariable4026_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1613
static  ANTLR3_BITSET_LIST FOLLOW_termAtomic_in_termNonVariable4026	= { FOLLOW_termAtomic_in_termNonVariable4026_bits, 1	};
1614
/** Bitset defining follow set for error recovery in rule state: FOLLOW_identifier_in_qualIdentifier4049  */
1615
static	ANTLR3_BITWORD FOLLOW_identifier_in_qualIdentifier4049_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1616
static  ANTLR3_BITSET_LIST FOLLOW_identifier_in_qualIdentifier4049	= { FOLLOW_identifier_in_qualIdentifier4049_bits, 1	};
1617
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_qualIdentifier4056  */
1618
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_qualIdentifier4056_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000080) };
1619
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_qualIdentifier4056	= { FOLLOW_LPAREN_TOK_in_qualIdentifier4056_bits, 1	};
1620
/** Bitset defining follow set for error recovery in rule state: FOLLOW_AS_TOK_in_qualIdentifier4058  */
1621
static	ANTLR3_BITWORD FOLLOW_AS_TOK_in_qualIdentifier4058_bits[]	= { ANTLR3_UINT64_LIT(0x0000000008000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1622
static  ANTLR3_BITSET_LIST FOLLOW_AS_TOK_in_qualIdentifier4058	= { FOLLOW_AS_TOK_in_qualIdentifier4058_bits, 2	};
1623
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CONST_TOK_in_qualIdentifier4066  */
1624
static	ANTLR3_BITWORD FOLLOW_CONST_TOK_in_qualIdentifier4066_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1625
static  ANTLR3_BITSET_LIST FOLLOW_CONST_TOK_in_qualIdentifier4066	= { FOLLOW_CONST_TOK_in_qualIdentifier4066_bits, 2	};
1626
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_qualIdentifier4068  */
1627
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_qualIdentifier4068_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1628
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_qualIdentifier4068	= { FOLLOW_sortSymbol_in_qualIdentifier4068_bits, 2	};
1629
/** Bitset defining follow set for error recovery in rule state: FOLLOW_identifier_in_qualIdentifier4085  */
1630
static	ANTLR3_BITWORD FOLLOW_identifier_in_qualIdentifier4085_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1631
static  ANTLR3_BITSET_LIST FOLLOW_identifier_in_qualIdentifier4085	= { FOLLOW_identifier_in_qualIdentifier4085_bits, 2	};
1632
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_qualIdentifier4094  */
1633
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_qualIdentifier4094_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1634
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_qualIdentifier4094	= { FOLLOW_sortSymbol_in_qualIdentifier4094_bits, 2	};
1635
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_qualIdentifier4115  */
1636
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_qualIdentifier4115_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1637
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_qualIdentifier4115	= { FOLLOW_RPAREN_TOK_in_qualIdentifier4115_bits, 1	};
1638
/** Bitset defining follow set for error recovery in rule state: FOLLOW_functionName_in_identifier4134  */
1639
static	ANTLR3_BITWORD FOLLOW_functionName_in_identifier4134_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1640
static  ANTLR3_BITSET_LIST FOLLOW_functionName_in_identifier4134	= { FOLLOW_functionName_in_identifier4134_bits, 1	};
1641
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_identifier4146  */
1642
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_identifier4146_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000800) };
1643
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_identifier4146	= { FOLLOW_LPAREN_TOK_in_identifier4146_bits, 2	};
1644
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INDEX_TOK_in_identifier4148  */
1645
static	ANTLR3_BITWORD FOLLOW_INDEX_TOK_in_identifier4148_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000168040000000) };
1646
static  ANTLR3_BITSET_LIST FOLLOW_INDEX_TOK_in_identifier4148	= { FOLLOW_INDEX_TOK_in_identifier4148_bits, 2	};
1647
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TESTER_TOK_in_identifier4156  */
1648
static	ANTLR3_BITWORD FOLLOW_TESTER_TOK_in_identifier4156_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1649
static  ANTLR3_BITSET_LIST FOLLOW_TESTER_TOK_in_identifier4156	= { FOLLOW_TESTER_TOK_in_identifier4156_bits, 2	};
1650
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_identifier4158  */
1651
static	ANTLR3_BITWORD FOLLOW_term_in_identifier4158_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1652
static  ANTLR3_BITSET_LIST FOLLOW_term_in_identifier4158	= { FOLLOW_term_in_identifier4158_bits, 2	};
1653
/** Bitset defining follow set for error recovery in rule state: FOLLOW_UPDATE_TOK_in_identifier4175  */
1654
static	ANTLR3_BITWORD FOLLOW_UPDATE_TOK_in_identifier4175_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1655
static  ANTLR3_BITSET_LIST FOLLOW_UPDATE_TOK_in_identifier4175	= { FOLLOW_UPDATE_TOK_in_identifier4175_bits, 2	};
1656
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_identifier4177  */
1657
static	ANTLR3_BITWORD FOLLOW_term_in_identifier4177_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1658
static  ANTLR3_BITSET_LIST FOLLOW_term_in_identifier4177	= { FOLLOW_term_in_identifier4177_bits, 2	};
1659
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TUPLE_SEL_TOK_in_identifier4194  */
1660
static	ANTLR3_BITWORD FOLLOW_TUPLE_SEL_TOK_in_identifier4194_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
1661
static  ANTLR3_BITSET_LIST FOLLOW_TUPLE_SEL_TOK_in_identifier4194	= { FOLLOW_TUPLE_SEL_TOK_in_identifier4194_bits, 2	};
1662
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_identifier4198  */
1663
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_identifier4198_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1664
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_identifier4198	= { FOLLOW_INTEGER_LITERAL_in_identifier4198_bits, 2	};
1665
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TUPLE_PROJECT_TOK_in_identifier4214  */
1666
static	ANTLR3_BITWORD FOLLOW_TUPLE_PROJECT_TOK_in_identifier4214_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
1667
static  ANTLR3_BITSET_LIST FOLLOW_TUPLE_PROJECT_TOK_in_identifier4214	= { FOLLOW_TUPLE_PROJECT_TOK_in_identifier4214_bits, 2	};
1668
/** Bitset defining follow set for error recovery in rule state: FOLLOW_nonemptyNumeralList_in_identifier4216  */
1669
static	ANTLR3_BITWORD FOLLOW_nonemptyNumeralList_in_identifier4216_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1670
static  ANTLR3_BITSET_LIST FOLLOW_nonemptyNumeralList_in_identifier4216	= { FOLLOW_nonemptyNumeralList_in_identifier4216_bits, 2	};
1671
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SIMPLE_SYMBOL_in_identifier4235  */
1672
static	ANTLR3_BITWORD FOLLOW_SIMPLE_SYMBOL_in_identifier4235_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
1673
static  ANTLR3_BITSET_LIST FOLLOW_SIMPLE_SYMBOL_in_identifier4235	= { FOLLOW_SIMPLE_SYMBOL_in_identifier4235_bits, 2	};
1674
/** Bitset defining follow set for error recovery in rule state: FOLLOW_nonemptyNumeralList_in_identifier4237  */
1675
static	ANTLR3_BITWORD FOLLOW_nonemptyNumeralList_in_identifier4237_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1676
static  ANTLR3_BITSET_LIST FOLLOW_nonemptyNumeralList_in_identifier4237	= { FOLLOW_nonemptyNumeralList_in_identifier4237_bits, 2	};
1677
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_identifier4258  */
1678
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_identifier4258_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1679
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_identifier4258	= { FOLLOW_RPAREN_TOK_in_identifier4258_bits, 1	};
1680
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_termAtomic4285  */
1681
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_termAtomic4285_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1682
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_termAtomic4285	= { FOLLOW_INTEGER_LITERAL_in_termAtomic4285_bits, 1	};
1683
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DECIMAL_LITERAL_in_termAtomic4297  */
1684
static	ANTLR3_BITWORD FOLLOW_DECIMAL_LITERAL_in_termAtomic4297_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1685
static  ANTLR3_BITSET_LIST FOLLOW_DECIMAL_LITERAL_in_termAtomic4297	= { FOLLOW_DECIMAL_LITERAL_in_termAtomic4297_bits, 1	};
1686
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_termAtomic4316  */
1687
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_termAtomic4316_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000800) };
1688
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_termAtomic4316	= { FOLLOW_LPAREN_TOK_in_termAtomic4316_bits, 2	};
1689
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INDEX_TOK_in_termAtomic4318  */
1690
static	ANTLR3_BITWORD FOLLOW_INDEX_TOK_in_termAtomic4318_bits[]	= { ANTLR3_UINT64_LIT(0x0010000000100000), ANTLR3_UINT64_LIT(0x0000000040000000) };
1691
static  ANTLR3_BITSET_LIST FOLLOW_INDEX_TOK_in_termAtomic4318	= { FOLLOW_INDEX_TOK_in_termAtomic4318_bits, 2	};
1692
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EMP_TOK_in_termAtomic4326  */
1693
static	ANTLR3_BITWORD FOLLOW_EMP_TOK_in_termAtomic4326_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1694
static  ANTLR3_BITSET_LIST FOLLOW_EMP_TOK_in_termAtomic4326	= { FOLLOW_EMP_TOK_in_termAtomic4326_bits, 2	};
1695
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_termAtomic4334  */
1696
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_termAtomic4334_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1697
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_termAtomic4334	= { FOLLOW_sortSymbol_in_termAtomic4334_bits, 2	};
1698
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_termAtomic4343  */
1699
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_termAtomic4343_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1700
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_termAtomic4343	= { FOLLOW_sortSymbol_in_termAtomic4343_bits, 2	};
1701
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHAR_TOK_in_termAtomic4360  */
1702
static	ANTLR3_BITWORD FOLLOW_CHAR_TOK_in_termAtomic4360_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000080) };
1703
static  ANTLR3_BITSET_LIST FOLLOW_CHAR_TOK_in_termAtomic4360	= { FOLLOW_CHAR_TOK_in_termAtomic4360_bits, 2	};
1704
/** Bitset defining follow set for error recovery in rule state: FOLLOW_HEX_LITERAL_in_termAtomic4362  */
1705
static	ANTLR3_BITWORD FOLLOW_HEX_LITERAL_in_termAtomic4362_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1706
static  ANTLR3_BITSET_LIST FOLLOW_HEX_LITERAL_in_termAtomic4362	= { FOLLOW_HEX_LITERAL_in_termAtomic4362_bits, 2	};
1707
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SIMPLE_SYMBOL_in_termAtomic4381  */
1708
static	ANTLR3_BITWORD FOLLOW_SIMPLE_SYMBOL_in_termAtomic4381_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
1709
static  ANTLR3_BITSET_LIST FOLLOW_SIMPLE_SYMBOL_in_termAtomic4381	= { FOLLOW_SIMPLE_SYMBOL_in_termAtomic4381_bits, 2	};
1710
/** Bitset defining follow set for error recovery in rule state: FOLLOW_nonemptyNumeralList_in_termAtomic4383  */
1711
static	ANTLR3_BITWORD FOLLOW_nonemptyNumeralList_in_termAtomic4383_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1712
static  ANTLR3_BITSET_LIST FOLLOW_nonemptyNumeralList_in_termAtomic4383	= { FOLLOW_nonemptyNumeralList_in_termAtomic4383_bits, 2	};
1713
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_termAtomic4404  */
1714
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_termAtomic4404_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1715
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_termAtomic4404	= { FOLLOW_RPAREN_TOK_in_termAtomic4404_bits, 1	};
1716
/** Bitset defining follow set for error recovery in rule state: FOLLOW_HEX_LITERAL_in_termAtomic4414  */
1717
static	ANTLR3_BITWORD FOLLOW_HEX_LITERAL_in_termAtomic4414_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1718
static  ANTLR3_BITSET_LIST FOLLOW_HEX_LITERAL_in_termAtomic4414	= { FOLLOW_HEX_LITERAL_in_termAtomic4414_bits, 1	};
1719
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BINARY_LITERAL_in_termAtomic4426  */
1720
static	ANTLR3_BITWORD FOLLOW_BINARY_LITERAL_in_termAtomic4426_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1721
static  ANTLR3_BITSET_LIST FOLLOW_BINARY_LITERAL_in_termAtomic4426	= { FOLLOW_BINARY_LITERAL_in_termAtomic4426_bits, 1	};
1722
/** Bitset defining follow set for error recovery in rule state: FOLLOW_str_in_termAtomic4442  */
1723
static	ANTLR3_BITWORD FOLLOW_str_in_termAtomic4442_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1724
static  ANTLR3_BITSET_LIST FOLLOW_str_in_termAtomic4442	= { FOLLOW_str_in_termAtomic4442_bits, 1	};
1725
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TUPLE_CONST_TOK_in_termAtomic4459  */
1726
static	ANTLR3_BITWORD FOLLOW_TUPLE_CONST_TOK_in_termAtomic4459_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1727
static  ANTLR3_BITSET_LIST FOLLOW_TUPLE_CONST_TOK_in_termAtomic4459	= { FOLLOW_TUPLE_CONST_TOK_in_termAtomic4459_bits, 1	};
1728
/** Bitset defining follow set for error recovery in rule state: FOLLOW_KEYWORD_in_attribute4486  */
1729
static	ANTLR3_BITWORD FOLLOW_KEYWORD_in_attribute4486_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620022), ANTLR3_UINT64_LIT(0x00000801F9F010B9) };
1730
static  ANTLR3_BITSET_LIST FOLLOW_KEYWORD_in_attribute4486	= { FOLLOW_KEYWORD_in_attribute4486_bits, 2	};
1731
/** Bitset defining follow set for error recovery in rule state: FOLLOW_simpleSymbolicExprNoKeyword_in_attribute4490  */
1732
static	ANTLR3_BITWORD FOLLOW_simpleSymbolicExprNoKeyword_in_attribute4490_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1733
static  ANTLR3_BITSET_LIST FOLLOW_simpleSymbolicExprNoKeyword_in_attribute4490	= { FOLLOW_simpleSymbolicExprNoKeyword_in_attribute4490_bits, 1	};
1734
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_PATTERN_TOK_in_attribute4508  */
1735
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_PATTERN_TOK_in_attribute4508_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1736
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_PATTERN_TOK_in_attribute4508	= { FOLLOW_ATTRIBUTE_PATTERN_TOK_in_attribute4508_bits, 2	};
1737
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_POOL_TOK_in_attribute4520  */
1738
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_POOL_TOK_in_attribute4520_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1739
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_POOL_TOK_in_attribute4520	= { FOLLOW_ATTRIBUTE_POOL_TOK_in_attribute4520_bits, 2	};
1740
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_INST_ADD_TO_POOL_TOK_in_attribute4533  */
1741
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_INST_ADD_TO_POOL_TOK_in_attribute4533_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1742
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_INST_ADD_TO_POOL_TOK_in_attribute4533	= { FOLLOW_ATTRIBUTE_INST_ADD_TO_POOL_TOK_in_attribute4533_bits, 2	};
1743
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK_in_attribute4546  */
1744
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK_in_attribute4546_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1745
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK_in_attribute4546	= { FOLLOW_ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK_in_attribute4546_bits, 2	};
1746
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_attribute4560  */
1747
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_attribute4560_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1748
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_attribute4560	= { FOLLOW_LPAREN_TOK_in_attribute4560_bits, 2	};
1749
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_attribute4568  */
1750
static	ANTLR3_BITWORD FOLLOW_term_in_attribute4568_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090142411080) };
1751
static  ANTLR3_BITSET_LIST FOLLOW_term_in_attribute4568	= { FOLLOW_term_in_attribute4568_bits, 2	};
1752
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_attribute4586  */
1753
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_attribute4586_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1754
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_attribute4586	= { FOLLOW_RPAREN_TOK_in_attribute4586_bits, 1	};
1755
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_NO_PATTERN_TOK_in_attribute4598  */
1756
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_NO_PATTERN_TOK_in_attribute4598_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020000), ANTLR3_UINT64_LIT(0x0000090140411080) };
1757
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_NO_PATTERN_TOK_in_attribute4598	= { FOLLOW_ATTRIBUTE_NO_PATTERN_TOK_in_attribute4598_bits, 2	};
1758
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_attribute4600  */
1759
static	ANTLR3_BITWORD FOLLOW_term_in_attribute4600_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1760
static  ANTLR3_BITSET_LIST FOLLOW_term_in_attribute4600	= { FOLLOW_term_in_attribute4600_bits, 1	};
1761
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_INST_LEVEL_in_attribute4617  */
1762
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_INST_LEVEL_in_attribute4617_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000001000) };
1763
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_INST_LEVEL_in_attribute4617	= { FOLLOW_ATTRIBUTE_INST_LEVEL_in_attribute4617_bits, 2	};
1764
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_attribute4621  */
1765
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_attribute4621_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1766
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_attribute4621	= { FOLLOW_INTEGER_LITERAL_in_attribute4621_bits, 1	};
1767
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_QUANTIFIER_ID_TOK_in_attribute4637  */
1768
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_QUANTIFIER_ID_TOK_in_attribute4637_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620020), ANTLR3_UINT64_LIT(0x00000801F9F150B9) };
1769
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_QUANTIFIER_ID_TOK_in_attribute4637	= { FOLLOW_ATTRIBUTE_QUANTIFIER_ID_TOK_in_attribute4637_bits, 2	};
1770
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbolicExpr_in_attribute4641  */
1771
static	ANTLR3_BITWORD FOLLOW_symbolicExpr_in_attribute4641_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1772
static  ANTLR3_BITSET_LIST FOLLOW_symbolicExpr_in_attribute4641	= { FOLLOW_symbolicExpr_in_attribute4641_bits, 1	};
1773
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ATTRIBUTE_NAMED_TOK_in_attribute4654  */
1774
static	ANTLR3_BITWORD FOLLOW_ATTRIBUTE_NAMED_TOK_in_attribute4654_bits[]	= { ANTLR3_UINT64_LIT(0xDE49E42410620020), ANTLR3_UINT64_LIT(0x00000801F9F150B9) };
1775
static  ANTLR3_BITSET_LIST FOLLOW_ATTRIBUTE_NAMED_TOK_in_attribute4654	= { FOLLOW_ATTRIBUTE_NAMED_TOK_in_attribute4654_bits, 2	};
1776
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbolicExpr_in_attribute4656  */
1777
static	ANTLR3_BITWORD FOLLOW_symbolicExpr_in_attribute4656_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1778
static  ANTLR3_BITSET_LIST FOLLOW_symbolicExpr_in_attribute4656	= { FOLLOW_symbolicExpr_in_attribute4656_bits, 1	};
1779
/** Bitset defining follow set for error recovery in rule state: FOLLOW_term_in_termList4688  */
1780
static	ANTLR3_BITWORD FOLLOW_term_in_termList4688_bits[]	= { ANTLR3_UINT64_LIT(0x0000000010020002), ANTLR3_UINT64_LIT(0x0000090140411080) };
1781
static  ANTLR3_BITSET_LIST FOLLOW_term_in_termList4688	= { FOLLOW_term_in_termList4688_bits, 2	};
1782
/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRING_LITERAL_in_str4710  */
1783
static	ANTLR3_BITWORD FOLLOW_STRING_LITERAL_in_str4710_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1784
static  ANTLR3_BITSET_LIST FOLLOW_STRING_LITERAL_in_str4710	= { FOLLOW_STRING_LITERAL_in_str4710_bits, 1	};
1785
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EXISTS_TOK_in_quantOp4735  */
1786
static	ANTLR3_BITWORD FOLLOW_EXISTS_TOK_in_quantOp4735_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1787
static  ANTLR3_BITSET_LIST FOLLOW_EXISTS_TOK_in_quantOp4735	= { FOLLOW_EXISTS_TOK_in_quantOp4735_bits, 1	};
1788
/** Bitset defining follow set for error recovery in rule state: FOLLOW_FORALL_TOK_in_quantOp4746  */
1789
static	ANTLR3_BITWORD FOLLOW_FORALL_TOK_in_quantOp4746_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1790
static  ANTLR3_BITSET_LIST FOLLOW_FORALL_TOK_in_quantOp4746	= { FOLLOW_FORALL_TOK_in_quantOp4746_bits, 1	};
1791
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_functionName4767  */
1792
static	ANTLR3_BITWORD FOLLOW_symbol_in_functionName4767_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1793
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_functionName4767	= { FOLLOW_symbol_in_functionName4767_bits, 1	};
1794
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sortList4791  */
1795
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sortList4791_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000080040410000) };
1796
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sortList4791	= { FOLLOW_sortSymbol_in_sortList4791_bits, 2	};
1797
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_nonemptySortList4818  */
1798
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_nonemptySortList4818_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000080040410000) };
1799
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_nonemptySortList4818	= { FOLLOW_sortSymbol_in_nonemptySortList4818_bits, 2	};
1800
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sortedVarList4847  */
1801
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sortedVarList4847_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1802
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sortedVarList4847	= { FOLLOW_LPAREN_TOK_in_sortedVarList4847_bits, 2	};
1803
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sortedVarList4849  */
1804
static	ANTLR3_BITWORD FOLLOW_symbol_in_sortedVarList4849_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1805
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sortedVarList4849	= { FOLLOW_symbol_in_sortedVarList4849_bits, 2	};
1806
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_sortedVarList4858  */
1807
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_sortedVarList4858_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1808
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_sortedVarList4858	= { FOLLOW_sortSymbol_in_sortedVarList4858_bits, 2	};
1809
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sortedVarList4861  */
1810
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sortedVarList4861_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
1811
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sortedVarList4861	= { FOLLOW_RPAREN_TOK_in_sortedVarList4861_bits, 2	};
1812
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_boundVarList4896  */
1813
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_boundVarList4896_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002010000) };
1814
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_boundVarList4896	= { FOLLOW_LPAREN_TOK_in_boundVarList4896_bits, 2	};
1815
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortedVarList_in_boundVarList4898  */
1816
static	ANTLR3_BITWORD FOLLOW_sortedVarList_in_boundVarList4898_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1817
static  ANTLR3_BITSET_LIST FOLLOW_sortedVarList_in_boundVarList4898	= { FOLLOW_sortedVarList_in_boundVarList4898_bits, 2	};
1818
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_boundVarList4901  */
1819
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_boundVarList4901_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1820
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_boundVarList4901	= { FOLLOW_RPAREN_TOK_in_boundVarList4901_bits, 1	};
1821
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sortName4921  */
1822
static	ANTLR3_BITWORD FOLLOW_symbol_in_sortName4921_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1823
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sortName4921	= { FOLLOW_symbol_in_sortName4921_bits, 1	};
1824
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortName_in_sortSymbol4941  */
1825
static	ANTLR3_BITWORD FOLLOW_sortName_in_sortSymbol4941_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1826
static  ANTLR3_BITSET_LIST FOLLOW_sortName_in_sortSymbol4941	= { FOLLOW_sortName_in_sortSymbol4941_bits, 1	};
1827
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sortSymbol4954  */
1828
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sortSymbol4954_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400800) };
1829
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sortSymbol4954	= { FOLLOW_LPAREN_TOK_in_sortSymbol4954_bits, 2	};
1830
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INDEX_TOK_in_sortSymbol4957  */
1831
static	ANTLR3_BITWORD FOLLOW_INDEX_TOK_in_sortSymbol4957_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1832
static  ANTLR3_BITSET_LIST FOLLOW_INDEX_TOK_in_sortSymbol4957	= { FOLLOW_INDEX_TOK_in_sortSymbol4957_bits, 2	};
1833
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_sortSymbol4970  */
1834
static	ANTLR3_BITWORD FOLLOW_symbol_in_sortSymbol4970_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042411000) };
1835
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_sortSymbol4970	= { FOLLOW_symbol_in_sortSymbol4970_bits, 2	};
1836
/** Bitset defining follow set for error recovery in rule state: FOLLOW_nonemptyNumeralList_in_sortSymbol4979  */
1837
static	ANTLR3_BITWORD FOLLOW_nonemptyNumeralList_in_sortSymbol4979_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1838
static  ANTLR3_BITSET_LIST FOLLOW_nonemptyNumeralList_in_sortSymbol4979	= { FOLLOW_nonemptyNumeralList_in_sortSymbol4979_bits, 2	};
1839
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortList_in_sortSymbol4996  */
1840
static	ANTLR3_BITWORD FOLLOW_sortList_in_sortSymbol4996_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1841
static  ANTLR3_BITSET_LIST FOLLOW_sortList_in_sortSymbol4996	= { FOLLOW_sortList_in_sortSymbol4996_bits, 2	};
1842
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sortSymbol5013  */
1843
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sortSymbol5013_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1844
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sortSymbol5013	= { FOLLOW_RPAREN_TOK_in_sortSymbol5013_bits, 1	};
1845
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_sortSymbol5019  */
1846
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_sortSymbol5019_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000100) };
1847
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_sortSymbol5019	= { FOLLOW_LPAREN_TOK_in_sortSymbol5019_bits, 2	};
1848
/** Bitset defining follow set for error recovery in rule state: FOLLOW_HO_ARROW_TOK_in_sortSymbol5021  */
1849
static	ANTLR3_BITWORD FOLLOW_HO_ARROW_TOK_in_sortSymbol5021_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080042410000) };
1850
static  ANTLR3_BITSET_LIST FOLLOW_HO_ARROW_TOK_in_sortSymbol5021	= { FOLLOW_HO_ARROW_TOK_in_sortSymbol5021_bits, 2	};
1851
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortList_in_sortSymbol5023  */
1852
static	ANTLR3_BITWORD FOLLOW_sortList_in_sortSymbol5023_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1853
static  ANTLR3_BITSET_LIST FOLLOW_sortList_in_sortSymbol5023	= { FOLLOW_sortList_in_sortSymbol5023_bits, 2	};
1854
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_sortSymbol5026  */
1855
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_sortSymbol5026_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1856
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_sortSymbol5026	= { FOLLOW_RPAREN_TOK_in_sortSymbol5026_bits, 1	};
1857
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_symbolList5055  */
1858
static	ANTLR3_BITWORD FOLLOW_symbol_in_symbolList5055_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000080040400000) };
1859
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_symbolList5055	= { FOLLOW_symbol_in_symbolList5055_bits, 2	};
1860
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SIMPLE_SYMBOL_in_symbol5077  */
1861
static	ANTLR3_BITWORD FOLLOW_SIMPLE_SYMBOL_in_symbol5077_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1862
static  ANTLR3_BITSET_LIST FOLLOW_SIMPLE_SYMBOL_in_symbol5077	= { FOLLOW_SIMPLE_SYMBOL_in_symbol5077_bits, 1	};
1863
/** Bitset defining follow set for error recovery in rule state: FOLLOW_QUOTED_SYMBOL_in_symbol5089  */
1864
static	ANTLR3_BITWORD FOLLOW_QUOTED_SYMBOL_in_symbol5089_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1865
static  ANTLR3_BITSET_LIST FOLLOW_QUOTED_SYMBOL_in_symbol5089	= { FOLLOW_QUOTED_SYMBOL_in_symbol5089_bits, 1	};
1866
/** Bitset defining follow set for error recovery in rule state: FOLLOW_UNTERMINATED_QUOTED_SYMBOL_in_symbol5101  */
1867
static	ANTLR3_BITWORD FOLLOW_UNTERMINATED_QUOTED_SYMBOL_in_symbol5101_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000400000000000) };
1868
static  ANTLR3_BITSET_LIST FOLLOW_UNTERMINATED_QUOTED_SYMBOL_in_symbol5101	= { FOLLOW_UNTERMINATED_QUOTED_SYMBOL_in_symbol5101_bits, 2	};
1869
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_symbol5109  */
1870
static	ANTLR3_BITWORD FOLLOW_EOF_in_symbol5109_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1871
static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_symbol5109	= { FOLLOW_EOF_in_symbol5109_bits, 1	};
1872
/** Bitset defining follow set for error recovery in rule state: FOLLOW_110_in_symbol5125  */
1873
static	ANTLR3_BITWORD FOLLOW_110_in_symbol5125_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1874
static  ANTLR3_BITSET_LIST FOLLOW_110_in_symbol5125	= { FOLLOW_110_in_symbol5125_bits, 1	};
1875
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INTEGER_LITERAL_in_nonemptyNumeralList5157  */
1876
static	ANTLR3_BITWORD FOLLOW_INTEGER_LITERAL_in_nonemptyNumeralList5157_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000001000) };
1877
static  ANTLR3_BITSET_LIST FOLLOW_INTEGER_LITERAL_in_nonemptyNumeralList5157	= { FOLLOW_INTEGER_LITERAL_in_nonemptyNumeralList5157_bits, 2	};
1878
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_datatypeDef5199  */
1879
static	ANTLR3_BITWORD FOLLOW_symbol_in_datatypeDef5199_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
1880
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_datatypeDef5199	= { FOLLOW_symbol_in_datatypeDef5199_bits, 2	};
1881
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_datatypeDef5216  */
1882
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_datatypeDef5216_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1883
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_datatypeDef5216	= { FOLLOW_LPAREN_TOK_in_datatypeDef5216_bits, 2	};
1884
/** Bitset defining follow set for error recovery in rule state: FOLLOW_constructorDef_in_datatypeDef5218  */
1885
static	ANTLR3_BITWORD FOLLOW_constructorDef_in_datatypeDef5218_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1886
static  ANTLR3_BITSET_LIST FOLLOW_constructorDef_in_datatypeDef5218	= { FOLLOW_constructorDef_in_datatypeDef5218_bits, 2	};
1887
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_datatypeDef5221  */
1888
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_datatypeDef5221_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
1889
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_datatypeDef5221	= { FOLLOW_RPAREN_TOK_in_datatypeDef5221_bits, 2	};
1890
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_constructorDef5251  */
1891
static	ANTLR3_BITWORD FOLLOW_symbol_in_constructorDef5251_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
1892
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_constructorDef5251	= { FOLLOW_symbol_in_constructorDef5251_bits, 2	};
1893
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LPAREN_TOK_in_constructorDef5266  */
1894
static	ANTLR3_BITWORD FOLLOW_LPAREN_TOK_in_constructorDef5266_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040400000) };
1895
static  ANTLR3_BITSET_LIST FOLLOW_LPAREN_TOK_in_constructorDef5266	= { FOLLOW_LPAREN_TOK_in_constructorDef5266_bits, 2	};
1896
/** Bitset defining follow set for error recovery in rule state: FOLLOW_selector_in_constructorDef5268  */
1897
static	ANTLR3_BITWORD FOLLOW_selector_in_constructorDef5268_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000002000000) };
1898
static  ANTLR3_BITSET_LIST FOLLOW_selector_in_constructorDef5268	= { FOLLOW_selector_in_constructorDef5268_bits, 2	};
1899
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RPAREN_TOK_in_constructorDef5271  */
1900
static	ANTLR3_BITWORD FOLLOW_RPAREN_TOK_in_constructorDef5271_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000010000) };
1901
static  ANTLR3_BITSET_LIST FOLLOW_RPAREN_TOK_in_constructorDef5271	= { FOLLOW_RPAREN_TOK_in_constructorDef5271_bits, 2	};
1902
/** Bitset defining follow set for error recovery in rule state: FOLLOW_symbol_in_selector5299  */
1903
static	ANTLR3_BITWORD FOLLOW_symbol_in_selector5299_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000080040410000) };
1904
static  ANTLR3_BITSET_LIST FOLLOW_symbol_in_selector5299	= { FOLLOW_symbol_in_selector5299_bits, 2	};
1905
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sortSymbol_in_selector5302  */
1906
static	ANTLR3_BITWORD FOLLOW_sortSymbol_in_selector5302_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
1907
static  ANTLR3_BITSET_LIST FOLLOW_sortSymbol_in_selector5302	= { FOLLOW_sortSymbol_in_selector5302_bits, 1	};
1908
1909
1910
/* ==============================================
1911
 * Parsing rules
1912
 */
1913
/**
1914
 * $ANTLR start parseExpr
1915
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:138:1: parseExpr returns [cvc5::api::Term expr = cvc5::api::Term()] : ( term[expr, expr2] | EOF );
1916
 */
1917
static cvc5::api::Term
1918
120
parseExpr(pSmt2Parser ctx)
1919
{
1920
120
    cvc5::api::Term expr;
1921
1922
1923
1924
240
      cvc5::api::Term expr2;
1925
1926
    /* Initialize rule variables
1927
     */
1928
120
    expr =  cvc5::api::Term();
1929
1930
1931
    {
1932
        {
1933
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:142:3: ( term[expr, expr2] | EOF )
1934
1935
            ANTLR3_UINT32 alt1;
1936
1937
120
            alt1=2;
1938
1939
120
            switch ( LA(1) )
1940
            {
1941
68
            case BINARY_LITERAL:
1942
            case DECIMAL_LITERAL:
1943
            case HEX_LITERAL:
1944
            case INTEGER_LITERAL:
1945
            case LPAREN_TOK:
1946
            case QUOTED_SYMBOL:
1947
            case SIMPLE_SYMBOL:
1948
            case STRING_LITERAL:
1949
            case TUPLE_CONST_TOK:
1950
            case UNTERMINATED_QUOTED_SYMBOL:
1951
            	{
1952
68
            		alt1=1;
1953
            	}
1954
68
                break;
1955
42
            case EOF:
1956
            	{
1957
42
            		alt1=2;
1958
            	}
1959
42
                break;
1960
1961
            default:
1962
                CONSTRUCTEX();
1963
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
1964
                EXCEPTION->message      = (void *)"";
1965
                EXCEPTION->decisionNum  = 1;
1966
                EXCEPTION->state        = 0;
1967
1968
1969
                goto ruleparseExprEx;
1970
1971
            }
1972
1973
110
            switch (alt1)
1974
            {
1975
68
        	case 1:
1976
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:142:5: term[expr, expr2]
1977
        	    {
1978
68
        	        FOLLOWPUSH(FOLLOW_term_in_parseExpr117);
1979
68
        	        term(ctx, expr, expr2);
1980
1981
36
        	        FOLLOWPOP();
1982
36
        	        if  (HASEXCEPTION())
1983
        	        {
1984
        	            goto ruleparseExprEx;
1985
        	        }
1986
1987
1988
        	    }
1989
36
        	    break;
1990
42
        	case 2:
1991
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:143:5: EOF
1992
        	    {
1993
42
        	         MATCHT(EOF, &FOLLOW_EOF_in_parseExpr124);
1994
42
        	        if  (HASEXCEPTION())
1995
        	        {
1996
        	            goto ruleparseExprEx;
1997
        	        }
1998
1999
2000
        	    }
2001
42
        	    break;
2002
2003
            }
2004
        }
2005
    }
2006
2007
    // This is where rules clean up and exit
2008
    //
2009
78
    goto ruleparseExprEx; /* Prevent compiler warnings */
2010
78
    ruleparseExprEx: ;
2011
2012
78
            if (HASEXCEPTION())
2013
            {
2014
                PREPORTERROR();
2015
                PRECOVER();
2016
            }
2017
156
    return expr;
2018
}
2019
/* $ANTLR end parseExpr */
2020
2021
/**
2022
 * $ANTLR start parseCommand
2023
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:150:1: parseCommand returns [cvc5::Command* cmd_return = NULL] : ( LPAREN_TOK command[&cmd] RPAREN_TOK | LPAREN_TOK INCLUDE_TOK str[name,true] RPAREN_TOK | EOF );
2024
 */
2025
static cvc5::Command*
2026
208420
parseCommand(pSmt2Parser ctx)
2027
{
2028
    cvc5::Command* cmd_return;
2029
2030
2031
2032
416840
      std::unique_ptr<cvc5::Command> cmd;
2033
416840
      std::string name;
2034
2035
    /* Initialize rule variables
2036
     */
2037
208420
    cmd_return =  NULL;
2038
2039
2040
    {
2041
        {
2042
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:158:3: ( LPAREN_TOK command[&cmd] RPAREN_TOK | LPAREN_TOK INCLUDE_TOK str[name,true] RPAREN_TOK | EOF )
2043
2044
            ANTLR3_UINT32 alt2;
2045
2046
208420
            alt2=3;
2047
2048
208420
            switch ( LA(1) )
2049
            {
2050
205153
            case LPAREN_TOK:
2051
            	{
2052
205153
            		switch ( LA(2) )
2053
            		{
2054
            		case INCLUDE_TOK:
2055
            			{
2056
            				alt2=2;
2057
            			}
2058
            		    break;
2059
205153
            		case ASSERT_TOK:
2060
            		case BLOCK_MODEL_TOK:
2061
            		case BLOCK_MODEL_VALUES_TOK:
2062
            		case CHECK_SAT_ASSUMING_TOK:
2063
            		case CHECK_SAT_TOK:
2064
            		case DECLARE_CODATATYPES_TOK:
2065
            		case DECLARE_CODATATYPE_TOK:
2066
            		case DECLARE_CONST_TOK:
2067
            		case DECLARE_DATATYPES_TOK:
2068
            		case DECLARE_DATATYPE_TOK:
2069
            		case DECLARE_FUNS_TOK:
2070
            		case DECLARE_FUN_TOK:
2071
            		case DECLARE_HEAP:
2072
            		case DECLARE_POOL:
2073
            		case DECLARE_PREDS_TOK:
2074
            		case DECLARE_SORTS_TOK:
2075
            		case DECLARE_SORT_TOK:
2076
            		case DEFINE_CONST_TOK:
2077
            		case DEFINE_FUNS_REC_TOK:
2078
            		case DEFINE_FUN_REC_TOK:
2079
            		case DEFINE_FUN_TOK:
2080
            		case DEFINE_SORT_TOK:
2081
            		case DEFINE_TOK:
2082
            		case ECHO_TOK:
2083
            		case EXIT_TOK:
2084
            		case GET_ABDUCT_TOK:
2085
            		case GET_ASSERTIONS_TOK:
2086
            		case GET_ASSIGNMENT_TOK:
2087
            		case GET_DIFFICULTY_TOK:
2088
            		case GET_INFO_TOK:
2089
            		case GET_INTERPOL_TOK:
2090
            		case GET_MODEL_TOK:
2091
            		case GET_OPTION_TOK:
2092
            		case GET_PROOF_TOK:
2093
            		case GET_QE_DISJUNCT_TOK:
2094
            		case GET_QE_TOK:
2095
            		case GET_UNSAT_ASSUMPTIONS_TOK:
2096
            		case GET_UNSAT_CORE_TOK:
2097
            		case GET_VALUE_TOK:
2098
            		case POP_TOK:
2099
            		case PUSH_TOK:
2100
            		case RESET_ASSERTIONS_TOK:
2101
            		case RESET_TOK:
2102
            		case SET_INFO_TOK:
2103
            		case SET_LOGIC_TOK:
2104
            		case SET_OPTION_TOK:
2105
            		case SIMPLE_SYMBOL:
2106
            		case SIMPLIFY_TOK:
2107
            			{
2108
205153
            				alt2=1;
2109
            			}
2110
205153
            		    break;
2111
2112
            		default:
2113
            		    CONSTRUCTEX();
2114
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
2115
            		    EXCEPTION->message      = (void *)"";
2116
            		    EXCEPTION->decisionNum  = 2;
2117
            		    EXCEPTION->state        = 1;
2118
2119
2120
            		    goto ruleparseCommandEx;
2121
2122
            		}
2123
2124
            	}
2125
205153
                break;
2126
3267
            case EOF:
2127
            	{
2128
3267
            		alt2=3;
2129
            	}
2130
3267
                break;
2131
2132
            default:
2133
                CONSTRUCTEX();
2134
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
2135
                EXCEPTION->message      = (void *)"";
2136
                EXCEPTION->decisionNum  = 2;
2137
                EXCEPTION->state        = 0;
2138
2139
2140
                goto ruleparseCommandEx;
2141
2142
            }
2143
2144
208420
            switch (alt2)
2145
            {
2146
205153
        	case 1:
2147
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:158:5: LPAREN_TOK command[&cmd] RPAREN_TOK
2148
        	    {
2149
205153
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_parseCommand153);
2150
205153
        	        if  (HASEXCEPTION())
2151
        	        {
2152
        	            goto ruleparseCommandEx;
2153
        	        }
2154
2155
2156
205153
        	        FOLLOWPUSH(FOLLOW_command_in_parseCommand155);
2157
205153
        	        command(ctx, &cmd);
2158
2159
205123
        	        FOLLOWPOP();
2160
205123
        	        if  (HASEXCEPTION())
2161
        	        {
2162
        	            goto ruleparseCommandEx;
2163
        	        }
2164
2165
2166
205123
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_parseCommand158);
2167
205123
        	        if  (HASEXCEPTION())
2168
        	        {
2169
2
        	            goto ruleparseCommandEx;
2170
        	        }
2171
2172
2173
        	    }
2174
205121
        	    break;
2175
        	case 2:
2176
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:163:5: LPAREN_TOK INCLUDE_TOK str[name,true] RPAREN_TOK
2177
        	    {
2178
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_parseCommand171);
2179
        	        if  (HASEXCEPTION())
2180
        	        {
2181
        	            goto ruleparseCommandEx;
2182
        	        }
2183
2184
2185
        	         MATCHT(INCLUDE_TOK, &FOLLOW_INCLUDE_TOK_in_parseCommand173);
2186
        	        if  (HASEXCEPTION())
2187
        	        {
2188
        	            goto ruleparseCommandEx;
2189
        	        }
2190
2191
2192
        	        FOLLOWPUSH(FOLLOW_str_in_parseCommand175);
2193
        	        str(ctx, name, true);
2194
2195
        	        FOLLOWPOP();
2196
        	        if  (HASEXCEPTION())
2197
        	        {
2198
        	            goto ruleparseCommandEx;
2199
        	        }
2200
2201
2202
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_parseCommand178);
2203
        	        if  (HASEXCEPTION())
2204
        	        {
2205
        	            goto ruleparseCommandEx;
2206
        	        }
2207
2208
2209
        	        {
2210
        	             if(!PARSER_STATE->canIncludeFile()) {
2211
        	                    PARSER_STATE->parseError("include-file feature was disabled for this "
2212
        	                                             "run.");
2213
        	                  }
2214
        	                  if(PARSER_STATE->strictModeEnabled()) {
2215
        	                    PARSER_STATE->parseError("Extended commands are not permitted while "
2216
        	                                             "operating in strict compliance mode.");
2217
        	                  }
2218
        	                  PARSER_STATE->includeFile(name);
2219
        	                  // The command of the included file will be produced at the next
2220
        	                  // parseCommand() call
2221
        	                  cmd.reset(new EmptyCommand("include::" + name));
2222
2223
        	        }
2224
2225
2226
        	    }
2227
        	    break;
2228
3267
        	case 3:
2229
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:178:5: EOF
2230
        	    {
2231
3267
        	         MATCHT(EOF, &FOLLOW_EOF_in_parseCommand191);
2232
3267
        	        if  (HASEXCEPTION())
2233
        	        {
2234
        	            goto ruleparseCommandEx;
2235
        	        }
2236
2237
2238
        	    }
2239
3267
        	    break;
2240
2241
            }
2242
        }
2243
    }
2244
2245
    // This is where rules clean up and exit
2246
    //
2247
208388
    goto ruleparseCommandEx; /* Prevent compiler warnings */
2248
208390
    ruleparseCommandEx: ;
2249
2250
208390
            if (HASEXCEPTION())
2251
            {
2252
2
                PREPORTERROR();
2253
                PRECOVER();
2254
            }
2255
            else
2256
            {
2257
                {
2258
2259
208388
                      cmd_return = cmd.release();
2260
2261
                }
2262
            }
2263
2264
2265
416776
    return cmd_return;
2266
}
2267
/* $ANTLR end parseCommand */
2268
2269
/**
2270
 * $ANTLR start parseSygus
2271
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:186:1: parseSygus returns [cvc5::Command* cmd_return = NULL] : ( LPAREN_TOK cmd= sygusCommand RPAREN_TOK | EOF );
2272
 */
2273
static cvc5::Command*
2274
2304
parseSygus(pSmt2Parser ctx)
2275
{
2276
    cvc5::Command* cmd_return;
2277
2278
2279
2280
4608
      std::string name;
2281
2282
4608
    std::unique_ptr<cvc5::Command> cmd;
2283
    #undef	RETURN_TYPE_cmd
2284
    #define	RETURN_TYPE_cmd std::unique_ptr<cvc5::Command>
2285
2286
    /* Initialize rule variables
2287
     */
2288
2304
    cmd_return =  NULL;
2289
2290
2291
    {
2292
        {
2293
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:193:3: ( LPAREN_TOK cmd= sygusCommand RPAREN_TOK | EOF )
2294
2295
            ANTLR3_UINT32 alt3;
2296
2297
2304
            alt3=2;
2298
2299
2304
            switch ( LA(1) )
2300
            {
2301
2117
            case LPAREN_TOK:
2302
            	{
2303
2117
            		alt3=1;
2304
            	}
2305
2117
                break;
2306
187
            case EOF:
2307
            	{
2308
187
            		alt3=2;
2309
            	}
2310
187
                break;
2311
2312
            default:
2313
                CONSTRUCTEX();
2314
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
2315
                EXCEPTION->message      = (void *)"";
2316
                EXCEPTION->decisionNum  = 3;
2317
                EXCEPTION->state        = 0;
2318
2319
2320
                goto ruleparseSygusEx;
2321
2322
            }
2323
2324
2304
            switch (alt3)
2325
            {
2326
2117
        	case 1:
2327
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:193:5: LPAREN_TOK cmd= sygusCommand RPAREN_TOK
2328
        	    {
2329
2117
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_parseSygus220);
2330
2117
        	        if  (HASEXCEPTION())
2331
        	        {
2332
        	            goto ruleparseSygusEx;
2333
        	        }
2334
2335
2336
2117
        	        FOLLOWPUSH(FOLLOW_sygusCommand_in_parseSygus224);
2337
2117
        	        cmd=sygusCommand(ctx);
2338
2339
2115
        	        FOLLOWPOP();
2340
2115
        	        if  (HASEXCEPTION())
2341
        	        {
2342
        	            goto ruleparseSygusEx;
2343
        	        }
2344
2345
2346
2115
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_parseSygus226);
2347
2115
        	        if  (HASEXCEPTION())
2348
        	        {
2349
        	            goto ruleparseSygusEx;
2350
        	        }
2351
2352
2353
        	    }
2354
2115
        	    break;
2355
187
        	case 2:
2356
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:194:5: EOF
2357
        	    {
2358
187
        	         MATCHT(EOF, &FOLLOW_EOF_in_parseSygus232);
2359
187
        	        if  (HASEXCEPTION())
2360
        	        {
2361
        	            goto ruleparseSygusEx;
2362
        	        }
2363
2364
2365
        	    }
2366
187
        	    break;
2367
2368
            }
2369
        }
2370
    }
2371
2372
    // This is where rules clean up and exit
2373
    //
2374
2302
    goto ruleparseSygusEx; /* Prevent compiler warnings */
2375
2302
    ruleparseSygusEx: ;
2376
2377
2302
            if (HASEXCEPTION())
2378
            {
2379
                PREPORTERROR();
2380
                PRECOVER();
2381
            }
2382
            else
2383
            {
2384
                {
2385
2386
2302
                      cmd_return = cmd.release();
2387
2388
                }
2389
            }
2390
2391
2392
4604
    return cmd_return;
2393
}
2394
/* $ANTLR end parseSygus */
2395
2396
/**
2397
 * $ANTLR start command
2398
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:201:1: command[std::unique_ptr<cvc5::Command>* cmd] : ( SET_LOGIC_TOK symbol[name,CHECK_NONE,SYM_SORT] | SET_INFO_TOK setInfoInternal[cmd] | GET_INFO_TOK KEYWORD | SET_OPTION_TOK setOptionInternal[cmd] | GET_OPTION_TOK KEYWORD | DECLARE_SORT_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL | DEFINE_SORT_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] LPAREN_TOK symbolList[names,CHECK_NONE,SYM_SORT] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] | DECLARE_FUN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] LPAREN_TOK sortList[sorts] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] | DEFINE_FUN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] term[expr, expr2] | DECLARE_DATATYPE_TOK datatypeDefCommand[false, cmd] | DECLARE_DATATYPES_TOK datatypesDefCommand[false, cmd] | GET_VALUE_TOK ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK ) | GET_ASSIGNMENT_TOK | ASSERT_TOK term[expr, expr2] | CHECK_SAT_TOK ( term[expr, expr2] |) | CHECK_SAT_ASSUMING_TOK ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK ) | GET_ASSERTIONS_TOK | GET_PROOF_TOK | GET_UNSAT_ASSUMPTIONS_TOK | GET_UNSAT_CORE_TOK | GET_DIFFICULTY_TOK | PUSH_TOK (k= INTEGER_LITERAL |) | POP_TOK (k= INTEGER_LITERAL |) | EXIT_TOK | smt25Command[cmd] | extendedCommand[cmd] | SIMPLE_SYMBOL );
2399
 */
2400
static void
2401
205760
command(pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd)
2402
{
2403
2404
411520
      std::string name;
2405
411520
      std::vector<std::string> names;
2406
411520
      cvc5::api::Term expr, expr2;
2407
411520
      cvc5::api::Sort t;
2408
411520
      std::vector<cvc5::api::Term> terms;
2409
411520
      std::vector<api::Sort> sorts;
2410
411520
      std::vector<std::pair<std::string, cvc5::api::Sort> > sortedVarNames;
2411
411520
      std::vector<cvc5::api::Term> flattenVars;
2412
2413
    pANTLR3_COMMON_TOKEN    n;
2414
    pANTLR3_COMMON_TOKEN    k;
2415
    pANTLR3_COMMON_TOKEN    KEYWORD1;
2416
    pANTLR3_COMMON_TOKEN    KEYWORD2;
2417
    pANTLR3_COMMON_TOKEN    SIMPLE_SYMBOL3;
2418
2419
    /* Initialize rule variables
2420
     */
2421
2422
205760
    n       = NULL;
2423
205760
    k       = NULL;
2424
205760
    KEYWORD1       = NULL;
2425
205760
    KEYWORD2       = NULL;
2426
205760
    SIMPLE_SYMBOL3       = NULL;
2427
2428
    {
2429
        {
2430
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:212:3: ( SET_LOGIC_TOK symbol[name,CHECK_NONE,SYM_SORT] | SET_INFO_TOK setInfoInternal[cmd] | GET_INFO_TOK KEYWORD | SET_OPTION_TOK setOptionInternal[cmd] | GET_OPTION_TOK KEYWORD | DECLARE_SORT_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL | DEFINE_SORT_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] LPAREN_TOK symbolList[names,CHECK_NONE,SYM_SORT] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] | DECLARE_FUN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] LPAREN_TOK sortList[sorts] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] | DEFINE_FUN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] term[expr, expr2] | DECLARE_DATATYPE_TOK datatypeDefCommand[false, cmd] | DECLARE_DATATYPES_TOK datatypesDefCommand[false, cmd] | GET_VALUE_TOK ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK ) | GET_ASSIGNMENT_TOK | ASSERT_TOK term[expr, expr2] | CHECK_SAT_TOK ( term[expr, expr2] |) | CHECK_SAT_ASSUMING_TOK ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK ) | GET_ASSERTIONS_TOK | GET_PROOF_TOK | GET_UNSAT_ASSUMPTIONS_TOK | GET_UNSAT_CORE_TOK | GET_DIFFICULTY_TOK | PUSH_TOK (k= INTEGER_LITERAL |) | POP_TOK (k= INTEGER_LITERAL |) | EXIT_TOK | smt25Command[cmd] | extendedCommand[cmd] | SIMPLE_SYMBOL )
2431
2432
            ANTLR3_UINT32 alt9;
2433
2434
205760
            alt9=27;
2435
2436
205760
            switch ( LA(1) )
2437
            {
2438
3866
            case SET_LOGIC_TOK:
2439
            	{
2440
3866
            		alt9=1;
2441
            	}
2442
3866
                break;
2443
3367
            case SET_INFO_TOK:
2444
            	{
2445
3367
            		alt9=2;
2446
            	}
2447
3367
                break;
2448
18
            case GET_INFO_TOK:
2449
            	{
2450
18
            		alt9=3;
2451
            	}
2452
18
                break;
2453
1675
            case SET_OPTION_TOK:
2454
            	{
2455
1675
            		alt9=4;
2456
            	}
2457
1675
                break;
2458
41
            case GET_OPTION_TOK:
2459
            	{
2460
41
            		alt9=5;
2461
            	}
2462
41
                break;
2463
1596
            case DECLARE_SORT_TOK:
2464
            	{
2465
1596
            		alt9=6;
2466
            	}
2467
1596
                break;
2468
124
            case DEFINE_SORT_TOK:
2469
            	{
2470
124
            		alt9=7;
2471
            	}
2472
124
                break;
2473
132390
            case DECLARE_FUN_TOK:
2474
            	{
2475
132390
            		alt9=8;
2476
            	}
2477
132390
                break;
2478
1375
            case DEFINE_FUN_TOK:
2479
            	{
2480
1375
            		alt9=9;
2481
            	}
2482
1375
                break;
2483
109
            case DECLARE_DATATYPE_TOK:
2484
            	{
2485
109
            		alt9=10;
2486
            	}
2487
109
                break;
2488
542
            case DECLARE_DATATYPES_TOK:
2489
            	{
2490
542
            		alt9=11;
2491
            	}
2492
542
                break;
2493
64
            case GET_VALUE_TOK:
2494
            	{
2495
64
            		alt9=12;
2496
            	}
2497
64
                break;
2498
10
            case GET_ASSIGNMENT_TOK:
2499
            	{
2500
10
            		alt9=13;
2501
            	}
2502
10
                break;
2503
48892
            case ASSERT_TOK:
2504
            	{
2505
48892
            		alt9=14;
2506
            	}
2507
48892
                break;
2508
5462
            case CHECK_SAT_TOK:
2509
            	{
2510
5462
            		alt9=15;
2511
            	}
2512
5462
                break;
2513
815
            case CHECK_SAT_ASSUMING_TOK:
2514
            	{
2515
815
            		alt9=16;
2516
            	}
2517
815
                break;
2518
            case GET_ASSERTIONS_TOK:
2519
            	{
2520
            		alt9=17;
2521
            	}
2522
                break;
2523
1
            case GET_PROOF_TOK:
2524
            	{
2525
1
            		alt9=18;
2526
            	}
2527
1
                break;
2528
5
            case GET_UNSAT_ASSUMPTIONS_TOK:
2529
            	{
2530
5
            		alt9=19;
2531
            	}
2532
5
                break;
2533
6
            case GET_UNSAT_CORE_TOK:
2534
            	{
2535
6
            		alt9=20;
2536
            	}
2537
6
                break;
2538
            case GET_DIFFICULTY_TOK:
2539
            	{
2540
            		alt9=21;
2541
            	}
2542
                break;
2543
1862
            case PUSH_TOK:
2544
            	{
2545
1862
            		alt9=22;
2546
            	}
2547
1862
                break;
2548
1499
            case POP_TOK:
2549
            	{
2550
1499
            		alt9=23;
2551
            	}
2552
1499
                break;
2553
425
            case EXIT_TOK:
2554
            	{
2555
425
            		alt9=24;
2556
            	}
2557
425
                break;
2558
1503
            case DECLARE_CONST_TOK:
2559
            case DEFINE_FUNS_REC_TOK:
2560
            case DEFINE_FUN_REC_TOK:
2561
            case ECHO_TOK:
2562
            case GET_MODEL_TOK:
2563
            case RESET_ASSERTIONS_TOK:
2564
            case RESET_TOK:
2565
            	{
2566
1503
            		alt9=25;
2567
            	}
2568
1503
                break;
2569
113
            case BLOCK_MODEL_TOK:
2570
            case BLOCK_MODEL_VALUES_TOK:
2571
            case DECLARE_CODATATYPES_TOK:
2572
            case DECLARE_CODATATYPE_TOK:
2573
            case DECLARE_FUNS_TOK:
2574
            case DECLARE_HEAP:
2575
            case DECLARE_POOL:
2576
            case DECLARE_PREDS_TOK:
2577
            case DECLARE_SORTS_TOK:
2578
            case DEFINE_CONST_TOK:
2579
            case DEFINE_TOK:
2580
            case GET_ABDUCT_TOK:
2581
            case GET_INTERPOL_TOK:
2582
            case GET_QE_DISJUNCT_TOK:
2583
            case GET_QE_TOK:
2584
            case SIMPLIFY_TOK:
2585
            	{
2586
113
            		alt9=26;
2587
            	}
2588
113
                break;
2589
            case SIMPLE_SYMBOL:
2590
            	{
2591
            		alt9=27;
2592
            	}
2593
                break;
2594
2595
            default:
2596
                CONSTRUCTEX();
2597
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
2598
                EXCEPTION->message      = (void *)"";
2599
                EXCEPTION->decisionNum  = 9;
2600
                EXCEPTION->state        = 0;
2601
2602
2603
                goto rulecommandEx;
2604
2605
            }
2606
2607
205760
            switch (alt9)
2608
            {
2609
3866
        	case 1:
2610
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:213:5: SET_LOGIC_TOK symbol[name,CHECK_NONE,SYM_SORT]
2611
        	    {
2612
3866
        	         MATCHT(SET_LOGIC_TOK, &FOLLOW_SET_LOGIC_TOK_in_command260);
2613
3866
        	        if  (HASEXCEPTION())
2614
        	        {
2615
        	            goto rulecommandEx;
2616
        	        }
2617
2618
2619
3866
        	        FOLLOWPUSH(FOLLOW_symbol_in_command262);
2620
3866
        	        symbol(ctx, name, CHECK_NONE, SYM_SORT);
2621
2622
3866
        	        FOLLOWPOP();
2623
3866
        	        if  (HASEXCEPTION())
2624
        	        {
2625
        	            goto rulecommandEx;
2626
        	        }
2627
2628
2629
        	        {
2630
2631
3867
        	                  cmd->reset(PARSER_STATE->setLogic(name));
2632
2633
        	        }
2634
2635
2636
        	    }
2637
3865
        	    break;
2638
3367
        	case 2:
2639
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:218:5: SET_INFO_TOK setInfoInternal[cmd]
2640
        	    {
2641
3367
        	         MATCHT(SET_INFO_TOK, &FOLLOW_SET_INFO_TOK_in_command281);
2642
3367
        	        if  (HASEXCEPTION())
2643
        	        {
2644
        	            goto rulecommandEx;
2645
        	        }
2646
2647
2648
3367
        	        FOLLOWPUSH(FOLLOW_setInfoInternal_in_command283);
2649
3367
        	        setInfoInternal(ctx, cmd);
2650
2651
3367
        	        FOLLOWPOP();
2652
3367
        	        if  (HASEXCEPTION())
2653
        	        {
2654
        	            goto rulecommandEx;
2655
        	        }
2656
2657
2658
        	    }
2659
3367
        	    break;
2660
18
        	case 3:
2661
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:220:5: GET_INFO_TOK KEYWORD
2662
        	    {
2663
18
        	         MATCHT(GET_INFO_TOK, &FOLLOW_GET_INFO_TOK_in_command296);
2664
18
        	        if  (HASEXCEPTION())
2665
        	        {
2666
        	            goto rulecommandEx;
2667
        	        }
2668
2669
2670
18
        	        KEYWORD1 = (pANTLR3_COMMON_TOKEN) MATCHT(KEYWORD, &FOLLOW_KEYWORD_in_command298);
2671
18
        	        if  (HASEXCEPTION())
2672
        	        {
2673
        	            goto rulecommandEx;
2674
        	        }
2675
2676
2677
        	        {
2678
72
        	             cmd->reset(new GetInfoCommand(
2679
54
        	                      AntlrInput::tokenText(KEYWORD1).c_str() + 1));
2680
2681
        	        }
2682
2683
2684
        	    }
2685
18
        	    break;
2686
1675
        	case 4:
2687
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:225:5: SET_OPTION_TOK setOptionInternal[cmd]
2688
        	    {
2689
1675
        	         MATCHT(SET_OPTION_TOK, &FOLLOW_SET_OPTION_TOK_in_command316);
2690
1675
        	        if  (HASEXCEPTION())
2691
        	        {
2692
        	            goto rulecommandEx;
2693
        	        }
2694
2695
2696
1675
        	        FOLLOWPUSH(FOLLOW_setOptionInternal_in_command318);
2697
1675
        	        setOptionInternal(ctx, cmd);
2698
2699
1675
        	        FOLLOWPOP();
2700
1675
        	        if  (HASEXCEPTION())
2701
        	        {
2702
        	            goto rulecommandEx;
2703
        	        }
2704
2705
2706
        	    }
2707
1675
        	    break;
2708
41
        	case 5:
2709
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:227:5: GET_OPTION_TOK KEYWORD
2710
        	    {
2711
41
        	         MATCHT(GET_OPTION_TOK, &FOLLOW_GET_OPTION_TOK_in_command331);
2712
41
        	        if  (HASEXCEPTION())
2713
        	        {
2714
        	            goto rulecommandEx;
2715
        	        }
2716
2717
2718
41
        	        KEYWORD2 = (pANTLR3_COMMON_TOKEN) MATCHT(KEYWORD, &FOLLOW_KEYWORD_in_command333);
2719
41
        	        if  (HASEXCEPTION())
2720
        	        {
2721
        	            goto rulecommandEx;
2722
        	        }
2723
2724
2725
        	        {
2726
164
        	             cmd->reset(new GetOptionCommand(
2727
123
        	                      AntlrInput::tokenText(KEYWORD2).c_str() + 1));
2728
2729
        	        }
2730
2731
2732
        	    }
2733
41
        	    break;
2734
1596
        	case 6:
2735
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:232:5: DECLARE_SORT_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL
2736
        	    {
2737
1596
        	         MATCHT(DECLARE_SORT_TOK, &FOLLOW_DECLARE_SORT_TOK_in_command351);
2738
1596
        	        if  (HASEXCEPTION())
2739
        	        {
2740
        	            goto rulecommandEx;
2741
        	        }
2742
2743
2744
        	        {
2745
2746
1596
        	                  PARSER_STATE->checkThatLogicIsSet();
2747
1596
        	                  PARSER_STATE->checkLogicAllowsFreeSorts();
2748
2749
        	        }
2750
2751
2752
1596
        	        FOLLOWPUSH(FOLLOW_symbol_in_command363);
2753
1596
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_SORT);
2754
2755
1594
        	        FOLLOWPOP();
2756
1594
        	        if  (HASEXCEPTION())
2757
        	        {
2758
        	            goto rulecommandEx;
2759
        	        }
2760
2761
2762
        	        {
2763
1594
        	             PARSER_STATE->checkUserSymbol(name);
2764
        	        }
2765
2766
2767
1594
        	        n = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_command378);
2768
1594
        	        if  (HASEXCEPTION())
2769
        	        {
2770
2
        	            goto rulecommandEx;
2771
        	        }
2772
2773
2774
        	        {
2775
3184
        	             Debug("parser") << "declare sort: '" << name
2776
1592
        	                                  << "' arity=" << n << std::endl;
2777
1592
        	                  unsigned arity = AntlrInput::tokenToUnsigned(n);
2778
1592
        	                  if(arity == 0) {
2779
3160
        	                    api::Sort type = PARSER_STATE->mkSort(name);
2780
1580
        	                    cmd->reset(new DeclareSortCommand(name, 0, type));
2781
        	                  } else {
2782
24
        	                    api::Sort type = PARSER_STATE->mkSortConstructor(name, arity);
2783
12
        	                    cmd->reset(new DeclareSortCommand(name, arity, type));
2784
        	                  }
2785
2786
        	        }
2787
2788
2789
        	    }
2790
1592
        	    break;
2791
124
        	case 7:
2792
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:252:5: DEFINE_SORT_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] LPAREN_TOK symbolList[names,CHECK_NONE,SYM_SORT] RPAREN_TOK sortSymbol[t,CHECK_DECLARED]
2793
        	    {
2794
124
        	         MATCHT(DEFINE_SORT_TOK, &FOLLOW_DEFINE_SORT_TOK_in_command396);
2795
124
        	        if  (HASEXCEPTION())
2796
        	        {
2797
        	            goto rulecommandEx;
2798
        	        }
2799
2800
2801
        	        {
2802
124
        	             PARSER_STATE->checkThatLogicIsSet();
2803
        	        }
2804
2805
2806
124
        	        FOLLOWPUSH(FOLLOW_symbol_in_command404);
2807
124
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_SORT);
2808
2809
124
        	        FOLLOWPOP();
2810
124
        	        if  (HASEXCEPTION())
2811
        	        {
2812
        	            goto rulecommandEx;
2813
        	        }
2814
2815
2816
        	        {
2817
124
        	             PARSER_STATE->checkUserSymbol(name);
2818
        	        }
2819
2820
2821
124
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_command417);
2822
124
        	        if  (HASEXCEPTION())
2823
        	        {
2824
        	            goto rulecommandEx;
2825
        	        }
2826
2827
2828
124
        	        FOLLOWPUSH(FOLLOW_symbolList_in_command419);
2829
124
        	        symbolList(ctx, names, CHECK_NONE, SYM_SORT);
2830
2831
124
        	        FOLLOWPOP();
2832
124
        	        if  (HASEXCEPTION())
2833
        	        {
2834
        	            goto rulecommandEx;
2835
        	        }
2836
2837
2838
124
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_command422);
2839
124
        	        if  (HASEXCEPTION())
2840
        	        {
2841
        	            goto rulecommandEx;
2842
        	        }
2843
2844
2845
        	        {
2846
124
        	             PARSER_STATE->pushScope();
2847
126
        	                  for(std::vector<std::string>::const_iterator i = names.begin(),
2848
124
        	                        iend = names.end();
2849
126
        	                      i != iend;
2850
        	                      ++i) {
2851
2
        	                    sorts.push_back(PARSER_STATE->mkSort(*i));
2852
        	                  }
2853
2854
        	        }
2855
2856
2857
124
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_command434);
2858
124
        	        sortSymbol(ctx, t, CHECK_DECLARED);
2859
2860
124
        	        FOLLOWPOP();
2861
124
        	        if  (HASEXCEPTION())
2862
        	        {
2863
        	            goto rulecommandEx;
2864
        	        }
2865
2866
2867
        	        {
2868
124
        	             PARSER_STATE->popScope();
2869
        	                  // Do NOT call mkSort, since that creates a new sort!
2870
        	                  // This name is not its own distinct sort, it's an alias.
2871
124
        	                  PARSER_STATE->defineParameterizedType(name, sorts, t);
2872
124
        	                  cmd->reset(new DefineSortCommand(name, sorts, t));
2873
2874
        	        }
2875
2876
2877
        	    }
2878
124
        	    break;
2879
132390
        	case 8:
2880
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:272:5: DECLARE_FUN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] LPAREN_TOK sortList[sorts] RPAREN_TOK sortSymbol[t,CHECK_DECLARED]
2881
        	    {
2882
132390
        	         MATCHT(DECLARE_FUN_TOK, &FOLLOW_DECLARE_FUN_TOK_in_command453);
2883
132390
        	        if  (HASEXCEPTION())
2884
        	        {
2885
        	            goto rulecommandEx;
2886
        	        }
2887
2888
2889
        	        {
2890
132390
        	             PARSER_STATE->checkThatLogicIsSet();
2891
        	        }
2892
2893
2894
132388
        	        FOLLOWPUSH(FOLLOW_symbol_in_command461);
2895
132388
        	        symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
2896
2897
132388
        	        FOLLOWPOP();
2898
132388
        	        if  (HASEXCEPTION())
2899
        	        {
2900
        	            goto rulecommandEx;
2901
        	        }
2902
2903
2904
        	        {
2905
132388
        	             PARSER_STATE->checkUserSymbol(name);
2906
        	        }
2907
2908
2909
132386
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_command474);
2910
132386
        	        if  (HASEXCEPTION())
2911
        	        {
2912
2
        	            goto rulecommandEx;
2913
        	        }
2914
2915
2916
132384
        	        FOLLOWPUSH(FOLLOW_sortList_in_command476);
2917
132384
        	        sortList(ctx, sorts);
2918
2919
132383
        	        FOLLOWPOP();
2920
132383
        	        if  (HASEXCEPTION())
2921
        	        {
2922
        	            goto rulecommandEx;
2923
        	        }
2924
2925
2926
132383
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_command479);
2927
132383
        	        if  (HASEXCEPTION())
2928
        	        {
2929
        	            goto rulecommandEx;
2930
        	        }
2931
2932
2933
132383
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_command485);
2934
132383
        	        sortSymbol(ctx, t, CHECK_DECLARED);
2935
2936
132382
        	        FOLLOWPOP();
2937
132382
        	        if  (HASEXCEPTION())
2938
        	        {
2939
        	            goto rulecommandEx;
2940
        	        }
2941
2942
2943
        	        {
2944
132382
        	             Debug("parser") << "declare fun: '" << name << "'" << std::endl;
2945
132382
        	                  if( !sorts.empty() ) {
2946
6349
        	                    t = PARSER_STATE->mkFlatFunctionType(sorts, t);
2947
        	                  }
2948
132382
        	                  if(t.isFunction())
2949
        	                  {
2950
6354
        	                    PARSER_STATE->checkLogicAllowsFunctions();
2951
        	                  }
2952
        	                  // we allow overloading for function declarations
2953
132382
        	                  if( PARSER_STATE->sygus() )
2954
        	                  {
2955
        	                    PARSER_STATE->parseErrorLogic("declare-fun are not allowed in sygus "
2956
        	                                                  "version 2.0");
2957
        	                  }
2958
        	                  else
2959
        	                  {
2960
        	                    api::Term func =
2961
264764
        	                        PARSER_STATE->bindVar(name, t, false, true);
2962
132382
        	                    cmd->reset(new DeclareFunctionCommand(name, func, t));
2963
        	                  }
2964
2965
        	        }
2966
2967
2968
        	    }
2969
132382
        	    break;
2970
1375
        	case 9:
2971
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:299:5: DEFINE_FUN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] term[expr, expr2]
2972
        	    {
2973
1375
        	         MATCHT(DEFINE_FUN_TOK, &FOLLOW_DEFINE_FUN_TOK_in_command504);
2974
1375
        	        if  (HASEXCEPTION())
2975
        	        {
2976
        	            goto rulecommandEx;
2977
        	        }
2978
2979
2980
        	        {
2981
1375
        	             PARSER_STATE->checkThatLogicIsSet();
2982
        	        }
2983
2984
2985
1375
        	        FOLLOWPUSH(FOLLOW_symbol_in_command512);
2986
1375
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
2987
2988
1375
        	        FOLLOWPOP();
2989
1375
        	        if  (HASEXCEPTION())
2990
        	        {
2991
        	            goto rulecommandEx;
2992
        	        }
2993
2994
2995
        	        {
2996
1375
        	             PARSER_STATE->checkUserSymbol(name);
2997
        	        }
2998
2999
3000
1375
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_command525);
3001
1375
        	        if  (HASEXCEPTION())
3002
        	        {
3003
        	            goto rulecommandEx;
3004
        	        }
3005
3006
3007
1375
        	        FOLLOWPUSH(FOLLOW_sortedVarList_in_command527);
3008
1375
        	        sortedVarList(ctx, sortedVarNames);
3009
3010
1375
        	        FOLLOWPOP();
3011
1375
        	        if  (HASEXCEPTION())
3012
        	        {
3013
        	            goto rulecommandEx;
3014
        	        }
3015
3016
3017
1375
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_command530);
3018
1375
        	        if  (HASEXCEPTION())
3019
        	        {
3020
        	            goto rulecommandEx;
3021
        	        }
3022
3023
3024
1375
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_command536);
3025
1375
        	        sortSymbol(ctx, t, CHECK_DECLARED);
3026
3027
1375
        	        FOLLOWPOP();
3028
1375
        	        if  (HASEXCEPTION())
3029
        	        {
3030
        	            goto rulecommandEx;
3031
        	        }
3032
3033
3034
        	        {
3035
        	             /* add variables to parser state before parsing term */
3036
1375
        	                  Debug("parser") << "define fun: '" << name << "'" << std::endl;
3037
1375
        	                  if( sortedVarNames.size() > 0 ) {
3038
741
        	                    sorts.reserve(sortedVarNames.size());
3039
2222
        	                    for(std::vector<std::pair<std::string, api::Sort> >::const_iterator i =
3040
741
        	                          sortedVarNames.begin(), iend = sortedVarNames.end();
3041
2963
        	                        i != iend;
3042
        	                        ++i) {
3043
2222
        	                      sorts.push_back((*i).second);
3044
        	                    }
3045
        	                  }
3046
3047
1375
        	                  t = PARSER_STATE->mkFlatFunctionType(sorts, t, flattenVars);
3048
1375
        	                  if (sortedVarNames.size() > 0)
3049
        	                  {
3050
741
        	                    PARSER_STATE->pushScope();
3051
        	                  }
3052
1375
        	                  terms = PARSER_STATE->bindBoundVars(sortedVarNames);
3053
3054
        	        }
3055
3056
3057
1375
        	        FOLLOWPUSH(FOLLOW_term_in_command549);
3058
1375
        	        term(ctx, expr, expr2);
3059
3060
1374
        	        FOLLOWPOP();
3061
1374
        	        if  (HASEXCEPTION())
3062
        	        {
3063
        	            goto rulecommandEx;
3064
        	        }
3065
3066
3067
        	        {
3068
3069
1374
        	                  if( !flattenVars.empty() ){
3070
        	                    // if this function has any implicit variables flattenVars,
3071
        	                    // we apply the body of the definition to the flatten vars
3072
1
        	                    expr = PARSER_STATE->mkHoApply(expr, flattenVars);
3073
1
        	                    terms.insert(terms.end(), flattenVars.begin(), flattenVars.end());
3074
        	                  }
3075
1374
        	                  if (sortedVarNames.size() > 0)
3076
        	                  {
3077
740
        	                    PARSER_STATE->popScope();
3078
        	                  }
3079
        	                  // declare the name down here (while parsing term, signature
3080
        	                  // must not be extended with the name itself; no recursion
3081
        	                  // permitted)
3082
        	                  // we allow overloading for function definitions
3083
2748
        	                  api::Term func = PARSER_STATE->bindVar(name, t, false, true);
3084
2748
        	                  cmd->reset(new DefineFunctionCommand(
3085
1374
        	                      name, func, terms, expr, SYM_MAN->getGlobalDeclarations()));
3086
3087
1374
        	        }
3088
3089
3090
        	    }
3091
1374
        	    break;
3092
109
        	case 10:
3093
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:343:5: DECLARE_DATATYPE_TOK datatypeDefCommand[false, cmd]
3094
        	    {
3095
109
        	         MATCHT(DECLARE_DATATYPE_TOK, &FOLLOW_DECLARE_DATATYPE_TOK_in_command562);
3096
109
        	        if  (HASEXCEPTION())
3097
        	        {
3098
        	            goto rulecommandEx;
3099
        	        }
3100
3101
3102
109
        	        FOLLOWPUSH(FOLLOW_datatypeDefCommand_in_command564);
3103
109
        	        datatypeDefCommand(ctx, false, cmd);
3104
3105
109
        	        FOLLOWPOP();
3106
109
        	        if  (HASEXCEPTION())
3107
        	        {
3108
        	            goto rulecommandEx;
3109
        	        }
3110
3111
3112
        	    }
3113
109
        	    break;
3114
542
        	case 11:
3115
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:344:5: DECLARE_DATATYPES_TOK datatypesDefCommand[false, cmd]
3116
        	    {
3117
542
        	         MATCHT(DECLARE_DATATYPES_TOK, &FOLLOW_DECLARE_DATATYPES_TOK_in_command571);
3118
542
        	        if  (HASEXCEPTION())
3119
        	        {
3120
        	            goto rulecommandEx;
3121
        	        }
3122
3123
3124
542
        	        FOLLOWPUSH(FOLLOW_datatypesDefCommand_in_command573);
3125
542
        	        datatypesDefCommand(ctx, false, cmd);
3126
3127
542
        	        FOLLOWPOP();
3128
542
        	        if  (HASEXCEPTION())
3129
        	        {
3130
        	            goto rulecommandEx;
3131
        	        }
3132
3133
3134
        	    }
3135
542
        	    break;
3136
64
        	case 12:
3137
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:346:5: GET_VALUE_TOK ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK )
3138
        	    {
3139
64
        	         MATCHT(GET_VALUE_TOK, &FOLLOW_GET_VALUE_TOK_in_command586);
3140
64
        	        if  (HASEXCEPTION())
3141
        	        {
3142
        	            goto rulecommandEx;
3143
        	        }
3144
3145
3146
        	        {
3147
64
        	             PARSER_STATE->checkThatLogicIsSet();
3148
        	        }
3149
3150
3151
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:347:5: ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK )
3152
        	        {
3153
64
        	            int alt4=2;
3154
64
        	            switch ( LA(1) )
3155
        	            {
3156
64
        	            case LPAREN_TOK:
3157
        	            	{
3158
64
        	            		alt4=1;
3159
        	            	}
3160
64
        	                break;
3161
        	            case ALPHA:
3162
        	            case ASSERT_TOK:
3163
        	            case ASSUME_TOK:
3164
        	            case AS_TOK:
3165
        	            case ATTRIBUTE_INST_ADD_TO_POOL_TOK:
3166
        	            case ATTRIBUTE_INST_LEVEL:
3167
        	            case ATTRIBUTE_NAMED_TOK:
3168
        	            case ATTRIBUTE_NO_PATTERN_TOK:
3169
        	            case ATTRIBUTE_PATTERN_TOK:
3170
        	            case ATTRIBUTE_POOL_TOK:
3171
        	            case ATTRIBUTE_QUANTIFIER_ID_TOK:
3172
        	            case ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK:
3173
        	            case ATTRIBUTE_TOK:
3174
        	            case BINARY_LITERAL:
3175
        	            case BLOCK_MODEL_TOK:
3176
        	            case BLOCK_MODEL_VALUES_TOK:
3177
        	            case CHAR_TOK:
3178
        	            case CHECK_SAT_ASSUMING_TOK:
3179
        	            case CHECK_SAT_TOK:
3180
        	            case CHECK_SYNTH_TOK:
3181
        	            case COMMENT:
3182
        	            case COMPREHENSION_TOK:
3183
        	            case CONSTRAINT_TOK:
3184
        	            case CONST_TOK:
3185
        	            case DECIMAL_LITERAL:
3186
        	            case DECLARE_CODATATYPES_2_5_TOK:
3187
        	            case DECLARE_CODATATYPES_TOK:
3188
        	            case DECLARE_CODATATYPE_TOK:
3189
        	            case DECLARE_CONST_TOK:
3190
        	            case DECLARE_DATATYPES_2_5_TOK:
3191
        	            case DECLARE_DATATYPES_TOK:
3192
        	            case DECLARE_DATATYPE_TOK:
3193
        	            case DECLARE_FUNS_TOK:
3194
        	            case DECLARE_FUN_TOK:
3195
        	            case DECLARE_HEAP:
3196
        	            case DECLARE_POOL:
3197
        	            case DECLARE_PREDS_TOK:
3198
        	            case DECLARE_SORTS_TOK:
3199
        	            case DECLARE_SORT_TOK:
3200
        	            case DECLARE_VAR_TOK:
3201
        	            case DEFINE_CONST_TOK:
3202
        	            case DEFINE_FUNS_REC_TOK:
3203
        	            case DEFINE_FUN_REC_TOK:
3204
        	            case DEFINE_FUN_TOK:
3205
        	            case DEFINE_SORT_TOK:
3206
        	            case DEFINE_TOK:
3207
        	            case DIGIT:
3208
        	            case ECHO_TOK:
3209
        	            case EMP_TOK:
3210
        	            case EXISTS_TOK:
3211
        	            case EXIT_TOK:
3212
        	            case FORALL_TOK:
3213
        	            case GET_ABDUCT_TOK:
3214
        	            case GET_ASSERTIONS_TOK:
3215
        	            case GET_ASSIGNMENT_TOK:
3216
        	            case GET_DIFFICULTY_TOK:
3217
        	            case GET_INFO_TOK:
3218
        	            case GET_INTERPOL_TOK:
3219
        	            case GET_MODEL_TOK:
3220
        	            case GET_OPTION_TOK:
3221
        	            case GET_PROOF_TOK:
3222
        	            case GET_QE_DISJUNCT_TOK:
3223
        	            case GET_QE_TOK:
3224
        	            case GET_UNSAT_ASSUMPTIONS_TOK:
3225
        	            case GET_UNSAT_CORE_TOK:
3226
        	            case GET_VALUE_TOK:
3227
        	            case HEX_DIGIT:
3228
        	            case HEX_LITERAL:
3229
        	            case HO_ARROW_TOK:
3230
        	            case HO_LAMBDA_TOK:
3231
        	            case INCLUDE_TOK:
3232
        	            case INDEX_TOK:
3233
        	            case INTEGER_LITERAL:
3234
        	            case INV_CONSTRAINT_TOK:
3235
        	            case KEYWORD:
3236
        	            case LET_TOK:
3237
        	            case MATCH_TOK:
3238
        	            case NUMERAL:
3239
        	            case PAR_TOK:
3240
        	            case POP_TOK:
3241
        	            case PUSH_TOK:
3242
        	            case QUOTED_SYMBOL:
3243
        	            case RESET_ASSERTIONS_TOK:
3244
        	            case RESET_TOK:
3245
        	            case RPAREN_TOK:
3246
        	            case SET_FEATURE_TOK:
3247
        	            case SET_INFO_TOK:
3248
        	            case SET_LOGIC_TOK:
3249
        	            case SET_OPTION_TOK:
3250
        	            case SIMPLE_SYMBOL:
3251
        	            case SIMPLIFY_TOK:
3252
        	            case STRING_LITERAL:
3253
        	            case SYGUS_CONSTANT_TOK:
3254
        	            case SYGUS_VARIABLE_TOK:
3255
        	            case SYMBOL_CHAR:
3256
        	            case SYMBOL_CHAR_NOUNDERSCORE_NOATTRIBUTE:
3257
        	            case SYNTH_FUN_TOK:
3258
        	            case SYNTH_INV_TOK:
3259
        	            case TESTER_TOK:
3260
        	            case TUPLE_CONST_TOK:
3261
        	            case TUPLE_PROJECT_TOK:
3262
        	            case TUPLE_SEL_TOK:
3263
        	            case UNTERMINATED_QUOTED_SYMBOL:
3264
        	            case UPDATE_TOK:
3265
        	            case WHITESPACE:
3266
        	            case 110:
3267
        	            	{
3268
        	            		alt4=2;
3269
        	            	}
3270
        	                break;
3271
3272
        	            default:
3273
        	                CONSTRUCTEX();
3274
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
3275
        	                EXCEPTION->message      = (void *)"";
3276
        	                EXCEPTION->decisionNum  = 4;
3277
        	                EXCEPTION->state        = 0;
3278
3279
3280
        	                goto rulecommandEx;
3281
3282
        	            }
3283
3284
64
        	            switch (alt4)
3285
        	            {
3286
64
        	        	case 1:
3287
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:347:7: LPAREN_TOK termList[terms,expr] RPAREN_TOK
3288
        	        	    {
3289
64
        	        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_command596);
3290
64
        	        	        if  (HASEXCEPTION())
3291
        	        	        {
3292
        	        	            goto rulecommandEx;
3293
        	        	        }
3294
3295
3296
64
        	        	        FOLLOWPUSH(FOLLOW_termList_in_command598);
3297
64
        	        	        termList(ctx, terms, expr);
3298
3299
64
        	        	        FOLLOWPOP();
3300
64
        	        	        if  (HASEXCEPTION())
3301
        	        	        {
3302
        	        	            goto rulecommandEx;
3303
        	        	        }
3304
3305
3306
64
        	        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_command601);
3307
64
        	        	        if  (HASEXCEPTION())
3308
        	        	        {
3309
        	        	            goto rulecommandEx;
3310
        	        	        }
3311
3312
3313
        	        	        {
3314
64
        	        	             cmd->reset(new GetValueCommand(terms));
3315
        	        	        }
3316
3317
3318
        	        	    }
3319
64
        	        	    break;
3320
        	        	case 2:
3321
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:349:7: ~ LPAREN_TOK
3322
        	        	    {
3323
        	        	        if ( ((LA(1) >= ALPHA) && (LA(1) <= LET_TOK)) || ((LA(1) >= MATCH_TOK) && (LA(1) <= 110)) )
3324
        	        	        {
3325
        	        	            CONSUME();
3326
        	        	            PERRORRECOVERY=ANTLR3_FALSE;
3327
        	        	        }
3328
        	        	        else
3329
        	        	        {
3330
        	        	            CONSTRUCTEX();
3331
        	        	            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
3332
        	        	            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
3333
        	        	            EXCEPTION->expectingSet = NULL;
3334
3335
        	        	            goto rulecommandEx;
3336
        	        	        }
3337
3338
3339
        	        	        {
3340
        	        	             PARSER_STATE->parseError("The get-value command expects a list of "
3341
        	        	                                             "terms.  Perhaps you forgot a pair of "
3342
        	        	                                             "parentheses?");
3343
3344
        	        	        }
3345
3346
3347
        	        	    }
3348
        	        	    break;
3349
3350
        	            }
3351
        	        }
3352
3353
        	    }
3354
64
        	    break;
3355
10
        	case 13:
3356
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:356:5: GET_ASSIGNMENT_TOK
3357
        	    {
3358
10
        	         MATCHT(GET_ASSIGNMENT_TOK, &FOLLOW_GET_ASSIGNMENT_TOK_in_command644);
3359
10
        	        if  (HASEXCEPTION())
3360
        	        {
3361
        	            goto rulecommandEx;
3362
        	        }
3363
3364
3365
        	        {
3366
10
        	             PARSER_STATE->checkThatLogicIsSet();
3367
        	        }
3368
3369
3370
        	        {
3371
10
        	             cmd->reset(new GetAssignmentCommand());
3372
        	        }
3373
3374
3375
        	    }
3376
10
        	    break;
3377
48892
        	case 14:
3378
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:359:5: ASSERT_TOK term[expr, expr2]
3379
        	    {
3380
48892
        	         MATCHT(ASSERT_TOK, &FOLLOW_ASSERT_TOK_in_command664);
3381
48892
        	        if  (HASEXCEPTION())
3382
        	        {
3383
        	            goto rulecommandEx;
3384
        	        }
3385
3386
3387
        	        {
3388
48892
        	             PARSER_STATE->checkThatLogicIsSet();
3389
        	        }
3390
3391
3392
        	        {
3393
48890
        	             PARSER_STATE->clearLastNamedTerm();
3394
        	        }
3395
3396
3397
48890
        	        FOLLOWPUSH(FOLLOW_term_in_command678);
3398
48890
        	        term(ctx, expr, expr2);
3399
3400
48882
        	        FOLLOWPOP();
3401
48882
        	        if  (HASEXCEPTION())
3402
        	        {
3403
        	            goto rulecommandEx;
3404
        	        }
3405
3406
3407
        	        {
3408
48882
        	             cmd->reset(new AssertCommand(expr));
3409
48882
        	                  if (PARSER_STATE->lastNamedTerm().first == expr)
3410
        	                  {
3411
        	                    // set the expression name, if there was a named term
3412
        	                    std::pair<api::Term, std::string> namedTerm =
3413
3154
        	                        PARSER_STATE->lastNamedTerm();
3414
1577
        	                    SYM_MAN->setExpressionName(namedTerm.first, namedTerm.second, true);
3415
        	                  }
3416
3417
        	        }
3418
3419
3420
        	    }
3421
48882
        	    break;
3422
5462
        	case 15:
3423
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:372:5: CHECK_SAT_TOK ( term[expr, expr2] |)
3424
        	    {
3425
5462
        	         MATCHT(CHECK_SAT_TOK, &FOLLOW_CHECK_SAT_TOK_in_command697);
3426
5462
        	        if  (HASEXCEPTION())
3427
        	        {
3428
        	            goto rulecommandEx;
3429
        	        }
3430
3431
3432
        	        {
3433
5462
        	             PARSER_STATE->checkThatLogicIsSet();
3434
        	        }
3435
3436
3437
        	        {
3438
5462
        	             if( PARSER_STATE->sygus() ){
3439
        	                    PARSER_STATE->parseError("Sygus does not support check-sat command.");
3440
        	                  }
3441
3442
        	        }
3443
3444
3445
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:377:5: ( term[expr, expr2] |)
3446
        	        {
3447
5462
        	            int alt5=2;
3448
5462
        	            switch ( LA(1) )
3449
        	            {
3450
6
        	            case BINARY_LITERAL:
3451
        	            case DECIMAL_LITERAL:
3452
        	            case HEX_LITERAL:
3453
        	            case INTEGER_LITERAL:
3454
        	            case LPAREN_TOK:
3455
        	            case QUOTED_SYMBOL:
3456
        	            case SIMPLE_SYMBOL:
3457
        	            case STRING_LITERAL:
3458
        	            case TUPLE_CONST_TOK:
3459
        	            case UNTERMINATED_QUOTED_SYMBOL:
3460
        	            	{
3461
6
        	            		alt5=1;
3462
        	            	}
3463
6
        	                break;
3464
5456
        	            case RPAREN_TOK:
3465
        	            	{
3466
5456
        	            		alt5=2;
3467
        	            	}
3468
5456
        	                break;
3469
3470
        	            default:
3471
        	                CONSTRUCTEX();
3472
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
3473
        	                EXCEPTION->message      = (void *)"";
3474
        	                EXCEPTION->decisionNum  = 5;
3475
        	                EXCEPTION->state        = 0;
3476
3477
3478
        	                goto rulecommandEx;
3479
3480
        	            }
3481
3482
5462
        	            switch (alt5)
3483
        	            {
3484
6
        	        	case 1:
3485
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:377:7: term[expr, expr2]
3486
        	        	    {
3487
6
        	        	        FOLLOWPUSH(FOLLOW_term_in_command713);
3488
6
        	        	        term(ctx, expr, expr2);
3489
3490
6
        	        	        FOLLOWPOP();
3491
6
        	        	        if  (HASEXCEPTION())
3492
        	        	        {
3493
        	        	            goto rulecommandEx;
3494
        	        	        }
3495
3496
3497
        	        	        {
3498
6
        	        	             if(PARSER_STATE->strictModeEnabled()) {
3499
4
        	        	                      PARSER_STATE->parseError(
3500
        	        	                          "Extended commands (such as check-sat with an argument) are not "
3501
        	        	                          "permitted while operating in strict compliance mode.");
3502
        	        	                    }
3503
3504
        	        	        }
3505
3506
3507
        	        	    }
3508
4
        	        	    break;
3509
5456
        	        	case 2:
3510
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:384:7:
3511
        	        	    {
3512
        	        	        {
3513
5456
        	        	             expr = api::Term();
3514
        	        	        }
3515
3516
3517
        	        	    }
3518
5456
        	        	    break;
3519
3520
        	            }
3521
        	        }
3522
3523
        	        {
3524
5460
        	             cmd->reset(new CheckSatCommand(expr));
3525
        	        }
3526
3527
3528
        	    }
3529
5460
        	    break;
3530
815
        	case 16:
3531
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:388:5: CHECK_SAT_ASSUMING_TOK ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK )
3532
        	    {
3533
815
        	         MATCHT(CHECK_SAT_ASSUMING_TOK, &FOLLOW_CHECK_SAT_ASSUMING_TOK_in_command754);
3534
815
        	        if  (HASEXCEPTION())
3535
        	        {
3536
        	            goto rulecommandEx;
3537
        	        }
3538
3539
3540
        	        {
3541
815
        	             PARSER_STATE->checkThatLogicIsSet();
3542
        	        }
3543
3544
3545
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:389:5: ( LPAREN_TOK termList[terms,expr] RPAREN_TOK |~ LPAREN_TOK )
3546
        	        {
3547
815
        	            int alt6=2;
3548
815
        	            switch ( LA(1) )
3549
        	            {
3550
815
        	            case LPAREN_TOK:
3551
        	            	{
3552
815
        	            		alt6=1;
3553
        	            	}
3554
815
        	                break;
3555
        	            case ALPHA:
3556
        	            case ASSERT_TOK:
3557
        	            case ASSUME_TOK:
3558
        	            case AS_TOK:
3559
        	            case ATTRIBUTE_INST_ADD_TO_POOL_TOK:
3560
        	            case ATTRIBUTE_INST_LEVEL:
3561
        	            case ATTRIBUTE_NAMED_TOK:
3562
        	            case ATTRIBUTE_NO_PATTERN_TOK:
3563
        	            case ATTRIBUTE_PATTERN_TOK:
3564
        	            case ATTRIBUTE_POOL_TOK:
3565
        	            case ATTRIBUTE_QUANTIFIER_ID_TOK:
3566
        	            case ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK:
3567
        	            case ATTRIBUTE_TOK:
3568
        	            case BINARY_LITERAL:
3569
        	            case BLOCK_MODEL_TOK:
3570
        	            case BLOCK_MODEL_VALUES_TOK:
3571
        	            case CHAR_TOK:
3572
        	            case CHECK_SAT_ASSUMING_TOK:
3573
        	            case CHECK_SAT_TOK:
3574
        	            case CHECK_SYNTH_TOK:
3575
        	            case COMMENT:
3576
        	            case COMPREHENSION_TOK:
3577
        	            case CONSTRAINT_TOK:
3578
        	            case CONST_TOK:
3579
        	            case DECIMAL_LITERAL:
3580
        	            case DECLARE_CODATATYPES_2_5_TOK:
3581
        	            case DECLARE_CODATATYPES_TOK:
3582
        	            case DECLARE_CODATATYPE_TOK:
3583
        	            case DECLARE_CONST_TOK:
3584
        	            case DECLARE_DATATYPES_2_5_TOK:
3585
        	            case DECLARE_DATATYPES_TOK:
3586
        	            case DECLARE_DATATYPE_TOK:
3587
        	            case DECLARE_FUNS_TOK:
3588
        	            case DECLARE_FUN_TOK:
3589
        	            case DECLARE_HEAP:
3590
        	            case DECLARE_POOL:
3591
        	            case DECLARE_PREDS_TOK:
3592
        	            case DECLARE_SORTS_TOK:
3593
        	            case DECLARE_SORT_TOK:
3594
        	            case DECLARE_VAR_TOK:
3595
        	            case DEFINE_CONST_TOK:
3596
        	            case DEFINE_FUNS_REC_TOK:
3597
        	            case DEFINE_FUN_REC_TOK:
3598
        	            case DEFINE_FUN_TOK:
3599
        	            case DEFINE_SORT_TOK:
3600
        	            case DEFINE_TOK:
3601
        	            case DIGIT:
3602
        	            case ECHO_TOK:
3603
        	            case EMP_TOK:
3604
        	            case EXISTS_TOK:
3605
        	            case EXIT_TOK:
3606
        	            case FORALL_TOK:
3607
        	            case GET_ABDUCT_TOK:
3608
        	            case GET_ASSERTIONS_TOK:
3609
        	            case GET_ASSIGNMENT_TOK:
3610
        	            case GET_DIFFICULTY_TOK:
3611
        	            case GET_INFO_TOK:
3612
        	            case GET_INTERPOL_TOK:
3613
        	            case GET_MODEL_TOK:
3614
        	            case GET_OPTION_TOK:
3615
        	            case GET_PROOF_TOK:
3616
        	            case GET_QE_DISJUNCT_TOK:
3617
        	            case GET_QE_TOK:
3618
        	            case GET_UNSAT_ASSUMPTIONS_TOK:
3619
        	            case GET_UNSAT_CORE_TOK:
3620
        	            case GET_VALUE_TOK:
3621
        	            case HEX_DIGIT:
3622
        	            case HEX_LITERAL:
3623
        	            case HO_ARROW_TOK:
3624
        	            case HO_LAMBDA_TOK:
3625
        	            case INCLUDE_TOK:
3626
        	            case INDEX_TOK:
3627
        	            case INTEGER_LITERAL:
3628
        	            case INV_CONSTRAINT_TOK:
3629
        	            case KEYWORD:
3630
        	            case LET_TOK:
3631
        	            case MATCH_TOK:
3632
        	            case NUMERAL:
3633
        	            case PAR_TOK:
3634
        	            case POP_TOK:
3635
        	            case PUSH_TOK:
3636
        	            case QUOTED_SYMBOL:
3637
        	            case RESET_ASSERTIONS_TOK:
3638
        	            case RESET_TOK:
3639
        	            case RPAREN_TOK:
3640
        	            case SET_FEATURE_TOK:
3641
        	            case SET_INFO_TOK:
3642
        	            case SET_LOGIC_TOK:
3643
        	            case SET_OPTION_TOK:
3644
        	            case SIMPLE_SYMBOL:
3645
        	            case SIMPLIFY_TOK:
3646
        	            case STRING_LITERAL:
3647
        	            case SYGUS_CONSTANT_TOK:
3648
        	            case SYGUS_VARIABLE_TOK:
3649
        	            case SYMBOL_CHAR:
3650
        	            case SYMBOL_CHAR_NOUNDERSCORE_NOATTRIBUTE:
3651
        	            case SYNTH_FUN_TOK:
3652
        	            case SYNTH_INV_TOK:
3653
        	            case TESTER_TOK:
3654
        	            case TUPLE_CONST_TOK:
3655
        	            case TUPLE_PROJECT_TOK:
3656
        	            case TUPLE_SEL_TOK:
3657
        	            case UNTERMINATED_QUOTED_SYMBOL:
3658
        	            case UPDATE_TOK:
3659
        	            case WHITESPACE:
3660
        	            case 110:
3661
        	            	{
3662
        	            		alt6=2;
3663
        	            	}
3664
        	                break;
3665
3666
        	            default:
3667
        	                CONSTRUCTEX();
3668
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
3669
        	                EXCEPTION->message      = (void *)"";
3670
        	                EXCEPTION->decisionNum  = 6;
3671
        	                EXCEPTION->state        = 0;
3672
3673
3674
        	                goto rulecommandEx;
3675
3676
        	            }
3677
3678
815
        	            switch (alt6)
3679
        	            {
3680
815
        	        	case 1:
3681
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:389:7: LPAREN_TOK termList[terms,expr] RPAREN_TOK
3682
        	        	    {
3683
815
        	        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_command764);
3684
815
        	        	        if  (HASEXCEPTION())
3685
        	        	        {
3686
        	        	            goto rulecommandEx;
3687
        	        	        }
3688
3689
3690
815
        	        	        FOLLOWPUSH(FOLLOW_termList_in_command766);
3691
815
        	        	        termList(ctx, terms, expr);
3692
3693
812
        	        	        FOLLOWPOP();
3694
812
        	        	        if  (HASEXCEPTION())
3695
        	        	        {
3696
        	        	            goto rulecommandEx;
3697
        	        	        }
3698
3699
3700
812
        	        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_command769);
3701
812
        	        	        if  (HASEXCEPTION())
3702
        	        	        {
3703
        	        	            goto rulecommandEx;
3704
        	        	        }
3705
3706
3707
        	        	        {
3708
3709
812
        	        	                    cmd->reset(new CheckSatAssumingCommand(terms));
3710
3711
        	        	        }
3712
3713
3714
        	        	    }
3715
812
        	        	    break;
3716
        	        	case 2:
3717
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:393:7: ~ LPAREN_TOK
3718
        	        	    {
3719
        	        	        if ( ((LA(1) >= ALPHA) && (LA(1) <= LET_TOK)) || ((LA(1) >= MATCH_TOK) && (LA(1) <= 110)) )
3720
        	        	        {
3721
        	        	            CONSUME();
3722
        	        	            PERRORRECOVERY=ANTLR3_FALSE;
3723
        	        	        }
3724
        	        	        else
3725
        	        	        {
3726
        	        	            CONSTRUCTEX();
3727
        	        	            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
3728
        	        	            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
3729
        	        	            EXCEPTION->expectingSet = NULL;
3730
3731
        	        	            goto rulecommandEx;
3732
        	        	        }
3733
3734
3735
        	        	        {
3736
        	        	             PARSER_STATE->parseError("The check-sat-assuming command expects a "
3737
        	        	                                             "list of terms.  Perhaps you forgot a pair of "
3738
        	        	                                             "parentheses?");
3739
3740
        	        	        }
3741
3742
3743
        	        	    }
3744
        	        	    break;
3745
3746
        	            }
3747
        	        }
3748
3749
        	    }
3750
812
        	    break;
3751
        	case 17:
3752
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:400:5: GET_ASSERTIONS_TOK
3753
        	    {
3754
        	         MATCHT(GET_ASSERTIONS_TOK, &FOLLOW_GET_ASSERTIONS_TOK_in_command812);
3755
        	        if  (HASEXCEPTION())
3756
        	        {
3757
        	            goto rulecommandEx;
3758
        	        }
3759
3760
3761
        	        {
3762
        	             PARSER_STATE->checkThatLogicIsSet();
3763
        	        }
3764
3765
3766
        	        {
3767
        	             cmd->reset(new GetAssertionsCommand());
3768
        	        }
3769
3770
3771
        	    }
3772
        	    break;
3773
1
        	case 18:
3774
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:403:5: GET_PROOF_TOK
3775
        	    {
3776
1
        	         MATCHT(GET_PROOF_TOK, &FOLLOW_GET_PROOF_TOK_in_command832);
3777
1
        	        if  (HASEXCEPTION())
3778
        	        {
3779
        	            goto rulecommandEx;
3780
        	        }
3781
3782
3783
        	        {
3784
1
        	             PARSER_STATE->checkThatLogicIsSet();
3785
        	        }
3786
3787
3788
        	        {
3789
1
        	             cmd->reset(new GetProofCommand());
3790
        	        }
3791
3792
3793
        	    }
3794
1
        	    break;
3795
5
        	case 19:
3796
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:406:5: GET_UNSAT_ASSUMPTIONS_TOK
3797
        	    {
3798
5
        	         MATCHT(GET_UNSAT_ASSUMPTIONS_TOK, &FOLLOW_GET_UNSAT_ASSUMPTIONS_TOK_in_command852);
3799
5
        	        if  (HASEXCEPTION())
3800
        	        {
3801
        	            goto rulecommandEx;
3802
        	        }
3803
3804
3805
        	        {
3806
5
        	             PARSER_STATE->checkThatLogicIsSet();
3807
        	        }
3808
3809
3810
        	        {
3811
5
        	             cmd->reset(new GetUnsatAssumptionsCommand);
3812
        	        }
3813
3814
3815
        	    }
3816
5
        	    break;
3817
6
        	case 20:
3818
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:409:5: GET_UNSAT_CORE_TOK
3819
        	    {
3820
6
        	         MATCHT(GET_UNSAT_CORE_TOK, &FOLLOW_GET_UNSAT_CORE_TOK_in_command872);
3821
6
        	        if  (HASEXCEPTION())
3822
        	        {
3823
        	            goto rulecommandEx;
3824
        	        }
3825
3826
3827
        	        {
3828
6
        	             PARSER_STATE->checkThatLogicIsSet();
3829
        	        }
3830
3831
3832
        	        {
3833
6
        	             cmd->reset(new GetUnsatCoreCommand);
3834
        	        }
3835
3836
3837
        	    }
3838
6
        	    break;
3839
        	case 21:
3840
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:412:5: GET_DIFFICULTY_TOK
3841
        	    {
3842
        	         MATCHT(GET_DIFFICULTY_TOK, &FOLLOW_GET_DIFFICULTY_TOK_in_command892);
3843
        	        if  (HASEXCEPTION())
3844
        	        {
3845
        	            goto rulecommandEx;
3846
        	        }
3847
3848
3849
        	        {
3850
        	             PARSER_STATE->checkThatLogicIsSet();
3851
        	        }
3852
3853
3854
        	        {
3855
        	             cmd->reset(new GetDifficultyCommand);
3856
        	        }
3857
3858
3859
        	    }
3860
        	    break;
3861
1862
        	case 22:
3862
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:415:5: PUSH_TOK (k= INTEGER_LITERAL |)
3863
        	    {
3864
1862
        	         MATCHT(PUSH_TOK, &FOLLOW_PUSH_TOK_in_command912);
3865
1862
        	        if  (HASEXCEPTION())
3866
        	        {
3867
        	            goto rulecommandEx;
3868
        	        }
3869
3870
3871
        	        {
3872
1862
        	             PARSER_STATE->checkThatLogicIsSet();
3873
        	        }
3874
3875
3876
        	        {
3877
1862
        	             if( PARSER_STATE->sygus() ){
3878
        	                    PARSER_STATE->parseError("Sygus does not support push command.");
3879
        	                  }
3880
3881
        	        }
3882
3883
3884
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:420:5: (k= INTEGER_LITERAL |)
3885
        	        {
3886
1862
        	            int alt7=2;
3887
1862
        	            switch ( LA(1) )
3888
        	            {
3889
1729
        	            case INTEGER_LITERAL:
3890
        	            	{
3891
1729
        	            		alt7=1;
3892
        	            	}
3893
1729
        	                break;
3894
133
        	            case RPAREN_TOK:
3895
        	            	{
3896
133
        	            		alt7=2;
3897
        	            	}
3898
133
        	                break;
3899
3900
        	            default:
3901
        	                CONSTRUCTEX();
3902
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
3903
        	                EXCEPTION->message      = (void *)"";
3904
        	                EXCEPTION->decisionNum  = 7;
3905
        	                EXCEPTION->state        = 0;
3906
3907
3908
        	                goto rulecommandEx;
3909
3910
        	            }
3911
3912
1862
        	            switch (alt7)
3913
        	            {
3914
1729
        	        	case 1:
3915
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:420:7: k= INTEGER_LITERAL
3916
        	        	    {
3917
1729
        	        	        k = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_command930);
3918
1729
        	        	        if  (HASEXCEPTION())
3919
        	        	        {
3920
        	        	            goto rulecommandEx;
3921
        	        	        }
3922
3923
3924
        	        	        {
3925
1729
        	        	             unsigned num = AntlrInput::tokenToUnsigned(k);
3926
1729
        	        	                    if(num == 0) {
3927
        	        	                      cmd->reset(new EmptyCommand());
3928
1729
        	        	                    } else if(num == 1) {
3929
1725
        	        	                      PARSER_STATE->pushScope(true);
3930
1725
        	        	                      cmd->reset(new PushCommand());
3931
        	        	                    } else {
3932
8
        	        	                      std::unique_ptr<CommandSequence> seq(new CommandSequence());
3933
10
        	        	                      do {
3934
14
        	        	                        PARSER_STATE->pushScope(true);
3935
14
        	        	                        Command* push_cmd = new PushCommand();
3936
14
        	        	                        push_cmd->setMuted(num > 1);
3937
14
        	        	                        seq->addCommand(push_cmd);
3938
14
        	        	                        --num;
3939
14
        	        	                        } while(num > 0);
3940
4
        	        	                      cmd->reset(seq.release());
3941
        	        	                    }
3942
3943
        	        	        }
3944
3945
3946
        	        	    }
3947
1729
        	        	    break;
3948
133
        	        	case 2:
3949
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:439:7:
3950
        	        	    {
3951
        	        	        {
3952
133
        	        	             if(PARSER_STATE->strictModeEnabled()) {
3953
        	        	                      PARSER_STATE->parseError(
3954
        	        	                          "Strict compliance mode demands an integer to be provided to "
3955
        	        	                          "PUSH.  Maybe you want (push 1)?");
3956
        	        	                    } else {
3957
133
        	        	                      PARSER_STATE->pushScope(true);
3958
133
        	        	                      cmd->reset(new PushCommand());
3959
        	        	                    }
3960
3961
        	        	        }
3962
3963
3964
        	        	    }
3965
133
        	        	    break;
3966
3967
        	            }
3968
        	        }
3969
3970
        	    }
3971
1862
        	    break;
3972
1499
        	case 23:
3973
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:448:5: POP_TOK (k= INTEGER_LITERAL |)
3974
        	    {
3975
1499
        	         MATCHT(POP_TOK, &FOLLOW_POP_TOK_in_command954);
3976
1499
        	        if  (HASEXCEPTION())
3977
        	        {
3978
        	            goto rulecommandEx;
3979
        	        }
3980
3981
3982
        	        {
3983
1499
        	             PARSER_STATE->checkThatLogicIsSet();
3984
        	        }
3985
3986
3987
        	        {
3988
1499
        	             if( PARSER_STATE->sygus() ){
3989
        	                    PARSER_STATE->parseError("Sygus does not support pop command.");
3990
        	                  }
3991
3992
        	        }
3993
3994
3995
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:453:5: (k= INTEGER_LITERAL |)
3996
        	        {
3997
1499
        	            int alt8=2;
3998
1499
        	            switch ( LA(1) )
3999
        	            {
4000
1381
        	            case INTEGER_LITERAL:
4001
        	            	{
4002
1381
        	            		alt8=1;
4003
        	            	}
4004
1381
        	                break;
4005
118
        	            case RPAREN_TOK:
4006
        	            	{
4007
118
        	            		alt8=2;
4008
        	            	}
4009
118
        	                break;
4010
4011
        	            default:
4012
        	                CONSTRUCTEX();
4013
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
4014
        	                EXCEPTION->message      = (void *)"";
4015
        	                EXCEPTION->decisionNum  = 8;
4016
        	                EXCEPTION->state        = 0;
4017
4018
4019
        	                goto rulecommandEx;
4020
4021
        	            }
4022
4023
1499
        	            switch (alt8)
4024
        	            {
4025
1381
        	        	case 1:
4026
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:453:7: k= INTEGER_LITERAL
4027
        	        	    {
4028
1381
        	        	        k = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_command972);
4029
1381
        	        	        if  (HASEXCEPTION())
4030
        	        	        {
4031
        	        	            goto rulecommandEx;
4032
        	        	        }
4033
4034
4035
        	        	        {
4036
1381
        	        	             unsigned num = AntlrInput::tokenToUnsigned(k);
4037
1381
        	        	                    if(num > PARSER_STATE->scopeLevel()) {
4038
        	        	                      PARSER_STATE->parseError("Attempted to pop above the top stack "
4039
        	        	                                               "frame.");
4040
        	        	                    }
4041
1381
        	        	                    if(num == 0) {
4042
32
        	        	                      cmd->reset(new EmptyCommand());
4043
1349
        	        	                    } else if(num == 1) {
4044
1303
        	        	                      PARSER_STATE->popScope();
4045
1303
        	        	                      cmd->reset(new PopCommand());
4046
        	        	                    } else {
4047
92
        	        	                      std::unique_ptr<CommandSequence> seq(new CommandSequence());
4048
78
        	        	                      do {
4049
124
        	        	                        PARSER_STATE->popScope();
4050
124
        	        	                        Command* pop_command = new PopCommand();
4051
124
        	        	                        pop_command->setMuted(num > 1);
4052
124
        	        	                        seq->addCommand(pop_command);
4053
124
        	        	                        --num;
4054
124
        	        	                      } while(num > 0);
4055
46
        	        	                      cmd->reset(seq.release());
4056
        	        	                    }
4057
4058
        	        	        }
4059
4060
4061
        	        	    }
4062
1381
        	        	    break;
4063
118
        	        	case 2:
4064
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:476:7:
4065
        	        	    {
4066
        	        	        {
4067
118
        	        	             if(PARSER_STATE->strictModeEnabled()) {
4068
        	        	                      PARSER_STATE->parseError(
4069
        	        	                          "Strict compliance mode demands an integer to be provided to POP."
4070
        	        	                          "Maybe you want (pop 1)?");
4071
        	        	                    } else {
4072
118
        	        	                      PARSER_STATE->popScope();
4073
118
        	        	                      cmd->reset(new PopCommand());
4074
        	        	                    }
4075
4076
        	        	        }
4077
4078
4079
        	        	    }
4080
118
        	        	    break;
4081
4082
        	            }
4083
        	        }
4084
4085
        	    }
4086
1499
        	    break;
4087
425
        	case 24:
4088
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:487:5: EXIT_TOK
4089
        	    {
4090
425
        	         MATCHT(EXIT_TOK, &FOLLOW_EXIT_TOK_in_command1006);
4091
425
        	        if  (HASEXCEPTION())
4092
        	        {
4093
        	            goto rulecommandEx;
4094
        	        }
4095
4096
4097
        	        {
4098
425
        	             cmd->reset(new QuitCommand());
4099
        	        }
4100
4101
4102
        	    }
4103
425
        	    break;
4104
1503
        	case 25:
4105
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:491:5: smt25Command[cmd]
4106
        	    {
4107
1503
        	        FOLLOWPUSH(FOLLOW_smt25Command_in_command1025);
4108
1503
        	        smt25Command(ctx, cmd);
4109
4110
1503
        	        FOLLOWPOP();
4111
1503
        	        if  (HASEXCEPTION())
4112
        	        {
4113
        	            goto rulecommandEx;
4114
        	        }
4115
4116
4117
        	    }
4118
1503
        	    break;
4119
113
        	case 26:
4120
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:494:5: extendedCommand[cmd]
4121
        	    {
4122
113
        	        FOLLOWPUSH(FOLLOW_extendedCommand_in_command1039);
4123
113
        	        extendedCommand(ctx, cmd);
4124
4125
112
        	        FOLLOWPOP();
4126
112
        	        if  (HASEXCEPTION())
4127
        	        {
4128
        	            goto rulecommandEx;
4129
        	        }
4130
4131
4132
        	        {
4133
112
        	             if(PARSER_STATE->strictModeEnabled()) {
4134
        	                    PARSER_STATE->parseError(
4135
        	                        "Extended commands are not permitted while operating in strict "
4136
        	                        "compliance mode.");
4137
        	                  }
4138
4139
        	        }
4140
4141
4142
        	    }
4143
112
        	    break;
4144
        	case 27:
4145
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:503:5: SIMPLE_SYMBOL
4146
        	    {
4147
        	        SIMPLE_SYMBOL3 = (pANTLR3_COMMON_TOKEN) MATCHT(SIMPLE_SYMBOL, &FOLLOW_SIMPLE_SYMBOL_in_command1059);
4148
        	        if  (HASEXCEPTION())
4149
        	        {
4150
        	            goto rulecommandEx;
4151
        	        }
4152
4153
4154
        	        {
4155
        	             std::string id = AntlrInput::tokenText(SIMPLE_SYMBOL3);
4156
        	                  if(id == "benchmark") {
4157
        	                    PARSER_STATE->parseError(
4158
        	                        "In SMT-LIBv2 mode, but got something that looks like SMT-LIBv1, "
4159
        	                        "which is not supported anymore.");
4160
        	                  } else {
4161
        	                    PARSER_STATE->parseError("expected SMT-LIBv2 command, got `" + id +
4162
        	                                             "'.");
4163
        	                  }
4164
4165
        	        }
4166
4167
4168
        	    }
4169
        	    break;
4170
4171
            }
4172
        }
4173
    }
4174
4175
    // This is where rules clean up and exit
4176
    //
4177
205730
    goto rulecommandEx; /* Prevent compiler warnings */
4178
205734
    rulecommandEx: ;
4179
4180
205734
            if (HASEXCEPTION())
4181
            {
4182
4
                PREPORTERROR();
4183
                PRECOVER();
4184
            }
4185
411460
    return ;
4186
}
4187
/* $ANTLR end command */
4188
4189
/**
4190
 * $ANTLR start sygusCommand
4191
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:516:1: sygusCommand returns [std::unique_ptr<cvc5::Command> cmd] : ( DECLARE_VAR_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] | ( SYNTH_FUN_TOK | SYNTH_INV_TOK ) symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK ( sortSymbol[range,CHECK_DECLARED] )? ( sygusGrammar[grammar, sygusVars, name] )? | ( CONSTRAINT_TOK | ASSUME_TOK ) term[expr, expr2] | INV_CONSTRAINT_TOK ( symbol[name,CHECK_NONE,SYM_VARIABLE] )+ | CHECK_SYNTH_TOK | SET_FEATURE_TOK keyword[name] symbolicExpr[expr] | command[&cmd] );
4192
 */
4193
static std::unique_ptr<cvc5::Command>
4194
2117
sygusCommand(pSmt2Parser ctx)
4195
{
4196
2117
    std::unique_ptr<cvc5::Command> cmd;
4197
4198
4199
4200
4234
      cvc5::api::Term expr, expr2, fun;
4201
4234
      cvc5::api::Sort t, range;
4202
4234
      std::vector<std::string> names;
4203
4234
      std::vector<std::pair<std::string, cvc5::api::Sort> > sortedVarNames;
4204
4234
      std::vector<cvc5::api::Term> sygusVars;
4205
4234
      std::string name;
4206
      bool isAssume;
4207
      bool isInv;
4208
2117
      cvc5::api::Grammar* grammar = nullptr;
4209
4210
    /* Initialize rule variables
4211
     */
4212
4213
    {
4214
        {
4215
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:528:3: ( DECLARE_VAR_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] | ( SYNTH_FUN_TOK | SYNTH_INV_TOK ) symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK ( sortSymbol[range,CHECK_DECLARED] )? ( sygusGrammar[grammar, sygusVars, name] )? | ( CONSTRAINT_TOK | ASSUME_TOK ) term[expr, expr2] | INV_CONSTRAINT_TOK ( symbol[name,CHECK_NONE,SYM_VARIABLE] )+ | CHECK_SYNTH_TOK | SET_FEATURE_TOK keyword[name] symbolicExpr[expr] | command[&cmd] )
4216
4217
            ANTLR3_UINT32 alt15;
4218
4219
2117
            alt15=7;
4220
4221
2117
            switch ( LA(1) )
4222
            {
4223
311
            case DECLARE_VAR_TOK:
4224
            	{
4225
311
            		alt15=1;
4226
            	}
4227
311
                break;
4228
349
            case SYNTH_FUN_TOK:
4229
            case SYNTH_INV_TOK:
4230
            	{
4231
349
            		alt15=2;
4232
            	}
4233
349
                break;
4234
639
            case ASSUME_TOK:
4235
            case CONSTRAINT_TOK:
4236
            	{
4237
639
            		alt15=3;
4238
            	}
4239
639
                break;
4240
14
            case INV_CONSTRAINT_TOK:
4241
            	{
4242
14
            		alt15=4;
4243
            	}
4244
14
                break;
4245
195
            case CHECK_SYNTH_TOK:
4246
            	{
4247
195
            		alt15=5;
4248
            	}
4249
195
                break;
4250
2
            case SET_FEATURE_TOK:
4251
            	{
4252
2
            		alt15=6;
4253
            	}
4254
2
                break;
4255
607
            case ASSERT_TOK:
4256
            case BLOCK_MODEL_TOK:
4257
            case BLOCK_MODEL_VALUES_TOK:
4258
            case CHECK_SAT_ASSUMING_TOK:
4259
            case CHECK_SAT_TOK:
4260
            case DECLARE_CODATATYPES_TOK:
4261
            case DECLARE_CODATATYPE_TOK:
4262
            case DECLARE_CONST_TOK:
4263
            case DECLARE_DATATYPES_TOK:
4264
            case DECLARE_DATATYPE_TOK:
4265
            case DECLARE_FUNS_TOK:
4266
            case DECLARE_FUN_TOK:
4267
            case DECLARE_HEAP:
4268
            case DECLARE_POOL:
4269
            case DECLARE_PREDS_TOK:
4270
            case DECLARE_SORTS_TOK:
4271
            case DECLARE_SORT_TOK:
4272
            case DEFINE_CONST_TOK:
4273
            case DEFINE_FUNS_REC_TOK:
4274
            case DEFINE_FUN_REC_TOK:
4275
            case DEFINE_FUN_TOK:
4276
            case DEFINE_SORT_TOK:
4277
            case DEFINE_TOK:
4278
            case ECHO_TOK:
4279
            case EXIT_TOK:
4280
            case GET_ABDUCT_TOK:
4281
            case GET_ASSERTIONS_TOK:
4282
            case GET_ASSIGNMENT_TOK:
4283
            case GET_DIFFICULTY_TOK:
4284
            case GET_INFO_TOK:
4285
            case GET_INTERPOL_TOK:
4286
            case GET_MODEL_TOK:
4287
            case GET_OPTION_TOK:
4288
            case GET_PROOF_TOK:
4289
            case GET_QE_DISJUNCT_TOK:
4290
            case GET_QE_TOK:
4291
            case GET_UNSAT_ASSUMPTIONS_TOK:
4292
            case GET_UNSAT_CORE_TOK:
4293
            case GET_VALUE_TOK:
4294
            case POP_TOK:
4295
            case PUSH_TOK:
4296
            case RESET_ASSERTIONS_TOK:
4297
            case RESET_TOK:
4298
            case SET_INFO_TOK:
4299
            case SET_LOGIC_TOK:
4300
            case SET_OPTION_TOK:
4301
            case SIMPLE_SYMBOL:
4302
            case SIMPLIFY_TOK:
4303
            	{
4304
607
            		alt15=7;
4305
            	}
4306
607
                break;
4307
4308
            default:
4309
                CONSTRUCTEX();
4310
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
4311
                EXCEPTION->message      = (void *)"";
4312
                EXCEPTION->decisionNum  = 15;
4313
                EXCEPTION->state        = 0;
4314
4315
4316
                goto rulesygusCommandEx;
4317
4318
            }
4319
4320
2117
            switch (alt15)
4321
            {
4322
311
        	case 1:
4323
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:529:5: DECLARE_VAR_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED]
4324
        	    {
4325
311
        	         MATCHT(DECLARE_VAR_TOK, &FOLLOW_DECLARE_VAR_TOK_in_sygusCommand1093);
4326
311
        	        if  (HASEXCEPTION())
4327
        	        {
4328
        	            goto rulesygusCommandEx;
4329
        	        }
4330
4331
4332
        	        {
4333
311
        	             PARSER_STATE->checkThatLogicIsSet();
4334
        	        }
4335
4336
4337
311
        	        FOLLOWPUSH(FOLLOW_symbol_in_sygusCommand1101);
4338
311
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
4339
4340
311
        	        FOLLOWPOP();
4341
311
        	        if  (HASEXCEPTION())
4342
        	        {
4343
        	            goto rulesygusCommandEx;
4344
        	        }
4345
4346
4347
        	        {
4348
311
        	             PARSER_STATE->checkUserSymbol(name);
4349
        	        }
4350
4351
4352
311
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_sygusCommand1114);
4353
311
        	        sortSymbol(ctx, t, CHECK_DECLARED);
4354
4355
311
        	        FOLLOWPOP();
4356
311
        	        if  (HASEXCEPTION())
4357
        	        {
4358
        	            goto rulesygusCommandEx;
4359
        	        }
4360
4361
4362
        	        {
4363
4364
622
        	                  api::Term var = SOLVER->mkSygusVar(t, name);
4365
311
        	                  PARSER_STATE->defineVar(name, var);
4366
311
        	                  cmd.reset(new DeclareSygusVarCommand(name, var, t));
4367
4368
311
        	        }
4369
4370
4371
        	    }
4372
311
        	    break;
4373
349
        	case 2:
4374
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:539:5: ( SYNTH_FUN_TOK | SYNTH_INV_TOK ) symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK ( sortSymbol[range,CHECK_DECLARED] )? ( sygusGrammar[grammar, sygusVars, name] )?
4375
        	    {
4376
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:539:5: ( SYNTH_FUN_TOK | SYNTH_INV_TOK )
4377
        	        {
4378
349
        	            int alt10=2;
4379
349
        	            switch ( LA(1) )
4380
        	            {
4381
335
        	            case SYNTH_FUN_TOK:
4382
        	            	{
4383
335
        	            		alt10=1;
4384
        	            	}
4385
335
        	                break;
4386
14
        	            case SYNTH_INV_TOK:
4387
        	            	{
4388
14
        	            		alt10=2;
4389
        	            	}
4390
14
        	                break;
4391
4392
        	            default:
4393
        	                CONSTRUCTEX();
4394
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
4395
        	                EXCEPTION->message      = (void *)"";
4396
        	                EXCEPTION->decisionNum  = 10;
4397
        	                EXCEPTION->state        = 0;
4398
4399
4400
        	                goto rulesygusCommandEx;
4401
4402
        	            }
4403
4404
349
        	            switch (alt10)
4405
        	            {
4406
335
        	        	case 1:
4407
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:539:7: SYNTH_FUN_TOK
4408
        	        	    {
4409
335
        	        	         MATCHT(SYNTH_FUN_TOK, &FOLLOW_SYNTH_FUN_TOK_in_sygusCommand1135);
4410
335
        	        	        if  (HASEXCEPTION())
4411
        	        	        {
4412
        	        	            goto rulesygusCommandEx;
4413
        	        	        }
4414
4415
4416
        	        	        {
4417
335
        	        	             isInv = false;
4418
        	        	        }
4419
4420
4421
        	        	    }
4422
335
        	        	    break;
4423
14
        	        	case 2:
4424
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:540:9: SYNTH_INV_TOK
4425
        	        	    {
4426
14
        	        	         MATCHT(SYNTH_INV_TOK, &FOLLOW_SYNTH_INV_TOK_in_sygusCommand1147);
4427
14
        	        	        if  (HASEXCEPTION())
4428
        	        	        {
4429
        	        	            goto rulesygusCommandEx;
4430
        	        	        }
4431
4432
4433
        	        	        {
4434
14
        	        	             isInv = true; range = SOLVER->getBooleanSort();
4435
        	        	        }
4436
4437
4438
        	        	    }
4439
14
        	        	    break;
4440
4441
        	            }
4442
        	        }
4443
4444
        	        {
4445
349
        	             PARSER_STATE->checkThatLogicIsSet();
4446
        	        }
4447
4448
4449
349
        	        FOLLOWPUSH(FOLLOW_symbol_in_sygusCommand1167);
4450
349
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
4451
4452
349
        	        FOLLOWPOP();
4453
349
        	        if  (HASEXCEPTION())
4454
        	        {
4455
        	            goto rulesygusCommandEx;
4456
        	        }
4457
4458
4459
349
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusCommand1174);
4460
349
        	        if  (HASEXCEPTION())
4461
        	        {
4462
        	            goto rulesygusCommandEx;
4463
        	        }
4464
4465
4466
349
        	        FOLLOWPUSH(FOLLOW_sortedVarList_in_sygusCommand1176);
4467
349
        	        sortedVarList(ctx, sortedVarNames);
4468
4469
349
        	        FOLLOWPOP();
4470
349
        	        if  (HASEXCEPTION())
4471
        	        {
4472
        	            goto rulesygusCommandEx;
4473
        	        }
4474
4475
4476
349
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusCommand1179);
4477
349
        	        if  (HASEXCEPTION())
4478
        	        {
4479
        	            goto rulesygusCommandEx;
4480
        	        }
4481
4482
4483
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:545:5: ( sortSymbol[range,CHECK_DECLARED] )?
4484
        	        {
4485
349
        	            int alt11=2;
4486
349
        	            switch ( LA(1) )
4487
        	            {
4488
306
        	                case QUOTED_SYMBOL:
4489
        	                case SIMPLE_SYMBOL:
4490
        	                case UNTERMINATED_QUOTED_SYMBOL:
4491
        	                	{
4492
306
        	                		alt11=1;
4493
        	                	}
4494
306
        	                    break;
4495
29
        	                case LPAREN_TOK:
4496
        	                	{
4497
29
        	                		switch ( LA(2) )
4498
        	                		{
4499
29
        	                		    case HO_ARROW_TOK:
4500
        	                		    case INDEX_TOK:
4501
        	                		    case QUOTED_SYMBOL:
4502
        	                		    case SIMPLE_SYMBOL:
4503
        	                		    case UNTERMINATED_QUOTED_SYMBOL:
4504
        	                		    	{
4505
29
        	                		    		alt11=1;
4506
        	                		    	}
4507
29
        	                		        break;
4508
        	                		}
4509
4510
        	                	}
4511
29
        	                    break;
4512
        	            }
4513
4514
349
        	            switch (alt11)
4515
        	            {
4516
335
        	        	case 1:
4517
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:545:7: sortSymbol[range,CHECK_DECLARED]
4518
        	        	    {
4519
335
        	        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_sygusCommand1187);
4520
335
        	        	        sortSymbol(ctx, range, CHECK_DECLARED);
4521
4522
335
        	        	        FOLLOWPOP();
4523
335
        	        	        if  (HASEXCEPTION())
4524
        	        	        {
4525
        	        	            goto rulesygusCommandEx;
4526
        	        	        }
4527
4528
4529
        	        	    }
4530
335
        	        	    break;
4531
4532
        	            }
4533
        	        }
4534
4535
        	        {
4536
4537
349
        	                  PARSER_STATE->pushScope();
4538
349
        	                  sygusVars = PARSER_STATE->bindBoundVars(sortedVarNames);
4539
4540
        	        }
4541
4542
4543
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:550:5: ( sygusGrammar[grammar, sygusVars, name] )?
4544
        	        {
4545
349
        	            int alt12=2;
4546
349
        	            switch ( LA(1) )
4547
        	            {
4548
147
        	                case LPAREN_TOK:
4549
        	                	{
4550
147
        	                		alt12=1;
4551
        	                	}
4552
147
        	                    break;
4553
        	            }
4554
4555
349
        	            switch (alt12)
4556
        	            {
4557
147
        	        	case 1:
4558
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:555:7: sygusGrammar[grammar, sygusVars, name]
4559
        	        	    {
4560
147
        	        	        FOLLOWPUSH(FOLLOW_sygusGrammar_in_sygusCommand1239);
4561
147
        	        	        sygusGrammar(ctx, grammar, sygusVars, name);
4562
4563
146
        	        	        FOLLOWPOP();
4564
146
        	        	        if  (HASEXCEPTION())
4565
        	        	        {
4566
        	        	            goto rulesygusCommandEx;
4567
        	        	        }
4568
4569
4570
        	        	    }
4571
146
        	        	    break;
4572
4573
        	            }
4574
        	        }
4575
4576
        	        {
4577
4578
348
        	                  Debug("parser-sygus") << "Define synth fun : " << name << std::endl;
4579
4580
1030
        	                  fun = isInv ? (grammar == nullptr
4581
14
        	                                     ? SOLVER->synthInv(name, sygusVars)
4582
        	                                     : SOLVER->synthInv(name, sygusVars, *grammar))
4583
334
        	                              : (grammar == nullptr
4584
188
        	                                     ? SOLVER->synthFun(name, sygusVars, range)
4585
146
        	                                     : SOLVER->synthFun(name, sygusVars, range, *grammar));
4586
4587
348
        	                  Debug("parser-sygus") << "...read synth fun " << name << std::endl;
4588
348
        	                  PARSER_STATE->popScope();
4589
        	                  // we do not allow overloading for synth fun
4590
348
        	                  PARSER_STATE->defineVar(name, fun);
4591
696
        	                  cmd = std::unique_ptr<Command>(
4592
348
        	                      new SynthFunCommand(name, fun, sygusVars, range, isInv, grammar));
4593
4594
        	        }
4595
4596
4597
        	    }
4598
348
        	    break;
4599
639
        	case 3:
4600
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:575:5: ( CONSTRAINT_TOK | ASSUME_TOK ) term[expr, expr2]
4601
        	    {
4602
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:575:5: ( CONSTRAINT_TOK | ASSUME_TOK )
4603
        	        {
4604
639
        	            int alt13=2;
4605
639
        	            switch ( LA(1) )
4606
        	            {
4607
637
        	            case CONSTRAINT_TOK:
4608
        	            	{
4609
637
        	            		alt13=1;
4610
        	            	}
4611
637
        	                break;
4612
2
        	            case ASSUME_TOK:
4613
        	            	{
4614
2
        	            		alt13=2;
4615
        	            	}
4616
2
        	                break;
4617
4618
        	            default:
4619
        	                CONSTRUCTEX();
4620
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
4621
        	                EXCEPTION->message      = (void *)"";
4622
        	                EXCEPTION->decisionNum  = 13;
4623
        	                EXCEPTION->state        = 0;
4624
4625
4626
        	                goto rulesygusCommandEx;
4627
4628
        	            }
4629
4630
639
        	            switch (alt13)
4631
        	            {
4632
637
        	        	case 1:
4633
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:575:7: CONSTRAINT_TOK
4634
        	        	    {
4635
637
        	        	         MATCHT(CONSTRAINT_TOK, &FOLLOW_CONSTRAINT_TOK_in_sygusCommand1267);
4636
637
        	        	        if  (HASEXCEPTION())
4637
        	        	        {
4638
        	        	            goto rulesygusCommandEx;
4639
        	        	        }
4640
4641
4642
        	        	        {
4643
637
        	        	             isAssume = false;
4644
        	        	        }
4645
4646
4647
        	        	    }
4648
637
        	        	    break;
4649
2
        	        	case 2:
4650
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:575:46: ASSUME_TOK
4651
        	        	    {
4652
2
        	        	         MATCHT(ASSUME_TOK, &FOLLOW_ASSUME_TOK_in_sygusCommand1273);
4653
2
        	        	        if  (HASEXCEPTION())
4654
        	        	        {
4655
        	        	            goto rulesygusCommandEx;
4656
        	        	        }
4657
4658
4659
        	        	        {
4660
2
        	        	             isAssume = true;
4661
        	        	        }
4662
4663
4664
        	        	    }
4665
2
        	        	    break;
4666
4667
        	            }
4668
        	        }
4669
4670
        	        {
4671
4672
639
        	                  PARSER_STATE->checkThatLogicIsSet();
4673
4674
        	        }
4675
4676
4677
639
        	        FOLLOWPUSH(FOLLOW_term_in_sygusCommand1289);
4678
639
        	        term(ctx, expr, expr2);
4679
4680
638
        	        FOLLOWPOP();
4681
638
        	        if  (HASEXCEPTION())
4682
        	        {
4683
        	            goto rulesygusCommandEx;
4684
        	        }
4685
4686
4687
        	        {
4688
638
        	             Debug("parser-sygus") << "...read constraint " << expr << std::endl;
4689
638
        	                  cmd.reset(new SygusConstraintCommand(expr, isAssume));
4690
4691
        	        }
4692
4693
4694
        	    }
4695
638
        	    break;
4696
14
        	case 4:
4697
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:584:5: INV_CONSTRAINT_TOK ( symbol[name,CHECK_NONE,SYM_VARIABLE] )+
4698
        	    {
4699
14
        	         MATCHT(INV_CONSTRAINT_TOK, &FOLLOW_INV_CONSTRAINT_TOK_in_sygusCommand1308);
4700
14
        	        if  (HASEXCEPTION())
4701
        	        {
4702
        	            goto rulesygusCommandEx;
4703
        	        }
4704
4705
4706
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:585:5: ( symbol[name,CHECK_NONE,SYM_VARIABLE] )+
4707
        	        {
4708
14
        	            int cnt14=0;
4709
4710
        	            for (;;)
4711
        	            {
4712
70
        	                int alt14=2;
4713
70
        	        	switch ( LA(1) )
4714
        	        	{
4715
56
        	        	case QUOTED_SYMBOL:
4716
        	        	case SIMPLE_SYMBOL:
4717
        	        	case UNTERMINATED_QUOTED_SYMBOL:
4718
        	        		{
4719
56
        	        			alt14=1;
4720
        	        		}
4721
56
        	        	    break;
4722
4723
        	        	}
4724
4725
70
        	        	switch (alt14)
4726
        	        	{
4727
56
        	        	    case 1:
4728
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:585:7: symbol[name,CHECK_NONE,SYM_VARIABLE]
4729
        	        	        {
4730
56
        	        	            FOLLOWPUSH(FOLLOW_symbol_in_sygusCommand1316);
4731
56
        	        	            symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
4732
4733
56
        	        	            FOLLOWPOP();
4734
56
        	        	            if  (HASEXCEPTION())
4735
        	        	            {
4736
        	        	                goto rulesygusCommandEx;
4737
        	        	            }
4738
4739
4740
        	        	            {
4741
56
        	        	                 names.push_back(name);
4742
        	        	            }
4743
4744
4745
        	        	        }
4746
56
        	        	        break;
4747
4748
14
        	        	    default:
4749
4750
14
        	        		if ( cnt14 >= 1 )
4751
        	        		{
4752
14
        	        		    goto loop14;
4753
        	        		}
4754
        	        		/* mismatchedSetEx()
4755
        	        		 */
4756
        	        		CONSTRUCTEX();
4757
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
4758
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
4759
4760
4761
        	        		goto rulesygusCommandEx;
4762
        	        	}
4763
56
        	        	cnt14++;
4764
56
        	            }
4765
14
        	            loop14: ;	/* Jump to here if this rule does not match */
4766
        	        }
4767
4768
        	        {
4769
4770
14
        	                  cmd = PARSER_STATE->invConstraint(names);
4771
4772
        	        }
4773
4774
4775
        	    }
4776
14
        	    break;
4777
195
        	case 5:
4778
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:590:5: CHECK_SYNTH_TOK
4779
        	    {
4780
195
        	         MATCHT(CHECK_SYNTH_TOK, &FOLLOW_CHECK_SYNTH_TOK_in_sygusCommand1340);
4781
195
        	        if  (HASEXCEPTION())
4782
        	        {
4783
        	            goto rulesygusCommandEx;
4784
        	        }
4785
4786
4787
        	        {
4788
4789
195
        	                  PARSER_STATE->checkThatLogicIsSet();
4790
195
        	                  cmd.reset(new CheckSynthCommand());
4791
4792
        	        }
4793
4794
4795
        	    }
4796
195
        	    break;
4797
2
        	case 6:
4798
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:596:5: SET_FEATURE_TOK keyword[name] symbolicExpr[expr]
4799
        	    {
4800
2
        	         MATCHT(SET_FEATURE_TOK, &FOLLOW_SET_FEATURE_TOK_in_sygusCommand1358);
4801
2
        	        if  (HASEXCEPTION())
4802
        	        {
4803
        	            goto rulesygusCommandEx;
4804
        	        }
4805
4806
4807
2
        	        FOLLOWPUSH(FOLLOW_keyword_in_sygusCommand1360);
4808
2
        	        keyword(ctx, name);
4809
4810
2
        	        FOLLOWPOP();
4811
2
        	        if  (HASEXCEPTION())
4812
        	        {
4813
        	            goto rulesygusCommandEx;
4814
        	        }
4815
4816
4817
2
        	        FOLLOWPUSH(FOLLOW_symbolicExpr_in_sygusCommand1363);
4818
2
        	        symbolicExpr(ctx, expr);
4819
4820
2
        	        FOLLOWPOP();
4821
2
        	        if  (HASEXCEPTION())
4822
        	        {
4823
        	            goto rulesygusCommandEx;
4824
        	        }
4825
4826
4827
        	        {
4828
4829
2
        	                  PARSER_STATE->checkThatLogicIsSet();
4830
        	                  // ":grammars" is defined in the SyGuS version 2.1 standard and is by
4831
        	                  // default supported, all other features are not.
4832
2
        	                  if (name != ":grammars")
4833
        	                  {
4834
2
        	                    std::stringstream ss;
4835
1
        	                    ss << "SyGuS feature " << name << " not currently supported";
4836
1
        	                    PARSER_STATE->warning(ss.str());
4837
        	                  }
4838
2
        	                  cmd.reset(new EmptyCommand());
4839
4840
        	        }
4841
4842
4843
        	    }
4844
2
        	    break;
4845
607
        	case 7:
4846
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:609:5: command[&cmd]
4847
        	    {
4848
607
        	        FOLLOWPUSH(FOLLOW_command_in_sygusCommand1376);
4849
607
        	        command(ctx, &cmd);
4850
4851
607
        	        FOLLOWPOP();
4852
607
        	        if  (HASEXCEPTION())
4853
        	        {
4854
        	            goto rulesygusCommandEx;
4855
        	        }
4856
4857
4858
        	    }
4859
607
        	    break;
4860
4861
            }
4862
        }
4863
    }
4864
4865
    // This is where rules clean up and exit
4866
    //
4867
2115
    goto rulesygusCommandEx; /* Prevent compiler warnings */
4868
2115
    rulesygusCommandEx: ;
4869
4870
2115
            if (HASEXCEPTION())
4871
            {
4872
                PREPORTERROR();
4873
                PRECOVER();
4874
            }
4875
4230
    return cmd;
4876
}
4877
/* $ANTLR end sygusCommand */
4878
4879
/**
4880
 * $ANTLR start sygusGrammar
4881
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:622:1: sygusGrammar[cvc5::api::Grammar*& ret,\n const std::vector<cvc5::api::Term>& sygusVars,\n const std::string& fun] : LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] ( LPAREN_TOK | RPAREN_TOK ) )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK symbol[name, CHECK_DECLARED, SYM_VARIABLE] sortSymbol[t, CHECK_DECLARED] LPAREN_TOK ( term[e,e2] | LPAREN_TOK SYGUS_CONSTANT_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK | LPAREN_TOK SYGUS_VARIABLE_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK )+ RPAREN_TOK ;
4882
 */
4883
static void
4884
152
sygusGrammar(pSmt2Parser ctx, cvc5::api::Grammar*& ret, const std::vector<cvc5::api::Term>& sygusVars, const std::string& fun)
4885
{
4886
4887
      // the pre-declaration
4888
304
      std::vector<std::pair<std::string, cvc5::api::Sort>> sortedVarNames;
4889
      // non-terminal symbols of the grammar
4890
304
      std::vector<cvc5::api::Term> ntSyms;
4891
304
      cvc5::api::Sort t;
4892
304
      std::string name;
4893
304
      cvc5::api::Term e, e2;
4894
152
      unsigned dtProcessed = 0;
4895
4896
    /* Initialize rule variables
4897
     */
4898
4899
    {
4900
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:636:3: ( LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] ( LPAREN_TOK | RPAREN_TOK ) )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK symbol[name, CHECK_DECLARED, SYM_VARIABLE] sortSymbol[t, CHECK_DECLARED] LPAREN_TOK ( term[e,e2] | LPAREN_TOK SYGUS_CONSTANT_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK | LPAREN_TOK SYGUS_VARIABLE_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK )+ RPAREN_TOK )
4901
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:638:3: LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] ( LPAREN_TOK | RPAREN_TOK ) )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK symbol[name, CHECK_DECLARED, SYM_VARIABLE] sortSymbol[t, CHECK_DECLARED] LPAREN_TOK ( term[e,e2] | LPAREN_TOK SYGUS_CONSTANT_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK | LPAREN_TOK SYGUS_VARIABLE_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK )+ RPAREN_TOK
4902
        {
4903
152
             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1404);
4904
152
            if  (HASEXCEPTION())
4905
            {
4906
                goto rulesygusGrammarEx;
4907
            }
4908
4909
4910
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:642:3: ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] ( LPAREN_TOK | RPAREN_TOK ) )*
4911
4912
            for (;;)
4913
            {
4914
503
                int alt17=2;
4915
503
                switch ( LA(1) )
4916
                {
4917
351
                case LPAREN_TOK:
4918
                	{
4919
351
                		alt17=1;
4920
                	}
4921
351
                    break;
4922
4923
                }
4924
4925
503
                switch (alt17)
4926
                {
4927
351
            	case 1:
4928
            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:642:5: LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] ( LPAREN_TOK | RPAREN_TOK )
4929
            	    {
4930
351
            	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1419);
4931
351
            	        if  (HASEXCEPTION())
4932
            	        {
4933
            	            goto rulesygusGrammarEx;
4934
            	        }
4935
4936
4937
351
            	        FOLLOWPUSH(FOLLOW_symbol_in_sygusGrammar1421);
4938
351
            	        symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
4939
4940
351
            	        FOLLOWPOP();
4941
351
            	        if  (HASEXCEPTION())
4942
            	        {
4943
            	            goto rulesygusGrammarEx;
4944
            	        }
4945
4946
4947
351
            	        FOLLOWPUSH(FOLLOW_sortSymbol_in_sygusGrammar1428);
4948
351
            	        sortSymbol(ctx, t, CHECK_DECLARED);
4949
4950
351
            	        FOLLOWPOP();
4951
351
            	        if  (HASEXCEPTION())
4952
            	        {
4953
            	            goto rulesygusGrammarEx;
4954
            	        }
4955
4956
4957
            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:643:34: ( LPAREN_TOK | RPAREN_TOK )
4958
            	        {
4959
351
            	            int alt16=2;
4960
351
            	            switch ( LA(1) )
4961
            	            {
4962
            	            case LPAREN_TOK:
4963
            	            	{
4964
            	            		alt16=1;
4965
            	            	}
4966
            	                break;
4967
351
            	            case RPAREN_TOK:
4968
            	            	{
4969
351
            	            		alt16=2;
4970
            	            	}
4971
351
            	                break;
4972
4973
            	            default:
4974
            	                CONSTRUCTEX();
4975
            	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
4976
            	                EXCEPTION->message      = (void *)"";
4977
            	                EXCEPTION->decisionNum  = 16;
4978
            	                EXCEPTION->state        = 0;
4979
4980
4981
            	                goto rulesygusGrammarEx;
4982
4983
            	            }
4984
4985
351
            	            switch (alt16)
4986
            	            {
4987
            	        	case 1:
4988
            	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:646:7: LPAREN_TOK
4989
            	        	    {
4990
            	        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1453);
4991
            	        	        if  (HASEXCEPTION())
4992
            	        	        {
4993
            	        	            goto rulesygusGrammarEx;
4994
            	        	        }
4995
4996
4997
            	        	        {
4998
4999
            	        	                    std::stringstream sse;
5000
            	        	                    if (sortedVarNames.empty())
5001
            	        	                    {
5002
            	        	                      sse << "The expected SyGuS language is version 2.0, whereas the "
5003
            	        	                          << "input appears to be SyGuS version 1.0 format. The version "
5004
            	        	                          << "2.0 format requires a predeclaration of the non-terminal "
5005
            	        	                          << "symbols of the grammar to be given prior to the definition "
5006
            	        	                          << "of the grammar. See https://sygus.org/language/ for details "
5007
            	        	                          << "and examples. cvc5 versions past 1.8 do not support SyGuS "
5008
            	        	                          << "version 1.0.";
5009
            	        	                    }
5010
            	        	                    else
5011
            	        	                    {
5012
            	        	                      // an unknown syntax error
5013
            	        	                      sse << "Unexpected syntax for SyGuS predeclaration.";
5014
            	        	                    }
5015
            	        	                    PARSER_STATE->parseError(sse.str().c_str());
5016
5017
            	        	        }
5018
5019
5020
            	        	    }
5021
            	        	    break;
5022
351
            	        	case 2:
5023
            	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:666:7: RPAREN_TOK
5024
            	        	    {
5025
351
            	        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusGrammar1469);
5026
351
            	        	        if  (HASEXCEPTION())
5027
            	        	        {
5028
            	        	            goto rulesygusGrammarEx;
5029
            	        	        }
5030
5031
5032
            	        	    }
5033
351
            	        	    break;
5034
5035
            	            }
5036
            	        }
5037
5038
            	        {
5039
351
            	             sortedVarNames.push_back(make_pair(name, t));
5040
            	        }
5041
5042
5043
            	    }
5044
351
            	    break;
5045
5046
152
            	default:
5047
152
            	    goto loop17;	/* break out of the loop */
5048
            	    break;
5049
                }
5050
351
            }
5051
152
            loop17: ; /* Jump out to here if this rule does not match */
5052
5053
5054
152
             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusGrammar1486);
5055
152
            if  (HASEXCEPTION())
5056
            {
5057
                goto rulesygusGrammarEx;
5058
            }
5059
5060
5061
            {
5062
5063
                    // non-terminal symbols in the pre-declaration are locally scoped
5064
152
                    PARSER_STATE->pushScope();
5065
503
                    for (std::pair<std::string, api::Sort>& i : sortedVarNames)
5066
                    {
5067
351
                      PARSER_STATE->checkDeclaration(name, CHECK_UNDECLARED, SYM_SORT);
5068
                      // make the non-terminal symbol, which will be parsed as an ordinary
5069
                      // free variable.
5070
702
                      api::Term nts = PARSER_STATE->bindBoundVar(i.first, i.second);
5071
351
                      ntSyms.push_back(nts);
5072
                    }
5073
152
                    ret = PARSER_STATE->mkGrammar(sygusVars, ntSyms);
5074
5075
            }
5076
5077
5078
152
             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1497);
5079
152
            if  (HASEXCEPTION())
5080
            {
5081
                goto rulesygusGrammarEx;
5082
            }
5083
5084
5085
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:685:3: ( LPAREN_TOK symbol[name, CHECK_DECLARED, SYM_VARIABLE] sortSymbol[t, CHECK_DECLARED] LPAREN_TOK ( term[e,e2] | LPAREN_TOK SYGUS_CONSTANT_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK | LPAREN_TOK SYGUS_VARIABLE_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK )+
5086
            {
5087
152
                int cnt19=0;
5088
5089
                for (;;)
5090
                {
5091
500
                    int alt19=2;
5092
500
            	switch ( LA(1) )
5093
            	{
5094
349
            	case LPAREN_TOK:
5095
            		{
5096
349
            			alt19=1;
5097
            		}
5098
349
            	    break;
5099
5100
            	}
5101
5102
500
            	switch (alt19)
5103
            	{
5104
349
            	    case 1:
5105
            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:686:5: LPAREN_TOK symbol[name, CHECK_DECLARED, SYM_VARIABLE] sortSymbol[t, CHECK_DECLARED] LPAREN_TOK ( term[e,e2] | LPAREN_TOK SYGUS_CONSTANT_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK | LPAREN_TOK SYGUS_VARIABLE_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK
5106
            	        {
5107
349
            	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1507);
5108
349
            	            if  (HASEXCEPTION())
5109
            	            {
5110
            	                goto rulesygusGrammarEx;
5111
            	            }
5112
5113
5114
349
            	            FOLLOWPUSH(FOLLOW_symbol_in_sygusGrammar1513);
5115
349
            	            symbol(ctx, name, CHECK_DECLARED, SYM_VARIABLE);
5116
5117
349
            	            FOLLOWPOP();
5118
349
            	            if  (HASEXCEPTION())
5119
            	            {
5120
            	                goto rulesygusGrammarEx;
5121
            	            }
5122
5123
5124
349
            	            FOLLOWPUSH(FOLLOW_sortSymbol_in_sygusGrammar1516);
5125
349
            	            sortSymbol(ctx, t, CHECK_DECLARED);
5126
5127
349
            	            FOLLOWPOP();
5128
349
            	            if  (HASEXCEPTION())
5129
            	            {
5130
            	                goto rulesygusGrammarEx;
5131
            	            }
5132
5133
5134
            	            {
5135
5136
            	                      // check that it matches sortedVarNames
5137
349
            	                      if (sortedVarNames[dtProcessed].first != name)
5138
            	                      {
5139
            	                        std::stringstream sse;
5140
            	                        sse << "Grouped rule listing " << name
5141
            	                            << " does not match the name (in order) from the predeclaration ("
5142
            	                            << sortedVarNames[dtProcessed].first << ")." << std::endl;
5143
            	                        PARSER_STATE->parseError(sse.str().c_str());
5144
            	                      }
5145
349
            	                      if (sortedVarNames[dtProcessed].second != t)
5146
            	                      {
5147
            	                        std::stringstream sse;
5148
            	                        sse << "Type for grouped rule listing " << name
5149
            	                            << " does not match the type (in order) from the predeclaration ("
5150
            	                            << sortedVarNames[dtProcessed].second << ")." << std::endl;
5151
            	                        PARSER_STATE->parseError(sse.str().c_str());
5152
            	                      }
5153
5154
            	            }
5155
5156
5157
349
            	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1529);
5158
349
            	            if  (HASEXCEPTION())
5159
            	            {
5160
            	                goto rulesygusGrammarEx;
5161
            	            }
5162
5163
5164
            	            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:708:5: ( term[e,e2] | LPAREN_TOK SYGUS_CONSTANT_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK | LPAREN_TOK SYGUS_VARIABLE_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK )+
5165
            	            {
5166
349
            	                int cnt18=0;
5167
5168
            	                for (;;)
5169
            	                {
5170
1828
            	                    int alt18=4;
5171
1828
            	            	switch ( LA(1) )
5172
            	            	{
5173
850
            	            	case LPAREN_TOK:
5174
            	            		{
5175
850
            	            			switch ( LA(2) )
5176
            	            			{
5177
825
            	            			case AS_TOK:
5178
            	            			case ATTRIBUTE_TOK:
5179
            	            			case COMPREHENSION_TOK:
5180
            	            			case EXISTS_TOK:
5181
            	            			case FORALL_TOK:
5182
            	            			case HO_LAMBDA_TOK:
5183
            	            			case INDEX_TOK:
5184
            	            			case LET_TOK:
5185
            	            			case LPAREN_TOK:
5186
            	            			case MATCH_TOK:
5187
            	            			case QUOTED_SYMBOL:
5188
            	            			case SIMPLE_SYMBOL:
5189
            	            			case TUPLE_CONST_TOK:
5190
            	            			case TUPLE_PROJECT_TOK:
5191
            	            			case UNTERMINATED_QUOTED_SYMBOL:
5192
            	            				{
5193
825
            	            					alt18=1;
5194
            	            				}
5195
825
            	            			    break;
5196
15
            	            			case SYGUS_CONSTANT_TOK:
5197
            	            				{
5198
15
            	            					alt18=2;
5199
            	            				}
5200
15
            	            			    break;
5201
10
            	            			case SYGUS_VARIABLE_TOK:
5202
            	            				{
5203
10
            	            					alt18=3;
5204
            	            				}
5205
10
            	            			    break;
5206
5207
            	            			}
5208
5209
            	            		}
5210
850
            	            	    break;
5211
630
            	            	case BINARY_LITERAL:
5212
            	            	case DECIMAL_LITERAL:
5213
            	            	case HEX_LITERAL:
5214
            	            	case INTEGER_LITERAL:
5215
            	            	case QUOTED_SYMBOL:
5216
            	            	case SIMPLE_SYMBOL:
5217
            	            	case STRING_LITERAL:
5218
            	            	case TUPLE_CONST_TOK:
5219
            	            	case UNTERMINATED_QUOTED_SYMBOL:
5220
            	            		{
5221
630
            	            			alt18=1;
5222
            	            		}
5223
630
            	            	    break;
5224
5225
            	            	}
5226
5227
1828
            	            	switch (alt18)
5228
            	            	{
5229
1455
            	            	    case 1:
5230
            	            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:709:7: term[e,e2]
5231
            	            	        {
5232
1455
            	            	            FOLLOWPUSH(FOLLOW_term_in_sygusGrammar1543);
5233
1455
            	            	            term(ctx, e, e2);
5234
5235
1454
            	            	            FOLLOWPOP();
5236
1454
            	            	            if  (HASEXCEPTION())
5237
            	            	            {
5238
            	            	                goto rulesygusGrammarEx;
5239
            	            	            }
5240
5241
5242
            	            	            {
5243
5244
            	            	                        // add term as constructor to datatype
5245
1454
            	            	                        ret->addRule(ntSyms[dtProcessed], e);
5246
5247
            	            	            }
5248
5249
5250
            	            	        }
5251
1454
            	            	        break;
5252
15
            	            	    case 2:
5253
            	            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:713:9: LPAREN_TOK SYGUS_CONSTANT_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK
5254
            	            	        {
5255
15
            	            	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1556);
5256
15
            	            	            if  (HASEXCEPTION())
5257
            	            	            {
5258
            	            	                goto rulesygusGrammarEx;
5259
            	            	            }
5260
5261
5262
15
            	            	             MATCHT(SYGUS_CONSTANT_TOK, &FOLLOW_SYGUS_CONSTANT_TOK_in_sygusGrammar1558);
5263
15
            	            	            if  (HASEXCEPTION())
5264
            	            	            {
5265
            	            	                goto rulesygusGrammarEx;
5266
            	            	            }
5267
5268
5269
15
            	            	            FOLLOWPUSH(FOLLOW_sortSymbol_in_sygusGrammar1560);
5270
15
            	            	            sortSymbol(ctx, t, CHECK_DECLARED);
5271
5272
15
            	            	            FOLLOWPOP();
5273
15
            	            	            if  (HASEXCEPTION())
5274
            	            	            {
5275
            	            	                goto rulesygusGrammarEx;
5276
            	            	            }
5277
5278
5279
15
            	            	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusGrammar1563);
5280
15
            	            	            if  (HASEXCEPTION())
5281
            	            	            {
5282
            	            	                goto rulesygusGrammarEx;
5283
            	            	            }
5284
5285
5286
            	            	            {
5287
5288
            	            	                        // allow constants in datatype for ntSyms[dtProcessed]
5289
15
            	            	                        ret->addAnyConstant(ntSyms[dtProcessed]);
5290
5291
            	            	            }
5292
5293
5294
            	            	        }
5295
15
            	            	        break;
5296
10
            	            	    case 3:
5297
            	            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:717:9: LPAREN_TOK SYGUS_VARIABLE_TOK sortSymbol[t, CHECK_DECLARED] RPAREN_TOK
5298
            	            	        {
5299
10
            	            	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sygusGrammar1575);
5300
10
            	            	            if  (HASEXCEPTION())
5301
            	            	            {
5302
            	            	                goto rulesygusGrammarEx;
5303
            	            	            }
5304
5305
5306
10
            	            	             MATCHT(SYGUS_VARIABLE_TOK, &FOLLOW_SYGUS_VARIABLE_TOK_in_sygusGrammar1577);
5307
10
            	            	            if  (HASEXCEPTION())
5308
            	            	            {
5309
            	            	                goto rulesygusGrammarEx;
5310
            	            	            }
5311
5312
5313
10
            	            	            FOLLOWPUSH(FOLLOW_sortSymbol_in_sygusGrammar1579);
5314
10
            	            	            sortSymbol(ctx, t, CHECK_DECLARED);
5315
5316
10
            	            	            FOLLOWPOP();
5317
10
            	            	            if  (HASEXCEPTION())
5318
            	            	            {
5319
            	            	                goto rulesygusGrammarEx;
5320
            	            	            }
5321
5322
5323
10
            	            	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusGrammar1582);
5324
10
            	            	            if  (HASEXCEPTION())
5325
            	            	            {
5326
            	            	                goto rulesygusGrammarEx;
5327
            	            	            }
5328
5329
5330
            	            	            {
5331
5332
            	            	                        // add variable constructors to datatype
5333
10
            	            	                        ret->addAnyVariable(ntSyms[dtProcessed]);
5334
5335
            	            	            }
5336
5337
5338
            	            	        }
5339
10
            	            	        break;
5340
5341
348
            	            	    default:
5342
5343
348
            	            		if ( cnt18 >= 1 )
5344
            	            		{
5345
348
            	            		    goto loop18;
5346
            	            		}
5347
            	            		/* mismatchedSetEx()
5348
            	            		 */
5349
            	            		CONSTRUCTEX();
5350
            	            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
5351
            	            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
5352
5353
5354
            	            		goto rulesygusGrammarEx;
5355
            	            	}
5356
1479
            	            	cnt18++;
5357
1479
            	                }
5358
348
            	                loop18: ;	/* Jump to here if this rule does not match */
5359
            	            }
5360
5361
348
            	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusGrammar1597);
5362
348
            	            if  (HASEXCEPTION())
5363
            	            {
5364
            	                goto rulesygusGrammarEx;
5365
            	            }
5366
5367
5368
348
            	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusGrammar1603);
5369
348
            	            if  (HASEXCEPTION())
5370
            	            {
5371
            	                goto rulesygusGrammarEx;
5372
            	            }
5373
5374
5375
            	            {
5376
5377
348
            	                      dtProcessed++;
5378
5379
            	            }
5380
5381
5382
            	        }
5383
348
            	        break;
5384
5385
151
            	    default:
5386
5387
151
            		if ( cnt19 >= 1 )
5388
            		{
5389
151
            		    goto loop19;
5390
            		}
5391
            		/* mismatchedSetEx()
5392
            		 */
5393
            		CONSTRUCTEX();
5394
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
5395
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
5396
5397
5398
            		goto rulesygusGrammarEx;
5399
            	}
5400
348
            	cnt19++;
5401
348
                }
5402
151
                loop19: ;	/* Jump to here if this rule does not match */
5403
            }
5404
5405
151
             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sygusGrammar1618);
5406
151
            if  (HASEXCEPTION())
5407
            {
5408
                goto rulesygusGrammarEx;
5409
            }
5410
5411
5412
            {
5413
5414
                    // pop scope from the pre-declaration
5415
151
                    PARSER_STATE->popScope();
5416
5417
            }
5418
5419
5420
        }
5421
5422
    }
5423
5424
    // This is where rules clean up and exit
5425
    //
5426
151
    goto rulesygusGrammarEx; /* Prevent compiler warnings */
5427
151
    rulesygusGrammarEx: ;
5428
5429
151
            if (HASEXCEPTION())
5430
            {
5431
                PREPORTERROR();
5432
                PRECOVER();
5433
            }
5434
302
    return ;
5435
}
5436
/* $ANTLR end sygusGrammar */
5437
5438
/**
5439
 * $ANTLR start setInfoInternal
5440
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:735:1: setInfoInternal[std::unique_ptr<cvc5::Command>* cmd] : KEYWORD symbolicExpr[sexpr] ;
5441
 */
5442
static void
5443
3367
setInfoInternal(pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd)
5444
{
5445
5446
6734
      std::string name;
5447
6734
      api::Term sexpr;
5448
5449
    pANTLR3_COMMON_TOKEN    KEYWORD4;
5450
5451
    /* Initialize rule variables
5452
     */
5453
5454
3367
    KEYWORD4       = NULL;
5455
5456
    {
5457
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:740:3: ( KEYWORD symbolicExpr[sexpr] )
5458
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:740:5: KEYWORD symbolicExpr[sexpr]
5459
        {
5460
3367
            KEYWORD4 = (pANTLR3_COMMON_TOKEN) MATCHT(KEYWORD, &FOLLOW_KEYWORD_in_setInfoInternal1639);
5461
3367
            if  (HASEXCEPTION())
5462
            {
5463
                goto rulesetInfoInternalEx;
5464
            }
5465
5466
5467
3367
            FOLLOWPUSH(FOLLOW_symbolicExpr_in_setInfoInternal1641);
5468
3367
            symbolicExpr(ctx, sexpr);
5469
5470
3367
            FOLLOWPOP();
5471
3367
            if  (HASEXCEPTION())
5472
            {
5473
                goto rulesetInfoInternalEx;
5474
            }
5475
5476
5477
            {
5478
3367
                 name = AntlrInput::tokenText(KEYWORD4);
5479
3367
                      cmd->reset(new SetInfoCommand(name.c_str() + 1, sexprToString(sexpr)));
5480
5481
            }
5482
5483
5484
        }
5485
5486
    }
5487
5488
    // This is where rules clean up and exit
5489
    //
5490
3367
    goto rulesetInfoInternalEx; /* Prevent compiler warnings */
5491
3367
    rulesetInfoInternalEx: ;
5492
5493
3367
            if (HASEXCEPTION())
5494
            {
5495
                PREPORTERROR();
5496
                PRECOVER();
5497
            }
5498
6734
    return ;
5499
}
5500
/* $ANTLR end setInfoInternal */
5501
5502
/**
5503
 * $ANTLR start setOptionInternal
5504
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:746:1: setOptionInternal[std::unique_ptr<cvc5::Command>* cmd] : keyword[name] symbolicExpr[sexpr] ;
5505
 */
5506
static void
5507
1675
setOptionInternal(pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd)
5508
{
5509
    /* Initialize rule variables
5510
     */
5511
5512
5513
3350
      std::string name;
5514
3350
      api::Term sexpr;
5515
5516
    {
5517
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:751:3: ( keyword[name] symbolicExpr[sexpr] )
5518
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:751:5: keyword[name] symbolicExpr[sexpr]
5519
        {
5520
1675
            FOLLOWPUSH(FOLLOW_keyword_in_setOptionInternal1667);
5521
1675
            keyword(ctx, name);
5522
5523
1675
            FOLLOWPOP();
5524
1675
            if  (HASEXCEPTION())
5525
            {
5526
                goto rulesetOptionInternalEx;
5527
            }
5528
5529
5530
1675
            FOLLOWPUSH(FOLLOW_symbolicExpr_in_setOptionInternal1670);
5531
1675
            symbolicExpr(ctx, sexpr);
5532
5533
1675
            FOLLOWPOP();
5534
1675
            if  (HASEXCEPTION())
5535
            {
5536
                goto rulesetOptionInternalEx;
5537
            }
5538
5539
5540
            {
5541
1675
                 cmd->reset(new SetOptionCommand(name.c_str() + 1, sexprToString(sexpr)));
5542
                      // Ugly that this changes the state of the parser; but
5543
                      // global-declarations affects parsing, so we can't hold off
5544
                      // on this until some SmtEngine eventually (if ever) executes it.
5545
1675
                      if(name == ":global-declarations")
5546
                      {
5547
13
                        SYM_MAN->setGlobalDeclarations(sexprToString(sexpr) == "true");
5548
                      }
5549
5550
            }
5551
5552
5553
        }
5554
5555
    }
5556
5557
    // This is where rules clean up and exit
5558
    //
5559
1675
    goto rulesetOptionInternalEx; /* Prevent compiler warnings */
5560
1675
    rulesetOptionInternalEx: ;
5561
5562
1675
            if (HASEXCEPTION())
5563
            {
5564
                PREPORTERROR();
5565
                PRECOVER();
5566
            }
5567
3350
    return ;
5568
}
5569
/* $ANTLR end setOptionInternal */
5570
5571
/**
5572
 * $ANTLR start smt25Command
5573
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:763:1: smt25Command[std::unique_ptr<cvc5::Command>* cmd] : ( DECLARE_CONST_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] | GET_MODEL_TOK | ECHO_TOK ( simpleSymbolicExpr[s] |) | RESET_TOK | RESET_ASSERTIONS_TOK | DEFINE_FUN_REC_TOK symbol[fname,CHECK_NONE,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] term[expr, expr2] | DEFINE_FUNS_REC_TOK LPAREN_TOK ( LPAREN_TOK symbol[fname,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK LPAREN_TOK ( term[expr,expr2] )+ RPAREN_TOK );
5574
 */
5575
static void
5576
1503
smt25Command(pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd)
5577
{
5578
5579
3006
      std::string name;
5580
3006
      std::string fname;
5581
3006
      cvc5::api::Term expr, expr2;
5582
3006
      std::vector<std::pair<std::string, cvc5::api::Sort> > sortedVarNames;
5583
3006
      std::string s;
5584
3006
      cvc5::api::Sort t;
5585
3006
      cvc5::api::Term func;
5586
3006
      std::vector<cvc5::api::Term> bvs;
5587
      std::vector<std::vector<std::pair<std::string, cvc5::api::Sort>>>
5588
3006
          sortedVarNamesList;
5589
3006
      std::vector<std::vector<cvc5::api::Term>> flattenVarsList;
5590
3006
      std::vector<std::vector<cvc5::api::Term>> formals;
5591
3006
      std::vector<cvc5::api::Term> funcs;
5592
3006
      std::vector<cvc5::api::Term> func_defs;
5593
3006
      cvc5::api::Term aexpr;
5594
3006
      std::unique_ptr<cvc5::CommandSequence> seq;
5595
3006
      std::vector<api::Sort> sorts;
5596
3006
      std::vector<cvc5::api::Term> flattenVars;
5597
5598
    /* Initialize rule variables
5599
     */
5600
5601
    {
5602
        {
5603
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:785:3: ( DECLARE_CONST_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] | GET_MODEL_TOK | ECHO_TOK ( simpleSymbolicExpr[s] |) | RESET_TOK | RESET_ASSERTIONS_TOK | DEFINE_FUN_REC_TOK symbol[fname,CHECK_NONE,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] term[expr, expr2] | DEFINE_FUNS_REC_TOK LPAREN_TOK ( LPAREN_TOK symbol[fname,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK LPAREN_TOK ( term[expr,expr2] )+ RPAREN_TOK )
5604
5605
            ANTLR3_UINT32 alt23;
5606
5607
1503
            alt23=7;
5608
5609
1503
            switch ( LA(1) )
5610
            {
5611
1345
            case DECLARE_CONST_TOK:
5612
            	{
5613
1345
            		alt23=1;
5614
            	}
5615
1345
                break;
5616
19
            case GET_MODEL_TOK:
5617
            	{
5618
19
            		alt23=2;
5619
            	}
5620
19
                break;
5621
9
            case ECHO_TOK:
5622
            	{
5623
9
            		alt23=3;
5624
            	}
5625
9
                break;
5626
25
            case RESET_TOK:
5627
            	{
5628
25
            		alt23=4;
5629
            	}
5630
25
                break;
5631
24
            case RESET_ASSERTIONS_TOK:
5632
            	{
5633
24
            		alt23=5;
5634
            	}
5635
24
                break;
5636
60
            case DEFINE_FUN_REC_TOK:
5637
            	{
5638
60
            		alt23=6;
5639
            	}
5640
60
                break;
5641
21
            case DEFINE_FUNS_REC_TOK:
5642
            	{
5643
21
            		alt23=7;
5644
            	}
5645
21
                break;
5646
5647
            default:
5648
                CONSTRUCTEX();
5649
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
5650
                EXCEPTION->message      = (void *)"";
5651
                EXCEPTION->decisionNum  = 23;
5652
                EXCEPTION->state        = 0;
5653
5654
5655
                goto rulesmt25CommandEx;
5656
5657
            }
5658
5659
1503
            switch (alt23)
5660
            {
5661
1345
        	case 1:
5662
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:785:5: DECLARE_CONST_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED]
5663
        	    {
5664
1345
        	         MATCHT(DECLARE_CONST_TOK, &FOLLOW_DECLARE_CONST_TOK_in_smt25Command1702);
5665
1345
        	        if  (HASEXCEPTION())
5666
        	        {
5667
        	            goto rulesmt25CommandEx;
5668
        	        }
5669
5670
5671
        	        {
5672
1345
        	             PARSER_STATE->checkThatLogicIsSet();
5673
        	        }
5674
5675
5676
1345
        	        FOLLOWPUSH(FOLLOW_symbol_in_smt25Command1710);
5677
1345
        	        symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
5678
5679
1345
        	        FOLLOWPOP();
5680
1345
        	        if  (HASEXCEPTION())
5681
        	        {
5682
        	            goto rulesmt25CommandEx;
5683
        	        }
5684
5685
5686
        	        {
5687
1345
        	             PARSER_STATE->checkUserSymbol(name);
5688
        	        }
5689
5690
5691
1345
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_smt25Command1723);
5692
1345
        	        sortSymbol(ctx, t, CHECK_DECLARED);
5693
5694
1345
        	        FOLLOWPOP();
5695
1345
        	        if  (HASEXCEPTION())
5696
        	        {
5697
        	            goto rulesmt25CommandEx;
5698
        	        }
5699
5700
5701
        	        {
5702
        	             // allow overloading here
5703
1345
        	                  if( PARSER_STATE->sygus() )
5704
        	                  {
5705
        	                    PARSER_STATE->parseErrorLogic("declare-const is not allowed in sygus "
5706
        	                                                  "version 2.0");
5707
        	                  }
5708
        	                  api::Term c =
5709
2690
        	                      PARSER_STATE->bindVar(name, t, false, true);
5710
1345
        	                  cmd->reset(new DeclareFunctionCommand(name, c, t));
5711
1345
        	        }
5712
5713
5714
        	    }
5715
1345
        	    break;
5716
19
        	case 2:
5717
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:800:5: GET_MODEL_TOK
5718
        	    {
5719
19
        	         MATCHT(GET_MODEL_TOK, &FOLLOW_GET_MODEL_TOK_in_smt25Command1743);
5720
19
        	        if  (HASEXCEPTION())
5721
        	        {
5722
        	            goto rulesmt25CommandEx;
5723
        	        }
5724
5725
5726
        	        {
5727
19
        	             PARSER_STATE->checkThatLogicIsSet();
5728
        	        }
5729
5730
5731
        	        {
5732
19
        	             cmd->reset(new GetModelCommand());
5733
        	        }
5734
5735
5736
        	    }
5737
19
        	    break;
5738
9
        	case 3:
5739
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:804:5: ECHO_TOK ( simpleSymbolicExpr[s] |)
5740
        	    {
5741
9
        	         MATCHT(ECHO_TOK, &FOLLOW_ECHO_TOK_in_smt25Command1764);
5742
9
        	        if  (HASEXCEPTION())
5743
        	        {
5744
        	            goto rulesmt25CommandEx;
5745
        	        }
5746
5747
5748
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:805:5: ( simpleSymbolicExpr[s] |)
5749
        	        {
5750
9
        	            int alt20=2;
5751
9
        	            switch ( LA(1) )
5752
        	            {
5753
9
        	            case ASSERT_TOK:
5754
        	            case BINARY_LITERAL:
5755
        	            case CHECK_SAT_ASSUMING_TOK:
5756
        	            case CHECK_SAT_TOK:
5757
        	            case DECIMAL_LITERAL:
5758
        	            case DECLARE_DATATYPES_TOK:
5759
        	            case DECLARE_FUN_TOK:
5760
        	            case DECLARE_SORT_TOK:
5761
        	            case DEFINE_FUNS_REC_TOK:
5762
        	            case DEFINE_FUN_REC_TOK:
5763
        	            case DEFINE_FUN_TOK:
5764
        	            case DEFINE_SORT_TOK:
5765
        	            case ECHO_TOK:
5766
        	            case EXIT_TOK:
5767
        	            case GET_ASSERTIONS_TOK:
5768
        	            case GET_ASSIGNMENT_TOK:
5769
        	            case GET_DIFFICULTY_TOK:
5770
        	            case GET_INFO_TOK:
5771
        	            case GET_MODEL_TOK:
5772
        	            case GET_OPTION_TOK:
5773
        	            case GET_PROOF_TOK:
5774
        	            case GET_UNSAT_ASSUMPTIONS_TOK:
5775
        	            case GET_UNSAT_CORE_TOK:
5776
        	            case GET_VALUE_TOK:
5777
        	            case HEX_LITERAL:
5778
        	            case INTEGER_LITERAL:
5779
        	            case KEYWORD:
5780
        	            case POP_TOK:
5781
        	            case PUSH_TOK:
5782
        	            case QUOTED_SYMBOL:
5783
        	            case RESET_ASSERTIONS_TOK:
5784
        	            case RESET_TOK:
5785
        	            case SET_INFO_TOK:
5786
        	            case SET_LOGIC_TOK:
5787
        	            case SET_OPTION_TOK:
5788
        	            case SIMPLE_SYMBOL:
5789
        	            case SIMPLIFY_TOK:
5790
        	            case STRING_LITERAL:
5791
        	            case UNTERMINATED_QUOTED_SYMBOL:
5792
        	            	{
5793
9
        	            		alt20=1;
5794
        	            	}
5795
9
        	                break;
5796
        	            case RPAREN_TOK:
5797
        	            	{
5798
        	            		alt20=2;
5799
        	            	}
5800
        	                break;
5801
5802
        	            default:
5803
        	                CONSTRUCTEX();
5804
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
5805
        	                EXCEPTION->message      = (void *)"";
5806
        	                EXCEPTION->decisionNum  = 20;
5807
        	                EXCEPTION->state        = 0;
5808
5809
5810
        	                goto rulesmt25CommandEx;
5811
5812
        	            }
5813
5814
9
        	            switch (alt20)
5815
        	            {
5816
9
        	        	case 1:
5817
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:805:7: simpleSymbolicExpr[s]
5818
        	        	    {
5819
9
        	        	        FOLLOWPUSH(FOLLOW_simpleSymbolicExpr_in_smt25Command1772);
5820
9
        	        	        simpleSymbolicExpr(ctx, s);
5821
5822
9
        	        	        FOLLOWPOP();
5823
9
        	        	        if  (HASEXCEPTION())
5824
        	        	        {
5825
        	        	            goto rulesmt25CommandEx;
5826
        	        	        }
5827
5828
5829
        	        	        {
5830
9
        	        	             cmd->reset(new EchoCommand(s));
5831
        	        	        }
5832
5833
5834
        	        	    }
5835
9
        	        	    break;
5836
        	        	case 2:
5837
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:807:7:
5838
        	        	    {
5839
        	        	        {
5840
        	        	             cmd->reset(new EchoCommand());
5841
        	        	        }
5842
5843
5844
        	        	    }
5845
        	        	    break;
5846
5847
        	            }
5848
        	        }
5849
5850
        	    }
5851
9
        	    break;
5852
25
        	case 4:
5853
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:812:5: RESET_TOK
5854
        	    {
5855
25
        	         MATCHT(RESET_TOK, &FOLLOW_RESET_TOK_in_smt25Command1808);
5856
25
        	        if  (HASEXCEPTION())
5857
        	        {
5858
        	            goto rulesmt25CommandEx;
5859
        	        }
5860
5861
5862
        	        {
5863
5864
25
        	                  cmd->reset(new ResetCommand());
5865
        	                  // reset the state of the parser, which is independent of the symbol
5866
        	                  // manager
5867
25
        	                  PARSER_STATE->reset();
5868
5869
        	        }
5870
5871
5872
        	    }
5873
25
        	    break;
5874
24
        	case 5:
5875
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:821:5: RESET_ASSERTIONS_TOK
5876
        	    {
5877
24
        	         MATCHT(RESET_ASSERTIONS_TOK, &FOLLOW_RESET_ASSERTIONS_TOK_in_smt25Command1826);
5878
24
        	        if  (HASEXCEPTION())
5879
        	        {
5880
        	            goto rulesmt25CommandEx;
5881
        	        }
5882
5883
5884
        	        {
5885
24
        	             cmd->reset(new ResetAssertionsCommand());
5886
5887
        	        }
5888
5889
5890
        	    }
5891
24
        	    break;
5892
60
        	case 6:
5893
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:824:5: DEFINE_FUN_REC_TOK symbol[fname,CHECK_NONE,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] term[expr, expr2]
5894
        	    {
5895
60
        	         MATCHT(DEFINE_FUN_REC_TOK, &FOLLOW_DEFINE_FUN_REC_TOK_in_smt25Command1838);
5896
60
        	        if  (HASEXCEPTION())
5897
        	        {
5898
        	            goto rulesmt25CommandEx;
5899
        	        }
5900
5901
5902
        	        {
5903
60
        	             PARSER_STATE->checkThatLogicIsSet();
5904
        	        }
5905
5906
5907
60
        	        FOLLOWPUSH(FOLLOW_symbol_in_smt25Command1850);
5908
60
        	        symbol(ctx, fname, CHECK_NONE, SYM_VARIABLE);
5909
5910
60
        	        FOLLOWPOP();
5911
60
        	        if  (HASEXCEPTION())
5912
        	        {
5913
        	            goto rulesmt25CommandEx;
5914
        	        }
5915
5916
5917
        	        {
5918
60
        	             PARSER_STATE->checkUserSymbol(fname);
5919
        	        }
5920
5921
5922
60
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_smt25Command1863);
5923
60
        	        if  (HASEXCEPTION())
5924
        	        {
5925
        	            goto rulesmt25CommandEx;
5926
        	        }
5927
5928
5929
60
        	        FOLLOWPUSH(FOLLOW_sortedVarList_in_smt25Command1865);
5930
60
        	        sortedVarList(ctx, sortedVarNames);
5931
5932
60
        	        FOLLOWPOP();
5933
60
        	        if  (HASEXCEPTION())
5934
        	        {
5935
        	            goto rulesmt25CommandEx;
5936
        	        }
5937
5938
5939
60
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_smt25Command1868);
5940
60
        	        if  (HASEXCEPTION())
5941
        	        {
5942
        	            goto rulesmt25CommandEx;
5943
        	        }
5944
5945
5946
60
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_smt25Command1874);
5947
60
        	        sortSymbol(ctx, t, CHECK_DECLARED);
5948
5949
60
        	        FOLLOWPOP();
5950
60
        	        if  (HASEXCEPTION())
5951
        	        {
5952
        	            goto rulesmt25CommandEx;
5953
        	        }
5954
5955
5956
        	        {
5957
5958
60
        	                  func =
5959
120
        	                      PARSER_STATE->bindDefineFunRec(fname, sortedVarNames, t, flattenVars);
5960
60
        	                  PARSER_STATE->pushDefineFunRecScope(
5961
        	                      sortedVarNames, func, flattenVars, bvs);
5962
5963
        	        }
5964
5965
5966
60
        	        FOLLOWPUSH(FOLLOW_term_in_smt25Command1887);
5967
60
        	        term(ctx, expr, expr2);
5968
5969
60
        	        FOLLOWPOP();
5970
60
        	        if  (HASEXCEPTION())
5971
        	        {
5972
        	            goto rulesmt25CommandEx;
5973
        	        }
5974
5975
5976
        	        {
5977
60
        	             PARSER_STATE->popScope();
5978
60
        	                  if( !flattenVars.empty() ){
5979
        	                    expr = PARSER_STATE->mkHoApply( expr, flattenVars );
5980
        	                  }
5981
120
        	                  cmd->reset(new DefineFunctionRecCommand(
5982
60
        	                      func, bvs, expr, SYM_MAN->getGlobalDeclarations()));
5983
5984
        	        }
5985
5986
5987
        	    }
5988
60
        	    break;
5989
21
        	case 7:
5990
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:844:5: DEFINE_FUNS_REC_TOK LPAREN_TOK ( LPAREN_TOK symbol[fname,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )+ RPAREN_TOK LPAREN_TOK ( term[expr,expr2] )+ RPAREN_TOK
5991
        	    {
5992
21
        	         MATCHT(DEFINE_FUNS_REC_TOK, &FOLLOW_DEFINE_FUNS_REC_TOK_in_smt25Command1900);
5993
21
        	        if  (HASEXCEPTION())
5994
        	        {
5995
        	            goto rulesmt25CommandEx;
5996
        	        }
5997
5998
5999
        	        {
6000
21
        	             PARSER_STATE->checkThatLogicIsSet();
6001
        	        }
6002
6003
6004
21
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_smt25Command1912);
6005
21
        	        if  (HASEXCEPTION())
6006
        	        {
6007
        	            goto rulesmt25CommandEx;
6008
        	        }
6009
6010
6011
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:847:5: ( LPAREN_TOK symbol[fname,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )+
6012
        	        {
6013
21
        	            int cnt21=0;
6014
6015
        	            for (;;)
6016
        	            {
6017
76
        	                int alt21=2;
6018
76
        	        	switch ( LA(1) )
6019
        	        	{
6020
55
        	        	case LPAREN_TOK:
6021
        	        		{
6022
55
        	        			alt21=1;
6023
        	        		}
6024
55
        	        	    break;
6025
6026
        	        	}
6027
6028
76
        	        	switch (alt21)
6029
        	        	{
6030
55
        	        	    case 1:
6031
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:847:7: LPAREN_TOK symbol[fname,CHECK_UNDECLARED,SYM_VARIABLE] LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK sortSymbol[t,CHECK_DECLARED] RPAREN_TOK
6032
        	        	        {
6033
55
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_smt25Command1920);
6034
55
        	        	            if  (HASEXCEPTION())
6035
        	        	            {
6036
        	        	                goto rulesmt25CommandEx;
6037
        	        	            }
6038
6039
6040
55
        	        	            FOLLOWPUSH(FOLLOW_symbol_in_smt25Command1928);
6041
55
        	        	            symbol(ctx, fname, CHECK_UNDECLARED, SYM_VARIABLE);
6042
6043
55
        	        	            FOLLOWPOP();
6044
55
        	        	            if  (HASEXCEPTION())
6045
        	        	            {
6046
        	        	                goto rulesmt25CommandEx;
6047
        	        	            }
6048
6049
6050
        	        	            {
6051
55
        	        	                 PARSER_STATE->checkUserSymbol(fname);
6052
        	        	            }
6053
6054
6055
55
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_smt25Command1945);
6056
55
        	        	            if  (HASEXCEPTION())
6057
        	        	            {
6058
        	        	                goto rulesmt25CommandEx;
6059
        	        	            }
6060
6061
6062
55
        	        	            FOLLOWPUSH(FOLLOW_sortedVarList_in_smt25Command1947);
6063
55
        	        	            sortedVarList(ctx, sortedVarNames);
6064
6065
55
        	        	            FOLLOWPOP();
6066
55
        	        	            if  (HASEXCEPTION())
6067
        	        	            {
6068
        	        	                goto rulesmt25CommandEx;
6069
        	        	            }
6070
6071
6072
55
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_smt25Command1950);
6073
55
        	        	            if  (HASEXCEPTION())
6074
        	        	            {
6075
        	        	                goto rulesmt25CommandEx;
6076
        	        	            }
6077
6078
6079
55
        	        	            FOLLOWPUSH(FOLLOW_sortSymbol_in_smt25Command1958);
6080
55
        	        	            sortSymbol(ctx, t, CHECK_DECLARED);
6081
6082
55
        	        	            FOLLOWPOP();
6083
55
        	        	            if  (HASEXCEPTION())
6084
        	        	            {
6085
        	        	                goto rulesmt25CommandEx;
6086
        	        	            }
6087
6088
6089
        	        	            {
6090
6091
55
        	        	                        flattenVars.clear();
6092
55
        	        	                        func = PARSER_STATE->bindDefineFunRec(
6093
        	        	                            fname, sortedVarNames, t, flattenVars);
6094
55
        	        	                        funcs.push_back( func );
6095
6096
        	        	                        // add to lists (need to remember for when parsing the bodies)
6097
55
        	        	                        sortedVarNamesList.push_back( sortedVarNames );
6098
55
        	        	                        flattenVarsList.push_back( flattenVars );
6099
6100
        	        	                        // set up parsing the next variable list block
6101
55
        	        	                        sortedVarNames.clear();
6102
55
        	        	                        flattenVars.clear();
6103
6104
        	        	            }
6105
6106
6107
55
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_smt25Command1975);
6108
55
        	        	            if  (HASEXCEPTION())
6109
        	        	            {
6110
        	        	                goto rulesmt25CommandEx;
6111
        	        	            }
6112
6113
6114
        	        	        }
6115
55
        	        	        break;
6116
6117
21
        	        	    default:
6118
6119
21
        	        		if ( cnt21 >= 1 )
6120
        	        		{
6121
21
        	        		    goto loop21;
6122
        	        		}
6123
        	        		/* mismatchedSetEx()
6124
        	        		 */
6125
        	        		CONSTRUCTEX();
6126
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
6127
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
6128
6129
6130
        	        		goto rulesmt25CommandEx;
6131
        	        	}
6132
55
        	        	cnt21++;
6133
55
        	            }
6134
21
        	            loop21: ;	/* Jump to here if this rule does not match */
6135
        	        }
6136
6137
21
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_smt25Command1988);
6138
21
        	        if  (HASEXCEPTION())
6139
        	        {
6140
        	            goto rulesmt25CommandEx;
6141
        	        }
6142
6143
6144
21
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_smt25Command1994);
6145
21
        	        if  (HASEXCEPTION())
6146
        	        {
6147
        	            goto rulesmt25CommandEx;
6148
        	        }
6149
6150
6151
        	        {
6152
6153
        	                  //set up the first scope
6154
21
        	                  if( sortedVarNamesList.empty() ){
6155
        	                    PARSER_STATE->parseError("Must define at least one function in "
6156
        	                                             "define-funs-rec");
6157
        	                  }
6158
21
        	                  bvs.clear();
6159
42
        	                  PARSER_STATE->pushDefineFunRecScope( sortedVarNamesList[0], funcs[0],
6160
21
        	                                                       flattenVarsList[0], bvs);
6161
6162
        	        }
6163
6164
6165
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:880:5: ( term[expr,expr2] )+
6166
        	        {
6167
21
        	            int cnt22=0;
6168
6169
        	            for (;;)
6170
        	            {
6171
76
        	                int alt22=2;
6172
76
        	        	switch ( LA(1) )
6173
        	        	{
6174
55
        	        	case BINARY_LITERAL:
6175
        	        	case DECIMAL_LITERAL:
6176
        	        	case HEX_LITERAL:
6177
        	        	case INTEGER_LITERAL:
6178
        	        	case LPAREN_TOK:
6179
        	        	case QUOTED_SYMBOL:
6180
        	        	case SIMPLE_SYMBOL:
6181
        	        	case STRING_LITERAL:
6182
        	        	case TUPLE_CONST_TOK:
6183
        	        	case UNTERMINATED_QUOTED_SYMBOL:
6184
        	        		{
6185
55
        	        			alt22=1;
6186
        	        		}
6187
55
        	        	    break;
6188
6189
        	        	}
6190
6191
76
        	        	switch (alt22)
6192
        	        	{
6193
55
        	        	    case 1:
6194
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:881:5: term[expr,expr2]
6195
        	        	        {
6196
55
        	        	            FOLLOWPUSH(FOLLOW_term_in_smt25Command2012);
6197
55
        	        	            term(ctx, expr, expr2);
6198
6199
55
        	        	            FOLLOWPOP();
6200
55
        	        	            if  (HASEXCEPTION())
6201
        	        	            {
6202
        	        	                goto rulesmt25CommandEx;
6203
        	        	            }
6204
6205
6206
        	        	            {
6207
6208
55
        	        	                      unsigned j = func_defs.size();
6209
55
        	        	                      if( !flattenVarsList[j].empty() ){
6210
        	        	                        expr = PARSER_STATE->mkHoApply( expr, flattenVarsList[j] );
6211
        	        	                      }
6212
55
        	        	                      func_defs.push_back( expr );
6213
55
        	        	                      formals.push_back(bvs);
6214
55
        	        	                      j++;
6215
        	        	                      //set up the next scope
6216
55
        	        	                      PARSER_STATE->popScope();
6217
55
        	        	                      if( func_defs.size()<funcs.size() ){
6218
34
        	        	                        bvs.clear();
6219
68
        	        	                        PARSER_STATE->pushDefineFunRecScope( sortedVarNamesList[j], funcs[j],
6220
34
        	        	                                                             flattenVarsList[j], bvs);
6221
        	        	                      }
6222
6223
        	        	            }
6224
6225
6226
        	        	        }
6227
55
        	        	        break;
6228
6229
21
        	        	    default:
6230
6231
21
        	        		if ( cnt22 >= 1 )
6232
        	        		{
6233
21
        	        		    goto loop22;
6234
        	        		}
6235
        	        		/* mismatchedSetEx()
6236
        	        		 */
6237
        	        		CONSTRUCTEX();
6238
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
6239
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
6240
6241
6242
        	        		goto rulesmt25CommandEx;
6243
        	        	}
6244
55
        	        	cnt22++;
6245
55
        	            }
6246
21
        	            loop22: ;	/* Jump to here if this rule does not match */
6247
        	        }
6248
6249
21
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_smt25Command2032);
6250
21
        	        if  (HASEXCEPTION())
6251
        	        {
6252
        	            goto rulesmt25CommandEx;
6253
        	        }
6254
6255
6256
        	        {
6257
21
        	             if( funcs.size()!=func_defs.size() ){
6258
        	                    PARSER_STATE->parseError(std::string(
6259
        	                        "Number of functions defined does not match number listed in "
6260
        	                        "define-funs-rec"));
6261
        	                  }
6262
21
        	                  cmd->reset(new DefineFunctionRecCommand(
6263
21
        	                      funcs, formals, func_defs, SYM_MAN->getGlobalDeclarations()));
6264
6265
        	        }
6266
6267
6268
        	    }
6269
21
        	    break;
6270
6271
            }
6272
        }
6273
    }
6274
6275
    // This is where rules clean up and exit
6276
    //
6277
1503
    goto rulesmt25CommandEx; /* Prevent compiler warnings */
6278
1503
    rulesmt25CommandEx: ;
6279
6280
1503
            if (HASEXCEPTION())
6281
            {
6282
                PREPORTERROR();
6283
                PRECOVER();
6284
            }
6285
3006
    return ;
6286
}
6287
/* $ANTLR end smt25Command */
6288
6289
/**
6290
 * $ANTLR start extendedCommand
6291
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:910:1: extendedCommand[std::unique_ptr<cvc5::Command>* cmd] : ( DECLARE_CODATATYPE_TOK datatypeDefCommand[true, cmd] | DECLARE_CODATATYPES_TOK datatypesDefCommand[true, cmd] | DECLARE_SORTS_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )+ RPAREN_TOK | DECLARE_FUNS_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] nonemptySortList[sorts] RPAREN_TOK )+ RPAREN_TOK | DECLARE_PREDS_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortList[sorts] RPAREN_TOK )+ RPAREN_TOK | DEFINE_TOK ( symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] | LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortedVarList[sortedVarNames] RPAREN_TOK term[e,e2] ) | DEFINE_CONST_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] term[e, e2] | SIMPLIFY_TOK term[e,e2] | GET_QE_TOK term[e,e2] | GET_QE_DISJUNCT_TOK term[e,e2] | GET_ABDUCT_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] ( sygusGrammar[g, terms, name] )? | GET_INTERPOL_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] ( sygusGrammar[g, terms, name] )? | DECLARE_HEAP LPAREN_TOK sortSymbol[t, CHECK_DECLARED] sortSymbol[s, CHECK_DECLARED] RPAREN_TOK | DECLARE_POOL symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] LPAREN_TOK ( term[e, e2] )* RPAREN_TOK | BLOCK_MODEL_TOK | BLOCK_MODEL_VALUES_TOK ( LPAREN_TOK termList[terms,e] RPAREN_TOK |~ LPAREN_TOK ) );
6292
 */
6293
static void
6294
113
extendedCommand(pSmt2Parser ctx, std::unique_ptr<cvc5::Command>* cmd)
6295
{
6296
6297
226
      std::vector<api::DatatypeDecl> dts;
6298
226
      cvc5::api::Term e, e2;
6299
226
      cvc5::api::Sort t, s;
6300
226
      std::string name;
6301
226
      std::vector<std::string> names;
6302
226
      std::vector<cvc5::api::Term> terms;
6303
226
      std::vector<api::Sort> sorts;
6304
226
      std::vector<std::pair<std::string, cvc5::api::Sort> > sortedVarNames;
6305
226
      std::unique_ptr<cvc5::CommandSequence> seq;
6306
113
      api::Grammar* g = nullptr;
6307
6308
    /* Initialize rule variables
6309
     */
6310
6311
    {
6312
        {
6313
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:925:3: ( DECLARE_CODATATYPE_TOK datatypeDefCommand[true, cmd] | DECLARE_CODATATYPES_TOK datatypesDefCommand[true, cmd] | DECLARE_SORTS_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )+ RPAREN_TOK | DECLARE_FUNS_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] nonemptySortList[sorts] RPAREN_TOK )+ RPAREN_TOK | DECLARE_PREDS_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortList[sorts] RPAREN_TOK )+ RPAREN_TOK | DEFINE_TOK ( symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] | LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortedVarList[sortedVarNames] RPAREN_TOK term[e,e2] ) | DEFINE_CONST_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] term[e, e2] | SIMPLIFY_TOK term[e,e2] | GET_QE_TOK term[e,e2] | GET_QE_DISJUNCT_TOK term[e,e2] | GET_ABDUCT_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] ( sygusGrammar[g, terms, name] )? | GET_INTERPOL_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] ( sygusGrammar[g, terms, name] )? | DECLARE_HEAP LPAREN_TOK sortSymbol[t, CHECK_DECLARED] sortSymbol[s, CHECK_DECLARED] RPAREN_TOK | DECLARE_POOL symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] LPAREN_TOK ( term[e, e2] )* RPAREN_TOK | BLOCK_MODEL_TOK | BLOCK_MODEL_VALUES_TOK ( LPAREN_TOK termList[terms,e] RPAREN_TOK |~ LPAREN_TOK ) )
6314
6315
            ANTLR3_UINT32 alt32;
6316
6317
113
            alt32=16;
6318
6319
113
            switch ( LA(1) )
6320
            {
6321
2
            case DECLARE_CODATATYPE_TOK:
6322
            	{
6323
2
            		alt32=1;
6324
            	}
6325
2
                break;
6326
14
            case DECLARE_CODATATYPES_TOK:
6327
            	{
6328
14
            		alt32=2;
6329
            	}
6330
14
                break;
6331
            case DECLARE_SORTS_TOK:
6332
            	{
6333
            		alt32=3;
6334
            	}
6335
                break;
6336
2
            case DECLARE_FUNS_TOK:
6337
            	{
6338
2
            		alt32=4;
6339
            	}
6340
2
                break;
6341
            case DECLARE_PREDS_TOK:
6342
            	{
6343
            		alt32=5;
6344
            	}
6345
                break;
6346
4
            case DEFINE_TOK:
6347
            	{
6348
4
            		alt32=6;
6349
            	}
6350
4
                break;
6351
4
            case DEFINE_CONST_TOK:
6352
            	{
6353
4
            		alt32=7;
6354
            	}
6355
4
                break;
6356
1
            case SIMPLIFY_TOK:
6357
            	{
6358
1
            		alt32=8;
6359
            	}
6360
1
                break;
6361
7
            case GET_QE_TOK:
6362
            	{
6363
7
            		alt32=9;
6364
            	}
6365
7
                break;
6366
1
            case GET_QE_DISJUNCT_TOK:
6367
            	{
6368
1
            		alt32=10;
6369
            	}
6370
1
                break;
6371
12
            case GET_ABDUCT_TOK:
6372
            	{
6373
12
            		alt32=11;
6374
            	}
6375
12
                break;
6376
8
            case GET_INTERPOL_TOK:
6377
            	{
6378
8
            		alt32=12;
6379
            	}
6380
8
                break;
6381
45
            case DECLARE_HEAP:
6382
            	{
6383
45
            		alt32=13;
6384
            	}
6385
45
                break;
6386
1
            case DECLARE_POOL:
6387
            	{
6388
1
            		alt32=14;
6389
            	}
6390
1
                break;
6391
8
            case BLOCK_MODEL_TOK:
6392
            	{
6393
8
            		alt32=15;
6394
            	}
6395
8
                break;
6396
4
            case BLOCK_MODEL_VALUES_TOK:
6397
            	{
6398
4
            		alt32=16;
6399
            	}
6400
4
                break;
6401
6402
            default:
6403
                CONSTRUCTEX();
6404
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
6405
                EXCEPTION->message      = (void *)"";
6406
                EXCEPTION->decisionNum  = 32;
6407
                EXCEPTION->state        = 0;
6408
6409
6410
                goto ruleextendedCommandEx;
6411
6412
            }
6413
6414
113
            switch (alt32)
6415
            {
6416
2
        	case 1:
6417
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:925:5: DECLARE_CODATATYPE_TOK datatypeDefCommand[true, cmd]
6418
        	    {
6419
2
        	         MATCHT(DECLARE_CODATATYPE_TOK, &FOLLOW_DECLARE_CODATATYPE_TOK_in_extendedCommand2063);
6420
2
        	        if  (HASEXCEPTION())
6421
        	        {
6422
        	            goto ruleextendedCommandEx;
6423
        	        }
6424
6425
6426
2
        	        FOLLOWPUSH(FOLLOW_datatypeDefCommand_in_extendedCommand2065);
6427
2
        	        datatypeDefCommand(ctx, true, cmd);
6428
6429
2
        	        FOLLOWPOP();
6430
2
        	        if  (HASEXCEPTION())
6431
        	        {
6432
        	            goto ruleextendedCommandEx;
6433
        	        }
6434
6435
6436
        	    }
6437
2
        	    break;
6438
14
        	case 2:
6439
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:926:5: DECLARE_CODATATYPES_TOK datatypesDefCommand[true, cmd]
6440
        	    {
6441
14
        	         MATCHT(DECLARE_CODATATYPES_TOK, &FOLLOW_DECLARE_CODATATYPES_TOK_in_extendedCommand2072);
6442
14
        	        if  (HASEXCEPTION())
6443
        	        {
6444
        	            goto ruleextendedCommandEx;
6445
        	        }
6446
6447
6448
14
        	        FOLLOWPUSH(FOLLOW_datatypesDefCommand_in_extendedCommand2074);
6449
14
        	        datatypesDefCommand(ctx, true, cmd);
6450
6451
14
        	        FOLLOWPOP();
6452
14
        	        if  (HASEXCEPTION())
6453
        	        {
6454
        	            goto ruleextendedCommandEx;
6455
        	        }
6456
6457
6458
        	    }
6459
14
        	    break;
6460
        	case 3:
6461
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:930:5: DECLARE_SORTS_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )+ RPAREN_TOK
6462
        	    {
6463
        	         MATCHT(DECLARE_SORTS_TOK, &FOLLOW_DECLARE_SORTS_TOK_in_extendedCommand2089);
6464
        	        if  (HASEXCEPTION())
6465
        	        {
6466
        	            goto ruleextendedCommandEx;
6467
        	        }
6468
6469
6470
        	        {
6471
6472
        	                  PARSER_STATE->checkThatLogicIsSet();
6473
        	                  PARSER_STATE->checkLogicAllowsFreeSorts();
6474
        	                  seq.reset(new cvc5::CommandSequence());
6475
6476
        	        }
6477
6478
6479
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2101);
6480
        	        if  (HASEXCEPTION())
6481
        	        {
6482
        	            goto ruleextendedCommandEx;
6483
        	        }
6484
6485
6486
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:937:5: ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )+
6487
        	        {
6488
        	            int cnt24=0;
6489
6490
        	            for (;;)
6491
        	            {
6492
        	                int alt24=2;
6493
        	        	switch ( LA(1) )
6494
        	        	{
6495
        	        	case QUOTED_SYMBOL:
6496
        	        	case SIMPLE_SYMBOL:
6497
        	        	case UNTERMINATED_QUOTED_SYMBOL:
6498
        	        		{
6499
        	        			alt24=1;
6500
        	        		}
6501
        	        	    break;
6502
6503
        	        	}
6504
6505
        	        	switch (alt24)
6506
        	        	{
6507
        	        	    case 1:
6508
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:937:7: symbol[name,CHECK_UNDECLARED,SYM_SORT]
6509
        	        	        {
6510
        	        	            FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2109);
6511
        	        	            symbol(ctx, name, CHECK_UNDECLARED, SYM_SORT);
6512
6513
        	        	            FOLLOWPOP();
6514
        	        	            if  (HASEXCEPTION())
6515
        	        	            {
6516
        	        	                goto ruleextendedCommandEx;
6517
        	        	            }
6518
6519
6520
        	        	            {
6521
        	        	                 PARSER_STATE->checkUserSymbol(name);
6522
        	        	                        api::Sort type = PARSER_STATE->mkSort(name);
6523
        	        	                        seq->addCommand(new DeclareSortCommand(name, 0, type));
6524
6525
        	        	            }
6526
6527
6528
        	        	        }
6529
        	        	        break;
6530
6531
        	        	    default:
6532
6533
        	        		if ( cnt24 >= 1 )
6534
        	        		{
6535
        	        		    goto loop24;
6536
        	        		}
6537
        	        		/* mismatchedSetEx()
6538
        	        		 */
6539
        	        		CONSTRUCTEX();
6540
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
6541
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
6542
6543
6544
        	        		goto ruleextendedCommandEx;
6545
        	        	}
6546
        	        	cnt24++;
6547
        	            }
6548
        	            loop24: ;	/* Jump to here if this rule does not match */
6549
        	        }
6550
6551
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2131);
6552
        	        if  (HASEXCEPTION())
6553
        	        {
6554
        	            goto ruleextendedCommandEx;
6555
        	        }
6556
6557
6558
        	        {
6559
        	             cmd->reset(seq.release());
6560
        	        }
6561
6562
6563
        	    }
6564
        	    break;
6565
2
        	case 4:
6566
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:946:5: DECLARE_FUNS_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] nonemptySortList[sorts] RPAREN_TOK )+ RPAREN_TOK
6567
        	    {
6568
2
        	         MATCHT(DECLARE_FUNS_TOK, &FOLLOW_DECLARE_FUNS_TOK_in_extendedCommand2144);
6569
2
        	        if  (HASEXCEPTION())
6570
        	        {
6571
        	            goto ruleextendedCommandEx;
6572
        	        }
6573
6574
6575
        	        {
6576
2
        	             PARSER_STATE->checkThatLogicIsSet();
6577
        	        }
6578
6579
6580
        	        {
6581
2
        	             seq.reset(new cvc5::CommandSequence());
6582
        	        }
6583
6584
6585
2
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2158);
6586
2
        	        if  (HASEXCEPTION())
6587
        	        {
6588
        	            goto ruleextendedCommandEx;
6589
        	        }
6590
6591
6592
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:949:5: ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] nonemptySortList[sorts] RPAREN_TOK )+
6593
        	        {
6594
2
        	            int cnt25=0;
6595
6596
        	            for (;;)
6597
        	            {
6598
6
        	                int alt25=2;
6599
6
        	        	switch ( LA(1) )
6600
        	        	{
6601
4
        	        	case LPAREN_TOK:
6602
        	        		{
6603
4
        	        			alt25=1;
6604
        	        		}
6605
4
        	        	    break;
6606
6607
        	        	}
6608
6609
6
        	        	switch (alt25)
6610
        	        	{
6611
4
        	        	    case 1:
6612
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:949:7: LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] nonemptySortList[sorts] RPAREN_TOK
6613
        	        	        {
6614
4
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2166);
6615
4
        	        	            if  (HASEXCEPTION())
6616
        	        	            {
6617
        	        	                goto ruleextendedCommandEx;
6618
        	        	            }
6619
6620
6621
4
        	        	            FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2168);
6622
4
        	        	            symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
6623
6624
4
        	        	            FOLLOWPOP();
6625
4
        	        	            if  (HASEXCEPTION())
6626
        	        	            {
6627
        	        	                goto ruleextendedCommandEx;
6628
        	        	            }
6629
6630
6631
        	        	            {
6632
4
        	        	                 PARSER_STATE->checkUserSymbol(name);
6633
        	        	            }
6634
6635
6636
4
        	        	            FOLLOWPUSH(FOLLOW_nonemptySortList_in_extendedCommand2185);
6637
4
        	        	            nonemptySortList(ctx, sorts);
6638
6639
4
        	        	            FOLLOWPOP();
6640
4
        	        	            if  (HASEXCEPTION())
6641
        	        	            {
6642
        	        	                goto ruleextendedCommandEx;
6643
        	        	            }
6644
6645
6646
4
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2188);
6647
4
        	        	            if  (HASEXCEPTION())
6648
        	        	            {
6649
        	        	                goto ruleextendedCommandEx;
6650
        	        	            }
6651
6652
6653
        	        	            {
6654
8
        	        	                 api::Sort tt;
6655
4
        	        	                        if(sorts.size() > 1) {
6656
        	        	                          PARSER_STATE->checkLogicAllowsFunctions();
6657
        	        	                          // must flatten
6658
        	        	                          api::Sort range = sorts.back();
6659
        	        	                          sorts.pop_back();
6660
        	        	                          tt = PARSER_STATE->mkFlatFunctionType(sorts, range);
6661
        	        	                        } else {
6662
4
        	        	                          tt = sorts[0];
6663
        	        	                        }
6664
        	        	                        // allow overloading
6665
        	        	                        api::Term func =
6666
8
        	        	                            PARSER_STATE->bindVar(name, tt, false, true);
6667
4
        	        	                        seq->addCommand(new DeclareFunctionCommand(name, func, tt));
6668
4
        	        	                        sorts.clear();
6669
6670
4
        	        	            }
6671
6672
6673
        	        	        }
6674
4
        	        	        break;
6675
6676
2
        	        	    default:
6677
6678
2
        	        		if ( cnt25 >= 1 )
6679
        	        		{
6680
2
        	        		    goto loop25;
6681
        	        		}
6682
        	        		/* mismatchedSetEx()
6683
        	        		 */
6684
        	        		CONSTRUCTEX();
6685
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
6686
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
6687
6688
6689
        	        		goto ruleextendedCommandEx;
6690
        	        	}
6691
4
        	        	cnt25++;
6692
4
        	            }
6693
2
        	            loop25: ;	/* Jump to here if this rule does not match */
6694
        	        }
6695
6696
2
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2209);
6697
2
        	        if  (HASEXCEPTION())
6698
        	        {
6699
        	            goto ruleextendedCommandEx;
6700
        	        }
6701
6702
6703
        	        {
6704
2
        	             cmd->reset(seq.release());
6705
        	        }
6706
6707
6708
        	    }
6709
2
        	    break;
6710
        	case 5:
6711
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:971:5: DECLARE_PREDS_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortList[sorts] RPAREN_TOK )+ RPAREN_TOK
6712
        	    {
6713
        	         MATCHT(DECLARE_PREDS_TOK, &FOLLOW_DECLARE_PREDS_TOK_in_extendedCommand2221);
6714
        	        if  (HASEXCEPTION())
6715
        	        {
6716
        	            goto ruleextendedCommandEx;
6717
        	        }
6718
6719
6720
        	        {
6721
        	             PARSER_STATE->checkThatLogicIsSet();
6722
        	        }
6723
6724
6725
        	        {
6726
        	             seq.reset(new cvc5::CommandSequence());
6727
        	        }
6728
6729
6730
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2235);
6731
        	        if  (HASEXCEPTION())
6732
        	        {
6733
        	            goto ruleextendedCommandEx;
6734
        	        }
6735
6736
6737
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:974:5: ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortList[sorts] RPAREN_TOK )+
6738
        	        {
6739
        	            int cnt26=0;
6740
6741
        	            for (;;)
6742
        	            {
6743
        	                int alt26=2;
6744
        	        	switch ( LA(1) )
6745
        	        	{
6746
        	        	case LPAREN_TOK:
6747
        	        		{
6748
        	        			alt26=1;
6749
        	        		}
6750
        	        	    break;
6751
6752
        	        	}
6753
6754
        	        	switch (alt26)
6755
        	        	{
6756
        	        	    case 1:
6757
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:974:7: LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortList[sorts] RPAREN_TOK
6758
        	        	        {
6759
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2243);
6760
        	        	            if  (HASEXCEPTION())
6761
        	        	            {
6762
        	        	                goto ruleextendedCommandEx;
6763
        	        	            }
6764
6765
6766
        	        	            FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2245);
6767
        	        	            symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
6768
6769
        	        	            FOLLOWPOP();
6770
        	        	            if  (HASEXCEPTION())
6771
        	        	            {
6772
        	        	                goto ruleextendedCommandEx;
6773
        	        	            }
6774
6775
6776
        	        	            {
6777
        	        	                 PARSER_STATE->checkUserSymbol(name);
6778
        	        	            }
6779
6780
6781
        	        	            FOLLOWPUSH(FOLLOW_sortList_in_extendedCommand2262);
6782
        	        	            sortList(ctx, sorts);
6783
6784
        	        	            FOLLOWPOP();
6785
        	        	            if  (HASEXCEPTION())
6786
        	        	            {
6787
        	        	                goto ruleextendedCommandEx;
6788
        	        	            }
6789
6790
6791
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2265);
6792
        	        	            if  (HASEXCEPTION())
6793
        	        	            {
6794
        	        	                goto ruleextendedCommandEx;
6795
        	        	            }
6796
6797
6798
        	        	            {
6799
        	        	                 t = SOLVER->getBooleanSort();
6800
        	        	                        if(sorts.size() > 0) {
6801
        	        	                          PARSER_STATE->checkLogicAllowsFunctions();
6802
        	        	                          t = SOLVER->mkFunctionSort(sorts, t);
6803
        	        	                        }
6804
        	        	                        // allow overloading
6805
        	        	                        api::Term func =
6806
        	        	                            PARSER_STATE->bindVar(name, t, false, true);
6807
        	        	                        seq->addCommand(new DeclareFunctionCommand(name, func, t));
6808
        	        	                        sorts.clear();
6809
6810
        	        	            }
6811
6812
6813
        	        	        }
6814
        	        	        break;
6815
6816
        	        	    default:
6817
6818
        	        		if ( cnt26 >= 1 )
6819
        	        		{
6820
        	        		    goto loop26;
6821
        	        		}
6822
        	        		/* mismatchedSetEx()
6823
        	        		 */
6824
        	        		CONSTRUCTEX();
6825
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
6826
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
6827
6828
6829
        	        		goto ruleextendedCommandEx;
6830
        	        	}
6831
        	        	cnt26++;
6832
        	            }
6833
        	            loop26: ;	/* Jump to here if this rule does not match */
6834
        	        }
6835
6836
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2286);
6837
        	        if  (HASEXCEPTION())
6838
        	        {
6839
        	            goto ruleextendedCommandEx;
6840
        	        }
6841
6842
6843
        	        {
6844
        	             cmd->reset(seq.release());
6845
        	        }
6846
6847
6848
        	    }
6849
        	    break;
6850
4
        	case 6:
6851
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:992:5: DEFINE_TOK ( symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] | LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortedVarList[sortedVarNames] RPAREN_TOK term[e,e2] )
6852
        	    {
6853
4
        	         MATCHT(DEFINE_TOK, &FOLLOW_DEFINE_TOK_in_extendedCommand2299);
6854
4
        	        if  (HASEXCEPTION())
6855
        	        {
6856
        	            goto ruleextendedCommandEx;
6857
        	        }
6858
6859
6860
        	        {
6861
4
        	             PARSER_STATE->checkThatLogicIsSet();
6862
        	        }
6863
6864
6865
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:993:5: ( symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] | LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortedVarList[sortedVarNames] RPAREN_TOK term[e,e2] )
6866
        	        {
6867
4
        	            int alt27=2;
6868
4
        	            switch ( LA(1) )
6869
        	            {
6870
3
        	            case QUOTED_SYMBOL:
6871
        	            case SIMPLE_SYMBOL:
6872
        	            case UNTERMINATED_QUOTED_SYMBOL:
6873
        	            	{
6874
3
        	            		alt27=1;
6875
        	            	}
6876
3
        	                break;
6877
1
        	            case LPAREN_TOK:
6878
        	            	{
6879
1
        	            		alt27=2;
6880
        	            	}
6881
1
        	                break;
6882
6883
        	            default:
6884
        	                CONSTRUCTEX();
6885
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
6886
        	                EXCEPTION->message      = (void *)"";
6887
        	                EXCEPTION->decisionNum  = 27;
6888
        	                EXCEPTION->state        = 0;
6889
6890
6891
        	                goto ruleextendedCommandEx;
6892
6893
        	            }
6894
6895
4
        	            switch (alt27)
6896
        	            {
6897
3
        	        	case 1:
6898
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:994:7: symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2]
6899
        	        	    {
6900
3
        	        	        FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2316);
6901
3
        	        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
6902
6903
3
        	        	        FOLLOWPOP();
6904
3
        	        	        if  (HASEXCEPTION())
6905
        	        	        {
6906
        	        	            goto ruleextendedCommandEx;
6907
        	        	        }
6908
6909
6910
        	        	        {
6911
3
        	        	             PARSER_STATE->checkUserSymbol(name);
6912
        	        	        }
6913
6914
6915
3
        	        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2333);
6916
3
        	        	        term(ctx, e, e2);
6917
6918
3
        	        	        FOLLOWPOP();
6919
3
        	        	        if  (HASEXCEPTION())
6920
        	        	        {
6921
        	        	            goto ruleextendedCommandEx;
6922
        	        	        }
6923
6924
6925
        	        	        {
6926
6927
6
        	        	                    api::Term func = PARSER_STATE->bindVar(name, e.getSort());
6928
6
        	        	                    cmd->reset(new DefineFunctionCommand(
6929
3
        	        	                        name, func, e, SYM_MAN->getGlobalDeclarations()));
6930
6931
3
        	        	        }
6932
6933
6934
        	        	    }
6935
3
        	        	    break;
6936
1
        	        	case 2:
6937
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1003:7: LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortedVarList[sortedVarNames] RPAREN_TOK term[e,e2]
6938
        	        	    {
6939
1
        	        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2357);
6940
1
        	        	        if  (HASEXCEPTION())
6941
        	        	        {
6942
        	        	            goto ruleextendedCommandEx;
6943
        	        	        }
6944
6945
6946
1
        	        	        FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2365);
6947
1
        	        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
6948
6949
1
        	        	        FOLLOWPOP();
6950
1
        	        	        if  (HASEXCEPTION())
6951
        	        	        {
6952
        	        	            goto ruleextendedCommandEx;
6953
        	        	        }
6954
6955
6956
        	        	        {
6957
1
        	        	             PARSER_STATE->checkUserSymbol(name);
6958
        	        	        }
6959
6960
6961
1
        	        	        FOLLOWPUSH(FOLLOW_sortedVarList_in_extendedCommand2382);
6962
1
        	        	        sortedVarList(ctx, sortedVarNames);
6963
6964
1
        	        	        FOLLOWPOP();
6965
1
        	        	        if  (HASEXCEPTION())
6966
        	        	        {
6967
        	        	            goto ruleextendedCommandEx;
6968
        	        	        }
6969
6970
6971
1
        	        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2385);
6972
1
        	        	        if  (HASEXCEPTION())
6973
        	        	        {
6974
        	        	            goto ruleextendedCommandEx;
6975
        	        	        }
6976
6977
6978
        	        	        {
6979
        	        	             /* add variables to parser state before parsing term */
6980
1
        	        	                    Debug("parser") << "define fun: '" << name << "'" << std::endl;
6981
1
        	        	                    PARSER_STATE->pushScope();
6982
1
        	        	                    terms = PARSER_STATE->bindBoundVars(sortedVarNames);
6983
6984
        	        	        }
6985
6986
6987
1
        	        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2401);
6988
1
        	        	        term(ctx, e, e2);
6989
6990
1
        	        	        FOLLOWPOP();
6991
1
        	        	        if  (HASEXCEPTION())
6992
        	        	        {
6993
        	        	            goto ruleextendedCommandEx;
6994
        	        	        }
6995
6996
6997
        	        	        {
6998
6999
1
        	        	                    PARSER_STATE->popScope();
7000
        	        	                    // declare the name down here (while parsing term, signature
7001
        	        	                    // must not be extended with the name itself; no recursion
7002
        	        	                    // permitted)
7003
2
        	        	                    api::Sort tt = e.getSort();
7004
1
        	        	                    if( sortedVarNames.size() > 0 ) {
7005
1
        	        	                      sorts.reserve(sortedVarNames.size());
7006
1
        	        	                      for(std::vector<std::pair<std::string, api::Sort> >::const_iterator
7007
1
        	        	                            i = sortedVarNames.begin(), iend = sortedVarNames.end();
7008
2
        	        	                          i != iend; ++i) {
7009
1
        	        	                        sorts.push_back((*i).second);
7010
        	        	                      }
7011
1
        	        	                      tt = SOLVER->mkFunctionSort(sorts, tt);
7012
        	        	                    }
7013
2
        	        	                    api::Term func = PARSER_STATE->bindVar(name, tt);
7014
2
        	        	                    cmd->reset(new DefineFunctionCommand(
7015
1
        	        	                        name, func, terms, e, SYM_MAN->getGlobalDeclarations()));
7016
7017
1
        	        	        }
7018
7019
7020
        	        	    }
7021
1
        	        	    break;
7022
7023
        	            }
7024
        	        }
7025
7026
        	    }
7027
4
        	    break;
7028
4
        	case 7:
7029
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1034:5: DEFINE_CONST_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] term[e, e2]
7030
        	    {
7031
4
        	         MATCHT(DEFINE_CONST_TOK, &FOLLOW_DEFINE_CONST_TOK_in_extendedCommand2427);
7032
4
        	        if  (HASEXCEPTION())
7033
        	        {
7034
        	            goto ruleextendedCommandEx;
7035
        	        }
7036
7037
7038
        	        {
7039
4
        	             PARSER_STATE->checkThatLogicIsSet();
7040
        	        }
7041
7042
7043
4
        	        FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2435);
7044
4
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
7045
7046
4
        	        FOLLOWPOP();
7047
4
        	        if  (HASEXCEPTION())
7048
        	        {
7049
        	            goto ruleextendedCommandEx;
7050
        	        }
7051
7052
7053
        	        {
7054
4
        	             PARSER_STATE->checkUserSymbol(name);
7055
        	        }
7056
7057
7058
4
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_extendedCommand2448);
7059
4
        	        sortSymbol(ctx, t, CHECK_DECLARED);
7060
7061
4
        	        FOLLOWPOP();
7062
4
        	        if  (HASEXCEPTION())
7063
        	        {
7064
        	            goto ruleextendedCommandEx;
7065
        	        }
7066
7067
7068
4
        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2455);
7069
4
        	        term(ctx, e, e2);
7070
7071
4
        	        FOLLOWPOP();
7072
4
        	        if  (HASEXCEPTION())
7073
        	        {
7074
        	            goto ruleextendedCommandEx;
7075
        	        }
7076
7077
7078
        	        {
7079
7080
        	                  // declare the name down here (while parsing term, signature
7081
        	                  // must not be extended with the name itself; no recursion
7082
        	                  // permitted)
7083
8
        	                  api::Term func = PARSER_STATE->bindVar(name, t);
7084
8
        	                  cmd->reset(new DefineFunctionCommand(
7085
4
        	                      name, func, terms, e, SYM_MAN->getGlobalDeclarations()));
7086
7087
4
        	        }
7088
7089
7090
        	    }
7091
4
        	    break;
7092
1
        	case 8:
7093
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1048:5: SIMPLIFY_TOK term[e,e2]
7094
        	    {
7095
1
        	         MATCHT(SIMPLIFY_TOK, &FOLLOW_SIMPLIFY_TOK_in_extendedCommand2469);
7096
1
        	        if  (HASEXCEPTION())
7097
        	        {
7098
        	            goto ruleextendedCommandEx;
7099
        	        }
7100
7101
7102
        	        {
7103
1
        	             PARSER_STATE->checkThatLogicIsSet();
7104
        	        }
7105
7106
7107
1
        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2477);
7108
1
        	        term(ctx, e, e2);
7109
7110
        	        FOLLOWPOP();
7111
        	        if  (HASEXCEPTION())
7112
        	        {
7113
        	            goto ruleextendedCommandEx;
7114
        	        }
7115
7116
7117
        	        {
7118
        	             cmd->reset(new SimplifyCommand(e));
7119
        	        }
7120
7121
7122
        	    }
7123
        	    break;
7124
7
        	case 9:
7125
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1051:5: GET_QE_TOK term[e,e2]
7126
        	    {
7127
7
        	         MATCHT(GET_QE_TOK, &FOLLOW_GET_QE_TOK_in_extendedCommand2490);
7128
7
        	        if  (HASEXCEPTION())
7129
        	        {
7130
        	            goto ruleextendedCommandEx;
7131
        	        }
7132
7133
7134
        	        {
7135
7
        	             PARSER_STATE->checkThatLogicIsSet();
7136
        	        }
7137
7138
7139
7
        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2498);
7140
7
        	        term(ctx, e, e2);
7141
7142
7
        	        FOLLOWPOP();
7143
7
        	        if  (HASEXCEPTION())
7144
        	        {
7145
        	            goto ruleextendedCommandEx;
7146
        	        }
7147
7148
7149
        	        {
7150
7
        	             cmd->reset(new GetQuantifierEliminationCommand(e, true));
7151
        	        }
7152
7153
7154
        	    }
7155
7
        	    break;
7156
1
        	case 10:
7157
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1054:5: GET_QE_DISJUNCT_TOK term[e,e2]
7158
        	    {
7159
1
        	         MATCHT(GET_QE_DISJUNCT_TOK, &FOLLOW_GET_QE_DISJUNCT_TOK_in_extendedCommand2511);
7160
1
        	        if  (HASEXCEPTION())
7161
        	        {
7162
        	            goto ruleextendedCommandEx;
7163
        	        }
7164
7165
7166
        	        {
7167
1
        	             PARSER_STATE->checkThatLogicIsSet();
7168
        	        }
7169
7170
7171
1
        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2519);
7172
1
        	        term(ctx, e, e2);
7173
7174
1
        	        FOLLOWPOP();
7175
1
        	        if  (HASEXCEPTION())
7176
        	        {
7177
        	            goto ruleextendedCommandEx;
7178
        	        }
7179
7180
7181
        	        {
7182
1
        	             cmd->reset(new GetQuantifierEliminationCommand(e, false));
7183
        	        }
7184
7185
7186
        	    }
7187
1
        	    break;
7188
12
        	case 11:
7189
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1057:5: GET_ABDUCT_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] ( sygusGrammar[g, terms, name] )?
7190
        	    {
7191
12
        	         MATCHT(GET_ABDUCT_TOK, &FOLLOW_GET_ABDUCT_TOK_in_extendedCommand2532);
7192
12
        	        if  (HASEXCEPTION())
7193
        	        {
7194
        	            goto ruleextendedCommandEx;
7195
        	        }
7196
7197
7198
        	        {
7199
7200
12
        	                  PARSER_STATE->checkThatLogicIsSet();
7201
7202
        	        }
7203
7204
7205
12
        	        FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2540);
7206
12
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
7207
7208
12
        	        FOLLOWPOP();
7209
12
        	        if  (HASEXCEPTION())
7210
        	        {
7211
        	            goto ruleextendedCommandEx;
7212
        	        }
7213
7214
7215
12
        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2547);
7216
12
        	        term(ctx, e, e2);
7217
7218
12
        	        FOLLOWPOP();
7219
12
        	        if  (HASEXCEPTION())
7220
        	        {
7221
        	            goto ruleextendedCommandEx;
7222
        	        }
7223
7224
7225
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1062:5: ( sygusGrammar[g, terms, name] )?
7226
        	        {
7227
12
        	            int alt28=2;
7228
12
        	            switch ( LA(1) )
7229
        	            {
7230
4
        	                case LPAREN_TOK:
7231
        	                	{
7232
4
        	                		alt28=1;
7233
        	                	}
7234
4
        	                    break;
7235
        	            }
7236
7237
12
        	            switch (alt28)
7238
        	            {
7239
4
        	        	case 1:
7240
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1063:7: sygusGrammar[g, terms, name]
7241
        	        	    {
7242
4
        	        	        FOLLOWPUSH(FOLLOW_sygusGrammar_in_extendedCommand2562);
7243
4
        	        	        sygusGrammar(ctx, g, terms, name);
7244
7245
4
        	        	        FOLLOWPOP();
7246
4
        	        	        if  (HASEXCEPTION())
7247
        	        	        {
7248
        	        	            goto ruleextendedCommandEx;
7249
        	        	        }
7250
7251
7252
        	        	    }
7253
4
        	        	    break;
7254
7255
        	            }
7256
        	        }
7257
7258
        	        {
7259
7260
12
        	                  cmd->reset(new GetAbductCommand(name, e, g));
7261
7262
        	        }
7263
7264
7265
        	    }
7266
12
        	    break;
7267
8
        	case 12:
7268
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1068:5: GET_INTERPOL_TOK symbol[name,CHECK_UNDECLARED,SYM_VARIABLE] term[e,e2] ( sygusGrammar[g, terms, name] )?
7269
        	    {
7270
8
        	         MATCHT(GET_INTERPOL_TOK, &FOLLOW_GET_INTERPOL_TOK_in_extendedCommand2582);
7271
8
        	        if  (HASEXCEPTION())
7272
        	        {
7273
        	            goto ruleextendedCommandEx;
7274
        	        }
7275
7276
7277
        	        {
7278
7279
8
        	                  PARSER_STATE->checkThatLogicIsSet();
7280
7281
        	        }
7282
7283
7284
8
        	        FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2590);
7285
8
        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_VARIABLE);
7286
7287
8
        	        FOLLOWPOP();
7288
8
        	        if  (HASEXCEPTION())
7289
        	        {
7290
        	            goto ruleextendedCommandEx;
7291
        	        }
7292
7293
7294
8
        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2597);
7295
8
        	        term(ctx, e, e2);
7296
7297
8
        	        FOLLOWPOP();
7298
8
        	        if  (HASEXCEPTION())
7299
        	        {
7300
        	            goto ruleextendedCommandEx;
7301
        	        }
7302
7303
7304
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1073:5: ( sygusGrammar[g, terms, name] )?
7305
        	        {
7306
8
        	            int alt29=2;
7307
8
        	            switch ( LA(1) )
7308
        	            {
7309
1
        	                case LPAREN_TOK:
7310
        	                	{
7311
1
        	                		alt29=1;
7312
        	                	}
7313
1
        	                    break;
7314
        	            }
7315
7316
8
        	            switch (alt29)
7317
        	            {
7318
1
        	        	case 1:
7319
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1074:7: sygusGrammar[g, terms, name]
7320
        	        	    {
7321
1
        	        	        FOLLOWPUSH(FOLLOW_sygusGrammar_in_extendedCommand2612);
7322
1
        	        	        sygusGrammar(ctx, g, terms, name);
7323
7324
1
        	        	        FOLLOWPOP();
7325
1
        	        	        if  (HASEXCEPTION())
7326
        	        	        {
7327
        	        	            goto ruleextendedCommandEx;
7328
        	        	        }
7329
7330
7331
        	        	    }
7332
1
        	        	    break;
7333
7334
        	            }
7335
        	        }
7336
7337
        	        {
7338
7339
8
        	                  cmd->reset(new GetInterpolCommand(name, e, g));
7340
7341
        	        }
7342
7343
7344
        	    }
7345
8
        	    break;
7346
45
        	case 13:
7347
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1079:5: DECLARE_HEAP LPAREN_TOK sortSymbol[t, CHECK_DECLARED] sortSymbol[s, CHECK_DECLARED] RPAREN_TOK
7348
        	    {
7349
45
        	         MATCHT(DECLARE_HEAP, &FOLLOW_DECLARE_HEAP_in_extendedCommand2632);
7350
45
        	        if  (HASEXCEPTION())
7351
        	        {
7352
        	            goto ruleextendedCommandEx;
7353
        	        }
7354
7355
7356
45
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2634);
7357
45
        	        if  (HASEXCEPTION())
7358
        	        {
7359
        	            goto ruleextendedCommandEx;
7360
        	        }
7361
7362
7363
45
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_extendedCommand2640);
7364
45
        	        sortSymbol(ctx, t, CHECK_DECLARED);
7365
7366
45
        	        FOLLOWPOP();
7367
45
        	        if  (HASEXCEPTION())
7368
        	        {
7369
        	            goto ruleextendedCommandEx;
7370
        	        }
7371
7372
7373
45
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_extendedCommand2647);
7374
45
        	        sortSymbol(ctx, s, CHECK_DECLARED);
7375
7376
45
        	        FOLLOWPOP();
7377
45
        	        if  (HASEXCEPTION())
7378
        	        {
7379
        	            goto ruleextendedCommandEx;
7380
        	        }
7381
7382
7383
        	        {
7384
45
        	             cmd->reset(new DeclareHeapCommand(t, s));
7385
        	        }
7386
7387
7388
45
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2660);
7389
45
        	        if  (HASEXCEPTION())
7390
        	        {
7391
        	            goto ruleextendedCommandEx;
7392
        	        }
7393
7394
7395
        	    }
7396
45
        	    break;
7397
1
        	case 14:
7398
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1084:5: DECLARE_POOL symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] LPAREN_TOK ( term[e, e2] )* RPAREN_TOK
7399
        	    {
7400
1
        	         MATCHT(DECLARE_POOL, &FOLLOW_DECLARE_POOL_in_extendedCommand2666);
7401
1
        	        if  (HASEXCEPTION())
7402
        	        {
7403
        	            goto ruleextendedCommandEx;
7404
        	        }
7405
7406
7407
        	        {
7408
1
        	             PARSER_STATE->checkThatLogicIsSet();
7409
        	        }
7410
7411
7412
1
        	        FOLLOWPUSH(FOLLOW_symbol_in_extendedCommand2674);
7413
1
        	        symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
7414
7415
1
        	        FOLLOWPOP();
7416
1
        	        if  (HASEXCEPTION())
7417
        	        {
7418
        	            goto ruleextendedCommandEx;
7419
        	        }
7420
7421
7422
        	        {
7423
1
        	             PARSER_STATE->checkUserSymbol(name);
7424
        	        }
7425
7426
7427
1
        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_extendedCommand2687);
7428
1
        	        sortSymbol(ctx, t, CHECK_DECLARED);
7429
7430
1
        	        FOLLOWPOP();
7431
1
        	        if  (HASEXCEPTION())
7432
        	        {
7433
        	            goto ruleextendedCommandEx;
7434
        	        }
7435
7436
7437
1
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2694);
7438
1
        	        if  (HASEXCEPTION())
7439
        	        {
7440
        	            goto ruleextendedCommandEx;
7441
        	        }
7442
7443
7444
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1089:5: ( term[e, e2] )*
7445
7446
        	        for (;;)
7447
        	        {
7448
1
        	            int alt30=2;
7449
1
        	            switch ( LA(1) )
7450
        	            {
7451
        	            case BINARY_LITERAL:
7452
        	            case DECIMAL_LITERAL:
7453
        	            case HEX_LITERAL:
7454
        	            case INTEGER_LITERAL:
7455
        	            case LPAREN_TOK:
7456
        	            case QUOTED_SYMBOL:
7457
        	            case SIMPLE_SYMBOL:
7458
        	            case STRING_LITERAL:
7459
        	            case TUPLE_CONST_TOK:
7460
        	            case UNTERMINATED_QUOTED_SYMBOL:
7461
        	            	{
7462
        	            		alt30=1;
7463
        	            	}
7464
        	                break;
7465
7466
        	            }
7467
7468
1
        	            switch (alt30)
7469
        	            {
7470
        	        	case 1:
7471
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1089:7: term[e, e2]
7472
        	        	    {
7473
        	        	        FOLLOWPUSH(FOLLOW_term_in_extendedCommand2702);
7474
        	        	        term(ctx, e, e2);
7475
7476
        	        	        FOLLOWPOP();
7477
        	        	        if  (HASEXCEPTION())
7478
        	        	        {
7479
        	        	            goto ruleextendedCommandEx;
7480
        	        	        }
7481
7482
7483
        	        	        {
7484
        	        	             terms.push_back( e );
7485
        	        	        }
7486
7487
7488
        	        	    }
7489
        	        	    break;
7490
7491
1
        	        	default:
7492
1
        	        	    goto loop30;	/* break out of the loop */
7493
        	        	    break;
7494
        	            }
7495
        	        }
7496
1
        	        loop30: ; /* Jump out to here if this rule does not match */
7497
7498
7499
1
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2720);
7500
1
        	        if  (HASEXCEPTION())
7501
        	        {
7502
        	            goto ruleextendedCommandEx;
7503
        	        }
7504
7505
7506
        	        {
7507
1
        	             Debug("parser") << "declare pool: '" << name << "'" << std::endl;
7508
2
        	                  api::Term pool = SOLVER->declarePool(name, t, terms);
7509
1
        	                  PARSER_STATE->defineVar(name, pool);
7510
1
        	                  cmd->reset(new DeclarePoolCommand(name, pool, t, terms));
7511
7512
1
        	        }
7513
7514
7515
        	    }
7516
1
        	    break;
7517
8
        	case 15:
7518
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1097:5: BLOCK_MODEL_TOK
7519
        	    {
7520
8
        	         MATCHT(BLOCK_MODEL_TOK, &FOLLOW_BLOCK_MODEL_TOK_in_extendedCommand2732);
7521
8
        	        if  (HASEXCEPTION())
7522
        	        {
7523
        	            goto ruleextendedCommandEx;
7524
        	        }
7525
7526
7527
        	        {
7528
8
        	             PARSER_STATE->checkThatLogicIsSet();
7529
        	        }
7530
7531
7532
        	        {
7533
8
        	             cmd->reset(new BlockModelCommand());
7534
        	        }
7535
7536
7537
        	    }
7538
8
        	    break;
7539
4
        	case 16:
7540
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1100:5: BLOCK_MODEL_VALUES_TOK ( LPAREN_TOK termList[terms,e] RPAREN_TOK |~ LPAREN_TOK )
7541
        	    {
7542
4
        	         MATCHT(BLOCK_MODEL_VALUES_TOK, &FOLLOW_BLOCK_MODEL_VALUES_TOK_in_extendedCommand2747);
7543
4
        	        if  (HASEXCEPTION())
7544
        	        {
7545
        	            goto ruleextendedCommandEx;
7546
        	        }
7547
7548
7549
        	        {
7550
4
        	             PARSER_STATE->checkThatLogicIsSet();
7551
        	        }
7552
7553
7554
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1101:5: ( LPAREN_TOK termList[terms,e] RPAREN_TOK |~ LPAREN_TOK )
7555
        	        {
7556
4
        	            int alt31=2;
7557
4
        	            switch ( LA(1) )
7558
        	            {
7559
4
        	            case LPAREN_TOK:
7560
        	            	{
7561
4
        	            		alt31=1;
7562
        	            	}
7563
4
        	                break;
7564
        	            case ALPHA:
7565
        	            case ASSERT_TOK:
7566
        	            case ASSUME_TOK:
7567
        	            case AS_TOK:
7568
        	            case ATTRIBUTE_INST_ADD_TO_POOL_TOK:
7569
        	            case ATTRIBUTE_INST_LEVEL:
7570
        	            case ATTRIBUTE_NAMED_TOK:
7571
        	            case ATTRIBUTE_NO_PATTERN_TOK:
7572
        	            case ATTRIBUTE_PATTERN_TOK:
7573
        	            case ATTRIBUTE_POOL_TOK:
7574
        	            case ATTRIBUTE_QUANTIFIER_ID_TOK:
7575
        	            case ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK:
7576
        	            case ATTRIBUTE_TOK:
7577
        	            case BINARY_LITERAL:
7578
        	            case BLOCK_MODEL_TOK:
7579
        	            case BLOCK_MODEL_VALUES_TOK:
7580
        	            case CHAR_TOK:
7581
        	            case CHECK_SAT_ASSUMING_TOK:
7582
        	            case CHECK_SAT_TOK:
7583
        	            case CHECK_SYNTH_TOK:
7584
        	            case COMMENT:
7585
        	            case COMPREHENSION_TOK:
7586
        	            case CONSTRAINT_TOK:
7587
        	            case CONST_TOK:
7588
        	            case DECIMAL_LITERAL:
7589
        	            case DECLARE_CODATATYPES_2_5_TOK:
7590
        	            case DECLARE_CODATATYPES_TOK:
7591
        	            case DECLARE_CODATATYPE_TOK:
7592
        	            case DECLARE_CONST_TOK:
7593
        	            case DECLARE_DATATYPES_2_5_TOK:
7594
        	            case DECLARE_DATATYPES_TOK:
7595
        	            case DECLARE_DATATYPE_TOK:
7596
        	            case DECLARE_FUNS_TOK:
7597
        	            case DECLARE_FUN_TOK:
7598
        	            case DECLARE_HEAP:
7599
        	            case DECLARE_POOL:
7600
        	            case DECLARE_PREDS_TOK:
7601
        	            case DECLARE_SORTS_TOK:
7602
        	            case DECLARE_SORT_TOK:
7603
        	            case DECLARE_VAR_TOK:
7604
        	            case DEFINE_CONST_TOK:
7605
        	            case DEFINE_FUNS_REC_TOK:
7606
        	            case DEFINE_FUN_REC_TOK:
7607
        	            case DEFINE_FUN_TOK:
7608
        	            case DEFINE_SORT_TOK:
7609
        	            case DEFINE_TOK:
7610
        	            case DIGIT:
7611
        	            case ECHO_TOK:
7612
        	            case EMP_TOK:
7613
        	            case EXISTS_TOK:
7614
        	            case EXIT_TOK:
7615
        	            case FORALL_TOK:
7616
        	            case GET_ABDUCT_TOK:
7617
        	            case GET_ASSERTIONS_TOK:
7618
        	            case GET_ASSIGNMENT_TOK:
7619
        	            case GET_DIFFICULTY_TOK:
7620
        	            case GET_INFO_TOK:
7621
        	            case GET_INTERPOL_TOK:
7622
        	            case GET_MODEL_TOK:
7623
        	            case GET_OPTION_TOK:
7624
        	            case GET_PROOF_TOK:
7625
        	            case GET_QE_DISJUNCT_TOK:
7626
        	            case GET_QE_TOK:
7627
        	            case GET_UNSAT_ASSUMPTIONS_TOK:
7628
        	            case GET_UNSAT_CORE_TOK:
7629
        	            case GET_VALUE_TOK:
7630
        	            case HEX_DIGIT:
7631
        	            case HEX_LITERAL:
7632
        	            case HO_ARROW_TOK:
7633
        	            case HO_LAMBDA_TOK:
7634
        	            case INCLUDE_TOK:
7635
        	            case INDEX_TOK:
7636
        	            case INTEGER_LITERAL:
7637
        	            case INV_CONSTRAINT_TOK:
7638
        	            case KEYWORD:
7639
        	            case LET_TOK:
7640
        	            case MATCH_TOK:
7641
        	            case NUMERAL:
7642
        	            case PAR_TOK:
7643
        	            case POP_TOK:
7644
        	            case PUSH_TOK:
7645
        	            case QUOTED_SYMBOL:
7646
        	            case RESET_ASSERTIONS_TOK:
7647
        	            case RESET_TOK:
7648
        	            case RPAREN_TOK:
7649
        	            case SET_FEATURE_TOK:
7650
        	            case SET_INFO_TOK:
7651
        	            case SET_LOGIC_TOK:
7652
        	            case SET_OPTION_TOK:
7653
        	            case SIMPLE_SYMBOL:
7654
        	            case SIMPLIFY_TOK:
7655
        	            case STRING_LITERAL:
7656
        	            case SYGUS_CONSTANT_TOK:
7657
        	            case SYGUS_VARIABLE_TOK:
7658
        	            case SYMBOL_CHAR:
7659
        	            case SYMBOL_CHAR_NOUNDERSCORE_NOATTRIBUTE:
7660
        	            case SYNTH_FUN_TOK:
7661
        	            case SYNTH_INV_TOK:
7662
        	            case TESTER_TOK:
7663
        	            case TUPLE_CONST_TOK:
7664
        	            case TUPLE_PROJECT_TOK:
7665
        	            case TUPLE_SEL_TOK:
7666
        	            case UNTERMINATED_QUOTED_SYMBOL:
7667
        	            case UPDATE_TOK:
7668
        	            case WHITESPACE:
7669
        	            case 110:
7670
        	            	{
7671
        	            		alt31=2;
7672
        	            	}
7673
        	                break;
7674
7675
        	            default:
7676
        	                CONSTRUCTEX();
7677
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
7678
        	                EXCEPTION->message      = (void *)"";
7679
        	                EXCEPTION->decisionNum  = 31;
7680
        	                EXCEPTION->state        = 0;
7681
7682
7683
        	                goto ruleextendedCommandEx;
7684
7685
        	            }
7686
7687
4
        	            switch (alt31)
7688
        	            {
7689
4
        	        	case 1:
7690
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1101:7: LPAREN_TOK termList[terms,e] RPAREN_TOK
7691
        	        	    {
7692
4
        	        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_extendedCommand2757);
7693
4
        	        	        if  (HASEXCEPTION())
7694
        	        	        {
7695
        	        	            goto ruleextendedCommandEx;
7696
        	        	        }
7697
7698
7699
4
        	        	        FOLLOWPUSH(FOLLOW_termList_in_extendedCommand2759);
7700
4
        	        	        termList(ctx, terms, e);
7701
7702
4
        	        	        FOLLOWPOP();
7703
4
        	        	        if  (HASEXCEPTION())
7704
        	        	        {
7705
        	        	            goto ruleextendedCommandEx;
7706
        	        	        }
7707
7708
7709
4
        	        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_extendedCommand2762);
7710
4
        	        	        if  (HASEXCEPTION())
7711
        	        	        {
7712
        	        	            goto ruleextendedCommandEx;
7713
        	        	        }
7714
7715
7716
        	        	        {
7717
4
        	        	             cmd->reset(new BlockModelValuesCommand(terms));
7718
        	        	        }
7719
7720
7721
        	        	    }
7722
4
        	        	    break;
7723
        	        	case 2:
7724
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1103:7: ~ LPAREN_TOK
7725
        	        	    {
7726
        	        	        if ( ((LA(1) >= ALPHA) && (LA(1) <= LET_TOK)) || ((LA(1) >= MATCH_TOK) && (LA(1) <= 110)) )
7727
        	        	        {
7728
        	        	            CONSUME();
7729
        	        	            PERRORRECOVERY=ANTLR3_FALSE;
7730
        	        	        }
7731
        	        	        else
7732
        	        	        {
7733
        	        	            CONSTRUCTEX();
7734
        	        	            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
7735
        	        	            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
7736
        	        	            EXCEPTION->expectingSet = NULL;
7737
7738
        	        	            goto ruleextendedCommandEx;
7739
        	        	        }
7740
7741
7742
        	        	        {
7743
        	        	             PARSER_STATE->parseError("The block-model-value command expects a list "
7744
        	        	                                             "of terms.  Perhaps you forgot a pair of "
7745
        	        	                                             "parentheses?");
7746
7747
        	        	        }
7748
7749
7750
        	        	    }
7751
        	        	    break;
7752
7753
        	            }
7754
        	        }
7755
7756
        	    }
7757
4
        	    break;
7758
7759
            }
7760
        }
7761
    }
7762
7763
    // This is where rules clean up and exit
7764
    //
7765
112
    goto ruleextendedCommandEx; /* Prevent compiler warnings */
7766
112
    ruleextendedCommandEx: ;
7767
7768
112
            if (HASEXCEPTION())
7769
            {
7770
                PREPORTERROR();
7771
                PRECOVER();
7772
            }
7773
224
    return ;
7774
}
7775
/* $ANTLR end extendedCommand */
7776
7777
/**
7778
 * $ANTLR start datatypeDefCommand
7779
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1111:1: datatypeDefCommand[bool isCo, std::unique_ptr<cvc5::Command>* cmd] : symbol[name,CHECK_UNDECLARED,SYM_SORT] datatypesDef[isCo, dnames, arities, cmd] ;
7780
 */
7781
static void
7782
111
datatypeDefCommand(pSmt2Parser ctx, bool isCo, std::unique_ptr<cvc5::Command>* cmd)
7783
{
7784
7785
222
      std::vector<api::DatatypeDecl> dts;
7786
222
      std::string name;
7787
222
      std::vector<std::string> dnames;
7788
222
      std::vector<int> arities;
7789
7790
    /* Initialize rule variables
7791
     */
7792
7793
    {
7794
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1118:2: ( symbol[name,CHECK_UNDECLARED,SYM_SORT] datatypesDef[isCo, dnames, arities, cmd] )
7795
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1118:4: symbol[name,CHECK_UNDECLARED,SYM_SORT] datatypesDef[isCo, dnames, arities, cmd]
7796
        {
7797
            {
7798
111
                 PARSER_STATE->checkThatLogicIsSet();
7799
            }
7800
7801
7802
111
            FOLLOWPUSH(FOLLOW_symbol_in_datatypeDefCommand2814);
7803
111
            symbol(ctx, name, CHECK_UNDECLARED, SYM_SORT);
7804
7805
111
            FOLLOWPOP();
7806
111
            if  (HASEXCEPTION())
7807
            {
7808
                goto ruledatatypeDefCommandEx;
7809
            }
7810
7811
7812
            {
7813
7814
111
                   dnames.push_back(name);
7815
111
                   arities.push_back(-1);
7816
7817
            }
7818
7819
7820
111
            FOLLOWPUSH(FOLLOW_datatypesDef_in_datatypeDefCommand2821);
7821
111
            datatypesDef(ctx, isCo, dnames, arities, cmd);
7822
7823
111
            FOLLOWPOP();
7824
111
            if  (HASEXCEPTION())
7825
            {
7826
                goto ruledatatypeDefCommandEx;
7827
            }
7828
7829
7830
        }
7831
7832
    }
7833
7834
    // This is where rules clean up and exit
7835
    //
7836
111
    goto ruledatatypeDefCommandEx; /* Prevent compiler warnings */
7837
111
    ruledatatypeDefCommandEx: ;
7838
7839
111
            if (HASEXCEPTION())
7840
            {
7841
                PREPORTERROR();
7842
                PRECOVER();
7843
            }
7844
222
    return ;
7845
}
7846
/* $ANTLR end datatypeDefCommand */
7847
7848
/**
7849
 * $ANTLR start datatypesDefCommand
7850
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1127:1: datatypesDefCommand[bool isCo, std::unique_ptr<cvc5::Command>* cmd] : LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL RPAREN_TOK )* RPAREN_TOK LPAREN_TOK datatypesDef[isCo, dnames, arities, cmd] RPAREN_TOK ;
7851
 */
7852
static void
7853
556
datatypesDefCommand(pSmt2Parser ctx, bool isCo, std::unique_ptr<cvc5::Command>* cmd)
7854
{
7855
7856
1112
      std::vector<api::DatatypeDecl> dts;
7857
1112
      std::string name;
7858
1112
      std::vector<std::string> dnames;
7859
1112
      std::vector<int> arities;
7860
7861
    pANTLR3_COMMON_TOKEN    n;
7862
7863
    /* Initialize rule variables
7864
     */
7865
7866
556
    n       = NULL;
7867
7868
    {
7869
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1134:3: ( LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL RPAREN_TOK )* RPAREN_TOK LPAREN_TOK datatypesDef[isCo, dnames, arities, cmd] RPAREN_TOK )
7870
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1134:5: LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL RPAREN_TOK )* RPAREN_TOK LPAREN_TOK datatypesDef[isCo, dnames, arities, cmd] RPAREN_TOK
7871
        {
7872
            {
7873
556
                 PARSER_STATE->checkThatLogicIsSet();
7874
            }
7875
7876
7877
556
             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDefCommand2844);
7878
556
            if  (HASEXCEPTION())
7879
            {
7880
                goto ruledatatypesDefCommandEx;
7881
            }
7882
7883
7884
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1136:3: ( LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL RPAREN_TOK )*
7885
7886
            for (;;)
7887
            {
7888
1313
                int alt33=2;
7889
1313
                switch ( LA(1) )
7890
                {
7891
757
                case LPAREN_TOK:
7892
                	{
7893
757
                		alt33=1;
7894
                	}
7895
757
                    break;
7896
7897
                }
7898
7899
1313
                switch (alt33)
7900
                {
7901
757
            	case 1:
7902
            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1136:5: LPAREN_TOK symbol[name,CHECK_UNDECLARED,SYM_SORT] n= INTEGER_LITERAL RPAREN_TOK
7903
            	    {
7904
757
            	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDefCommand2852);
7905
757
            	        if  (HASEXCEPTION())
7906
            	        {
7907
            	            goto ruledatatypesDefCommandEx;
7908
            	        }
7909
7910
7911
757
            	        FOLLOWPUSH(FOLLOW_symbol_in_datatypesDefCommand2854);
7912
757
            	        symbol(ctx, name, CHECK_UNDECLARED, SYM_SORT);
7913
7914
757
            	        FOLLOWPOP();
7915
757
            	        if  (HASEXCEPTION())
7916
            	        {
7917
            	            goto ruledatatypesDefCommandEx;
7918
            	        }
7919
7920
7921
757
            	        n = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_datatypesDefCommand2859);
7922
757
            	        if  (HASEXCEPTION())
7923
            	        {
7924
            	            goto ruledatatypesDefCommandEx;
7925
            	        }
7926
7927
7928
757
            	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDefCommand2861);
7929
757
            	        if  (HASEXCEPTION())
7930
            	        {
7931
            	            goto ruledatatypesDefCommandEx;
7932
            	        }
7933
7934
7935
            	        {
7936
757
            	             unsigned arity = AntlrInput::tokenToUnsigned(n);
7937
757
            	                  Debug("parser-dt") << "Datatype : " << name << ", arity = " << arity << std::endl;
7938
757
            	                  dnames.push_back(name);
7939
757
            	                  arities.push_back( static_cast<int>(arity) );
7940
7941
757
            	        }
7942
7943
7944
            	    }
7945
757
            	    break;
7946
7947
556
            	default:
7948
556
            	    goto loop33;	/* break out of the loop */
7949
            	    break;
7950
                }
7951
757
            }
7952
556
            loop33: ; /* Jump out to here if this rule does not match */
7953
7954
7955
556
             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDefCommand2876);
7956
556
            if  (HASEXCEPTION())
7957
            {
7958
                goto ruledatatypesDefCommandEx;
7959
            }
7960
7961
7962
556
             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDefCommand2880);
7963
556
            if  (HASEXCEPTION())
7964
            {
7965
                goto ruledatatypesDefCommandEx;
7966
            }
7967
7968
7969
556
            FOLLOWPUSH(FOLLOW_datatypesDef_in_datatypesDefCommand2884);
7970
556
            datatypesDef(ctx, isCo, dnames, arities, cmd);
7971
7972
556
            FOLLOWPOP();
7973
556
            if  (HASEXCEPTION())
7974
            {
7975
                goto ruledatatypesDefCommandEx;
7976
            }
7977
7978
7979
556
             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDefCommand2889);
7980
556
            if  (HASEXCEPTION())
7981
            {
7982
                goto ruledatatypesDefCommandEx;
7983
            }
7984
7985
7986
        }
7987
7988
    }
7989
7990
    // This is where rules clean up and exit
7991
    //
7992
556
    goto ruledatatypesDefCommandEx; /* Prevent compiler warnings */
7993
556
    ruledatatypesDefCommandEx: ;
7994
7995
556
            if (HASEXCEPTION())
7996
            {
7997
                PREPORTERROR();
7998
                PRECOVER();
7999
            }
8000
1112
    return ;
8001
}
8002
/* $ANTLR end datatypesDefCommand */
8003
8004
/**
8005
 * $ANTLR start datatypesDef
8006
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1157:1: datatypesDef[bool isCo,\n const std::vector<std::string>& dnames,\n const std::vector<int>& arities,\n std::unique_ptr<cvc5::Command>* cmd] : ( LPAREN_TOK ( PAR_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ RPAREN_TOK | ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ ) RPAREN_TOK )+ ;
8007
 */
8008
static void
8009
667
datatypesDef(pSmt2Parser ctx, bool isCo, const std::vector<std::string>& dnames, const std::vector<int>& arities, std::unique_ptr<cvc5::Command>* cmd)
8010
{
8011
8012
1334
      std::vector<api::DatatypeDecl> dts;
8013
1334
      std::string name;
8014
1334
      std::vector<api::Sort> params;
8015
8016
    /* Initialize rule variables
8017
     */
8018
8019
    {
8020
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1166:3: ( ( LPAREN_TOK ( PAR_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ RPAREN_TOK | ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ ) RPAREN_TOK )+ )
8021
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1166:5: ( LPAREN_TOK ( PAR_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ RPAREN_TOK | ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ ) RPAREN_TOK )+
8022
        {
8023
            {
8024
667
                 PARSER_STATE->pushScope();
8025
                      // Declare the datatypes that are currently being defined as unresolved
8026
                      // types. If we do not know the arity of the datatype yet, we wait to
8027
                      // define it until parsing the preamble of its body, which may optionally
8028
                      // involve `par`. This is limited to the case of single datatypes defined
8029
                      // via declare-datatype, and hence no datatype body is parsed without
8030
                      // having all types declared. This ensures we can parse datatypes with
8031
                      // nested recursion, e.g. datatypes D having a subfield type
8032
                      // (Array Int D).
8033
1535
                      for (unsigned i=0, dsize=dnames.size(); i<dsize; i++)
8034
                      {
8035
868
                        if( arities[i]<0 )
8036
                        {
8037
                          // do not know the arity yet
8038
111
                          continue;
8039
                        }
8040
757
                        unsigned arity = static_cast<unsigned>(arities[i]);
8041
757
                        PARSER_STATE->mkUnresolvedType(dnames[i], arity);
8042
                      }
8043
8044
            }
8045
8046
8047
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1186:5: ( LPAREN_TOK ( PAR_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ RPAREN_TOK | ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ ) RPAREN_TOK )+
8048
            {
8049
667
                int cnt38=0;
8050
8051
                for (;;)
8052
                {
8053
1535
                    int alt38=2;
8054
1535
            	switch ( LA(1) )
8055
            	{
8056
868
            	case LPAREN_TOK:
8057
            		{
8058
868
            			alt38=1;
8059
            		}
8060
868
            	    break;
8061
8062
            	}
8063
8064
1535
            	switch (alt38)
8065
            	{
8066
868
            	    case 1:
8067
            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1186:7: LPAREN_TOK ( PAR_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ RPAREN_TOK | ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ ) RPAREN_TOK
8068
            	        {
8069
868
            	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDef2918);
8070
868
            	            if  (HASEXCEPTION())
8071
            	            {
8072
            	                goto ruledatatypesDefEx;
8073
            	            }
8074
8075
8076
            	            {
8077
8078
868
            	                      params.clear();
8079
868
            	                      Debug("parser-dt") << "Processing datatype #" << dts.size() << std::endl;
8080
868
            	                      if( dts.size()>=dnames.size() ){
8081
            	                        PARSER_STATE->parseError("Too many datatypes defined in this block.");
8082
            	                      }
8083
8084
            	            }
8085
8086
8087
            	            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1193:5: ( PAR_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ RPAREN_TOK | ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ )
8088
            	            {
8089
868
            	                int alt37=2;
8090
868
            	                switch ( LA(1) )
8091
            	                {
8092
43
            	                case PAR_TOK:
8093
            	                	{
8094
43
            	                		alt37=1;
8095
            	                	}
8096
43
            	                    break;
8097
825
            	                case LPAREN_TOK:
8098
            	                	{
8099
825
            	                		alt37=2;
8100
            	                	}
8101
825
            	                    break;
8102
8103
            	                default:
8104
            	                    CONSTRUCTEX();
8105
            	                    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
8106
            	                    EXCEPTION->message      = (void *)"";
8107
            	                    EXCEPTION->decisionNum  = 37;
8108
            	                    EXCEPTION->state        = 0;
8109
8110
8111
            	                    goto ruledatatypesDefEx;
8112
8113
            	                }
8114
8115
868
            	                switch (alt37)
8116
            	                {
8117
43
            	            	case 1:
8118
            	            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1193:7: PAR_TOK LPAREN_TOK ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )* RPAREN_TOK LPAREN_TOK ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+ RPAREN_TOK
8119
            	            	    {
8120
43
            	            	         MATCHT(PAR_TOK, &FOLLOW_PAR_TOK_in_datatypesDef2928);
8121
43
            	            	        if  (HASEXCEPTION())
8122
            	            	        {
8123
            	            	            goto ruledatatypesDefEx;
8124
            	            	        }
8125
8126
8127
            	            	        {
8128
43
            	            	             PARSER_STATE->pushScope();
8129
            	            	        }
8130
8131
8132
43
            	            	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDef2932);
8133
43
            	            	        if  (HASEXCEPTION())
8134
            	            	        {
8135
            	            	            goto ruledatatypesDefEx;
8136
            	            	        }
8137
8138
8139
            	            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1194:7: ( symbol[name,CHECK_UNDECLARED,SYM_SORT] )*
8140
8141
            	            	        for (;;)
8142
            	            	        {
8143
101
            	            	            int alt34=2;
8144
101
            	            	            switch ( LA(1) )
8145
            	            	            {
8146
58
            	            	            case QUOTED_SYMBOL:
8147
            	            	            case SIMPLE_SYMBOL:
8148
            	            	            case UNTERMINATED_QUOTED_SYMBOL:
8149
            	            	            	{
8150
58
            	            	            		alt34=1;
8151
            	            	            	}
8152
58
            	            	                break;
8153
8154
            	            	            }
8155
8156
101
            	            	            switch (alt34)
8157
            	            	            {
8158
58
            	            	        	case 1:
8159
            	            	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1194:9: symbol[name,CHECK_UNDECLARED,SYM_SORT]
8160
            	            	        	    {
8161
58
            	            	        	        FOLLOWPUSH(FOLLOW_symbol_in_datatypesDef2942);
8162
58
            	            	        	        symbol(ctx, name, CHECK_UNDECLARED, SYM_SORT);
8163
8164
58
            	            	        	        FOLLOWPOP();
8165
58
            	            	        	        if  (HASEXCEPTION())
8166
            	            	        	        {
8167
            	            	        	            goto ruledatatypesDefEx;
8168
            	            	        	        }
8169
8170
8171
            	            	        	        {
8172
8173
58
            	            	        	                      params.push_back( PARSER_STATE->mkSort(name));
8174
            	            	        	        }
8175
8176
8177
            	            	        	    }
8178
58
            	            	        	    break;
8179
8180
43
            	            	        	default:
8181
43
            	            	        	    goto loop34;	/* break out of the loop */
8182
            	            	        	    break;
8183
            	            	            }
8184
58
            	            	        }
8185
43
            	            	        loop34: ; /* Jump out to here if this rule does not match */
8186
8187
8188
43
            	            	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDef2970);
8189
43
            	            	        if  (HASEXCEPTION())
8190
            	            	        {
8191
            	            	            goto ruledatatypesDefEx;
8192
            	            	        }
8193
8194
8195
            	            	        {
8196
8197
            	            	                    // if the arity was fixed by prelude and is not equal to the number of parameters
8198
43
            	            	                    if( arities[dts.size()]>=0 && static_cast<int>(params.size())!=arities[dts.size()] ){
8199
            	            	                      PARSER_STATE->parseError("Wrong number of parameters for datatype.");
8200
            	            	                    }
8201
43
            	            	                    if (arities[dts.size()]<0)
8202
            	            	                    {
8203
            	            	                      // now declare it as an unresolved type
8204
6
            	            	                      PARSER_STATE->mkUnresolvedType(dnames[dts.size()], params.size());
8205
            	            	                    }
8206
43
            	            	                    Debug("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl;
8207
43
            	            	                    dts.push_back(SOLVER->mkDatatypeDecl(dnames[dts.size()], params, isCo));
8208
8209
            	            	        }
8210
8211
8212
43
            	            	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDef2980);
8213
43
            	            	        if  (HASEXCEPTION())
8214
            	            	        {
8215
            	            	            goto ruledatatypesDefEx;
8216
            	            	        }
8217
8218
8219
            	            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1212:7: ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+
8220
            	            	        {
8221
43
            	            	            int cnt35=0;
8222
8223
            	            	            for (;;)
8224
            	            	            {
8225
110
            	            	                int alt35=2;
8226
110
            	            	        	switch ( LA(1) )
8227
            	            	        	{
8228
67
            	            	        	case LPAREN_TOK:
8229
            	            	        		{
8230
67
            	            	        			alt35=1;
8231
            	            	        		}
8232
67
            	            	        	    break;
8233
8234
            	            	        	}
8235
8236
110
            	            	        	switch (alt35)
8237
            	            	        	{
8238
67
            	            	        	    case 1:
8239
            	            	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1212:9: LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK
8240
            	            	        	        {
8241
67
            	            	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDef2990);
8242
67
            	            	        	            if  (HASEXCEPTION())
8243
            	            	        	            {
8244
            	            	        	                goto ruledatatypesDefEx;
8245
            	            	        	            }
8246
8247
8248
67
            	            	        	            FOLLOWPUSH(FOLLOW_constructorDef_in_datatypesDef2992);
8249
67
            	            	        	            constructorDef(ctx, dts.back());
8250
8251
67
            	            	        	            FOLLOWPOP();
8252
67
            	            	        	            if  (HASEXCEPTION())
8253
            	            	        	            {
8254
            	            	        	                goto ruledatatypesDefEx;
8255
            	            	        	            }
8256
8257
8258
67
            	            	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDef2995);
8259
67
            	            	        	            if  (HASEXCEPTION())
8260
            	            	        	            {
8261
            	            	        	                goto ruledatatypesDefEx;
8262
            	            	        	            }
8263
8264
8265
            	            	        	        }
8266
67
            	            	        	        break;
8267
8268
43
            	            	        	    default:
8269
8270
43
            	            	        		if ( cnt35 >= 1 )
8271
            	            	        		{
8272
43
            	            	        		    goto loop35;
8273
            	            	        		}
8274
            	            	        		/* mismatchedSetEx()
8275
            	            	        		 */
8276
            	            	        		CONSTRUCTEX();
8277
            	            	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
8278
            	            	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
8279
8280
8281
            	            	        		goto ruledatatypesDefEx;
8282
            	            	        	}
8283
67
            	            	        	cnt35++;
8284
67
            	            	            }
8285
43
            	            	            loop35: ;	/* Jump to here if this rule does not match */
8286
            	            	        }
8287
8288
43
            	            	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDef3006);
8289
43
            	            	        if  (HASEXCEPTION())
8290
            	            	        {
8291
            	            	            goto ruledatatypesDefEx;
8292
            	            	        }
8293
8294
8295
            	            	        {
8296
43
            	            	             PARSER_STATE->popScope();
8297
            	            	        }
8298
8299
8300
            	            	    }
8301
43
            	            	    break;
8302
825
            	            	case 2:
8303
            	            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1214:7: ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+
8304
            	            	    {
8305
            	            	        {
8306
            	            	             // if the arity was fixed by prelude and is not equal to 0
8307
825
            	            	                    if( arities[dts.size()]>0 ){
8308
            	            	                      PARSER_STATE->parseError("No parameters given for datatype.");
8309
            	            	                    }
8310
825
            	            	                    else if (arities[dts.size()]<0)
8311
            	            	                    {
8312
            	            	                      // now declare it as an unresolved type
8313
105
            	            	                      PARSER_STATE->mkUnresolvedType(dnames[dts.size()], 0);
8314
            	            	                    }
8315
825
            	            	                    Debug("parser-dt") << params.size() << " parameters for " << dnames[dts.size()] << std::endl;
8316
825
            	            	                    dts.push_back(SOLVER->mkDatatypeDecl(dnames[dts.size()],
8317
            	            	                                                         params,
8318
            	            	                                                         isCo));
8319
8320
            	            	        }
8321
8322
8323
            	            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1228:7: ( LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK )+
8324
            	            	        {
8325
825
            	            	            int cnt36=0;
8326
8327
            	            	            for (;;)
8328
            	            	            {
8329
2519
            	            	                int alt36=2;
8330
2519
            	            	        	switch ( LA(1) )
8331
            	            	        	{
8332
1694
            	            	        	case LPAREN_TOK:
8333
            	            	        		{
8334
1694
            	            	        			alt36=1;
8335
            	            	        		}
8336
1694
            	            	        	    break;
8337
8338
            	            	        	}
8339
8340
2519
            	            	        	switch (alt36)
8341
            	            	        	{
8342
1694
            	            	        	    case 1:
8343
            	            	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1228:9: LPAREN_TOK constructorDef[dts.back()] RPAREN_TOK
8344
            	            	        	        {
8345
1694
            	            	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypesDef3026);
8346
1694
            	            	        	            if  (HASEXCEPTION())
8347
            	            	        	            {
8348
            	            	        	                goto ruledatatypesDefEx;
8349
            	            	        	            }
8350
8351
8352
1694
            	            	        	            FOLLOWPUSH(FOLLOW_constructorDef_in_datatypesDef3028);
8353
1694
            	            	        	            constructorDef(ctx, dts.back());
8354
8355
1694
            	            	        	            FOLLOWPOP();
8356
1694
            	            	        	            if  (HASEXCEPTION())
8357
            	            	        	            {
8358
            	            	        	                goto ruledatatypesDefEx;
8359
            	            	        	            }
8360
8361
8362
1694
            	            	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDef3031);
8363
1694
            	            	        	            if  (HASEXCEPTION())
8364
            	            	        	            {
8365
            	            	        	                goto ruledatatypesDefEx;
8366
            	            	        	            }
8367
8368
8369
            	            	        	        }
8370
1694
            	            	        	        break;
8371
8372
825
            	            	        	    default:
8373
8374
825
            	            	        		if ( cnt36 >= 1 )
8375
            	            	        		{
8376
825
            	            	        		    goto loop36;
8377
            	            	        		}
8378
            	            	        		/* mismatchedSetEx()
8379
            	            	        		 */
8380
            	            	        		CONSTRUCTEX();
8381
            	            	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
8382
            	            	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
8383
8384
8385
            	            	        		goto ruledatatypesDefEx;
8386
            	            	        	}
8387
1694
            	            	        	cnt36++;
8388
1694
            	            	            }
8389
825
            	            	            loop36: ;	/* Jump to here if this rule does not match */
8390
            	            	        }
8391
8392
            	            	    }
8393
825
            	            	    break;
8394
8395
            	                }
8396
            	            }
8397
8398
868
            	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypesDef3046);
8399
868
            	            if  (HASEXCEPTION())
8400
            	            {
8401
            	                goto ruledatatypesDefEx;
8402
868
            	            }
8403
8404
8405
            	        }
8406
868
            	        break;
8407
8408
667
            	    default:
8409
8410
667
            		if ( cnt38 >= 1 )
8411
            		{
8412
667
            		    goto loop38;
8413
            		}
8414
            		/* mismatchedSetEx()
8415
            		 */
8416
            		CONSTRUCTEX();
8417
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
8418
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
8419
8420
8421
            		goto ruledatatypesDefEx;
8422
            	}
8423
868
            	cnt38++;
8424
868
                }
8425
667
                loop38: ;	/* Jump to here if this rule does not match */
8426
            }
8427
8428
            {
8429
8430
667
                    if (dts.size() != dnames.size())
8431
                    {
8432
                      PARSER_STATE->parseError("Wrong number of datatypes provided.");
8433
                    }
8434
667
                    PARSER_STATE->popScope();
8435
1334
                    cmd->reset(new DatatypeDeclarationCommand(
8436
2001
                        PARSER_STATE->bindMutualDatatypeTypes(dts, true)));
8437
8438
            }
8439
8440
8441
        }
8442
8443
    }
8444
8445
    // This is where rules clean up and exit
8446
    //
8447
667
    goto ruledatatypesDefEx; /* Prevent compiler warnings */
8448
667
    ruledatatypesDefEx: ;
8449
8450
667
            if (HASEXCEPTION())
8451
            {
8452
                PREPORTERROR();
8453
                PRECOVER();
8454
            }
8455
1334
    return ;
8456
}
8457
/* $ANTLR end datatypesDef */
8458
8459
/**
8460
 * $ANTLR start simpleSymbolicExprNoKeyword
8461
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1243:1: simpleSymbolicExprNoKeyword[std::string& s] : ( INTEGER_LITERAL | DECIMAL_LITERAL | HEX_LITERAL | BINARY_LITERAL | str[s,false] | symbol[s,CHECK_NONE,SYM_SORT] |tok= ( ASSERT_TOK | CHECK_SAT_TOK | CHECK_SAT_ASSUMING_TOK | DECLARE_FUN_TOK | DECLARE_SORT_TOK | DEFINE_FUN_TOK | DEFINE_FUN_REC_TOK | DEFINE_FUNS_REC_TOK | DEFINE_SORT_TOK | GET_VALUE_TOK | GET_ASSIGNMENT_TOK | GET_ASSERTIONS_TOK | GET_PROOF_TOK | GET_UNSAT_ASSUMPTIONS_TOK | GET_UNSAT_CORE_TOK | GET_DIFFICULTY_TOK | EXIT_TOK | RESET_TOK | RESET_ASSERTIONS_TOK | SET_LOGIC_TOK | SET_INFO_TOK | GET_INFO_TOK | SET_OPTION_TOK | GET_OPTION_TOK | PUSH_TOK | POP_TOK | DECLARE_DATATYPES_TOK | GET_MODEL_TOK | ECHO_TOK | SIMPLIFY_TOK ) );
8462
 */
8463
static void
8464
6800
simpleSymbolicExprNoKeyword(pSmt2Parser ctx, std::string& s)
8465
{
8466
    pANTLR3_COMMON_TOKEN    tok;
8467
    pANTLR3_COMMON_TOKEN    INTEGER_LITERAL5;
8468
    pANTLR3_COMMON_TOKEN    DECIMAL_LITERAL6;
8469
    pANTLR3_COMMON_TOKEN    HEX_LITERAL7;
8470
    pANTLR3_COMMON_TOKEN    BINARY_LITERAL8;
8471
8472
    /* Initialize rule variables
8473
     */
8474
8475
6800
    tok       = NULL;
8476
6800
    INTEGER_LITERAL5       = NULL;
8477
6800
    DECIMAL_LITERAL6       = NULL;
8478
6800
    HEX_LITERAL7       = NULL;
8479
6800
    BINARY_LITERAL8       = NULL;
8480
8481
    {
8482
        {
8483
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1244:3: ( INTEGER_LITERAL | DECIMAL_LITERAL | HEX_LITERAL | BINARY_LITERAL | str[s,false] | symbol[s,CHECK_NONE,SYM_SORT] |tok= ( ASSERT_TOK | CHECK_SAT_TOK | CHECK_SAT_ASSUMING_TOK | DECLARE_FUN_TOK | DECLARE_SORT_TOK | DEFINE_FUN_TOK | DEFINE_FUN_REC_TOK | DEFINE_FUNS_REC_TOK | DEFINE_SORT_TOK | GET_VALUE_TOK | GET_ASSIGNMENT_TOK | GET_ASSERTIONS_TOK | GET_PROOF_TOK | GET_UNSAT_ASSUMPTIONS_TOK | GET_UNSAT_CORE_TOK | GET_DIFFICULTY_TOK | EXIT_TOK | RESET_TOK | RESET_ASSERTIONS_TOK | SET_LOGIC_TOK | SET_INFO_TOK | GET_INFO_TOK | SET_OPTION_TOK | GET_OPTION_TOK | PUSH_TOK | POP_TOK | DECLARE_DATATYPES_TOK | GET_MODEL_TOK | ECHO_TOK | SIMPLIFY_TOK ) )
8484
8485
            ANTLR3_UINT32 alt39;
8486
8487
6800
            alt39=7;
8488
8489
6800
            switch ( LA(1) )
8490
            {
8491
21
            case INTEGER_LITERAL:
8492
            	{
8493
21
            		alt39=1;
8494
            	}
8495
21
                break;
8496
457
            case DECIMAL_LITERAL:
8497
            	{
8498
457
            		alt39=2;
8499
            	}
8500
457
                break;
8501
            case HEX_LITERAL:
8502
            	{
8503
            		alt39=3;
8504
            	}
8505
                break;
8506
            case BINARY_LITERAL:
8507
            	{
8508
            		alt39=4;
8509
            	}
8510
                break;
8511
518
            case STRING_LITERAL:
8512
            	{
8513
518
            		alt39=5;
8514
            	}
8515
518
                break;
8516
5802
            case QUOTED_SYMBOL:
8517
            case SIMPLE_SYMBOL:
8518
            case UNTERMINATED_QUOTED_SYMBOL:
8519
            	{
8520
5802
            		alt39=6;
8521
            	}
8522
5802
                break;
8523
2
            case ASSERT_TOK:
8524
            case CHECK_SAT_ASSUMING_TOK:
8525
            case CHECK_SAT_TOK:
8526
            case DECLARE_DATATYPES_TOK:
8527
            case DECLARE_FUN_TOK:
8528
            case DECLARE_SORT_TOK:
8529
            case DEFINE_FUNS_REC_TOK:
8530
            case DEFINE_FUN_REC_TOK:
8531
            case DEFINE_FUN_TOK:
8532
            case DEFINE_SORT_TOK:
8533
            case ECHO_TOK:
8534
            case EXIT_TOK:
8535
            case GET_ASSERTIONS_TOK:
8536
            case GET_ASSIGNMENT_TOK:
8537
            case GET_DIFFICULTY_TOK:
8538
            case GET_INFO_TOK:
8539
            case GET_MODEL_TOK:
8540
            case GET_OPTION_TOK:
8541
            case GET_PROOF_TOK:
8542
            case GET_UNSAT_ASSUMPTIONS_TOK:
8543
            case GET_UNSAT_CORE_TOK:
8544
            case GET_VALUE_TOK:
8545
            case POP_TOK:
8546
            case PUSH_TOK:
8547
            case RESET_ASSERTIONS_TOK:
8548
            case RESET_TOK:
8549
            case SET_INFO_TOK:
8550
            case SET_LOGIC_TOK:
8551
            case SET_OPTION_TOK:
8552
            case SIMPLIFY_TOK:
8553
            	{
8554
2
            		alt39=7;
8555
            	}
8556
2
                break;
8557
8558
            default:
8559
                CONSTRUCTEX();
8560
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
8561
                EXCEPTION->message      = (void *)"";
8562
                EXCEPTION->decisionNum  = 39;
8563
                EXCEPTION->state        = 0;
8564
8565
8566
                goto rulesimpleSymbolicExprNoKeywordEx;
8567
8568
            }
8569
8570
6800
            switch (alt39)
8571
            {
8572
21
        	case 1:
8573
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1244:5: INTEGER_LITERAL
8574
        	    {
8575
21
        	        INTEGER_LITERAL5 = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_simpleSymbolicExprNoKeyword3071);
8576
21
        	        if  (HASEXCEPTION())
8577
        	        {
8578
        	            goto rulesimpleSymbolicExprNoKeywordEx;
8579
        	        }
8580
8581
8582
        	        {
8583
21
        	             s = AntlrInput::tokenText(INTEGER_LITERAL5);
8584
        	        }
8585
8586
8587
        	    }
8588
21
        	    break;
8589
457
        	case 2:
8590
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1246:5: DECIMAL_LITERAL
8591
        	    {
8592
457
        	        DECIMAL_LITERAL6 = (pANTLR3_COMMON_TOKEN) MATCHT(DECIMAL_LITERAL, &FOLLOW_DECIMAL_LITERAL_in_simpleSymbolicExprNoKeyword3083);
8593
457
        	        if  (HASEXCEPTION())
8594
        	        {
8595
        	            goto rulesimpleSymbolicExprNoKeywordEx;
8596
        	        }
8597
8598
8599
        	        {
8600
457
        	             s = AntlrInput::tokenText(DECIMAL_LITERAL6);
8601
        	        }
8602
8603
8604
        	    }
8605
457
        	    break;
8606
        	case 3:
8607
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1248:5: HEX_LITERAL
8608
        	    {
8609
        	        HEX_LITERAL7 = (pANTLR3_COMMON_TOKEN) MATCHT(HEX_LITERAL, &FOLLOW_HEX_LITERAL_in_simpleSymbolicExprNoKeyword3095);
8610
        	        if  (HASEXCEPTION())
8611
        	        {
8612
        	            goto rulesimpleSymbolicExprNoKeywordEx;
8613
        	        }
8614
8615
8616
        	        {
8617
        	             s = AntlrInput::tokenText(HEX_LITERAL7);
8618
        	        }
8619
8620
8621
        	    }
8622
        	    break;
8623
        	case 4:
8624
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1250:5: BINARY_LITERAL
8625
        	    {
8626
        	        BINARY_LITERAL8 = (pANTLR3_COMMON_TOKEN) MATCHT(BINARY_LITERAL, &FOLLOW_BINARY_LITERAL_in_simpleSymbolicExprNoKeyword3107);
8627
        	        if  (HASEXCEPTION())
8628
        	        {
8629
        	            goto rulesimpleSymbolicExprNoKeywordEx;
8630
        	        }
8631
8632
8633
        	        {
8634
        	             s = AntlrInput::tokenText(BINARY_LITERAL8);
8635
        	        }
8636
8637
8638
        	    }
8639
        	    break;
8640
518
        	case 5:
8641
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1252:5: str[s,false]
8642
        	    {
8643
518
        	        FOLLOWPUSH(FOLLOW_str_in_simpleSymbolicExprNoKeyword3119);
8644
518
        	        str(ctx, s, false);
8645
8646
518
        	        FOLLOWPOP();
8647
518
        	        if  (HASEXCEPTION())
8648
        	        {
8649
        	            goto rulesimpleSymbolicExprNoKeywordEx;
8650
        	        }
8651
8652
8653
        	    }
8654
518
        	    break;
8655
5802
        	case 6:
8656
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1253:5: symbol[s,CHECK_NONE,SYM_SORT]
8657
        	    {
8658
5802
        	        FOLLOWPUSH(FOLLOW_symbol_in_simpleSymbolicExprNoKeyword3126);
8659
5802
        	        symbol(ctx, s, CHECK_NONE, SYM_SORT);
8660
8661
5802
        	        FOLLOWPOP();
8662
5802
        	        if  (HASEXCEPTION())
8663
        	        {
8664
        	            goto rulesimpleSymbolicExprNoKeywordEx;
8665
        	        }
8666
8667
8668
        	    }
8669
5802
        	    break;
8670
2
        	case 7:
8671
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1254:5: tok= ( ASSERT_TOK | CHECK_SAT_TOK | CHECK_SAT_ASSUMING_TOK | DECLARE_FUN_TOK | DECLARE_SORT_TOK | DEFINE_FUN_TOK | DEFINE_FUN_REC_TOK | DEFINE_FUNS_REC_TOK | DEFINE_SORT_TOK | GET_VALUE_TOK | GET_ASSIGNMENT_TOK | GET_ASSERTIONS_TOK | GET_PROOF_TOK | GET_UNSAT_ASSUMPTIONS_TOK | GET_UNSAT_CORE_TOK | GET_DIFFICULTY_TOK | EXIT_TOK | RESET_TOK | RESET_ASSERTIONS_TOK | SET_LOGIC_TOK | SET_INFO_TOK | GET_INFO_TOK | SET_OPTION_TOK | GET_OPTION_TOK | PUSH_TOK | POP_TOK | DECLARE_DATATYPES_TOK | GET_MODEL_TOK | ECHO_TOK | SIMPLIFY_TOK )
8672
        	    {
8673
2
        	        tok=(pANTLR3_COMMON_TOKEN)LT(1);
8674
8675
2
        	        if ( LA(1) == ASSERT_TOK || ((LA(1) >= CHECK_SAT_ASSUMING_TOK) && (LA(1) <= CHECK_SAT_TOK)) || LA(1) == DECLARE_DATATYPES_TOK || LA(1) == DECLARE_FUN_TOK || LA(1) == DECLARE_SORT_TOK || ((LA(1) >= DEFINE_FUNS_REC_TOK) && (LA(1) <= DEFINE_SORT_TOK)) || LA(1) == ECHO_TOK || LA(1) == EXIT_TOK || ((LA(1) >= GET_ASSERTIONS_TOK) && (LA(1) <= GET_INFO_TOK)) || ((LA(1) >= GET_MODEL_TOK) && (LA(1) <= GET_PROOF_TOK)) || ((LA(1) >= GET_UNSAT_ASSUMPTIONS_TOK) && (LA(1) <= GET_VALUE_TOK)) || ((LA(1) >= POP_TOK) && (LA(1) <= PUSH_TOK)) || ((LA(1) >= RESET_ASSERTIONS_TOK) && (LA(1) <= RESET_TOK)) || ((LA(1) >= SET_INFO_TOK) && (LA(1) <= SET_OPTION_TOK)) || LA(1) == SIMPLIFY_TOK )
8676
        	        {
8677
2
        	            CONSUME();
8678
2
        	            PERRORRECOVERY=ANTLR3_FALSE;
8679
        	        }
8680
        	        else
8681
        	        {
8682
        	            CONSTRUCTEX();
8683
        	            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
8684
        	            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
8685
        	            EXCEPTION->expectingSet = NULL;
8686
8687
        	            goto rulesimpleSymbolicExprNoKeywordEx;
8688
        	        }
8689
8690
8691
        	        {
8692
2
        	             s = AntlrInput::tokenText(tok);
8693
        	        }
8694
8695
8696
        	    }
8697
2
        	    break;
8698
8699
            }
8700
        }
8701
    }
8702
8703
    // This is where rules clean up and exit
8704
    //
8705
6800
    goto rulesimpleSymbolicExprNoKeywordEx; /* Prevent compiler warnings */
8706
6800
    rulesimpleSymbolicExprNoKeywordEx: ;
8707
8708
6800
            if (HASEXCEPTION())
8709
            {
8710
                PREPORTERROR();
8711
                PRECOVER();
8712
            }
8713
6800
    return ;
8714
}
8715
/* $ANTLR end simpleSymbolicExprNoKeyword */
8716
8717
/**
8718
 * $ANTLR start keyword
8719
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1266:1: keyword[std::string& s] : KEYWORD ;
8720
 */
8721
static void
8722
1677
keyword(pSmt2Parser ctx, std::string& s)
8723
{
8724
    pANTLR3_COMMON_TOKEN    KEYWORD9;
8725
8726
    /* Initialize rule variables
8727
     */
8728
8729
1677
    KEYWORD9       = NULL;
8730
8731
    {
8732
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1267:3: ( KEYWORD )
8733
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1267:5: KEYWORD
8734
        {
8735
1677
            KEYWORD9 = (pANTLR3_COMMON_TOKEN) MATCHT(KEYWORD, &FOLLOW_KEYWORD_in_keyword3337);
8736
1677
            if  (HASEXCEPTION())
8737
            {
8738
                goto rulekeywordEx;
8739
            }
8740
8741
8742
            {
8743
1677
                 s = AntlrInput::tokenText(KEYWORD9);
8744
            }
8745
8746
8747
        }
8748
8749
    }
8750
8751
    // This is where rules clean up and exit
8752
    //
8753
1677
    goto rulekeywordEx; /* Prevent compiler warnings */
8754
1677
    rulekeywordEx: ;
8755
8756
1677
            if (HASEXCEPTION())
8757
            {
8758
                PREPORTERROR();
8759
                PRECOVER();
8760
            }
8761
1677
    return ;
8762
}
8763
/* $ANTLR end keyword */
8764
8765
/**
8766
 * $ANTLR start simpleSymbolicExpr
8767
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1271:1: simpleSymbolicExpr[std::string& s] : ( simpleSymbolicExprNoKeyword[s] | KEYWORD );
8768
 */
8769
static void
8770
6743
simpleSymbolicExpr(pSmt2Parser ctx, std::string& s)
8771
{
8772
    pANTLR3_COMMON_TOKEN    KEYWORD10;
8773
8774
    /* Initialize rule variables
8775
     */
8776
8777
6743
    KEYWORD10       = NULL;
8778
8779
    {
8780
        {
8781
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1272:3: ( simpleSymbolicExprNoKeyword[s] | KEYWORD )
8782
8783
            ANTLR3_UINT32 alt40;
8784
8785
6743
            alt40=2;
8786
8787
6743
            switch ( LA(1) )
8788
            {
8789
6741
            case ASSERT_TOK:
8790
            case BINARY_LITERAL:
8791
            case CHECK_SAT_ASSUMING_TOK:
8792
            case CHECK_SAT_TOK:
8793
            case DECIMAL_LITERAL:
8794
            case DECLARE_DATATYPES_TOK:
8795
            case DECLARE_FUN_TOK:
8796
            case DECLARE_SORT_TOK:
8797
            case DEFINE_FUNS_REC_TOK:
8798
            case DEFINE_FUN_REC_TOK:
8799
            case DEFINE_FUN_TOK:
8800
            case DEFINE_SORT_TOK:
8801
            case ECHO_TOK:
8802
            case EXIT_TOK:
8803
            case GET_ASSERTIONS_TOK:
8804
            case GET_ASSIGNMENT_TOK:
8805
            case GET_DIFFICULTY_TOK:
8806
            case GET_INFO_TOK:
8807
            case GET_MODEL_TOK:
8808
            case GET_OPTION_TOK:
8809
            case GET_PROOF_TOK:
8810
            case GET_UNSAT_ASSUMPTIONS_TOK:
8811
            case GET_UNSAT_CORE_TOK:
8812
            case GET_VALUE_TOK:
8813
            case HEX_LITERAL:
8814
            case INTEGER_LITERAL:
8815
            case POP_TOK:
8816
            case PUSH_TOK:
8817
            case QUOTED_SYMBOL:
8818
            case RESET_ASSERTIONS_TOK:
8819
            case RESET_TOK:
8820
            case SET_INFO_TOK:
8821
            case SET_LOGIC_TOK:
8822
            case SET_OPTION_TOK:
8823
            case SIMPLE_SYMBOL:
8824
            case SIMPLIFY_TOK:
8825
            case STRING_LITERAL:
8826
            case UNTERMINATED_QUOTED_SYMBOL:
8827
            	{
8828
6741
            		alt40=1;
8829
            	}
8830
6741
                break;
8831
2
            case KEYWORD:
8832
            	{
8833
2
            		alt40=2;
8834
            	}
8835
2
                break;
8836
8837
            default:
8838
                CONSTRUCTEX();
8839
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
8840
                EXCEPTION->message      = (void *)"";
8841
                EXCEPTION->decisionNum  = 40;
8842
                EXCEPTION->state        = 0;
8843
8844
8845
                goto rulesimpleSymbolicExprEx;
8846
8847
            }
8848
8849
6743
            switch (alt40)
8850
            {
8851
6741
        	case 1:
8852
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1272:5: simpleSymbolicExprNoKeyword[s]
8853
        	    {
8854
6741
        	        FOLLOWPUSH(FOLLOW_simpleSymbolicExprNoKeyword_in_simpleSymbolicExpr3357);
8855
6741
        	        simpleSymbolicExprNoKeyword(ctx, s);
8856
8857
6741
        	        FOLLOWPOP();
8858
6741
        	        if  (HASEXCEPTION())
8859
        	        {
8860
        	            goto rulesimpleSymbolicExprEx;
8861
        	        }
8862
8863
8864
        	    }
8865
6741
        	    break;
8866
2
        	case 2:
8867
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1273:5: KEYWORD
8868
        	    {
8869
2
        	        KEYWORD10 = (pANTLR3_COMMON_TOKEN) MATCHT(KEYWORD, &FOLLOW_KEYWORD_in_simpleSymbolicExpr3364);
8870
2
        	        if  (HASEXCEPTION())
8871
        	        {
8872
        	            goto rulesimpleSymbolicExprEx;
8873
        	        }
8874
8875
8876
        	        {
8877
2
        	             s = AntlrInput::tokenText(KEYWORD10);
8878
        	        }
8879
8880
8881
        	    }
8882
2
        	    break;
8883
8884
            }
8885
        }
8886
    }
8887
8888
    // This is where rules clean up and exit
8889
    //
8890
6743
    goto rulesimpleSymbolicExprEx; /* Prevent compiler warnings */
8891
6743
    rulesimpleSymbolicExprEx: ;
8892
8893
6743
            if (HASEXCEPTION())
8894
            {
8895
                PREPORTERROR();
8896
                PRECOVER();
8897
            }
8898
6743
    return ;
8899
}
8900
/* $ANTLR end simpleSymbolicExpr */
8901
8902
/**
8903
 * $ANTLR start symbolicExpr
8904
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1276:1: symbolicExpr[cvc5::api::Term& sexpr] : ( simpleSymbolicExpr[s] | LPAREN_TOK ( symbolicExpr[sexpr] )* RPAREN_TOK );
8905
 */
8906
static void
8907
6739
symbolicExpr(pSmt2Parser ctx, cvc5::api::Term& sexpr)
8908
{
8909
8910
13478
      std::string s;
8911
13478
      std::vector<api::Term> children;
8912
8913
    /* Initialize rule variables
8914
     */
8915
8916
    {
8917
        {
8918
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1281:3: ( simpleSymbolicExpr[s] | LPAREN_TOK ( symbolicExpr[sexpr] )* RPAREN_TOK )
8919
8920
            ANTLR3_UINT32 alt42;
8921
8922
6739
            alt42=2;
8923
8924
6739
            switch ( LA(1) )
8925
            {
8926
6734
            case ASSERT_TOK:
8927
            case BINARY_LITERAL:
8928
            case CHECK_SAT_ASSUMING_TOK:
8929
            case CHECK_SAT_TOK:
8930
            case DECIMAL_LITERAL:
8931
            case DECLARE_DATATYPES_TOK:
8932
            case DECLARE_FUN_TOK:
8933
            case DECLARE_SORT_TOK:
8934
            case DEFINE_FUNS_REC_TOK:
8935
            case DEFINE_FUN_REC_TOK:
8936
            case DEFINE_FUN_TOK:
8937
            case DEFINE_SORT_TOK:
8938
            case ECHO_TOK:
8939
            case EXIT_TOK:
8940
            case GET_ASSERTIONS_TOK:
8941
            case GET_ASSIGNMENT_TOK:
8942
            case GET_DIFFICULTY_TOK:
8943
            case GET_INFO_TOK:
8944
            case GET_MODEL_TOK:
8945
            case GET_OPTION_TOK:
8946
            case GET_PROOF_TOK:
8947
            case GET_UNSAT_ASSUMPTIONS_TOK:
8948
            case GET_UNSAT_CORE_TOK:
8949
            case GET_VALUE_TOK:
8950
            case HEX_LITERAL:
8951
            case INTEGER_LITERAL:
8952
            case KEYWORD:
8953
            case POP_TOK:
8954
            case PUSH_TOK:
8955
            case QUOTED_SYMBOL:
8956
            case RESET_ASSERTIONS_TOK:
8957
            case RESET_TOK:
8958
            case SET_INFO_TOK:
8959
            case SET_LOGIC_TOK:
8960
            case SET_OPTION_TOK:
8961
            case SIMPLE_SYMBOL:
8962
            case SIMPLIFY_TOK:
8963
            case STRING_LITERAL:
8964
            case UNTERMINATED_QUOTED_SYMBOL:
8965
            	{
8966
6734
            		alt42=1;
8967
            	}
8968
6734
                break;
8969
5
            case LPAREN_TOK:
8970
            	{
8971
5
            		alt42=2;
8972
            	}
8973
5
                break;
8974
8975
            default:
8976
                CONSTRUCTEX();
8977
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
8978
                EXCEPTION->message      = (void *)"";
8979
                EXCEPTION->decisionNum  = 42;
8980
                EXCEPTION->state        = 0;
8981
8982
8983
                goto rulesymbolicExprEx;
8984
8985
            }
8986
8987
6739
            switch (alt42)
8988
            {
8989
6734
        	case 1:
8990
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1281:5: simpleSymbolicExpr[s]
8991
        	    {
8992
6734
        	        FOLLOWPUSH(FOLLOW_simpleSymbolicExpr_in_symbolicExpr3385);
8993
6734
        	        simpleSymbolicExpr(ctx, s);
8994
8995
6734
        	        FOLLOWPOP();
8996
6734
        	        if  (HASEXCEPTION())
8997
        	        {
8998
        	            goto rulesymbolicExprEx;
8999
        	        }
9000
9001
9002
        	        {
9003
6734
        	             sexpr = SOLVER->mkString(PARSER_STATE->processAdHocStringEsc(s));
9004
        	        }
9005
9006
9007
        	    }
9008
6734
        	    break;
9009
5
        	case 2:
9010
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1283:5: LPAREN_TOK ( symbolicExpr[sexpr] )* RPAREN_TOK
9011
        	    {
9012
5
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_symbolicExpr3398);
9013
5
        	        if  (HASEXCEPTION())
9014
        	        {
9015
        	            goto rulesymbolicExprEx;
9016
        	        }
9017
9018
9019
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1284:5: ( symbolicExpr[sexpr] )*
9020
9021
        	        for (;;)
9022
        	        {
9023
19
        	            int alt41=2;
9024
19
        	            switch ( LA(1) )
9025
        	            {
9026
14
        	            case ASSERT_TOK:
9027
        	            case BINARY_LITERAL:
9028
        	            case CHECK_SAT_ASSUMING_TOK:
9029
        	            case CHECK_SAT_TOK:
9030
        	            case DECIMAL_LITERAL:
9031
        	            case DECLARE_DATATYPES_TOK:
9032
        	            case DECLARE_FUN_TOK:
9033
        	            case DECLARE_SORT_TOK:
9034
        	            case DEFINE_FUNS_REC_TOK:
9035
        	            case DEFINE_FUN_REC_TOK:
9036
        	            case DEFINE_FUN_TOK:
9037
        	            case DEFINE_SORT_TOK:
9038
        	            case ECHO_TOK:
9039
        	            case EXIT_TOK:
9040
        	            case GET_ASSERTIONS_TOK:
9041
        	            case GET_ASSIGNMENT_TOK:
9042
        	            case GET_DIFFICULTY_TOK:
9043
        	            case GET_INFO_TOK:
9044
        	            case GET_MODEL_TOK:
9045
        	            case GET_OPTION_TOK:
9046
        	            case GET_PROOF_TOK:
9047
        	            case GET_UNSAT_ASSUMPTIONS_TOK:
9048
        	            case GET_UNSAT_CORE_TOK:
9049
        	            case GET_VALUE_TOK:
9050
        	            case HEX_LITERAL:
9051
        	            case INTEGER_LITERAL:
9052
        	            case KEYWORD:
9053
        	            case LPAREN_TOK:
9054
        	            case POP_TOK:
9055
        	            case PUSH_TOK:
9056
        	            case QUOTED_SYMBOL:
9057
        	            case RESET_ASSERTIONS_TOK:
9058
        	            case RESET_TOK:
9059
        	            case SET_INFO_TOK:
9060
        	            case SET_LOGIC_TOK:
9061
        	            case SET_OPTION_TOK:
9062
        	            case SIMPLE_SYMBOL:
9063
        	            case SIMPLIFY_TOK:
9064
        	            case STRING_LITERAL:
9065
        	            case UNTERMINATED_QUOTED_SYMBOL:
9066
        	            	{
9067
14
        	            		alt41=1;
9068
        	            	}
9069
14
        	                break;
9070
9071
        	            }
9072
9073
19
        	            switch (alt41)
9074
        	            {
9075
14
        	        	case 1:
9076
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1284:7: symbolicExpr[sexpr]
9077
        	        	    {
9078
14
        	        	        FOLLOWPUSH(FOLLOW_symbolicExpr_in_symbolicExpr3406);
9079
14
        	        	        symbolicExpr(ctx, sexpr);
9080
9081
14
        	        	        FOLLOWPOP();
9082
14
        	        	        if  (HASEXCEPTION())
9083
        	        	        {
9084
        	        	            goto rulesymbolicExprEx;
9085
        	        	        }
9086
9087
9088
        	        	        {
9089
14
        	        	             children.push_back(sexpr);
9090
        	        	        }
9091
9092
9093
        	        	    }
9094
14
        	        	    break;
9095
9096
5
        	        	default:
9097
5
        	        	    goto loop41;	/* break out of the loop */
9098
        	        	    break;
9099
        	            }
9100
14
        	        }
9101
5
        	        loop41: ; /* Jump out to here if this rule does not match */
9102
9103
9104
5
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_symbolicExpr3414);
9105
5
        	        if  (HASEXCEPTION())
9106
        	        {
9107
        	            goto rulesymbolicExprEx;
9108
        	        }
9109
9110
9111
        	        {
9112
5
        	             sexpr = SOLVER->mkTerm(cvc5::api::SEXPR, children);
9113
        	        }
9114
9115
9116
        	    }
9117
5
        	    break;
9118
9119
            }
9120
        }
9121
    }
9122
9123
    // This is where rules clean up and exit
9124
    //
9125
6739
    goto rulesymbolicExprEx; /* Prevent compiler warnings */
9126
6739
    rulesymbolicExprEx: ;
9127
9128
6739
            if (HASEXCEPTION())
9129
            {
9130
                PREPORTERROR();
9131
                PRECOVER();
9132
            }
9133
13478
    return ;
9134
}
9135
/* $ANTLR end symbolicExpr */
9136
9137
/**
9138
 * $ANTLR start term
9139
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1292:1: term[cvc5::api::Term& expr, cvc5::api::Term& expr2] : ( termNonVariable[expr, expr2] | qualIdentifier[p] );
9140
 */
9141
static void
9142
5064594
term(pSmt2Parser ctx, cvc5::api::Term& expr, cvc5::api::Term& expr2)
9143
{
9144
    /* Initialize rule variables
9145
     */
9146
9147
9148
5064594
      api::Kind kind = api::NULL_EXPR;
9149
10129188
      cvc5::api::Term f;
9150
10129188
      std::string name;
9151
10129188
      cvc5::api::Sort type;
9152
10129188
      ParseOp p;
9153
9154
    {
9155
        {
9156
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1300:3: ( termNonVariable[expr, expr2] | qualIdentifier[p] )
9157
9158
            ANTLR3_UINT32 alt43;
9159
9160
5064594
            alt43=2;
9161
9162
5064594
            switch ( LA(1) )
9163
            {
9164
2271748
            case LPAREN_TOK:
9165
            	{
9166
2271748
            		switch ( LA(2) )
9167
            		{
9168
2223663
            		case ATTRIBUTE_TOK:
9169
            		case COMPREHENSION_TOK:
9170
            		case EXISTS_TOK:
9171
            		case FORALL_TOK:
9172
            		case HO_LAMBDA_TOK:
9173
            		case LET_TOK:
9174
            		case LPAREN_TOK:
9175
            		case MATCH_TOK:
9176
            		case QUOTED_SYMBOL:
9177
            		case SIMPLE_SYMBOL:
9178
            		case TUPLE_CONST_TOK:
9179
            		case TUPLE_PROJECT_TOK:
9180
            		case UNTERMINATED_QUOTED_SYMBOL:
9181
            			{
9182
2223663
            				alt43=1;
9183
            			}
9184
2223663
            		    break;
9185
47886
            		case INDEX_TOK:
9186
            			{
9187
47886
            				alt43=1;
9188
            			}
9189
47886
            		    break;
9190
199
            		case AS_TOK:
9191
            			{
9192
199
            				alt43=2;
9193
            			}
9194
199
            		    break;
9195
9196
            		default:
9197
            		    CONSTRUCTEX();
9198
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
9199
            		    EXCEPTION->message      = (void *)"";
9200
            		    EXCEPTION->decisionNum  = 43;
9201
            		    EXCEPTION->state        = 1;
9202
9203
9204
            		    goto ruletermEx;
9205
9206
            		}
9207
9208
            	}
9209
2271748
                break;
9210
186048
            case BINARY_LITERAL:
9211
            case DECIMAL_LITERAL:
9212
            case HEX_LITERAL:
9213
            case INTEGER_LITERAL:
9214
            case STRING_LITERAL:
9215
            case TUPLE_CONST_TOK:
9216
            	{
9217
186048
            		alt43=1;
9218
            	}
9219
186048
                break;
9220
2606796
            case QUOTED_SYMBOL:
9221
            case SIMPLE_SYMBOL:
9222
            case UNTERMINATED_QUOTED_SYMBOL:
9223
            	{
9224
2606796
            		alt43=2;
9225
            	}
9226
2606796
                break;
9227
9228
2
            default:
9229
2
                CONSTRUCTEX();
9230
2
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
9231
2
                EXCEPTION->message      = (void *)"";
9232
2
                EXCEPTION->decisionNum  = 43;
9233
2
                EXCEPTION->state        = 0;
9234
9235
9236
2
                goto ruletermEx;
9237
9238
            }
9239
9240
5064592
            switch (alt43)
9241
            {
9242
2457597
        	case 1:
9243
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1300:3: termNonVariable[expr, expr2]
9244
        	    {
9245
2457597
        	        FOLLOWPUSH(FOLLOW_termNonVariable_in_term3439);
9246
2457597
        	        termNonVariable(ctx, expr, expr2);
9247
9248
2457537
        	        FOLLOWPOP();
9249
2457537
        	        if  (HASEXCEPTION())
9250
        	        {
9251
        	            goto ruletermEx;
9252
        	        }
9253
9254
9255
        	    }
9256
2457537
        	    break;
9257
2606995
        	case 2:
9258
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1304:5: qualIdentifier[p]
9259
        	    {
9260
2606995
        	        FOLLOWPUSH(FOLLOW_qualIdentifier_in_term3451);
9261
2606995
        	        qualIdentifier(ctx, p);
9262
9263
2606995
        	        FOLLOWPOP();
9264
2606995
        	        if  (HASEXCEPTION())
9265
        	        {
9266
        	            goto ruletermEx;
9267
        	        }
9268
9269
9270
        	        {
9271
9272
2606995
        	                  expr = PARSER_STATE->parseOpToExpr(p);
9273
9274
        	        }
9275
9276
9277
        	    }
9278
2606986
        	    break;
9279
9280
            }
9281
        }
9282
    }
9283
9284
    // This is where rules clean up and exit
9285
    //
9286
5064523
    goto ruletermEx; /* Prevent compiler warnings */
9287
5064525
    ruletermEx: ;
9288
9289
5064525
            if (HASEXCEPTION())
9290
            {
9291
2
                PREPORTERROR();
9292
                PRECOVER();
9293
            }
9294
10129046
    return ;
9295
}
9296
/* $ANTLR end term */
9297
9298
/**
9299
 * $ANTLR start termNonVariable
9300
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1315:1: termNonVariable[cvc5::api::Term& expr, cvc5::api::Term& expr2] : ( LPAREN_TOK quantOp[kind] boundVarList[bvl] term[f, f2] RPAREN_TOK | LPAREN_TOK COMPREHENSION_TOK boundVarList[bvl] term[f, f2] term[f, f2] RPAREN_TOK | LPAREN_TOK qualIdentifier[p] termList[args,expr] RPAREN_TOK | LPAREN_TOK LET_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[expr, f2] RPAREN_TOK )+ RPAREN_TOK term[expr, f2] RPAREN_TOK | LPAREN_TOK MATCH_TOK term[expr, f2] LPAREN_TOK ( LPAREN_TOK LPAREN_TOK term[f, f2] ( symbol[name,CHECK_NONE,SYM_VARIABLE] )* RPAREN_TOK term[f3, f2] RPAREN_TOK | LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[f3, f2] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK | LPAREN_TOK ATTRIBUTE_TOK term[expr, f2] ( attribute[expr, attexpr] )+ RPAREN_TOK | LPAREN_TOK HO_LAMBDA_TOK boundVarList[bvl] term[f, f2] RPAREN_TOK | LPAREN_TOK TUPLE_CONST_TOK termList[args,expr] RPAREN_TOK | LPAREN_TOK TUPLE_PROJECT_TOK term[expr,expr2] RPAREN_TOK | termAtomic[atomTerm] );
9301
 */
9302
static void
9303
2457597
termNonVariable(pSmt2Parser ctx, cvc5::api::Term& expr, cvc5::api::Term& expr2)
9304
{
9305
    /* Initialize rule variables
9306
     */
9307
9308
9309
2457597
      Debug("parser") << "term: " << AntlrInput::tokenText(LT(1)) << std::endl;
9310
2457597
      api::Kind kind = api::NULL_EXPR;
9311
4915194
      std::string name;
9312
4915194
      std::vector<cvc5::api::Term> args;
9313
4915194
      std::vector< std::pair<std::string, cvc5::api::Sort> > sortedVarNames;
9314
4915194
      cvc5::api::Term bvl;
9315
4915194
      cvc5::api::Term f, f2, f3;
9316
4915194
      std::string attr;
9317
4915194
      cvc5::api::Term attexpr;
9318
4915194
      std::vector<cvc5::api::Term> patexprs;
9319
4915194
      std::vector<cvc5::api::Term> matchcases;
9320
4915194
      std::unordered_set<std::string> names;
9321
4915194
      std::vector< std::pair<std::string, cvc5::api::Term> > binders;
9322
4915194
      cvc5::api::Sort type;
9323
4915194
      cvc5::api::Sort type2;
9324
4915194
      api::Term atomTerm;
9325
4915194
      ParseOp p;
9326
4915194
      std::vector<api::Sort> argTypes;
9327
9328
    {
9329
        {
9330
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1336:3: ( LPAREN_TOK quantOp[kind] boundVarList[bvl] term[f, f2] RPAREN_TOK | LPAREN_TOK COMPREHENSION_TOK boundVarList[bvl] term[f, f2] term[f, f2] RPAREN_TOK | LPAREN_TOK qualIdentifier[p] termList[args,expr] RPAREN_TOK | LPAREN_TOK LET_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[expr, f2] RPAREN_TOK )+ RPAREN_TOK term[expr, f2] RPAREN_TOK | LPAREN_TOK MATCH_TOK term[expr, f2] LPAREN_TOK ( LPAREN_TOK LPAREN_TOK term[f, f2] ( symbol[name,CHECK_NONE,SYM_VARIABLE] )* RPAREN_TOK term[f3, f2] RPAREN_TOK | LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[f3, f2] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK | LPAREN_TOK ATTRIBUTE_TOK term[expr, f2] ( attribute[expr, attexpr] )+ RPAREN_TOK | LPAREN_TOK HO_LAMBDA_TOK boundVarList[bvl] term[f, f2] RPAREN_TOK | LPAREN_TOK TUPLE_CONST_TOK termList[args,expr] RPAREN_TOK | LPAREN_TOK TUPLE_PROJECT_TOK term[expr,expr2] RPAREN_TOK | termAtomic[atomTerm] )
9331
9332
            ANTLR3_UINT32 alt48;
9333
9334
2457597
            alt48=10;
9335
9336
2457597
            switch ( LA(1) )
9337
            {
9338
2271549
            case LPAREN_TOK:
9339
            	{
9340
2271549
            		switch ( LA(2) )
9341
            		{
9342
8
            		case COMPREHENSION_TOK:
9343
            			{
9344
8
            				alt48=2;
9345
            			}
9346
8
            		    break;
9347
39133
            		case LET_TOK:
9348
            			{
9349
39133
            				alt48=4;
9350
            			}
9351
39133
            		    break;
9352
9
            		case MATCH_TOK:
9353
            			{
9354
9
            				alt48=5;
9355
            			}
9356
9
            		    break;
9357
2803
            		case ATTRIBUTE_TOK:
9358
            			{
9359
2803
            				alt48=6;
9360
            			}
9361
2803
            		    break;
9362
26
            		case HO_LAMBDA_TOK:
9363
            			{
9364
26
            				alt48=7;
9365
            			}
9366
26
            		    break;
9367
878
            		case TUPLE_CONST_TOK:
9368
            			{
9369
878
            				alt48=8;
9370
            			}
9371
878
            		    break;
9372
2
            		case TUPLE_PROJECT_TOK:
9373
            			{
9374
2
            				alt48=9;
9375
            			}
9376
2
            		    break;
9377
47886
            		case INDEX_TOK:
9378
            			{
9379
47886
            				alt48=10;
9380
            			}
9381
47886
            		    break;
9382
10006
            		case EXISTS_TOK:
9383
            		case FORALL_TOK:
9384
            			{
9385
10006
            				alt48=1;
9386
            			}
9387
10006
            		    break;
9388
2170798
            		case LPAREN_TOK:
9389
            		case QUOTED_SYMBOL:
9390
            		case SIMPLE_SYMBOL:
9391
            		case UNTERMINATED_QUOTED_SYMBOL:
9392
            			{
9393
2170798
            				alt48=3;
9394
            			}
9395
2170798
            		    break;
9396
9397
            		default:
9398
            		    CONSTRUCTEX();
9399
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
9400
            		    EXCEPTION->message      = (void *)"";
9401
            		    EXCEPTION->decisionNum  = 48;
9402
            		    EXCEPTION->state        = 1;
9403
9404
9405
            		    goto ruletermNonVariableEx;
9406
9407
            		}
9408
9409
            	}
9410
2271549
                break;
9411
186048
            case BINARY_LITERAL:
9412
            case DECIMAL_LITERAL:
9413
            case HEX_LITERAL:
9414
            case INTEGER_LITERAL:
9415
            case STRING_LITERAL:
9416
            case TUPLE_CONST_TOK:
9417
            	{
9418
186048
            		alt48=10;
9419
            	}
9420
186048
                break;
9421
9422
            default:
9423
                CONSTRUCTEX();
9424
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
9425
                EXCEPTION->message      = (void *)"";
9426
                EXCEPTION->decisionNum  = 48;
9427
                EXCEPTION->state        = 0;
9428
9429
9430
                goto ruletermNonVariableEx;
9431
9432
            }
9433
9434
2457597
            switch (alt48)
9435
            {
9436
10006
        	case 1:
9437
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1336:5: LPAREN_TOK quantOp[kind] boundVarList[bvl] term[f, f2] RPAREN_TOK
9438
        	    {
9439
10006
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3479);
9440
10006
        	        if  (HASEXCEPTION())
9441
        	        {
9442
        	            goto ruletermNonVariableEx;
9443
        	        }
9444
9445
9446
10006
        	        FOLLOWPUSH(FOLLOW_quantOp_in_termNonVariable3481);
9447
10006
        	        quantOp(ctx, kind);
9448
9449
10006
        	        FOLLOWPOP();
9450
10006
        	        if  (HASEXCEPTION())
9451
        	        {
9452
        	            goto ruletermNonVariableEx;
9453
        	        }
9454
9455
9456
        	        {
9457
9458
10006
        	                  if (!PARSER_STATE->isTheoryEnabled(theory::THEORY_QUANTIFIERS))
9459
        	                  {
9460
2
        	                    PARSER_STATE->parseError("Quantifier used in non-quantified logic.");
9461
        	                  }
9462
10005
        	                  PARSER_STATE->pushScope();
9463
9464
        	        }
9465
9466
9467
10005
        	        FOLLOWPUSH(FOLLOW_boundVarList_in_termNonVariable3494);
9468
10005
        	        boundVarList(ctx, bvl);
9469
9470
10004
        	        FOLLOWPOP();
9471
10004
        	        if  (HASEXCEPTION())
9472
        	        {
9473
        	            goto ruletermNonVariableEx;
9474
        	        }
9475
9476
9477
10004
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable3501);
9478
10004
        	        term(ctx, f, f2);
9479
9480
10004
        	        FOLLOWPOP();
9481
10004
        	        if  (HASEXCEPTION())
9482
        	        {
9483
        	            goto ruletermNonVariableEx;
9484
        	        }
9485
9486
9487
10004
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3504);
9488
10004
        	        if  (HASEXCEPTION())
9489
        	        {
9490
        	            goto ruletermNonVariableEx;
9491
        	        }
9492
9493
9494
        	        {
9495
9496
10004
        	                  args.push_back(bvl);
9497
9498
10004
        	                  PARSER_STATE->popScope();
9499
10004
        	                  args.push_back(f);
9500
10004
        	                  if(! f2.isNull()){
9501
1181
        	                    args.push_back(f2);
9502
        	                  }
9503
10004
        	                  expr = MK_TERM(kind, args);
9504
9505
        	        }
9506
9507
9508
        	    }
9509
10004
        	    break;
9510
8
        	case 2:
9511
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1356:5: LPAREN_TOK COMPREHENSION_TOK boundVarList[bvl] term[f, f2] term[f, f2] RPAREN_TOK
9512
        	    {
9513
8
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3516);
9514
8
        	        if  (HASEXCEPTION())
9515
        	        {
9516
        	            goto ruletermNonVariableEx;
9517
        	        }
9518
9519
9520
8
        	         MATCHT(COMPREHENSION_TOK, &FOLLOW_COMPREHENSION_TOK_in_termNonVariable3518);
9521
8
        	        if  (HASEXCEPTION())
9522
        	        {
9523
        	            goto ruletermNonVariableEx;
9524
        	        }
9525
9526
9527
        	        {
9528
8
        	             PARSER_STATE->pushScope();
9529
        	        }
9530
9531
9532
8
        	        FOLLOWPUSH(FOLLOW_boundVarList_in_termNonVariable3530);
9533
8
        	        boundVarList(ctx, bvl);
9534
9535
8
        	        FOLLOWPOP();
9536
8
        	        if  (HASEXCEPTION())
9537
        	        {
9538
        	            goto ruletermNonVariableEx;
9539
        	        }
9540
9541
9542
        	        {
9543
9544
8
        	                  args.push_back(bvl);
9545
9546
        	        }
9547
9548
9549
8
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable3543);
9550
8
        	        term(ctx, f, f2);
9551
9552
8
        	        FOLLOWPOP();
9553
8
        	        if  (HASEXCEPTION())
9554
        	        {
9555
        	            goto ruletermNonVariableEx;
9556
        	        }
9557
9558
9559
        	        {
9560
8
        	             args.push_back(f);
9561
        	        }
9562
9563
9564
8
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable3552);
9565
8
        	        term(ctx, f, f2);
9566
9567
8
        	        FOLLOWPOP();
9568
8
        	        if  (HASEXCEPTION())
9569
        	        {
9570
        	            goto ruletermNonVariableEx;
9571
        	        }
9572
9573
9574
        	        {
9575
9576
8
        	                  args.push_back(f);
9577
8
        	                  expr = MK_TERM(api::COMPREHENSION, args);
9578
9579
        	        }
9580
9581
9582
8
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3561);
9583
8
        	        if  (HASEXCEPTION())
9584
        	        {
9585
        	            goto ruletermNonVariableEx;
9586
        	        }
9587
9588
9589
        	    }
9590
8
        	    break;
9591
2170798
        	case 3:
9592
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1368:5: LPAREN_TOK qualIdentifier[p] termList[args,expr] RPAREN_TOK
9593
        	    {
9594
2170798
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3567);
9595
2170798
        	        if  (HASEXCEPTION())
9596
        	        {
9597
        	            goto ruletermNonVariableEx;
9598
        	        }
9599
9600
9601
2170798
        	        FOLLOWPUSH(FOLLOW_qualIdentifier_in_termNonVariable3569);
9602
2170798
        	        qualIdentifier(ctx, p);
9603
9604
2170797
        	        FOLLOWPOP();
9605
2170797
        	        if  (HASEXCEPTION())
9606
        	        {
9607
        	            goto ruletermNonVariableEx;
9608
        	        }
9609
9610
9611
2170797
        	        FOLLOWPUSH(FOLLOW_termList_in_termNonVariable3576);
9612
2170797
        	        termList(ctx, args, expr);
9613
9614
2170769
        	        FOLLOWPOP();
9615
2170769
        	        if  (HASEXCEPTION())
9616
        	        {
9617
        	            goto ruletermNonVariableEx;
9618
        	        }
9619
9620
9621
2170769
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3579);
9622
2170769
        	        if  (HASEXCEPTION())
9623
        	        {
9624
2
        	            goto ruletermNonVariableEx;
9625
        	        }
9626
9627
9628
        	        {
9629
9630
2170767
        	                  expr = PARSER_STATE->applyParseOp(p, args);
9631
9632
        	        }
9633
9634
9635
        	    }
9636
2170741
        	    break;
9637
39133
        	case 4:
9638
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1374:5: LPAREN_TOK LET_TOK LPAREN_TOK ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[expr, f2] RPAREN_TOK )+ RPAREN_TOK term[expr, f2] RPAREN_TOK
9639
        	    {
9640
39133
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3597);
9641
39133
        	        if  (HASEXCEPTION())
9642
        	        {
9643
        	            goto ruletermNonVariableEx;
9644
        	        }
9645
9646
9647
39133
        	         MATCHT(LET_TOK, &FOLLOW_LET_TOK_in_termNonVariable3606);
9648
39133
        	        if  (HASEXCEPTION())
9649
        	        {
9650
        	            goto ruletermNonVariableEx;
9651
        	        }
9652
9653
9654
39133
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3608);
9655
39133
        	        if  (HASEXCEPTION())
9656
        	        {
9657
        	            goto ruletermNonVariableEx;
9658
        	        }
9659
9660
9661
        	        {
9662
39133
        	             PARSER_STATE->pushScope();
9663
        	        }
9664
9665
9666
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1377:7: ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[expr, f2] RPAREN_TOK )+
9667
        	        {
9668
39133
        	            int cnt44=0;
9669
9670
        	            for (;;)
9671
        	            {
9672
90565
        	                int alt44=2;
9673
90565
        	        	switch ( LA(1) )
9674
        	        	{
9675
51432
        	        	case LPAREN_TOK:
9676
        	        		{
9677
51432
        	        			alt44=1;
9678
        	        		}
9679
51432
        	        	    break;
9680
9681
        	        	}
9682
9683
90565
        	        	switch (alt44)
9684
        	        	{
9685
51432
        	        	    case 1:
9686
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1377:9: LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[expr, f2] RPAREN_TOK
9687
        	        	        {
9688
51432
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3626);
9689
51432
        	        	            if  (HASEXCEPTION())
9690
        	        	            {
9691
        	        	                goto ruletermNonVariableEx;
9692
        	        	            }
9693
9694
9695
51432
        	        	            FOLLOWPUSH(FOLLOW_symbol_in_termNonVariable3628);
9696
51432
        	        	            symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
9697
9698
51432
        	        	            FOLLOWPOP();
9699
51432
        	        	            if  (HASEXCEPTION())
9700
        	        	            {
9701
        	        	                goto ruletermNonVariableEx;
9702
        	        	            }
9703
9704
9705
51432
        	        	            FOLLOWPUSH(FOLLOW_term_in_termNonVariable3639);
9706
51432
        	        	            term(ctx, expr, f2);
9707
9708
51432
        	        	            FOLLOWPOP();
9709
51432
        	        	            if  (HASEXCEPTION())
9710
        	        	            {
9711
        	        	                goto ruletermNonVariableEx;
9712
        	        	            }
9713
9714
9715
51432
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3650);
9716
51432
        	        	            if  (HASEXCEPTION())
9717
        	        	            {
9718
        	        	                goto ruletermNonVariableEx;
9719
        	        	            }
9720
9721
9722
        	        	            {
9723
51432
        	        	                 if(names.count(name) == 1) {
9724
        	        	                            std::stringstream ss;
9725
        	        	                            ss << "warning: symbol `" << name << "' bound multiple times by let;"
9726
        	        	                               << " the last binding will be used, shadowing earlier ones";
9727
        	        	                            PARSER_STATE->warning(ss.str());
9728
        	        	                          } else {
9729
51432
        	        	                            names.insert(name);
9730
        	        	                          }
9731
51432
        	        	                          binders.push_back(std::make_pair(name, expr));
9732
        	        	            }
9733
9734
9735
        	        	        }
9736
51432
        	        	        break;
9737
9738
39133
        	        	    default:
9739
9740
39133
        	        		if ( cnt44 >= 1 )
9741
        	        		{
9742
39133
        	        		    goto loop44;
9743
        	        		}
9744
        	        		/* mismatchedSetEx()
9745
        	        		 */
9746
        	        		CONSTRUCTEX();
9747
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
9748
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
9749
9750
9751
        	        		goto ruletermNonVariableEx;
9752
        	        	}
9753
51432
        	        	cnt44++;
9754
51432
        	            }
9755
39133
        	            loop44: ;	/* Jump to here if this rule does not match */
9756
        	        }
9757
9758
        	        {
9759
        	             // now implement these bindings
9760
90565
        	                  for (const std::pair<std::string, api::Term>& binder : binders)
9761
        	                  {
9762
        	                    {
9763
51432
        	                      PARSER_STATE->defineVar(binder.first, binder.second);
9764
        	                    }
9765
        	                  }
9766
9767
        	        }
9768
9769
9770
39133
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3693);
9771
39133
        	        if  (HASEXCEPTION())
9772
        	        {
9773
        	            goto ruletermNonVariableEx;
9774
        	        }
9775
9776
9777
39133
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable3699);
9778
39133
        	        term(ctx, expr, f2);
9779
9780
39133
        	        FOLLOWPOP();
9781
39133
        	        if  (HASEXCEPTION())
9782
        	        {
9783
        	            goto ruletermNonVariableEx;
9784
        	        }
9785
9786
9787
39133
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3706);
9788
39133
        	        if  (HASEXCEPTION())
9789
        	        {
9790
        	            goto ruletermNonVariableEx;
9791
        	        }
9792
9793
9794
        	        {
9795
39133
        	             PARSER_STATE->popScope();
9796
        	        }
9797
9798
9799
        	    }
9800
39133
        	    break;
9801
9
        	case 5:
9802
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1404:5: LPAREN_TOK MATCH_TOK term[expr, f2] LPAREN_TOK ( LPAREN_TOK LPAREN_TOK term[f, f2] ( symbol[name,CHECK_NONE,SYM_VARIABLE] )* RPAREN_TOK term[f3, f2] RPAREN_TOK | LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[f3, f2] RPAREN_TOK )+ RPAREN_TOK RPAREN_TOK
9803
        	    {
9804
9
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3724);
9805
9
        	        if  (HASEXCEPTION())
9806
        	        {
9807
        	            goto ruletermNonVariableEx;
9808
        	        }
9809
9810
9811
9
        	         MATCHT(MATCH_TOK, &FOLLOW_MATCH_TOK_in_termNonVariable3726);
9812
9
        	        if  (HASEXCEPTION())
9813
        	        {
9814
        	            goto ruletermNonVariableEx;
9815
        	        }
9816
9817
9818
9
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable3728);
9819
9
        	        term(ctx, expr, f2);
9820
9821
9
        	        FOLLOWPOP();
9822
9
        	        if  (HASEXCEPTION())
9823
        	        {
9824
        	            goto ruletermNonVariableEx;
9825
        	        }
9826
9827
9828
        	        {
9829
9830
9
        	                  if( !expr.getSort().isDatatype() ){
9831
        	                    PARSER_STATE->parseError("Cannot match on non-datatype term.");
9832
        	                  }
9833
9834
        	        }
9835
9836
9837
9
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3737);
9838
9
        	        if  (HASEXCEPTION())
9839
        	        {
9840
        	            goto ruletermNonVariableEx;
9841
        	        }
9842
9843
9844
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1410:5: ( LPAREN_TOK LPAREN_TOK term[f, f2] ( symbol[name,CHECK_NONE,SYM_VARIABLE] )* RPAREN_TOK term[f3, f2] RPAREN_TOK | LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[f3, f2] RPAREN_TOK )+
9845
        	        {
9846
9
        	            int cnt46=0;
9847
9848
        	            for (;;)
9849
        	            {
9850
32
        	                int alt46=3;
9851
32
        	        	switch ( LA(1) )
9852
        	        	{
9853
23
        	        	case LPAREN_TOK:
9854
        	        		{
9855
23
        	        			switch ( LA(2) )
9856
        	        			{
9857
7
        	        			case LPAREN_TOK:
9858
        	        				{
9859
7
        	        					alt46=1;
9860
        	        				}
9861
7
        	        			    break;
9862
16
        	        			case QUOTED_SYMBOL:
9863
        	        			case SIMPLE_SYMBOL:
9864
        	        			case UNTERMINATED_QUOTED_SYMBOL:
9865
        	        				{
9866
16
        	        					alt46=2;
9867
        	        				}
9868
16
        	        			    break;
9869
9870
        	        			}
9871
9872
        	        		}
9873
23
        	        	    break;
9874
9875
        	        	}
9876
9877
32
        	        	switch (alt46)
9878
        	        	{
9879
7
        	        	    case 1:
9880
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1412:7: LPAREN_TOK LPAREN_TOK term[f, f2] ( symbol[name,CHECK_NONE,SYM_VARIABLE] )* RPAREN_TOK term[f3, f2] RPAREN_TOK
9881
        	        	        {
9882
7
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3758);
9883
7
        	        	            if  (HASEXCEPTION())
9884
        	        	            {
9885
        	        	                goto ruletermNonVariableEx;
9886
        	        	            }
9887
9888
9889
7
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3760);
9890
7
        	        	            if  (HASEXCEPTION())
9891
        	        	            {
9892
        	        	                goto ruletermNonVariableEx;
9893
        	        	            }
9894
9895
9896
7
        	        	            FOLLOWPUSH(FOLLOW_term_in_termNonVariable3762);
9897
7
        	        	            term(ctx, f, f2);
9898
9899
7
        	        	            FOLLOWPOP();
9900
7
        	        	            if  (HASEXCEPTION())
9901
        	        	            {
9902
        	        	                goto ruletermNonVariableEx;
9903
        	        	            }
9904
9905
9906
        	        	            {
9907
9908
7
        	        	                          args.clear();
9909
7
        	        	                          PARSER_STATE->pushScope();
9910
        	        	                          // f should be a constructor
9911
7
        	        	                          type = f.getSort();
9912
7
        	        	                          Debug("parser-dt") << "Pattern head : " << f << " " << type << std::endl;
9913
7
        	        	                          if (!type.isConstructor())
9914
        	        	                          {
9915
        	        	                            PARSER_STATE->parseError("Pattern must be application of a constructor or a variable.");
9916
        	        	                          }
9917
14
        	        	                          api::Datatype dt = type.getConstructorCodomainSort().getDatatype();
9918
7
        	        	                          if (dt.isParametric())
9919
        	        	                          {
9920
        	        	                            // lookup constructor by name
9921
4
        	        	                            api::DatatypeConstructor dc = dt.getConstructor(f.toString());
9922
4
        	        	                            api::Term scons = dc.getSpecializedConstructorTerm(expr.getSort());
9923
        	        	                            // take the type of the specialized constructor instead
9924
2
        	        	                            type = scons.getSort();
9925
        	        	                          }
9926
7
        	        	                          argTypes = type.getConstructorDomainSorts();
9927
9928
        	        	            }
9929
9930
9931
        	        	            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1434:9: ( symbol[name,CHECK_NONE,SYM_VARIABLE] )*
9932
9933
        	        	            for (;;)
9934
        	        	            {
9935
21
        	        	                int alt45=2;
9936
21
        	        	                switch ( LA(1) )
9937
        	        	                {
9938
14
        	        	                case QUOTED_SYMBOL:
9939
        	        	                case SIMPLE_SYMBOL:
9940
        	        	                case UNTERMINATED_QUOTED_SYMBOL:
9941
        	        	                	{
9942
14
        	        	                		alt45=1;
9943
        	        	                	}
9944
14
        	        	                    break;
9945
9946
        	        	                }
9947
9948
21
        	        	                switch (alt45)
9949
        	        	                {
9950
14
        	        	            	case 1:
9951
        	        	            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1434:11: symbol[name,CHECK_NONE,SYM_VARIABLE]
9952
        	        	            	    {
9953
14
        	        	            	        FOLLOWPUSH(FOLLOW_symbol_in_termNonVariable3786);
9954
14
        	        	            	        symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
9955
9956
14
        	        	            	        FOLLOWPOP();
9957
14
        	        	            	        if  (HASEXCEPTION())
9958
        	        	            	        {
9959
        	        	            	            goto ruletermNonVariableEx;
9960
        	        	            	        }
9961
9962
9963
        	        	            	        {
9964
9965
14
        	        	            	                        if (args.size() >= argTypes.size())
9966
        	        	            	                        {
9967
        	        	            	                          PARSER_STATE->parseError("Too many arguments for pattern.");
9968
        	        	            	                        }
9969
        	        	            	                        //make of proper type
9970
28
        	        	            	                        api::Term arg = PARSER_STATE->bindBoundVar(name, argTypes[args.size()]);
9971
14
        	        	            	                        args.push_back( arg );
9972
9973
14
        	        	            	        }
9974
9975
9976
        	        	            	    }
9977
14
        	        	            	    break;
9978
9979
7
        	        	            	default:
9980
7
        	        	            	    goto loop45;	/* break out of the loop */
9981
        	        	            	    break;
9982
        	        	                }
9983
14
        	        	            }
9984
7
        	        	            loop45: ; /* Jump out to here if this rule does not match */
9985
9986
9987
7
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3810);
9988
7
        	        	            if  (HASEXCEPTION())
9989
        	        	            {
9990
        	        	                goto ruletermNonVariableEx;
9991
        	        	            }
9992
9993
9994
7
        	        	            FOLLOWPUSH(FOLLOW_term_in_termNonVariable3812);
9995
7
        	        	            term(ctx, f3, f2);
9996
9997
7
        	        	            FOLLOWPOP();
9998
7
        	        	            if  (HASEXCEPTION())
9999
        	        	            {
10000
        	        	                goto ruletermNonVariableEx;
10001
        	        	            }
10002
10003
10004
        	        	            {
10005
10006
        	        	                          // make the match case
10007
14
        	        	                          std::vector<cvc5::api::Term> cargs;
10008
7
        	        	                          cargs.push_back(f);
10009
7
        	        	                          cargs.insert(cargs.end(),args.begin(),args.end());
10010
14
        	        	                          api::Term c = MK_TERM(api::APPLY_CONSTRUCTOR,cargs);
10011
14
        	        	                          api::Term bvla = MK_TERM(api::BOUND_VAR_LIST,args);
10012
14
        	        	                          api::Term mc = MK_TERM(api::MATCH_BIND_CASE, bvla, c, f3);
10013
7
        	        	                          matchcases.push_back(mc);
10014
        	        	                          // now, pop the scope
10015
7
        	        	                          PARSER_STATE->popScope();
10016
10017
        	        	            }
10018
10019
10020
7
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3825);
10021
7
        	        	            if  (HASEXCEPTION())
10022
        	        	            {
10023
        	        	                goto ruletermNonVariableEx;
10024
7
        	        	            }
10025
10026
10027
        	        	        }
10028
7
        	        	        break;
10029
16
        	        	    case 2:
10030
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1458:9: LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] term[f3, f2] RPAREN_TOK
10031
        	        	        {
10032
16
        	        	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3842);
10033
16
        	        	            if  (HASEXCEPTION())
10034
        	        	            {
10035
        	        	                goto ruletermNonVariableEx;
10036
        	        	            }
10037
10038
10039
16
        	        	            FOLLOWPUSH(FOLLOW_symbol_in_termNonVariable3844);
10040
16
        	        	            symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
10041
10042
16
        	        	            FOLLOWPOP();
10043
16
        	        	            if  (HASEXCEPTION())
10044
        	        	            {
10045
        	        	                goto ruletermNonVariableEx;
10046
        	        	            }
10047
10048
10049
        	        	            {
10050
10051
16
        	        	                          if (PARSER_STATE->isDeclared(name,SYM_VARIABLE))
10052
        	        	                          {
10053
15
        	        	                            f = PARSER_STATE->getVariable(name);
10054
15
        	        	                            type = f.getSort();
10055
60
        	        	                            if (!type.isConstructor() ||
10056
45
        	        	                                !type.getConstructorDomainSorts().empty())
10057
        	        	                            {
10058
        	        	                              PARSER_STATE->parseError("Must apply constructors of arity greater than 0 to arguments in pattern.");
10059
        	        	                            }
10060
        	        	                            // make nullary constructor application
10061
15
        	        	                            f = MK_TERM(api::APPLY_CONSTRUCTOR, f);
10062
        	        	                          }
10063
        	        	                          else
10064
        	        	                          {
10065
        	        	                            // it has the type of the head expr
10066
1
        	        	                            f = PARSER_STATE->bindBoundVar(name, expr.getSort());
10067
        	        	                          }
10068
10069
        	        	            }
10070
10071
10072
16
        	        	            FOLLOWPUSH(FOLLOW_term_in_termNonVariable3857);
10073
16
        	        	            term(ctx, f3, f2);
10074
10075
16
        	        	            FOLLOWPOP();
10076
16
        	        	            if  (HASEXCEPTION())
10077
        	        	            {
10078
        	        	                goto ruletermNonVariableEx;
10079
        	        	            }
10080
10081
10082
        	        	            {
10083
10084
32
        	        	                          api::Term mc;
10085
16
        	        	                          if (f.getKind() == api::VARIABLE)
10086
        	        	                          {
10087
2
        	        	                            api::Term bvlf = MK_TERM(api::BOUND_VAR_LIST, f);
10088
1
        	        	                            mc = MK_TERM(api::MATCH_BIND_CASE, bvlf, f, f3);
10089
        	        	                          }
10090
        	        	                          else
10091
        	        	                          {
10092
15
        	        	                            mc = MK_TERM(api::MATCH_CASE, f, f3);
10093
        	        	                          }
10094
16
        	        	                          matchcases.push_back(mc);
10095
10096
        	        	            }
10097
10098
10099
16
        	        	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3870);
10100
16
        	        	            if  (HASEXCEPTION())
10101
        	        	            {
10102
        	        	                goto ruletermNonVariableEx;
10103
16
        	        	            }
10104
10105
10106
        	        	        }
10107
16
        	        	        break;
10108
10109
9
        	        	    default:
10110
10111
9
        	        		if ( cnt46 >= 1 )
10112
        	        		{
10113
9
        	        		    goto loop46;
10114
        	        		}
10115
        	        		/* mismatchedSetEx()
10116
        	        		 */
10117
        	        		CONSTRUCTEX();
10118
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
10119
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
10120
10121
10122
        	        		goto ruletermNonVariableEx;
10123
        	        	}
10124
23
        	        	cnt46++;
10125
23
        	            }
10126
9
        	            loop46: ;	/* Jump to here if this rule does not match */
10127
        	        }
10128
10129
9
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3883);
10130
9
        	        if  (HASEXCEPTION())
10131
        	        {
10132
        	            goto ruletermNonVariableEx;
10133
        	        }
10134
10135
10136
9
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3885);
10137
9
        	        if  (HASEXCEPTION())
10138
        	        {
10139
        	            goto ruletermNonVariableEx;
10140
        	        }
10141
10142
10143
        	        {
10144
10145
        	                  //now, make the match
10146
9
        	                  if (matchcases.empty())
10147
        	                  {
10148
        	                    PARSER_STATE->parseError("Must have at least one case in match.");
10149
        	                  }
10150
18
        	                  std::vector<api::Term> mchildren;
10151
9
        	                  mchildren.push_back(expr);
10152
9
        	                  mchildren.insert(mchildren.end(), matchcases.begin(), matchcases.end());
10153
9
        	                  expr = MK_TERM(api::MATCH, mchildren);
10154
10155
9
        	        }
10156
10157
10158
        	    }
10159
9
        	    break;
10160
2803
        	case 6:
10161
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1505:5: LPAREN_TOK ATTRIBUTE_TOK term[expr, f2] ( attribute[expr, attexpr] )+ RPAREN_TOK
10162
        	    {
10163
2803
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3901);
10164
2803
        	        if  (HASEXCEPTION())
10165
        	        {
10166
        	            goto ruletermNonVariableEx;
10167
        	        }
10168
10169
10170
2803
        	         MATCHT(ATTRIBUTE_TOK, &FOLLOW_ATTRIBUTE_TOK_in_termNonVariable3903);
10171
2803
        	        if  (HASEXCEPTION())
10172
        	        {
10173
        	            goto ruletermNonVariableEx;
10174
        	        }
10175
10176
10177
2803
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable3905);
10178
2803
        	        term(ctx, expr, f2);
10179
10180
2803
        	        FOLLOWPOP();
10181
2803
        	        if  (HASEXCEPTION())
10182
        	        {
10183
        	            goto ruletermNonVariableEx;
10184
        	        }
10185
10186
10187
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1506:5: ( attribute[expr, attexpr] )+
10188
        	        {
10189
2803
        	            int cnt47=0;
10190
10191
        	            for (;;)
10192
        	            {
10193
5735
        	                int alt47=2;
10194
5735
        	        	switch ( LA(1) )
10195
        	        	{
10196
2933
        	        	case ATTRIBUTE_INST_ADD_TO_POOL_TOK:
10197
        	        	case ATTRIBUTE_INST_LEVEL:
10198
        	        	case ATTRIBUTE_NAMED_TOK:
10199
        	        	case ATTRIBUTE_NO_PATTERN_TOK:
10200
        	        	case ATTRIBUTE_PATTERN_TOK:
10201
        	        	case ATTRIBUTE_POOL_TOK:
10202
        	        	case ATTRIBUTE_QUANTIFIER_ID_TOK:
10203
        	        	case ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK:
10204
        	        	case KEYWORD:
10205
        	        		{
10206
2933
        	        			alt47=1;
10207
        	        		}
10208
2933
        	        	    break;
10209
10210
        	        	}
10211
10212
5735
        	        	switch (alt47)
10213
        	        	{
10214
2933
        	        	    case 1:
10215
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1506:7: attribute[expr, attexpr]
10216
        	        	        {
10217
2933
        	        	            FOLLOWPUSH(FOLLOW_attribute_in_termNonVariable3914);
10218
2933
        	        	            attribute(ctx, expr, attexpr);
10219
10220
2932
        	        	            FOLLOWPOP();
10221
2932
        	        	            if  (HASEXCEPTION())
10222
        	        	            {
10223
        	        	                goto ruletermNonVariableEx;
10224
        	        	            }
10225
10226
10227
        	        	            {
10228
2932
        	        	                 if( ! attexpr.isNull()) {
10229
1314
        	        	                          patexprs.push_back( attexpr );
10230
        	        	                        }
10231
10232
        	        	            }
10233
10234
10235
        	        	        }
10236
2932
        	        	        break;
10237
10238
2802
        	        	    default:
10239
10240
2802
        	        		if ( cnt47 >= 1 )
10241
        	        		{
10242
2802
        	        		    goto loop47;
10243
        	        		}
10244
        	        		/* mismatchedSetEx()
10245
        	        		 */
10246
        	        		CONSTRUCTEX();
10247
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
10248
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
10249
10250
10251
        	        		goto ruletermNonVariableEx;
10252
        	        	}
10253
2932
        	        	cnt47++;
10254
2932
        	            }
10255
2802
        	            loop47: ;	/* Jump to here if this rule does not match */
10256
        	        }
10257
10258
2802
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3932);
10259
2802
        	        if  (HASEXCEPTION())
10260
        	        {
10261
        	            goto ruletermNonVariableEx;
10262
        	        }
10263
10264
10265
        	        {
10266
10267
2802
        	                  if(! patexprs.empty()) {
10268
1184
        	                    if( !f2.isNull() && f2.getKind()==api::INST_PATTERN_LIST ){
10269
6
        	                      for( size_t i=0; i<f2.getNumChildren(); i++ ){
10270
3
        	                        patexprs.push_back( f2[i] );
10271
        	                      }
10272
        	                    }
10273
1184
        	                    expr2 = MK_TERM(api::INST_PATTERN_LIST, patexprs);
10274
        	                  } else {
10275
1618
        	                    expr2 = f2;
10276
        	                  }
10277
10278
        	        }
10279
10280
10281
        	    }
10282
2802
        	    break;
10283
26
        	case 7:
10284
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1525:5: LPAREN_TOK HO_LAMBDA_TOK boundVarList[bvl] term[f, f2] RPAREN_TOK
10285
        	    {
10286
26
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3950);
10287
26
        	        if  (HASEXCEPTION())
10288
        	        {
10289
        	            goto ruletermNonVariableEx;
10290
        	        }
10291
10292
10293
26
        	         MATCHT(HO_LAMBDA_TOK, &FOLLOW_HO_LAMBDA_TOK_in_termNonVariable3952);
10294
26
        	        if  (HASEXCEPTION())
10295
        	        {
10296
        	            goto ruletermNonVariableEx;
10297
        	        }
10298
10299
10300
        	        {
10301
26
        	             PARSER_STATE->pushScope();
10302
        	        }
10303
10304
10305
26
        	        FOLLOWPUSH(FOLLOW_boundVarList_in_termNonVariable3964);
10306
26
        	        boundVarList(ctx, bvl);
10307
10308
26
        	        FOLLOWPOP();
10309
26
        	        if  (HASEXCEPTION())
10310
        	        {
10311
        	            goto ruletermNonVariableEx;
10312
        	        }
10313
10314
10315
26
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable3971);
10316
26
        	        term(ctx, f, f2);
10317
10318
26
        	        FOLLOWPOP();
10319
26
        	        if  (HASEXCEPTION())
10320
        	        {
10321
        	            goto ruletermNonVariableEx;
10322
        	        }
10323
10324
10325
26
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3974);
10326
26
        	        if  (HASEXCEPTION())
10327
        	        {
10328
        	            goto ruletermNonVariableEx;
10329
        	        }
10330
10331
10332
        	        {
10333
10334
26
        	                  args.push_back(bvl);
10335
26
        	                  args.push_back(f);
10336
26
        	                  PARSER_STATE->popScope();
10337
26
        	                  expr = MK_TERM(api::LAMBDA, args);
10338
10339
        	        }
10340
10341
10342
        	    }
10343
26
        	    break;
10344
878
        	case 8:
10345
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1535:5: LPAREN_TOK TUPLE_CONST_TOK termList[args,expr] RPAREN_TOK
10346
        	    {
10347
878
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable3986);
10348
878
        	        if  (HASEXCEPTION())
10349
        	        {
10350
        	            goto ruletermNonVariableEx;
10351
        	        }
10352
10353
10354
878
        	         MATCHT(TUPLE_CONST_TOK, &FOLLOW_TUPLE_CONST_TOK_in_termNonVariable3988);
10355
878
        	        if  (HASEXCEPTION())
10356
        	        {
10357
        	            goto ruletermNonVariableEx;
10358
        	        }
10359
10360
10361
878
        	        FOLLOWPUSH(FOLLOW_termList_in_termNonVariable3990);
10362
878
        	        termList(ctx, args, expr);
10363
10364
878
        	        FOLLOWPOP();
10365
878
        	        if  (HASEXCEPTION())
10366
        	        {
10367
        	            goto ruletermNonVariableEx;
10368
        	        }
10369
10370
10371
878
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable3993);
10372
878
        	        if  (HASEXCEPTION())
10373
        	        {
10374
        	            goto ruletermNonVariableEx;
10375
        	        }
10376
10377
10378
        	        {
10379
10380
1756
        	                std::vector<api::Sort> sorts;
10381
1756
        	                std::vector<api::Term> terms;
10382
2634
        	                for (const api::Term& arg : args)
10383
        	                {
10384
1756
        	                  sorts.emplace_back(arg.getSort());
10385
1756
        	                  terms.emplace_back(arg);
10386
        	                }
10387
878
        	                expr = SOLVER->mkTuple(sorts, terms);
10388
10389
878
        	        }
10390
10391
10392
        	    }
10393
878
        	    break;
10394
2
        	case 9:
10395
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1546:5: LPAREN_TOK TUPLE_PROJECT_TOK term[expr,expr2] RPAREN_TOK
10396
        	    {
10397
2
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termNonVariable4003);
10398
2
        	        if  (HASEXCEPTION())
10399
        	        {
10400
        	            goto ruletermNonVariableEx;
10401
        	        }
10402
10403
10404
2
        	         MATCHT(TUPLE_PROJECT_TOK, &FOLLOW_TUPLE_PROJECT_TOK_in_termNonVariable4005);
10405
2
        	        if  (HASEXCEPTION())
10406
        	        {
10407
        	            goto ruletermNonVariableEx;
10408
        	        }
10409
10410
10411
2
        	        FOLLOWPUSH(FOLLOW_term_in_termNonVariable4007);
10412
2
        	        term(ctx, expr, expr2);
10413
10414
2
        	        FOLLOWPOP();
10415
2
        	        if  (HASEXCEPTION())
10416
        	        {
10417
        	            goto ruletermNonVariableEx;
10418
        	        }
10419
10420
10421
2
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termNonVariable4010);
10422
2
        	        if  (HASEXCEPTION())
10423
        	        {
10424
        	            goto ruletermNonVariableEx;
10425
        	        }
10426
10427
10428
        	        {
10429
10430
4
        	                std::vector<uint32_t> indices;
10431
4
        	                api::Op op = SOLVER->mkOp(api::TUPLE_PROJECT, indices);
10432
2
        	                expr = SOLVER->mkTerm(op, expr);
10433
10434
2
        	        }
10435
10436
10437
        	    }
10438
2
        	    break;
10439
233934
        	case 10:
10440
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1553:5: termAtomic[atomTerm]
10441
        	    {
10442
233934
        	        FOLLOWPUSH(FOLLOW_termAtomic_in_termNonVariable4026);
10443
233934
        	        termAtomic(ctx, atomTerm);
10444
10445
233934
        	        FOLLOWPOP();
10446
233934
        	        if  (HASEXCEPTION())
10447
        	        {
10448
        	            goto ruletermNonVariableEx;
10449
        	        }
10450
10451
10452
        	        {
10453
233934
        	             expr = atomTerm;
10454
        	        }
10455
10456
10457
        	    }
10458
233934
        	    break;
10459
10460
            }
10461
        }
10462
    }
10463
10464
    // This is where rules clean up and exit
10465
    //
10466
2457537
    goto ruletermNonVariableEx; /* Prevent compiler warnings */
10467
2457539
    ruletermNonVariableEx: ;
10468
10469
2457539
            if (HASEXCEPTION())
10470
            {
10471
2
                PREPORTERROR();
10472
                PRECOVER();
10473
            }
10474
4915074
    return ;
10475
}
10476
/* $ANTLR end termNonVariable */
10477
10478
/**
10479
 * $ANTLR start qualIdentifier
10480
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1608:1: qualIdentifier[cvc5::ParseOp& p] : ( identifier[p] | LPAREN_TOK AS_TOK ( CONST_TOK sortSymbol[type, CHECK_DECLARED] | identifier[p] sortSymbol[type, CHECK_DECLARED] ) RPAREN_TOK );
10481
 */
10482
static void
10483
4777793
qualIdentifier(pSmt2Parser ctx, cvc5::ParseOp& p)
10484
{
10485
    /* Initialize rule variables
10486
     */
10487
10488
10489
      api::Kind k;
10490
9555586
      std::string baseName;
10491
9555586
      cvc5::api::Term f;
10492
9555586
      cvc5::api::Sort type;
10493
10494
    {
10495
        {
10496
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1615:3: ( identifier[p] | LPAREN_TOK AS_TOK ( CONST_TOK sortSymbol[type, CHECK_DECLARED] | identifier[p] sortSymbol[type, CHECK_DECLARED] ) RPAREN_TOK )
10497
10498
            ANTLR3_UINT32 alt50;
10499
10500
4777793
            alt50=2;
10501
10502
4777793
            switch ( LA(1) )
10503
            {
10504
4735075
            case QUOTED_SYMBOL:
10505
            case SIMPLE_SYMBOL:
10506
            case UNTERMINATED_QUOTED_SYMBOL:
10507
            	{
10508
4735075
            		alt50=1;
10509
            	}
10510
4735075
                break;
10511
42718
            case LPAREN_TOK:
10512
            	{
10513
42718
            		switch ( LA(2) )
10514
            		{
10515
42471
            		case INDEX_TOK:
10516
            			{
10517
42471
            				alt50=1;
10518
            			}
10519
42471
            		    break;
10520
247
            		case AS_TOK:
10521
            			{
10522
247
            				alt50=2;
10523
            			}
10524
247
            		    break;
10525
10526
            		default:
10527
            		    CONSTRUCTEX();
10528
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
10529
            		    EXCEPTION->message      = (void *)"";
10530
            		    EXCEPTION->decisionNum  = 50;
10531
            		    EXCEPTION->state        = 4;
10532
10533
10534
            		    goto rulequalIdentifierEx;
10535
10536
            		}
10537
10538
            	}
10539
42718
                break;
10540
10541
            default:
10542
                CONSTRUCTEX();
10543
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
10544
                EXCEPTION->message      = (void *)"";
10545
                EXCEPTION->decisionNum  = 50;
10546
                EXCEPTION->state        = 0;
10547
10548
10549
                goto rulequalIdentifierEx;
10550
10551
            }
10552
10553
4777793
            switch (alt50)
10554
            {
10555
4777546
        	case 1:
10556
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1615:3: identifier[p]
10557
        	    {
10558
4777546
        	        FOLLOWPUSH(FOLLOW_identifier_in_qualIdentifier4049);
10559
4777546
        	        identifier(ctx, p);
10560
10561
4777545
        	        FOLLOWPOP();
10562
4777545
        	        if  (HASEXCEPTION())
10563
        	        {
10564
        	            goto rulequalIdentifierEx;
10565
        	        }
10566
10567
10568
        	    }
10569
4777545
        	    break;
10570
247
        	case 2:
10571
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1616:5: LPAREN_TOK AS_TOK ( CONST_TOK sortSymbol[type, CHECK_DECLARED] | identifier[p] sortSymbol[type, CHECK_DECLARED] ) RPAREN_TOK
10572
        	    {
10573
247
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_qualIdentifier4056);
10574
247
        	        if  (HASEXCEPTION())
10575
        	        {
10576
        	            goto rulequalIdentifierEx;
10577
        	        }
10578
10579
10580
247
        	         MATCHT(AS_TOK, &FOLLOW_AS_TOK_in_qualIdentifier4058);
10581
247
        	        if  (HASEXCEPTION())
10582
        	        {
10583
        	            goto rulequalIdentifierEx;
10584
        	        }
10585
10586
10587
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1617:5: ( CONST_TOK sortSymbol[type, CHECK_DECLARED] | identifier[p] sortSymbol[type, CHECK_DECLARED] )
10588
        	        {
10589
247
        	            int alt49=2;
10590
247
        	            switch ( LA(1) )
10591
        	            {
10592
40
        	            case CONST_TOK:
10593
        	            	{
10594
40
        	            		alt49=1;
10595
        	            	}
10596
40
        	                break;
10597
207
        	            case LPAREN_TOK:
10598
        	            case QUOTED_SYMBOL:
10599
        	            case SIMPLE_SYMBOL:
10600
        	            case UNTERMINATED_QUOTED_SYMBOL:
10601
        	            	{
10602
207
        	            		alt49=2;
10603
        	            	}
10604
207
        	                break;
10605
10606
        	            default:
10607
        	                CONSTRUCTEX();
10608
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
10609
        	                EXCEPTION->message      = (void *)"";
10610
        	                EXCEPTION->decisionNum  = 49;
10611
        	                EXCEPTION->state        = 0;
10612
10613
10614
        	                goto rulequalIdentifierEx;
10615
10616
        	            }
10617
10618
247
        	            switch (alt49)
10619
        	            {
10620
40
        	        	case 1:
10621
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1617:7: CONST_TOK sortSymbol[type, CHECK_DECLARED]
10622
        	        	    {
10623
40
        	        	         MATCHT(CONST_TOK, &FOLLOW_CONST_TOK_in_qualIdentifier4066);
10624
40
        	        	        if  (HASEXCEPTION())
10625
        	        	        {
10626
        	        	            goto rulequalIdentifierEx;
10627
        	        	        }
10628
10629
10630
40
        	        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_qualIdentifier4068);
10631
40
        	        	        sortSymbol(ctx, type, CHECK_DECLARED);
10632
10633
40
        	        	        FOLLOWPOP();
10634
40
        	        	        if  (HASEXCEPTION())
10635
        	        	        {
10636
        	        	            goto rulequalIdentifierEx;
10637
        	        	        }
10638
10639
10640
        	        	        {
10641
10642
40
        	        	                    p.d_kind = api::CONST_ARRAY;
10643
40
        	        	                    PARSER_STATE->parseOpApplyTypeAscription(p, type);
10644
10645
        	        	        }
10646
10647
10648
        	        	    }
10649
40
        	        	    break;
10650
207
        	        	case 2:
10651
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1622:7: identifier[p] sortSymbol[type, CHECK_DECLARED]
10652
        	        	    {
10653
207
        	        	        FOLLOWPUSH(FOLLOW_identifier_in_qualIdentifier4085);
10654
207
        	        	        identifier(ctx, p);
10655
10656
207
        	        	        FOLLOWPOP();
10657
207
        	        	        if  (HASEXCEPTION())
10658
        	        	        {
10659
        	        	            goto rulequalIdentifierEx;
10660
        	        	        }
10661
10662
10663
207
        	        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_qualIdentifier4094);
10664
207
        	        	        sortSymbol(ctx, type, CHECK_DECLARED);
10665
10666
207
        	        	        FOLLOWPOP();
10667
207
        	        	        if  (HASEXCEPTION())
10668
        	        	        {
10669
        	        	            goto rulequalIdentifierEx;
10670
        	        	        }
10671
10672
10673
        	        	        {
10674
10675
207
        	        	                    PARSER_STATE->parseOpApplyTypeAscription(p, type);
10676
10677
        	        	        }
10678
10679
10680
        	        	    }
10681
207
        	        	    break;
10682
10683
        	            }
10684
        	        }
10685
10686
247
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_qualIdentifier4115);
10687
247
        	        if  (HASEXCEPTION())
10688
        	        {
10689
        	            goto rulequalIdentifierEx;
10690
247
        	        }
10691
10692
10693
        	    }
10694
247
        	    break;
10695
10696
            }
10697
        }
10698
    }
10699
10700
    // This is where rules clean up and exit
10701
    //
10702
4777792
    goto rulequalIdentifierEx; /* Prevent compiler warnings */
10703
4777792
    rulequalIdentifierEx: ;
10704
10705
4777792
            if (HASEXCEPTION())
10706
            {
10707
                PREPORTERROR();
10708
                PRECOVER();
10709
            }
10710
9555584
    return ;
10711
}
10712
/* $ANTLR end qualIdentifier */
10713
10714
/**
10715
 * $ANTLR start identifier
10716
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1639:1: identifier[cvc5::ParseOp& p] : ( functionName[p.d_name, CHECK_NONE] | LPAREN_TOK INDEX_TOK ( TESTER_TOK term[f, f2] | UPDATE_TOK term[f, f2] | TUPLE_SEL_TOK m= INTEGER_LITERAL | TUPLE_PROJECT_TOK nonemptyNumeralList[numerals] |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] ) RPAREN_TOK );
10717
 */
10718
static void
10719
4777753
identifier(pSmt2Parser ctx, cvc5::ParseOp& p)
10720
{
10721
    pANTLR3_COMMON_TOKEN    m;
10722
    pANTLR3_COMMON_TOKEN    sym;
10723
10724
    /* Initialize rule variables
10725
     */
10726
10727
10728
9555506
      cvc5::api::Term f;
10729
9555506
      cvc5::api::Term f2;
10730
9555506
      std::vector<uint64_t> numerals;
10731
10732
4777753
    m       = NULL;
10733
4777753
    sym       = NULL;
10734
10735
    {
10736
        {
10737
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1645:3: ( functionName[p.d_name, CHECK_NONE] | LPAREN_TOK INDEX_TOK ( TESTER_TOK term[f, f2] | UPDATE_TOK term[f, f2] | TUPLE_SEL_TOK m= INTEGER_LITERAL | TUPLE_PROJECT_TOK nonemptyNumeralList[numerals] |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] ) RPAREN_TOK )
10738
10739
            ANTLR3_UINT32 alt52;
10740
10741
4777753
            alt52=2;
10742
10743
4777753
            switch ( LA(1) )
10744
            {
10745
4735282
            case QUOTED_SYMBOL:
10746
            case SIMPLE_SYMBOL:
10747
            case UNTERMINATED_QUOTED_SYMBOL:
10748
            	{
10749
4735282
            		alt52=1;
10750
            	}
10751
4735282
                break;
10752
42471
            case LPAREN_TOK:
10753
            	{
10754
42471
            		alt52=2;
10755
            	}
10756
42471
                break;
10757
10758
            default:
10759
                CONSTRUCTEX();
10760
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
10761
                EXCEPTION->message      = (void *)"";
10762
                EXCEPTION->decisionNum  = 52;
10763
                EXCEPTION->state        = 0;
10764
10765
10766
                goto ruleidentifierEx;
10767
10768
            }
10769
10770
4777753
            switch (alt52)
10771
            {
10772
4735282
        	case 1:
10773
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1645:3: functionName[p.d_name, CHECK_NONE]
10774
        	    {
10775
4735282
        	        FOLLOWPUSH(FOLLOW_functionName_in_identifier4134);
10776
4735282
        	        functionName(ctx, p.d_name, CHECK_NONE);
10777
10778
4735282
        	        FOLLOWPOP();
10779
4735282
        	        if  (HASEXCEPTION())
10780
        	        {
10781
        	            goto ruleidentifierEx;
10782
        	        }
10783
10784
10785
        	    }
10786
4735282
        	    break;
10787
42471
        	case 2:
10788
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1649:5: LPAREN_TOK INDEX_TOK ( TESTER_TOK term[f, f2] | UPDATE_TOK term[f, f2] | TUPLE_SEL_TOK m= INTEGER_LITERAL | TUPLE_PROJECT_TOK nonemptyNumeralList[numerals] |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] ) RPAREN_TOK
10789
        	    {
10790
42471
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_identifier4146);
10791
42471
        	        if  (HASEXCEPTION())
10792
        	        {
10793
        	            goto ruleidentifierEx;
10794
        	        }
10795
10796
10797
42471
        	         MATCHT(INDEX_TOK, &FOLLOW_INDEX_TOK_in_identifier4148);
10798
42471
        	        if  (HASEXCEPTION())
10799
        	        {
10800
        	            goto ruleidentifierEx;
10801
        	        }
10802
10803
10804
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1650:5: ( TESTER_TOK term[f, f2] | UPDATE_TOK term[f, f2] | TUPLE_SEL_TOK m= INTEGER_LITERAL | TUPLE_PROJECT_TOK nonemptyNumeralList[numerals] |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] )
10805
        	        {
10806
42471
        	            int alt51=5;
10807
42471
        	            switch ( LA(1) )
10808
        	            {
10809
841
        	            case TESTER_TOK:
10810
        	            	{
10811
841
        	            		alt51=1;
10812
        	            	}
10813
841
        	                break;
10814
17
        	            case UPDATE_TOK:
10815
        	            	{
10816
17
        	            		alt51=2;
10817
        	            	}
10818
17
        	                break;
10819
31
        	            case TUPLE_SEL_TOK:
10820
        	            	{
10821
31
        	            		alt51=3;
10822
        	            	}
10823
31
        	                break;
10824
2
        	            case TUPLE_PROJECT_TOK:
10825
        	            	{
10826
2
        	            		alt51=4;
10827
        	            	}
10828
2
        	                break;
10829
41580
        	            case SIMPLE_SYMBOL:
10830
        	            	{
10831
41580
        	            		alt51=5;
10832
        	            	}
10833
41580
        	                break;
10834
10835
        	            default:
10836
        	                CONSTRUCTEX();
10837
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
10838
        	                EXCEPTION->message      = (void *)"";
10839
        	                EXCEPTION->decisionNum  = 51;
10840
        	                EXCEPTION->state        = 0;
10841
10842
10843
        	                goto ruleidentifierEx;
10844
10845
        	            }
10846
10847
42471
        	            switch (alt51)
10848
        	            {
10849
841
        	        	case 1:
10850
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1650:7: TESTER_TOK term[f, f2]
10851
        	        	    {
10852
841
        	        	         MATCHT(TESTER_TOK, &FOLLOW_TESTER_TOK_in_identifier4156);
10853
841
        	        	        if  (HASEXCEPTION())
10854
        	        	        {
10855
        	        	            goto ruleidentifierEx;
10856
        	        	        }
10857
10858
10859
841
        	        	        FOLLOWPUSH(FOLLOW_term_in_identifier4158);
10860
841
        	        	        term(ctx, f, f2);
10861
10862
841
        	        	        FOLLOWPOP();
10863
841
        	        	        if  (HASEXCEPTION())
10864
        	        	        {
10865
        	        	            goto ruleidentifierEx;
10866
        	        	        }
10867
10868
10869
        	        	        {
10870
10871
841
        	        	                    if (f.getKind() == api::APPLY_CONSTRUCTOR && f.getNumChildren() == 1)
10872
        	        	                    {
10873
        	        	                      // for nullary constructors, must get the operator
10874
273
        	        	                      f = f[0];
10875
        	        	                    }
10876
841
        	        	                    if (!f.getSort().isConstructor())
10877
        	        	                    {
10878
        	        	                      PARSER_STATE->parseError(
10879
        	        	                          "Bad syntax for test (_ is X), X must be a constructor.");
10880
        	        	                    }
10881
        	        	                    // get the datatype that f belongs to
10882
1682
        	        	                    api::Sort sf = f.getSort().getConstructorCodomainSort();
10883
1682
        	        	                    api::Datatype d = sf.getDatatype();
10884
        	        	                    // lookup by name
10885
1682
        	        	                    api::DatatypeConstructor dc = d.getConstructor(f.toString());
10886
841
        	        	                    p.d_expr = dc.getTesterTerm();
10887
10888
841
        	        	        }
10889
10890
10891
        	        	    }
10892
841
        	        	    break;
10893
17
        	        	case 2:
10894
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1669:7: UPDATE_TOK term[f, f2]
10895
        	        	    {
10896
17
        	        	         MATCHT(UPDATE_TOK, &FOLLOW_UPDATE_TOK_in_identifier4175);
10897
17
        	        	        if  (HASEXCEPTION())
10898
        	        	        {
10899
        	        	            goto ruleidentifierEx;
10900
        	        	        }
10901
10902
10903
17
        	        	        FOLLOWPUSH(FOLLOW_term_in_identifier4177);
10904
17
        	        	        term(ctx, f, f2);
10905
10906
17
        	        	        FOLLOWPOP();
10907
17
        	        	        if  (HASEXCEPTION())
10908
        	        	        {
10909
        	        	            goto ruleidentifierEx;
10910
        	        	        }
10911
10912
10913
        	        	        {
10914
10915
17
        	        	                    if (!f.getSort().isSelector())
10916
        	        	                    {
10917
        	        	                      PARSER_STATE->parseError(
10918
        	        	                          "Bad syntax for test (_ update X), X must be a selector.");
10919
        	        	                    }
10920
34
        	        	                    std::string sname = f.toString();
10921
        	        	                    // get the datatype that f belongs to
10922
34
        	        	                    api::Sort sf = f.getSort().getSelectorDomainSort();
10923
34
        	        	                    api::Datatype d = sf.getDatatype();
10924
        	        	                    // find the selector
10925
34
        	        	                    api::DatatypeSelector ds = d.getSelector(f.toString());
10926
        	        	                    // get the updater term
10927
17
        	        	                    p.d_expr = ds.getUpdaterTerm();
10928
10929
17
        	        	        }
10930
10931
10932
        	        	    }
10933
17
        	        	    break;
10934
31
        	        	case 3:
10935
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1685:7: TUPLE_SEL_TOK m= INTEGER_LITERAL
10936
        	        	    {
10937
31
        	        	         MATCHT(TUPLE_SEL_TOK, &FOLLOW_TUPLE_SEL_TOK_in_identifier4194);
10938
31
        	        	        if  (HASEXCEPTION())
10939
        	        	        {
10940
        	        	            goto ruleidentifierEx;
10941
        	        	        }
10942
10943
10944
31
        	        	        m = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_identifier4198);
10945
31
        	        	        if  (HASEXCEPTION())
10946
        	        	        {
10947
        	        	            goto ruleidentifierEx;
10948
        	        	        }
10949
10950
10951
        	        	        {
10952
10953
        	        	                    // we adopt a special syntax (_ tupSel n)
10954
31
        	        	                    p.d_kind = api::APPLY_SELECTOR;
10955
        	        	                    // put m in expr so that the caller can deal with this case
10956
31
        	        	                    p.d_expr = SOLVER->mkInteger(AntlrInput::tokenToUnsigned(m));
10957
10958
        	        	        }
10959
10960
10961
        	        	    }
10962
31
        	        	    break;
10963
2
        	        	case 4:
10964
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1692:7: TUPLE_PROJECT_TOK nonemptyNumeralList[numerals]
10965
        	        	    {
10966
2
        	        	         MATCHT(TUPLE_PROJECT_TOK, &FOLLOW_TUPLE_PROJECT_TOK_in_identifier4214);
10967
2
        	        	        if  (HASEXCEPTION())
10968
        	        	        {
10969
        	        	            goto ruleidentifierEx;
10970
        	        	        }
10971
10972
10973
2
        	        	        FOLLOWPUSH(FOLLOW_nonemptyNumeralList_in_identifier4216);
10974
2
        	        	        nonemptyNumeralList(ctx, numerals);
10975
10976
2
        	        	        FOLLOWPOP();
10977
2
        	        	        if  (HASEXCEPTION())
10978
        	        	        {
10979
        	        	            goto ruleidentifierEx;
10980
        	        	        }
10981
10982
10983
        	        	        {
10984
10985
        	        	                    // we adopt a special syntax (_ tuple_project i_1 ... i_n) where
10986
        	        	                    // i_1, ..., i_n are numerals
10987
2
        	        	                    p.d_kind = api::TUPLE_PROJECT;
10988
4
        	        	                    std::vector<uint32_t> indices(numerals.size());
10989
6
        	        	                    for(size_t i = 0; i < numerals.size(); ++i)
10990
        	        	                    {
10991
        	        	                      // convert uint64_t to uint32_t
10992
4
        	        	                      indices[i] = numerals[i];
10993
        	        	                    }
10994
2
        	        	                    p.d_op = SOLVER->mkOp(api::TUPLE_PROJECT, indices);
10995
10996
2
        	        	        }
10997
10998
10999
        	        	    }
11000
2
        	        	    break;
11001
41580
        	        	case 5:
11002
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1705:7: sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals]
11003
        	        	    {
11004
41580
        	        	        sym = (pANTLR3_COMMON_TOKEN) MATCHT(SIMPLE_SYMBOL, &FOLLOW_SIMPLE_SYMBOL_in_identifier4235);
11005
41580
        	        	        if  (HASEXCEPTION())
11006
        	        	        {
11007
        	        	            goto ruleidentifierEx;
11008
        	        	        }
11009
11010
11011
41580
        	        	        FOLLOWPUSH(FOLLOW_nonemptyNumeralList_in_identifier4237);
11012
41580
        	        	        nonemptyNumeralList(ctx, numerals);
11013
11014
41580
        	        	        FOLLOWPOP();
11015
41580
        	        	        if  (HASEXCEPTION())
11016
        	        	        {
11017
        	        	            goto ruleidentifierEx;
11018
        	        	        }
11019
11020
11021
        	        	        {
11022
11023
83160
        	        	                    std::string opName = AntlrInput::tokenText(sym);
11024
41580
        	        	                    api::Kind k = PARSER_STATE->getIndexedOpKind(opName);
11025
41580
        	        	                    if (k == api::APPLY_UPDATER)
11026
        	        	                    {
11027
        	        	                      // we adopt a special syntax (_ tuple_update n) for tuple updaters
11028
6
        	        	                      if (numerals.size() != 1)
11029
        	        	                      {
11030
        	        	                        PARSER_STATE->parseError(
11031
        	        	                            "Unexpected syntax for tuple selector or updater.");
11032
        	        	                      }
11033
        	        	                      // The operator is dependent upon inferring the type of the arguments,
11034
        	        	                      // and hence the type is not available yet. Hence, we remember the
11035
        	        	                      // index as a numeral in the parse operator.
11036
6
        	        	                      p.d_kind = k;
11037
6
        	        	                      p.d_expr = SOLVER->mkInteger(numerals[0]);
11038
        	        	                    }
11039
41574
        	        	                    else if (numerals.size() == 1)
11040
        	        	                    {
11041
32959
        	        	                      p.d_op = SOLVER->mkOp(k, numerals[0]);
11042
        	        	                    }
11043
8615
        	        	                    else if (numerals.size() == 2)
11044
        	        	                    {
11045
8615
        	        	                      p.d_op = SOLVER->mkOp(k, numerals[0], numerals[1]);
11046
        	        	                    }
11047
        	        	                    else
11048
        	        	                    {
11049
        	        	                      PARSER_STATE->parseError(
11050
        	        	                          "Unexpected number of numerals for indexed symbol.");
11051
        	        	                    }
11052
11053
41580
        	        	        }
11054
11055
11056
        	        	    }
11057
41579
        	        	    break;
11058
11059
        	            }
11060
        	        }
11061
11062
42470
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_identifier4258);
11063
42470
        	        if  (HASEXCEPTION())
11064
        	        {
11065
        	            goto ruleidentifierEx;
11066
42470
        	        }
11067
11068
11069
        	    }
11070
42470
        	    break;
11071
11072
            }
11073
        }
11074
    }
11075
11076
    // This is where rules clean up and exit
11077
    //
11078
4777752
    goto ruleidentifierEx; /* Prevent compiler warnings */
11079
4777752
    ruleidentifierEx: ;
11080
11081
4777752
            if (HASEXCEPTION())
11082
            {
11083
                PREPORTERROR();
11084
                PRECOVER();
11085
            }
11086
9555504
    return ;
11087
}
11088
/* $ANTLR end identifier */
11089
11090
/**
11091
 * $ANTLR start termAtomic
11092
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1745:1: termAtomic[cvc5::api::Term& atomTerm] : ( INTEGER_LITERAL | DECIMAL_LITERAL | LPAREN_TOK INDEX_TOK ( EMP_TOK sortSymbol[type,CHECK_DECLARED] sortSymbol[type2,CHECK_DECLARED] | CHAR_TOK HEX_LITERAL |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] ) RPAREN_TOK | HEX_LITERAL | BINARY_LITERAL | str[s,false] | TUPLE_CONST_TOK );
11093
 */
11094
static void
11095
233934
termAtomic(pSmt2Parser ctx, cvc5::api::Term& atomTerm)
11096
{
11097
    pANTLR3_COMMON_TOKEN    sym;
11098
    pANTLR3_COMMON_TOKEN    INTEGER_LITERAL11;
11099
    pANTLR3_COMMON_TOKEN    DECIMAL_LITERAL12;
11100
    pANTLR3_COMMON_TOKEN    HEX_LITERAL13;
11101
    pANTLR3_COMMON_TOKEN    HEX_LITERAL14;
11102
    pANTLR3_COMMON_TOKEN    BINARY_LITERAL15;
11103
11104
    /* Initialize rule variables
11105
     */
11106
11107
11108
467868
      cvc5::api::Sort type;
11109
467868
      cvc5::api::Sort type2;
11110
467868
      std::string s;
11111
467868
      std::vector<uint64_t> numerals;
11112
11113
233934
    sym       = NULL;
11114
233934
    INTEGER_LITERAL11       = NULL;
11115
233934
    DECIMAL_LITERAL12       = NULL;
11116
233934
    HEX_LITERAL13       = NULL;
11117
233934
    HEX_LITERAL14       = NULL;
11118
233934
    BINARY_LITERAL15       = NULL;
11119
11120
    {
11121
        {
11122
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1753:3: ( INTEGER_LITERAL | DECIMAL_LITERAL | LPAREN_TOK INDEX_TOK ( EMP_TOK sortSymbol[type,CHECK_DECLARED] sortSymbol[type2,CHECK_DECLARED] | CHAR_TOK HEX_LITERAL |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] ) RPAREN_TOK | HEX_LITERAL | BINARY_LITERAL | str[s,false] | TUPLE_CONST_TOK )
11123
11124
            ANTLR3_UINT32 alt54;
11125
11126
233934
            alt54=7;
11127
11128
233934
            switch ( LA(1) )
11129
            {
11130
161028
            case INTEGER_LITERAL:
11131
            	{
11132
161028
            		alt54=1;
11133
            	}
11134
161028
                break;
11135
12562
            case DECIMAL_LITERAL:
11136
            	{
11137
12562
            		alt54=2;
11138
            	}
11139
12562
                break;
11140
47886
            case LPAREN_TOK:
11141
            	{
11142
47886
            		alt54=3;
11143
            	}
11144
47886
                break;
11145
3796
            case HEX_LITERAL:
11146
            	{
11147
3796
            		alt54=4;
11148
            	}
11149
3796
                break;
11150
943
            case BINARY_LITERAL:
11151
            	{
11152
943
            		alt54=5;
11153
            	}
11154
943
                break;
11155
7716
            case STRING_LITERAL:
11156
            	{
11157
7716
            		alt54=6;
11158
            	}
11159
7716
                break;
11160
3
            case TUPLE_CONST_TOK:
11161
            	{
11162
3
            		alt54=7;
11163
            	}
11164
3
                break;
11165
11166
            default:
11167
                CONSTRUCTEX();
11168
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
11169
                EXCEPTION->message      = (void *)"";
11170
                EXCEPTION->decisionNum  = 54;
11171
                EXCEPTION->state        = 0;
11172
11173
11174
                goto ruletermAtomicEx;
11175
11176
            }
11177
11178
233934
            switch (alt54)
11179
            {
11180
161028
        	case 1:
11181
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1753:5: INTEGER_LITERAL
11182
        	    {
11183
161028
        	        INTEGER_LITERAL11 = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_termAtomic4285);
11184
161028
        	        if  (HASEXCEPTION())
11185
        	        {
11186
        	            goto ruletermAtomicEx;
11187
        	        }
11188
11189
11190
        	        {
11191
11192
322056
        	                  std::string intStr = AntlrInput::tokenText(INTEGER_LITERAL11);
11193
161028
        	                  atomTerm = SOLVER->mkInteger(intStr);
11194
11195
161028
        	        }
11196
11197
11198
        	    }
11199
161028
        	    break;
11200
12562
        	case 2:
11201
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1758:5: DECIMAL_LITERAL
11202
        	    {
11203
12562
        	        DECIMAL_LITERAL12 = (pANTLR3_COMMON_TOKEN) MATCHT(DECIMAL_LITERAL, &FOLLOW_DECIMAL_LITERAL_in_termAtomic4297);
11204
12562
        	        if  (HASEXCEPTION())
11205
        	        {
11206
        	            goto ruletermAtomicEx;
11207
        	        }
11208
11209
11210
        	        {
11211
11212
25124
        	                  std::string realStr = AntlrInput::tokenText(DECIMAL_LITERAL12);
11213
25124
        	                  atomTerm = SOLVER->ensureTermSort(SOLVER->mkReal(realStr),
11214
25124
        	                                                    SOLVER->getRealSort());
11215
11216
12562
        	        }
11217
11218
11219
        	    }
11220
12562
        	    break;
11221
47886
        	case 3:
11222
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1767:5: LPAREN_TOK INDEX_TOK ( EMP_TOK sortSymbol[type,CHECK_DECLARED] sortSymbol[type2,CHECK_DECLARED] | CHAR_TOK HEX_LITERAL |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] ) RPAREN_TOK
11223
        	    {
11224
47886
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_termAtomic4316);
11225
47886
        	        if  (HASEXCEPTION())
11226
        	        {
11227
        	            goto ruletermAtomicEx;
11228
        	        }
11229
11230
11231
47886
        	         MATCHT(INDEX_TOK, &FOLLOW_INDEX_TOK_in_termAtomic4318);
11232
47886
        	        if  (HASEXCEPTION())
11233
        	        {
11234
        	            goto ruletermAtomicEx;
11235
        	        }
11236
11237
11238
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1768:5: ( EMP_TOK sortSymbol[type,CHECK_DECLARED] sortSymbol[type2,CHECK_DECLARED] | CHAR_TOK HEX_LITERAL |sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals] )
11239
        	        {
11240
47886
        	            int alt53=3;
11241
47886
        	            switch ( LA(1) )
11242
        	            {
11243
23
        	            case EMP_TOK:
11244
        	            	{
11245
23
        	            		alt53=1;
11246
        	            	}
11247
23
        	                break;
11248
8
        	            case CHAR_TOK:
11249
        	            	{
11250
8
        	            		alt53=2;
11251
        	            	}
11252
8
        	                break;
11253
47855
        	            case SIMPLE_SYMBOL:
11254
        	            	{
11255
47855
        	            		alt53=3;
11256
        	            	}
11257
47855
        	                break;
11258
11259
        	            default:
11260
        	                CONSTRUCTEX();
11261
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
11262
        	                EXCEPTION->message      = (void *)"";
11263
        	                EXCEPTION->decisionNum  = 53;
11264
        	                EXCEPTION->state        = 0;
11265
11266
11267
        	                goto ruletermAtomicEx;
11268
11269
        	            }
11270
11271
47886
        	            switch (alt53)
11272
        	            {
11273
23
        	        	case 1:
11274
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1768:7: EMP_TOK sortSymbol[type,CHECK_DECLARED] sortSymbol[type2,CHECK_DECLARED]
11275
        	        	    {
11276
23
        	        	         MATCHT(EMP_TOK, &FOLLOW_EMP_TOK_in_termAtomic4326);
11277
23
        	        	        if  (HASEXCEPTION())
11278
        	        	        {
11279
        	        	            goto ruletermAtomicEx;
11280
        	        	        }
11281
11282
11283
23
        	        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_termAtomic4334);
11284
23
        	        	        sortSymbol(ctx, type, CHECK_DECLARED);
11285
11286
23
        	        	        FOLLOWPOP();
11287
23
        	        	        if  (HASEXCEPTION())
11288
        	        	        {
11289
        	        	            goto ruletermAtomicEx;
11290
        	        	        }
11291
11292
11293
23
        	        	        FOLLOWPUSH(FOLLOW_sortSymbol_in_termAtomic4343);
11294
23
        	        	        sortSymbol(ctx, type2, CHECK_DECLARED);
11295
11296
23
        	        	        FOLLOWPOP();
11297
23
        	        	        if  (HASEXCEPTION())
11298
        	        	        {
11299
        	        	            goto ruletermAtomicEx;
11300
        	        	        }
11301
11302
11303
        	        	        {
11304
11305
        	        	                    // Empty heap constant in seperation logic
11306
46
        	        	                    api::Term v1 = SOLVER->mkConst(api::Sort(type), "_emp1");
11307
46
        	        	                    api::Term v2 = SOLVER->mkConst(api::Sort(type2), "_emp2");
11308
23
        	        	                    atomTerm = SOLVER->mkTerm(api::SEP_EMP, v1, v2);
11309
11310
23
        	        	        }
11311
11312
11313
        	        	    }
11314
23
        	        	    break;
11315
8
        	        	case 2:
11316
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1777:7: CHAR_TOK HEX_LITERAL
11317
        	        	    {
11318
8
        	        	         MATCHT(CHAR_TOK, &FOLLOW_CHAR_TOK_in_termAtomic4360);
11319
8
        	        	        if  (HASEXCEPTION())
11320
        	        	        {
11321
        	        	            goto ruletermAtomicEx;
11322
        	        	        }
11323
11324
11325
8
        	        	        HEX_LITERAL13 = (pANTLR3_COMMON_TOKEN) MATCHT(HEX_LITERAL, &FOLLOW_HEX_LITERAL_in_termAtomic4362);
11326
8
        	        	        if  (HASEXCEPTION())
11327
        	        	        {
11328
        	        	            goto ruletermAtomicEx;
11329
        	        	        }
11330
11331
11332
        	        	        {
11333
11334
16
        	        	                    std::string hexStr = AntlrInput::tokenTextSubstr(HEX_LITERAL13, 2);
11335
8
        	        	                    atomTerm = PARSER_STATE->mkCharConstant(hexStr);
11336
11337
8
        	        	        }
11338
11339
11340
        	        	    }
11341
8
        	        	    break;
11342
47855
        	        	case 3:
11343
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1782:7: sym= SIMPLE_SYMBOL nonemptyNumeralList[numerals]
11344
        	        	    {
11345
47855
        	        	        sym = (pANTLR3_COMMON_TOKEN) MATCHT(SIMPLE_SYMBOL, &FOLLOW_SIMPLE_SYMBOL_in_termAtomic4381);
11346
47855
        	        	        if  (HASEXCEPTION())
11347
        	        	        {
11348
        	        	            goto ruletermAtomicEx;
11349
        	        	        }
11350
11351
11352
47855
        	        	        FOLLOWPUSH(FOLLOW_nonemptyNumeralList_in_termAtomic4383);
11353
47855
        	        	        nonemptyNumeralList(ctx, numerals);
11354
11355
47855
        	        	        FOLLOWPOP();
11356
47855
        	        	        if  (HASEXCEPTION())
11357
        	        	        {
11358
        	        	            goto ruletermAtomicEx;
11359
        	        	        }
11360
11361
11362
        	        	        {
11363
11364
47855
        	        	                    atomTerm =
11365
95710
        	        	                      PARSER_STATE->mkIndexedConstant(AntlrInput::tokenText(sym),
11366
        	        	                                                      numerals);
11367
11368
        	        	        }
11369
11370
11371
        	        	    }
11372
47855
        	        	    break;
11373
11374
        	            }
11375
        	        }
11376
11377
47886
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_termAtomic4404);
11378
47886
        	        if  (HASEXCEPTION())
11379
        	        {
11380
        	            goto ruletermAtomicEx;
11381
47886
        	        }
11382
11383
11384
        	    }
11385
47886
        	    break;
11386
3796
        	case 4:
11387
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1792:5: HEX_LITERAL
11388
        	    {
11389
3796
        	        HEX_LITERAL14 = (pANTLR3_COMMON_TOKEN) MATCHT(HEX_LITERAL, &FOLLOW_HEX_LITERAL_in_termAtomic4414);
11390
3796
        	        if  (HASEXCEPTION())
11391
        	        {
11392
        	            goto ruletermAtomicEx;
11393
        	        }
11394
11395
11396
        	        {
11397
11398
3796
        	                  Assert(AntlrInput::tokenText(HEX_LITERAL14).find("#x") == 0);
11399
7592
        	                  std::string hexStr = AntlrInput::tokenTextSubstr(HEX_LITERAL14, 2);
11400
3796
        	                  atomTerm = SOLVER->mkBitVector(hexStr.size() * 4, hexStr, 16);
11401
11402
3796
        	        }
11403
11404
11405
        	    }
11406
3796
        	    break;
11407
943
        	case 5:
11408
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1798:5: BINARY_LITERAL
11409
        	    {
11410
943
        	        BINARY_LITERAL15 = (pANTLR3_COMMON_TOKEN) MATCHT(BINARY_LITERAL, &FOLLOW_BINARY_LITERAL_in_termAtomic4426);
11411
943
        	        if  (HASEXCEPTION())
11412
        	        {
11413
        	            goto ruletermAtomicEx;
11414
        	        }
11415
11416
11417
        	        {
11418
11419
943
        	                  Assert(AntlrInput::tokenText(BINARY_LITERAL15).find("#b") == 0);
11420
1886
        	                  std::string binStr = AntlrInput::tokenTextSubstr(BINARY_LITERAL15, 2);
11421
943
        	                  atomTerm = SOLVER->mkBitVector(binStr.size(), binStr, 2);
11422
11423
943
        	        }
11424
11425
11426
        	    }
11427
943
        	    break;
11428
7716
        	case 6:
11429
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1806:5: str[s,false]
11430
        	    {
11431
7716
        	        FOLLOWPUSH(FOLLOW_str_in_termAtomic4442);
11432
7716
        	        str(ctx, s, false);
11433
11434
7716
        	        FOLLOWPOP();
11435
7716
        	        if  (HASEXCEPTION())
11436
        	        {
11437
        	            goto ruletermAtomicEx;
11438
        	        }
11439
11440
11441
        	        {
11442
7716
        	             atomTerm = PARSER_STATE->mkStringConstant(s);
11443
        	        }
11444
11445
11446
        	    }
11447
7716
        	    break;
11448
3
        	case 7:
11449
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1811:5: TUPLE_CONST_TOK
11450
        	    {
11451
3
        	         MATCHT(TUPLE_CONST_TOK, &FOLLOW_TUPLE_CONST_TOK_in_termAtomic4459);
11452
3
        	        if  (HASEXCEPTION())
11453
        	        {
11454
        	            goto ruletermAtomicEx;
11455
        	        }
11456
11457
11458
        	        {
11459
11460
6
        	                  atomTerm = SOLVER->mkTuple(std::vector<api::Sort>(),
11461
6
        	                                             std::vector<api::Term>());
11462
11463
        	        }
11464
11465
11466
        	    }
11467
3
        	    break;
11468
11469
            }
11470
        }
11471
    }
11472
11473
    // This is where rules clean up and exit
11474
    //
11475
233934
    goto ruletermAtomicEx; /* Prevent compiler warnings */
11476
233934
    ruletermAtomicEx: ;
11477
11478
233934
            if (HASEXCEPTION())
11479
            {
11480
                PREPORTERROR();
11481
                PRECOVER();
11482
            }
11483
467868
    return ;
11484
}
11485
/* $ANTLR end termAtomic */
11486
11487
/**
11488
 * $ANTLR start attribute
11489
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1821:1: attribute[cvc5::api::Term& expr, cvc5::api::Term& retExpr] : ( KEYWORD ( simpleSymbolicExprNoKeyword[s] )? | ( ATTRIBUTE_PATTERN_TOK | ATTRIBUTE_POOL_TOK | ATTRIBUTE_INST_ADD_TO_POOL_TOK | ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK ) LPAREN_TOK ( term[patexpr, e2] )+ RPAREN_TOK | ATTRIBUTE_NO_PATTERN_TOK term[patexpr, e2] |tok= ( ATTRIBUTE_INST_LEVEL ) INTEGER_LITERAL |tok= ( ATTRIBUTE_QUANTIFIER_ID_TOK ) symbolicExpr[sexpr] | ATTRIBUTE_NAMED_TOK symbolicExpr[sexpr] );
11490
 */
11491
static void
11492
2933
attribute(pSmt2Parser ctx, cvc5::api::Term& expr, cvc5::api::Term& retExpr)
11493
{
11494
    pANTLR3_COMMON_TOKEN    tok;
11495
    pANTLR3_COMMON_TOKEN    KEYWORD16;
11496
    pANTLR3_COMMON_TOKEN    INTEGER_LITERAL17;
11497
11498
    /* Initialize rule variables
11499
     */
11500
11501
11502
5866
      api::Term sexpr;
11503
5866
      std::string s;
11504
5866
      cvc5::api::Term patexpr;
11505
5866
      std::vector<cvc5::api::Term> patexprs;
11506
5866
      cvc5::api::Term e2;
11507
2933
      bool hasValue = false;
11508
      api::Kind k;
11509
11510
2933
    tok       = NULL;
11511
2933
    KEYWORD16       = NULL;
11512
2933
    INTEGER_LITERAL17       = NULL;
11513
11514
    {
11515
        {
11516
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1831:3: ( KEYWORD ( simpleSymbolicExprNoKeyword[s] )? | ( ATTRIBUTE_PATTERN_TOK | ATTRIBUTE_POOL_TOK | ATTRIBUTE_INST_ADD_TO_POOL_TOK | ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK ) LPAREN_TOK ( term[patexpr, e2] )+ RPAREN_TOK | ATTRIBUTE_NO_PATTERN_TOK term[patexpr, e2] |tok= ( ATTRIBUTE_INST_LEVEL ) INTEGER_LITERAL |tok= ( ATTRIBUTE_QUANTIFIER_ID_TOK ) symbolicExpr[sexpr] | ATTRIBUTE_NAMED_TOK symbolicExpr[sexpr] )
11517
11518
            ANTLR3_UINT32 alt58;
11519
11520
2933
            alt58=6;
11521
11522
2933
            switch ( LA(1) )
11523
            {
11524
59
            case KEYWORD:
11525
            	{
11526
59
            		alt58=1;
11527
            	}
11528
59
                break;
11529
1189
            case ATTRIBUTE_INST_ADD_TO_POOL_TOK:
11530
            case ATTRIBUTE_PATTERN_TOK:
11531
            case ATTRIBUTE_POOL_TOK:
11532
            case ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK:
11533
            	{
11534
1189
            		alt58=2;
11535
            	}
11536
1189
                break;
11537
4
            case ATTRIBUTE_NO_PATTERN_TOK:
11538
            	{
11539
4
            		alt58=3;
11540
            	}
11541
4
                break;
11542
            case ATTRIBUTE_INST_LEVEL:
11543
            	{
11544
            		alt58=4;
11545
            	}
11546
                break;
11547
80
            case ATTRIBUTE_QUANTIFIER_ID_TOK:
11548
            	{
11549
80
            		alt58=5;
11550
            	}
11551
80
                break;
11552
1601
            case ATTRIBUTE_NAMED_TOK:
11553
            	{
11554
1601
            		alt58=6;
11555
            	}
11556
1601
                break;
11557
11558
            default:
11559
                CONSTRUCTEX();
11560
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
11561
                EXCEPTION->message      = (void *)"";
11562
                EXCEPTION->decisionNum  = 58;
11563
                EXCEPTION->state        = 0;
11564
11565
11566
                goto ruleattributeEx;
11567
11568
            }
11569
11570
2933
            switch (alt58)
11571
            {
11572
59
        	case 1:
11573
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1831:5: KEYWORD ( simpleSymbolicExprNoKeyword[s] )?
11574
        	    {
11575
59
        	        KEYWORD16 = (pANTLR3_COMMON_TOKEN) MATCHT(KEYWORD, &FOLLOW_KEYWORD_in_attribute4486);
11576
59
        	        if  (HASEXCEPTION())
11577
        	        {
11578
        	            goto ruleattributeEx;
11579
        	        }
11580
11581
11582
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1831:13: ( simpleSymbolicExprNoKeyword[s] )?
11583
        	        {
11584
59
        	            int alt55=2;
11585
59
        	            switch ( LA(1) )
11586
        	            {
11587
59
        	                case ASSERT_TOK:
11588
        	                case BINARY_LITERAL:
11589
        	                case CHECK_SAT_ASSUMING_TOK:
11590
        	                case CHECK_SAT_TOK:
11591
        	                case DECIMAL_LITERAL:
11592
        	                case DECLARE_DATATYPES_TOK:
11593
        	                case DECLARE_FUN_TOK:
11594
        	                case DECLARE_SORT_TOK:
11595
        	                case DEFINE_FUNS_REC_TOK:
11596
        	                case DEFINE_FUN_REC_TOK:
11597
        	                case DEFINE_FUN_TOK:
11598
        	                case DEFINE_SORT_TOK:
11599
        	                case ECHO_TOK:
11600
        	                case EXIT_TOK:
11601
        	                case GET_ASSERTIONS_TOK:
11602
        	                case GET_ASSIGNMENT_TOK:
11603
        	                case GET_DIFFICULTY_TOK:
11604
        	                case GET_INFO_TOK:
11605
        	                case GET_MODEL_TOK:
11606
        	                case GET_OPTION_TOK:
11607
        	                case GET_PROOF_TOK:
11608
        	                case GET_UNSAT_ASSUMPTIONS_TOK:
11609
        	                case GET_UNSAT_CORE_TOK:
11610
        	                case GET_VALUE_TOK:
11611
        	                case HEX_LITERAL:
11612
        	                case INTEGER_LITERAL:
11613
        	                case POP_TOK:
11614
        	                case PUSH_TOK:
11615
        	                case QUOTED_SYMBOL:
11616
        	                case RESET_ASSERTIONS_TOK:
11617
        	                case RESET_TOK:
11618
        	                case SET_INFO_TOK:
11619
        	                case SET_LOGIC_TOK:
11620
        	                case SET_OPTION_TOK:
11621
        	                case SIMPLE_SYMBOL:
11622
        	                case SIMPLIFY_TOK:
11623
        	                case STRING_LITERAL:
11624
        	                case UNTERMINATED_QUOTED_SYMBOL:
11625
        	                	{
11626
59
        	                		alt55=1;
11627
        	                	}
11628
59
        	                    break;
11629
        	            }
11630
11631
59
        	            switch (alt55)
11632
        	            {
11633
59
        	        	case 1:
11634
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1831:15: simpleSymbolicExprNoKeyword[s]
11635
        	        	    {
11636
59
        	        	        FOLLOWPUSH(FOLLOW_simpleSymbolicExprNoKeyword_in_attribute4490);
11637
59
        	        	        simpleSymbolicExprNoKeyword(ctx, s);
11638
11639
59
        	        	        FOLLOWPOP();
11640
59
        	        	        if  (HASEXCEPTION())
11641
        	        	        {
11642
        	        	            goto ruleattributeEx;
11643
        	        	        }
11644
11645
11646
        	        	        {
11647
59
        	        	             hasValue = true;
11648
        	        	        }
11649
11650
11651
        	        	    }
11652
59
        	        	    break;
11653
11654
        	            }
11655
        	        }
11656
11657
        	        {
11658
11659
59
        	                PARSER_STATE->attributeNotSupported(AntlrInput::tokenText(KEYWORD16));
11660
11661
        	        }
11662
11663
11664
        	    }
11665
59
        	    break;
11666
1189
        	case 2:
11667
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1835:5: ( ATTRIBUTE_PATTERN_TOK | ATTRIBUTE_POOL_TOK | ATTRIBUTE_INST_ADD_TO_POOL_TOK | ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK ) LPAREN_TOK ( term[patexpr, e2] )+ RPAREN_TOK
11668
        	    {
11669
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1835:5: ( ATTRIBUTE_PATTERN_TOK | ATTRIBUTE_POOL_TOK | ATTRIBUTE_INST_ADD_TO_POOL_TOK | ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK )
11670
        	        {
11671
1189
        	            int alt56=4;
11672
1189
        	            switch ( LA(1) )
11673
        	            {
11674
1185
        	            case ATTRIBUTE_PATTERN_TOK:
11675
        	            	{
11676
1185
        	            		alt56=1;
11677
        	            	}
11678
1185
        	                break;
11679
2
        	            case ATTRIBUTE_POOL_TOK:
11680
        	            	{
11681
2
        	            		alt56=2;
11682
        	            	}
11683
2
        	                break;
11684
        	            case ATTRIBUTE_INST_ADD_TO_POOL_TOK:
11685
        	            	{
11686
        	            		alt56=3;
11687
        	            	}
11688
        	                break;
11689
2
        	            case ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK:
11690
        	            	{
11691
2
        	            		alt56=4;
11692
        	            	}
11693
2
        	                break;
11694
11695
        	            default:
11696
        	                CONSTRUCTEX();
11697
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
11698
        	                EXCEPTION->message      = (void *)"";
11699
        	                EXCEPTION->decisionNum  = 56;
11700
        	                EXCEPTION->state        = 0;
11701
11702
11703
        	                goto ruleattributeEx;
11704
11705
        	            }
11706
11707
1189
        	            switch (alt56)
11708
        	            {
11709
1185
        	        	case 1:
11710
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1835:7: ATTRIBUTE_PATTERN_TOK
11711
        	        	    {
11712
1185
        	        	         MATCHT(ATTRIBUTE_PATTERN_TOK, &FOLLOW_ATTRIBUTE_PATTERN_TOK_in_attribute4508);
11713
1185
        	        	        if  (HASEXCEPTION())
11714
        	        	        {
11715
        	        	            goto ruleattributeEx;
11716
        	        	        }
11717
11718
11719
        	        	        {
11720
1185
        	        	             k = api::INST_PATTERN;
11721
        	        	        }
11722
11723
11724
        	        	    }
11725
1185
        	        	    break;
11726
2
        	        	case 2:
11727
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1836:7: ATTRIBUTE_POOL_TOK
11728
        	        	    {
11729
2
        	        	         MATCHT(ATTRIBUTE_POOL_TOK, &FOLLOW_ATTRIBUTE_POOL_TOK_in_attribute4520);
11730
2
        	        	        if  (HASEXCEPTION())
11731
        	        	        {
11732
        	        	            goto ruleattributeEx;
11733
        	        	        }
11734
11735
11736
        	        	        {
11737
2
        	        	             k = api::INST_POOL;
11738
        	        	        }
11739
11740
11741
        	        	    }
11742
2
        	        	    break;
11743
        	        	case 3:
11744
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1837:7: ATTRIBUTE_INST_ADD_TO_POOL_TOK
11745
        	        	    {
11746
        	        	         MATCHT(ATTRIBUTE_INST_ADD_TO_POOL_TOK, &FOLLOW_ATTRIBUTE_INST_ADD_TO_POOL_TOK_in_attribute4533);
11747
        	        	        if  (HASEXCEPTION())
11748
        	        	        {
11749
        	        	            goto ruleattributeEx;
11750
        	        	        }
11751
11752
11753
        	        	        {
11754
        	        	             k = api::INST_ADD_TO_POOL;
11755
        	        	        }
11756
11757
11758
        	        	    }
11759
        	        	    break;
11760
2
        	        	case 4:
11761
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1838:7: ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK
11762
        	        	    {
11763
2
        	        	         MATCHT(ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK, &FOLLOW_ATTRIBUTE_SKOLEM_ADD_TO_POOL_TOK_in_attribute4546);
11764
2
        	        	        if  (HASEXCEPTION())
11765
        	        	        {
11766
        	        	            goto ruleattributeEx;
11767
        	        	        }
11768
11769
11770
        	        	        {
11771
2
        	        	             k = api::SKOLEM_ADD_TO_POOL;
11772
        	        	        }
11773
11774
11775
        	        	    }
11776
2
        	        	    break;
11777
11778
        	            }
11779
        	        }
11780
11781
1189
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_attribute4560);
11782
1189
        	        if  (HASEXCEPTION())
11783
        	        {
11784
        	            goto ruleattributeEx;
11785
        	        }
11786
11787
11788
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1841:5: ( term[patexpr, e2] )+
11789
        	        {
11790
1189
        	            int cnt57=0;
11791
11792
        	            for (;;)
11793
        	            {
11794
2452
        	                int alt57=2;
11795
2452
        	        	switch ( LA(1) )
11796
        	        	{
11797
1263
        	        	case BINARY_LITERAL:
11798
        	        	case DECIMAL_LITERAL:
11799
        	        	case HEX_LITERAL:
11800
        	        	case INTEGER_LITERAL:
11801
        	        	case LPAREN_TOK:
11802
        	        	case QUOTED_SYMBOL:
11803
        	        	case SIMPLE_SYMBOL:
11804
        	        	case STRING_LITERAL:
11805
        	        	case TUPLE_CONST_TOK:
11806
        	        	case UNTERMINATED_QUOTED_SYMBOL:
11807
        	        		{
11808
1263
        	        			alt57=1;
11809
        	        		}
11810
1263
        	        	    break;
11811
11812
        	        	}
11813
11814
2452
        	        	switch (alt57)
11815
        	        	{
11816
1263
        	        	    case 1:
11817
        	        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1841:7: term[patexpr, e2]
11818
        	        	        {
11819
1263
        	        	            FOLLOWPUSH(FOLLOW_term_in_attribute4568);
11820
1263
        	        	            term(ctx, patexpr, e2);
11821
11822
1263
        	        	            FOLLOWPOP();
11823
1263
        	        	            if  (HASEXCEPTION())
11824
        	        	            {
11825
        	        	                goto ruleattributeEx;
11826
        	        	            }
11827
11828
11829
        	        	            {
11830
1263
        	        	                 patexprs.push_back( patexpr );
11831
        	        	            }
11832
11833
11834
        	        	        }
11835
1263
        	        	        break;
11836
11837
1189
        	        	    default:
11838
11839
1189
        	        		if ( cnt57 >= 1 )
11840
        	        		{
11841
1189
        	        		    goto loop57;
11842
        	        		}
11843
        	        		/* mismatchedSetEx()
11844
        	        		 */
11845
        	        		CONSTRUCTEX();
11846
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
11847
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
11848
11849
11850
        	        		goto ruleattributeEx;
11851
        	        	}
11852
1263
        	        	cnt57++;
11853
1263
        	            }
11854
1189
        	            loop57: ;	/* Jump to here if this rule does not match */
11855
        	        }
11856
11857
1189
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_attribute4586);
11858
1189
        	        if  (HASEXCEPTION())
11859
        	        {
11860
        	            goto ruleattributeEx;
11861
        	        }
11862
11863
11864
        	        {
11865
11866
1189
        	                  retExpr = MK_TERM(k, patexprs);
11867
11868
        	        }
11869
11870
11871
        	    }
11872
1189
        	    break;
11873
4
        	case 3:
11874
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1847:5: ATTRIBUTE_NO_PATTERN_TOK term[patexpr, e2]
11875
        	    {
11876
4
        	         MATCHT(ATTRIBUTE_NO_PATTERN_TOK, &FOLLOW_ATTRIBUTE_NO_PATTERN_TOK_in_attribute4598);
11877
4
        	        if  (HASEXCEPTION())
11878
        	        {
11879
        	            goto ruleattributeEx;
11880
        	        }
11881
11882
11883
4
        	        FOLLOWPUSH(FOLLOW_term_in_attribute4600);
11884
4
        	        term(ctx, patexpr, e2);
11885
11886
4
        	        FOLLOWPOP();
11887
4
        	        if  (HASEXCEPTION())
11888
        	        {
11889
        	            goto ruleattributeEx;
11890
        	        }
11891
11892
11893
        	        {
11894
11895
4
        	                  retExpr = MK_TERM(api::INST_NO_PATTERN, patexpr);
11896
11897
        	        }
11898
11899
11900
        	    }
11901
4
        	    break;
11902
        	case 4:
11903
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1851:5: tok= ( ATTRIBUTE_INST_LEVEL ) INTEGER_LITERAL
11904
        	    {
11905
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1851:9: ( ATTRIBUTE_INST_LEVEL )
11906
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1851:11: ATTRIBUTE_INST_LEVEL
11907
        	        {
11908
        	             MATCHT(ATTRIBUTE_INST_LEVEL, &FOLLOW_ATTRIBUTE_INST_LEVEL_in_attribute4617);
11909
        	            if  (HASEXCEPTION())
11910
        	            {
11911
        	                goto ruleattributeEx;
11912
        	            }
11913
11914
11915
        	        }
11916
11917
11918
        	        INTEGER_LITERAL17 = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_attribute4621);
11919
        	        if  (HASEXCEPTION())
11920
        	        {
11921
        	            goto ruleattributeEx;
11922
        	        }
11923
11924
11925
        	        {
11926
11927
        	                  std::stringstream sIntLit;
11928
        	                  sIntLit << INTEGER_LITERAL17;
11929
        	                  api::Term keyword = SOLVER->mkString("quant-inst-max-level");
11930
        	                  api::Term n = SOLVER->mkInteger(sIntLit.str());
11931
        	                  retExpr = MK_TERM(api::INST_ATTRIBUTE, keyword, n);
11932
11933
        	        }
11934
11935
11936
        	    }
11937
        	    break;
11938
80
        	case 5:
11939
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1859:5: tok= ( ATTRIBUTE_QUANTIFIER_ID_TOK ) symbolicExpr[sexpr]
11940
        	    {
11941
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1859:9: ( ATTRIBUTE_QUANTIFIER_ID_TOK )
11942
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1859:11: ATTRIBUTE_QUANTIFIER_ID_TOK
11943
        	        {
11944
80
        	             MATCHT(ATTRIBUTE_QUANTIFIER_ID_TOK, &FOLLOW_ATTRIBUTE_QUANTIFIER_ID_TOK_in_attribute4637);
11945
80
        	            if  (HASEXCEPTION())
11946
        	            {
11947
        	                goto ruleattributeEx;
11948
        	            }
11949
11950
11951
        	        }
11952
11953
11954
80
        	        FOLLOWPUSH(FOLLOW_symbolicExpr_in_attribute4641);
11955
80
        	        symbolicExpr(ctx, sexpr);
11956
11957
80
        	        FOLLOWPOP();
11958
80
        	        if  (HASEXCEPTION())
11959
        	        {
11960
        	            goto ruleattributeEx;
11961
        	        }
11962
11963
11964
        	        {
11965
11966
160
        	                  api::Term keyword = SOLVER->mkString("qid");
11967
160
        	                  api::Term name = SOLVER->mkString(sexprToString(sexpr));
11968
80
        	                  retExpr = MK_TERM(api::INST_ATTRIBUTE, keyword, name);
11969
11970
80
        	        }
11971
11972
11973
        	    }
11974
80
        	    break;
11975
1601
        	case 6:
11976
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1865:5: ATTRIBUTE_NAMED_TOK symbolicExpr[sexpr]
11977
        	    {
11978
1601
        	         MATCHT(ATTRIBUTE_NAMED_TOK, &FOLLOW_ATTRIBUTE_NAMED_TOK_in_attribute4654);
11979
1601
        	        if  (HASEXCEPTION())
11980
        	        {
11981
        	            goto ruleattributeEx;
11982
        	        }
11983
11984
11985
1601
        	        FOLLOWPUSH(FOLLOW_symbolicExpr_in_attribute4656);
11986
1601
        	        symbolicExpr(ctx, sexpr);
11987
11988
1601
        	        FOLLOWPOP();
11989
1601
        	        if  (HASEXCEPTION())
11990
        	        {
11991
        	            goto ruleattributeEx;
11992
        	        }
11993
11994
11995
        	        {
11996
11997
        	                  // notify that expression was given a name
11998
1602
        	                  PARSER_STATE->notifyNamedExpression(expr, sexprToString(sexpr));
11999
12000
        	        }
12001
12002
12003
        	    }
12004
1600
        	    break;
12005
12006
            }
12007
        }
12008
    }
12009
12010
    // This is where rules clean up and exit
12011
    //
12012
2932
    goto ruleattributeEx; /* Prevent compiler warnings */
12013
2932
    ruleattributeEx: ;
12014
12015
2932
            if (HASEXCEPTION())
12016
            {
12017
                PREPORTERROR();
12018
                PRECOVER();
12019
            }
12020
5864
    return ;
12021
}
12022
/* $ANTLR end attribute */
12023
12024
/**
12025
 * $ANTLR start termList
12026
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1880:1: termList[std::vector<cvc5::api::Term>& formulas, cvc5::api::Term& expr] : ( term[expr, expr2] )+ ;
12027
 */
12028
static void
12029
2172558
termList(pSmt2Parser ctx, std::vector<cvc5::api::Term>& formulas, cvc5::api::Term& expr)
12030
{
12031
12032
4345116
      cvc5::api::Term expr2;
12033
12034
    /* Initialize rule variables
12035
     */
12036
12037
    {
12038
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1884:3: ( ( term[expr, expr2] )+ )
12039
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1884:5: ( term[expr, expr2] )+
12040
        {
12041
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1884:5: ( term[expr, expr2] )+
12042
            {
12043
2172558
                int cnt59=0;
12044
12045
                for (;;)
12046
                {
12047
7078960
                    int alt59=2;
12048
7078960
            	switch ( LA(1) )
12049
            	{
12050
4906429
            	case BINARY_LITERAL:
12051
            	case DECIMAL_LITERAL:
12052
            	case HEX_LITERAL:
12053
            	case INTEGER_LITERAL:
12054
            	case LPAREN_TOK:
12055
            	case QUOTED_SYMBOL:
12056
            	case SIMPLE_SYMBOL:
12057
            	case STRING_LITERAL:
12058
            	case TUPLE_CONST_TOK:
12059
            	case UNTERMINATED_QUOTED_SYMBOL:
12060
            		{
12061
4906429
            			alt59=1;
12062
            		}
12063
4906429
            	    break;
12064
12065
            	}
12066
12067
7078958
            	switch (alt59)
12068
            	{
12069
4906429
            	    case 1:
12070
            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1884:7: term[expr, expr2]
12071
            	        {
12072
4906429
            	            FOLLOWPUSH(FOLLOW_term_in_termList4688);
12073
4906429
            	            term(ctx, expr, expr2);
12074
12075
4906402
            	            FOLLOWPOP();
12076
4906402
            	            if  (HASEXCEPTION())
12077
            	            {
12078
            	                goto ruletermListEx;
12079
            	            }
12080
12081
12082
            	            {
12083
4906402
            	                 formulas.push_back(expr);
12084
            	            }
12085
12086
12087
            	        }
12088
4906402
            	        break;
12089
12090
2172529
            	    default:
12091
12092
2172529
            		if ( cnt59 >= 1 )
12093
            		{
12094
2172527
            		    goto loop59;
12095
            		}
12096
            		/* mismatchedSetEx()
12097
            		 */
12098
2
            		CONSTRUCTEX();
12099
2
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
12100
2
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
12101
12102
12103
2
            		goto ruletermListEx;
12104
            	}
12105
4906402
            	cnt59++;
12106
4906402
                }
12107
2172527
                loop59: ;	/* Jump to here if this rule does not match */
12108
            }
12109
12110
        }
12111
12112
    }
12113
12114
    // This is where rules clean up and exit
12115
    //
12116
2172527
    goto ruletermListEx; /* Prevent compiler warnings */
12117
2172529
    ruletermListEx: ;
12118
12119
2172529
            if (HASEXCEPTION())
12120
            {
12121
2
                PREPORTERROR();
12122
                PRECOVER();
12123
            }
12124
4345054
    return ;
12125
}
12126
/* $ANTLR end termList */
12127
12128
/**
12129
 * $ANTLR start str
12130
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1890:1: str[std::string& s, bool fsmtlib] : STRING_LITERAL ;
12131
 */
12132
static void
12133
8234
str(pSmt2Parser ctx, std::string& s, bool fsmtlib)
12134
{
12135
    pANTLR3_COMMON_TOKEN    STRING_LITERAL18;
12136
12137
    /* Initialize rule variables
12138
     */
12139
12140
8234
    STRING_LITERAL18       = NULL;
12141
12142
    {
12143
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1891:3: ( STRING_LITERAL )
12144
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1891:5: STRING_LITERAL
12145
        {
12146
8234
            STRING_LITERAL18 = (pANTLR3_COMMON_TOKEN) MATCHT(STRING_LITERAL, &FOLLOW_STRING_LITERAL_in_str4710);
12147
8234
            if  (HASEXCEPTION())
12148
            {
12149
                goto rulestrEx;
12150
            }
12151
12152
12153
            {
12154
12155
8234
                      s = AntlrInput::tokenText(STRING_LITERAL18);
12156
                      /* strip off the quotes */
12157
8234
                      s = s.substr(1, s.size() - 2);
12158
40722
                      for (size_t i = 0; i < s.size(); i++)
12159
                      {
12160
32488
                        if ((unsigned)s[i] > 127 && !isprint(s[i]))
12161
                        {
12162
                          PARSER_STATE->parseError(
12163
                              "Extended/unprintable characters are not "
12164
                              "part of SMT-LIB, and they must be encoded "
12165
                              "as escape sequences");
12166
                        }
12167
                      }
12168
8234
                      if (fsmtlib || PARSER_STATE->escapeDupDblQuote())
12169
                      {
12170
8234
                        char* p_orig = strdup(s.c_str());
12171
8234
                        char *p = p_orig, *q = p_orig;
12172
73166
                        while (*q != '\0')
12173
                        {
12174
32466
                          if (PARSER_STATE->escapeDupDblQuote() && *q == '"')
12175
                          {
12176
                            // Handle SMT-LIB >=2.5 standard escape '""'.
12177
22
                            ++q;
12178
22
                            Assert(*q == '"');
12179
                          }
12180
32444
                          else if (!PARSER_STATE->escapeDupDblQuote() && *q == '\\')
12181
                          {
12182
                            ++q;
12183
                            // Handle SMT-LIB 2.0 standard escapes '\\' and '\"'.
12184
                            if (*q != '\\' && *q != '"')
12185
                            {
12186
                              Assert(*q != '\0');
12187
                              *p++ = '\\';
12188
                            }
12189
                          }
12190
32466
                          *p++ = *q++;
12191
                        }
12192
8234
                        *p = '\0';
12193
8234
                        s = p_orig;
12194
8234
                        free(p_orig);
12195
                      }
12196
12197
            }
12198
12199
12200
        }
12201
12202
    }
12203
12204
    // This is where rules clean up and exit
12205
    //
12206
8234
    goto rulestrEx; /* Prevent compiler warnings */
12207
8234
    rulestrEx: ;
12208
12209
8234
            if (HASEXCEPTION())
12210
            {
12211
                PREPORTERROR();
12212
                PRECOVER();
12213
            }
12214
8234
    return ;
12215
}
12216
/* $ANTLR end str */
12217
12218
/**
12219
 * $ANTLR start quantOp
12220
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1937:1: quantOp[cvc5::api::Kind& kind] : ( EXISTS_TOK | FORALL_TOK );
12221
 */
12222
static void
12223
10006
quantOp(pSmt2Parser ctx, cvc5::api::Kind& kind)
12224
{
12225
    /* Initialize rule variables
12226
     */
12227
12228
12229
10006
      Debug("parser") << "quant: " << AntlrInput::tokenText(LT(1)) << std::endl;
12230
12231
    {
12232
        {
12233
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1941:3: ( EXISTS_TOK | FORALL_TOK )
12234
12235
            ANTLR3_UINT32 alt60;
12236
12237
10006
            alt60=2;
12238
12239
10006
            switch ( LA(1) )
12240
            {
12241
791
            case EXISTS_TOK:
12242
            	{
12243
791
            		alt60=1;
12244
            	}
12245
791
                break;
12246
9215
            case FORALL_TOK:
12247
            	{
12248
9215
            		alt60=2;
12249
            	}
12250
9215
                break;
12251
12252
            default:
12253
                CONSTRUCTEX();
12254
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
12255
                EXCEPTION->message      = (void *)"";
12256
                EXCEPTION->decisionNum  = 60;
12257
                EXCEPTION->state        = 0;
12258
12259
12260
                goto rulequantOpEx;
12261
12262
            }
12263
12264
10006
            switch (alt60)
12265
            {
12266
791
        	case 1:
12267
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1941:5: EXISTS_TOK
12268
        	    {
12269
791
        	         MATCHT(EXISTS_TOK, &FOLLOW_EXISTS_TOK_in_quantOp4735);
12270
791
        	        if  (HASEXCEPTION())
12271
        	        {
12272
        	            goto rulequantOpEx;
12273
        	        }
12274
12275
12276
        	        {
12277
791
        	             kind= api::EXISTS;
12278
        	        }
12279
12280
12281
        	    }
12282
791
        	    break;
12283
9215
        	case 2:
12284
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1942:5: FORALL_TOK
12285
        	    {
12286
9215
        	         MATCHT(FORALL_TOK, &FOLLOW_FORALL_TOK_in_quantOp4746);
12287
9215
        	        if  (HASEXCEPTION())
12288
        	        {
12289
        	            goto rulequantOpEx;
12290
        	        }
12291
12292
12293
        	        {
12294
9215
        	             kind= api::FORALL;
12295
        	        }
12296
12297
12298
        	    }
12299
9215
        	    break;
12300
12301
            }
12302
        }
12303
    }
12304
12305
    // This is where rules clean up and exit
12306
    //
12307
10006
    goto rulequantOpEx; /* Prevent compiler warnings */
12308
10006
    rulequantOpEx: ;
12309
12310
10006
            if (HASEXCEPTION())
12311
            {
12312
                PREPORTERROR();
12313
                PRECOVER();
12314
            }
12315
10006
    return ;
12316
}
12317
/* $ANTLR end quantOp */
12318
12319
/**
12320
 * $ANTLR start functionName
12321
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1949:1: functionName[std::string& name, cvc5::parser::DeclarationCheck check] : symbol[name,check,SYM_VARIABLE] ;
12322
 */
12323
static void
12324
4735282
functionName(pSmt2Parser ctx, std::string& name, cvc5::parser::DeclarationCheck check)
12325
{
12326
    /* Initialize rule variables
12327
     */
12328
12329
    {
12330
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1950:3: ( symbol[name,check,SYM_VARIABLE] )
12331
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1950:5: symbol[name,check,SYM_VARIABLE]
12332
        {
12333
4735282
            FOLLOWPUSH(FOLLOW_symbol_in_functionName4767);
12334
4735282
            symbol(ctx, name, check, SYM_VARIABLE);
12335
12336
4735282
            FOLLOWPOP();
12337
4735282
            if  (HASEXCEPTION())
12338
            {
12339
                goto rulefunctionNameEx;
12340
            }
12341
12342
12343
        }
12344
12345
    }
12346
12347
    // This is where rules clean up and exit
12348
    //
12349
4735282
    goto rulefunctionNameEx; /* Prevent compiler warnings */
12350
4735282
    rulefunctionNameEx: ;
12351
12352
4735282
            if (HASEXCEPTION())
12353
            {
12354
                PREPORTERROR();
12355
                PRECOVER();
12356
            }
12357
4735282
    return ;
12358
}
12359
/* $ANTLR end functionName */
12360
12361
/**
12362
 * $ANTLR start sortList
12363
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1957:1: sortList[std::vector<cvc5::api::Sort>& sorts] : ( sortSymbol[t,CHECK_DECLARED] )* ;
12364
 */
12365
static void
12366
136742
sortList(pSmt2Parser ctx, std::vector<cvc5::api::Sort>& sorts)
12367
{
12368
12369
273484
      cvc5::api::Sort t;
12370
12371
    /* Initialize rule variables
12372
     */
12373
12374
    {
12375
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1961:3: ( ( sortSymbol[t,CHECK_DECLARED] )* )
12376
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1961:5: ( sortSymbol[t,CHECK_DECLARED] )*
12377
        {
12378
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1961:5: ( sortSymbol[t,CHECK_DECLARED] )*
12379
12380
            for (;;)
12381
            {
12382
184695
                int alt61=2;
12383
184695
                switch ( LA(1) )
12384
                {
12385
47954
                case LPAREN_TOK:
12386
                case QUOTED_SYMBOL:
12387
                case SIMPLE_SYMBOL:
12388
                case UNTERMINATED_QUOTED_SYMBOL:
12389
                	{
12390
47954
                		alt61=1;
12391
                	}
12392
47954
                    break;
12393
12394
                }
12395
12396
184695
                switch (alt61)
12397
                {
12398
47954
            	case 1:
12399
            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1961:7: sortSymbol[t,CHECK_DECLARED]
12400
            	    {
12401
47954
            	        FOLLOWPUSH(FOLLOW_sortSymbol_in_sortList4791);
12402
47954
            	        sortSymbol(ctx, t, CHECK_DECLARED);
12403
12404
47953
            	        FOLLOWPOP();
12405
47953
            	        if  (HASEXCEPTION())
12406
            	        {
12407
            	            goto rulesortListEx;
12408
            	        }
12409
12410
12411
            	        {
12412
47953
            	             sorts.push_back(t);
12413
            	        }
12414
12415
12416
            	    }
12417
47953
            	    break;
12418
12419
136741
            	default:
12420
136741
            	    goto loop61;	/* break out of the loop */
12421
            	    break;
12422
                }
12423
47953
            }
12424
136741
            loop61: ; /* Jump out to here if this rule does not match */
12425
12426
12427
        }
12428
12429
    }
12430
12431
    // This is where rules clean up and exit
12432
    //
12433
136741
    goto rulesortListEx; /* Prevent compiler warnings */
12434
136741
    rulesortListEx: ;
12435
12436
136741
            if (HASEXCEPTION())
12437
            {
12438
                PREPORTERROR();
12439
                PRECOVER();
12440
            }
12441
273482
    return ;
12442
}
12443
/* $ANTLR end sortList */
12444
12445
/**
12446
 * $ANTLR start nonemptySortList
12447
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1964:1: nonemptySortList[std::vector<cvc5::api::Sort>& sorts] : ( sortSymbol[t,CHECK_DECLARED] )+ ;
12448
 */
12449
static void
12450
4
nonemptySortList(pSmt2Parser ctx, std::vector<cvc5::api::Sort>& sorts)
12451
{
12452
12453
8
      cvc5::api::Sort t;
12454
12455
    /* Initialize rule variables
12456
     */
12457
12458
    {
12459
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1968:3: ( ( sortSymbol[t,CHECK_DECLARED] )+ )
12460
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1968:5: ( sortSymbol[t,CHECK_DECLARED] )+
12461
        {
12462
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1968:5: ( sortSymbol[t,CHECK_DECLARED] )+
12463
            {
12464
4
                int cnt62=0;
12465
12466
                for (;;)
12467
                {
12468
8
                    int alt62=2;
12469
8
            	switch ( LA(1) )
12470
            	{
12471
4
            	case LPAREN_TOK:
12472
            	case QUOTED_SYMBOL:
12473
            	case SIMPLE_SYMBOL:
12474
            	case UNTERMINATED_QUOTED_SYMBOL:
12475
            		{
12476
4
            			alt62=1;
12477
            		}
12478
4
            	    break;
12479
12480
            	}
12481
12482
8
            	switch (alt62)
12483
            	{
12484
4
            	    case 1:
12485
            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1968:7: sortSymbol[t,CHECK_DECLARED]
12486
            	        {
12487
4
            	            FOLLOWPUSH(FOLLOW_sortSymbol_in_nonemptySortList4818);
12488
4
            	            sortSymbol(ctx, t, CHECK_DECLARED);
12489
12490
4
            	            FOLLOWPOP();
12491
4
            	            if  (HASEXCEPTION())
12492
            	            {
12493
            	                goto rulenonemptySortListEx;
12494
            	            }
12495
12496
12497
            	            {
12498
4
            	                 sorts.push_back(t);
12499
            	            }
12500
12501
12502
            	        }
12503
4
            	        break;
12504
12505
4
            	    default:
12506
12507
4
            		if ( cnt62 >= 1 )
12508
            		{
12509
4
            		    goto loop62;
12510
            		}
12511
            		/* mismatchedSetEx()
12512
            		 */
12513
            		CONSTRUCTEX();
12514
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
12515
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
12516
12517
12518
            		goto rulenonemptySortListEx;
12519
            	}
12520
4
            	cnt62++;
12521
4
                }
12522
4
                loop62: ;	/* Jump to here if this rule does not match */
12523
            }
12524
12525
        }
12526
12527
    }
12528
12529
    // This is where rules clean up and exit
12530
    //
12531
4
    goto rulenonemptySortListEx; /* Prevent compiler warnings */
12532
4
    rulenonemptySortListEx: ;
12533
12534
4
            if (HASEXCEPTION())
12535
            {
12536
                PREPORTERROR();
12537
                PRECOVER();
12538
            }
12539
8
    return ;
12540
}
12541
/* $ANTLR end nonemptySortList */
12542
12543
/**
12544
 * $ANTLR start sortedVarList
12545
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1975:1: sortedVarList[std::vector<std::pair<std::string, cvc5::api::Sort> >& sortedVars] : ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )* ;
12546
 */
12547
static void
12548
11879
sortedVarList(pSmt2Parser ctx, std::vector<std::pair<std::string, cvc5::api::Sort> >& sortedVars)
12549
{
12550
12551
23758
      std::string name;
12552
23758
      cvc5::api::Sort t;
12553
12554
    /* Initialize rule variables
12555
     */
12556
12557
    {
12558
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1980:3: ( ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )* )
12559
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1980:5: ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )*
12560
        {
12561
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1980:5: ( LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] RPAREN_TOK )*
12562
12563
            for (;;)
12564
            {
12565
33271
                int alt63=2;
12566
33271
                switch ( LA(1) )
12567
                {
12568
21393
                case LPAREN_TOK:
12569
                	{
12570
21393
                		alt63=1;
12571
                	}
12572
21393
                    break;
12573
12574
                }
12575
12576
33271
                switch (alt63)
12577
                {
12578
21393
            	case 1:
12579
            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1980:7: LPAREN_TOK symbol[name,CHECK_NONE,SYM_VARIABLE] sortSymbol[t,CHECK_DECLARED] RPAREN_TOK
12580
            	    {
12581
21393
            	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sortedVarList4847);
12582
21393
            	        if  (HASEXCEPTION())
12583
            	        {
12584
            	            goto rulesortedVarListEx;
12585
            	        }
12586
12587
12588
21393
            	        FOLLOWPUSH(FOLLOW_symbol_in_sortedVarList4849);
12589
21393
            	        symbol(ctx, name, CHECK_NONE, SYM_VARIABLE);
12590
12591
21393
            	        FOLLOWPOP();
12592
21393
            	        if  (HASEXCEPTION())
12593
            	        {
12594
            	            goto rulesortedVarListEx;
12595
            	        }
12596
12597
12598
21393
            	        FOLLOWPUSH(FOLLOW_sortSymbol_in_sortedVarList4858);
12599
21393
            	        sortSymbol(ctx, t, CHECK_DECLARED);
12600
12601
21392
            	        FOLLOWPOP();
12602
21392
            	        if  (HASEXCEPTION())
12603
            	        {
12604
            	            goto rulesortedVarListEx;
12605
            	        }
12606
12607
12608
21392
            	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sortedVarList4861);
12609
21392
            	        if  (HASEXCEPTION())
12610
            	        {
12611
            	            goto rulesortedVarListEx;
12612
            	        }
12613
12614
12615
            	        {
12616
21392
            	             sortedVars.push_back(make_pair(name, t));
12617
            	        }
12618
12619
12620
            	    }
12621
21392
            	    break;
12622
12623
11878
            	default:
12624
11878
            	    goto loop63;	/* break out of the loop */
12625
            	    break;
12626
                }
12627
21392
            }
12628
11878
            loop63: ; /* Jump out to here if this rule does not match */
12629
12630
12631
        }
12632
12633
    }
12634
12635
    // This is where rules clean up and exit
12636
    //
12637
11878
    goto rulesortedVarListEx; /* Prevent compiler warnings */
12638
11878
    rulesortedVarListEx: ;
12639
12640
11878
            if (HASEXCEPTION())
12641
            {
12642
                PREPORTERROR();
12643
                PRECOVER();
12644
            }
12645
23756
    return ;
12646
}
12647
/* $ANTLR end sortedVarList */
12648
12649
/**
12650
 * $ANTLR start boundVarList
12651
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1990:1: boundVarList[cvc5::api::Term& expr] : LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK ;
12652
 */
12653
static void
12654
10039
boundVarList(pSmt2Parser ctx, cvc5::api::Term& expr)
12655
{
12656
12657
20078
      std::vector<std::pair<std::string, cvc5::api::Sort>> sortedVarNames;
12658
12659
    /* Initialize rule variables
12660
     */
12661
12662
    {
12663
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1994:2: ( LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK )
12664
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:1994:4: LPAREN_TOK sortedVarList[sortedVarNames] RPAREN_TOK
12665
        {
12666
10039
             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_boundVarList4896);
12667
10039
            if  (HASEXCEPTION())
12668
            {
12669
                goto ruleboundVarListEx;
12670
            }
12671
12672
12673
10039
            FOLLOWPUSH(FOLLOW_sortedVarList_in_boundVarList4898);
12674
10039
            sortedVarList(ctx, sortedVarNames);
12675
12676
10038
            FOLLOWPOP();
12677
10038
            if  (HASEXCEPTION())
12678
            {
12679
                goto ruleboundVarListEx;
12680
            }
12681
12682
12683
10038
             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_boundVarList4901);
12684
10038
            if  (HASEXCEPTION())
12685
            {
12686
                goto ruleboundVarListEx;
12687
            }
12688
12689
12690
            {
12691
12692
                     std::vector<cvc5::api::Term> args =
12693
20076
                         PARSER_STATE->bindBoundVars(sortedVarNames);
12694
10038
                     expr = MK_TERM(api::BOUND_VAR_LIST, args);
12695
12696
            }
12697
12698
12699
        }
12700
12701
    }
12702
12703
    // This is where rules clean up and exit
12704
    //
12705
10038
    goto ruleboundVarListEx; /* Prevent compiler warnings */
12706
10038
    ruleboundVarListEx: ;
12707
12708
10038
            if (HASEXCEPTION())
12709
            {
12710
                PREPORTERROR();
12711
                PRECOVER();
12712
            }
12713
20076
    return ;
12714
}
12715
/* $ANTLR end boundVarList */
12716
12717
/**
12718
 * $ANTLR start sortName
12719
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2006:1: sortName[std::string& name, cvc5::parser::DeclarationCheck check] : symbol[name,check,SYM_SORT] ;
12720
 */
12721
static void
12722
190640
sortName(pSmt2Parser ctx, std::string& name, cvc5::parser::DeclarationCheck check)
12723
{
12724
    /* Initialize rule variables
12725
     */
12726
12727
    {
12728
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2007:3: ( symbol[name,check,SYM_SORT] )
12729
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2007:5: symbol[name,check,SYM_SORT]
12730
        {
12731
190640
            FOLLOWPUSH(FOLLOW_symbol_in_sortName4921);
12732
190640
            symbol(ctx, name, check, SYM_SORT);
12733
12734
190640
            FOLLOWPOP();
12735
190640
            if  (HASEXCEPTION())
12736
            {
12737
                goto rulesortNameEx;
12738
            }
12739
12740
12741
        }
12742
12743
    }
12744
12745
    // This is where rules clean up and exit
12746
    //
12747
190640
    goto rulesortNameEx; /* Prevent compiler warnings */
12748
190640
    rulesortNameEx: ;
12749
12750
190640
            if (HASEXCEPTION())
12751
            {
12752
                PREPORTERROR();
12753
                PRECOVER();
12754
            }
12755
190640
    return ;
12756
}
12757
/* $ANTLR end sortName */
12758
12759
/**
12760
 * $ANTLR start sortSymbol
12761
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2010:1: sortSymbol[cvc5::api::Sort& t, cvc5::parser::DeclarationCheck check] : ( sortName[name,CHECK_NONE] | LPAREN_TOK ( INDEX_TOK |) symbol[name,CHECK_NONE,SYM_SORT] ( nonemptyNumeralList[numerals] | sortList[args] ) RPAREN_TOK | LPAREN_TOK HO_ARROW_TOK sortList[args] RPAREN_TOK );
12762
 */
12763
static void
12764
208200
sortSymbol(pSmt2Parser ctx, cvc5::api::Sort& t, cvc5::parser::DeclarationCheck check)
12765
{
12766
12767
416400
      std::string name;
12768
416400
      std::vector<cvc5::api::Sort> args;
12769
416400
      std::vector<uint64_t> numerals;
12770
208200
      bool indexed = false;
12771
12772
    /* Initialize rule variables
12773
     */
12774
12775
    {
12776
        {
12777
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2017:3: ( sortName[name,CHECK_NONE] | LPAREN_TOK ( INDEX_TOK |) symbol[name,CHECK_NONE,SYM_SORT] ( nonemptyNumeralList[numerals] | sortList[args] ) RPAREN_TOK | LPAREN_TOK HO_ARROW_TOK sortList[args] RPAREN_TOK )
12778
12779
            ANTLR3_UINT32 alt66;
12780
12781
208200
            alt66=3;
12782
12783
208200
            switch ( LA(1) )
12784
            {
12785
190640
            case QUOTED_SYMBOL:
12786
            case SIMPLE_SYMBOL:
12787
            case UNTERMINATED_QUOTED_SYMBOL:
12788
            	{
12789
190640
            		alt66=1;
12790
            	}
12791
190640
                break;
12792
17560
            case LPAREN_TOK:
12793
            	{
12794
17560
            		switch ( LA(2) )
12795
            		{
12796
373
            		case HO_ARROW_TOK:
12797
            			{
12798
373
            				alt66=3;
12799
            			}
12800
373
            		    break;
12801
17187
            		case INDEX_TOK:
12802
            		case QUOTED_SYMBOL:
12803
            		case SIMPLE_SYMBOL:
12804
            		case UNTERMINATED_QUOTED_SYMBOL:
12805
            			{
12806
17187
            				alt66=2;
12807
            			}
12808
17187
            		    break;
12809
12810
            		default:
12811
            		    CONSTRUCTEX();
12812
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
12813
            		    EXCEPTION->message      = (void *)"";
12814
            		    EXCEPTION->decisionNum  = 66;
12815
            		    EXCEPTION->state        = 4;
12816
12817
12818
            		    goto rulesortSymbolEx;
12819
12820
            		}
12821
12822
            	}
12823
17560
                break;
12824
12825
            default:
12826
                CONSTRUCTEX();
12827
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
12828
                EXCEPTION->message      = (void *)"";
12829
                EXCEPTION->decisionNum  = 66;
12830
                EXCEPTION->state        = 0;
12831
12832
12833
                goto rulesortSymbolEx;
12834
12835
            }
12836
12837
208200
            switch (alt66)
12838
            {
12839
190640
        	case 1:
12840
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2017:5: sortName[name,CHECK_NONE]
12841
        	    {
12842
190640
        	        FOLLOWPUSH(FOLLOW_sortName_in_sortSymbol4941);
12843
190640
        	        sortName(ctx, name, CHECK_NONE);
12844
12845
190640
        	        FOLLOWPOP();
12846
190640
        	        if  (HASEXCEPTION())
12847
        	        {
12848
        	            goto rulesortSymbolEx;
12849
        	        }
12850
12851
12852
        	        {
12853
12854
190640
        	                  if(check == CHECK_DECLARED || PARSER_STATE->isDeclared(name, SYM_SORT)) {
12855
190640
        	                    t = PARSER_STATE->getSort(name);
12856
        	                  } else {
12857
        	                    t = PARSER_STATE->mkUnresolvedType(name);
12858
        	                  }
12859
12860
        	        }
12861
12862
12863
        	    }
12864
190639
        	    break;
12865
17187
        	case 2:
12866
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2025:5: LPAREN_TOK ( INDEX_TOK |) symbol[name,CHECK_NONE,SYM_SORT] ( nonemptyNumeralList[numerals] | sortList[args] ) RPAREN_TOK
12867
        	    {
12868
17187
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sortSymbol4954);
12869
17187
        	        if  (HASEXCEPTION())
12870
        	        {
12871
        	            goto rulesortSymbolEx;
12872
        	        }
12873
12874
12875
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2025:16: ( INDEX_TOK |)
12876
        	        {
12877
17187
        	            int alt64=2;
12878
17187
        	            switch ( LA(1) )
12879
        	            {
12880
13202
        	            case INDEX_TOK:
12881
        	            	{
12882
13202
        	            		alt64=1;
12883
        	            	}
12884
13202
        	                break;
12885
3985
        	            case QUOTED_SYMBOL:
12886
        	            case SIMPLE_SYMBOL:
12887
        	            case UNTERMINATED_QUOTED_SYMBOL:
12888
        	            	{
12889
3985
        	            		alt64=2;
12890
        	            	}
12891
3985
        	                break;
12892
12893
        	            default:
12894
        	                CONSTRUCTEX();
12895
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
12896
        	                EXCEPTION->message      = (void *)"";
12897
        	                EXCEPTION->decisionNum  = 64;
12898
        	                EXCEPTION->state        = 0;
12899
12900
12901
        	                goto rulesortSymbolEx;
12902
12903
        	            }
12904
12905
17187
        	            switch (alt64)
12906
        	            {
12907
13202
        	        	case 1:
12908
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2025:17: INDEX_TOK
12909
        	        	    {
12910
13202
        	        	         MATCHT(INDEX_TOK, &FOLLOW_INDEX_TOK_in_sortSymbol4957);
12911
13202
        	        	        if  (HASEXCEPTION())
12912
        	        	        {
12913
        	        	            goto rulesortSymbolEx;
12914
        	        	        }
12915
12916
12917
        	        	        {
12918
13202
        	        	            indexed = true;
12919
        	        	        }
12920
12921
12922
        	        	    }
12923
13202
        	        	    break;
12924
3985
        	        	case 2:
12925
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2025:47:
12926
        	        	    {
12927
        	        	        {
12928
3985
        	        	            indexed = false;
12929
        	        	        }
12930
12931
12932
        	        	    }
12933
3985
        	        	    break;
12934
12935
        	            }
12936
        	        }
12937
12938
17187
        	        FOLLOWPUSH(FOLLOW_symbol_in_sortSymbol4970);
12939
17187
        	        symbol(ctx, name, CHECK_NONE, SYM_SORT);
12940
12941
17187
        	        FOLLOWPOP();
12942
17187
        	        if  (HASEXCEPTION())
12943
        	        {
12944
        	            goto rulesortSymbolEx;
12945
        	        }
12946
12947
12948
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2027:5: ( nonemptyNumeralList[numerals] | sortList[args] )
12949
        	        {
12950
17187
        	            int alt65=2;
12951
17187
        	            switch ( LA(1) )
12952
        	            {
12953
13202
        	            case INTEGER_LITERAL:
12954
        	            	{
12955
13202
        	            		alt65=1;
12956
        	            	}
12957
13202
        	                break;
12958
3985
        	            case LPAREN_TOK:
12959
        	            case QUOTED_SYMBOL:
12960
        	            case RPAREN_TOK:
12961
        	            case SIMPLE_SYMBOL:
12962
        	            case UNTERMINATED_QUOTED_SYMBOL:
12963
        	            	{
12964
3985
        	            		alt65=2;
12965
        	            	}
12966
3985
        	                break;
12967
12968
        	            default:
12969
        	                CONSTRUCTEX();
12970
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
12971
        	                EXCEPTION->message      = (void *)"";
12972
        	                EXCEPTION->decisionNum  = 65;
12973
        	                EXCEPTION->state        = 0;
12974
12975
12976
        	                goto rulesortSymbolEx;
12977
12978
        	            }
12979
12980
17187
        	            switch (alt65)
12981
        	            {
12982
13202
        	        	case 1:
12983
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2027:7: nonemptyNumeralList[numerals]
12984
        	        	    {
12985
13202
        	        	        FOLLOWPUSH(FOLLOW_nonemptyNumeralList_in_sortSymbol4979);
12986
13202
        	        	        nonemptyNumeralList(ctx, numerals);
12987
12988
13202
        	        	        FOLLOWPOP();
12989
13202
        	        	        if  (HASEXCEPTION())
12990
        	        	        {
12991
        	        	            goto rulesortSymbolEx;
12992
        	        	        }
12993
12994
12995
        	        	        {
12996
12997
13202
        	        	                    if (!indexed)
12998
        	        	                    {
12999
        	        	                      std::stringstream ss;
13000
        	        	                      ss << "SMT-LIB requires use of an indexed sort here, e.g. (_ " << name
13001
        	        	                         << " ...)";
13002
        	        	                      PARSER_STATE->parseError(ss.str());
13003
        	        	                    }
13004
13202
        	        	                    if( name == "BitVec" ) {
13005
13141
        	        	                      if( numerals.size() != 1 ) {
13006
        	        	                        PARSER_STATE->parseError("Illegal bitvector type.");
13007
        	        	                      }
13008
13141
        	        	                      if(numerals.front() == 0) {
13009
        	        	                        PARSER_STATE->parseError("Illegal bitvector size: 0");
13010
        	        	                      }
13011
13141
        	        	                      t = SOLVER->mkBitVectorSort(numerals.front());
13012
61
        	        	                    } else if ( name == "FloatingPoint" ) {
13013
61
        	        	                      if( numerals.size() != 2 ) {
13014
        	        	                        PARSER_STATE->parseError("Illegal floating-point type.");
13015
        	        	                      }
13016
61
        	        	                      if(!validExponentSize(numerals[0])) {
13017
        	        	                        PARSER_STATE->parseError("Illegal floating-point exponent size");
13018
        	        	                      }
13019
61
        	        	                      if(!validSignificandSize(numerals[1])) {
13020
        	        	                        PARSER_STATE->parseError("Illegal floating-point significand size");
13021
        	        	                      }
13022
61
        	        	                      t = SOLVER->mkFloatingPointSort(numerals[0],numerals[1]);
13023
        	        	                    } else {
13024
        	        	                      std::stringstream ss;
13025
        	        	                      ss << "unknown indexed sort symbol `" << name << "'";
13026
        	        	                      PARSER_STATE->parseError(ss.str());
13027
        	        	                    }
13028
13029
        	        	        }
13030
13031
13032
        	        	    }
13033
13202
        	        	    break;
13034
3985
        	        	case 2:
13035
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2061:7: sortList[args]
13036
        	        	    {
13037
3985
        	        	        FOLLOWPUSH(FOLLOW_sortList_in_sortSymbol4996);
13038
3985
        	        	        sortList(ctx, args);
13039
13040
3985
        	        	        FOLLOWPOP();
13041
3985
        	        	        if  (HASEXCEPTION())
13042
        	        	        {
13043
        	        	            goto rulesortSymbolEx;
13044
        	        	        }
13045
13046
13047
        	        	        {
13048
3985
        	        	             if( indexed ) {
13049
        	        	                      std::stringstream ss;
13050
        	        	                      ss << "Unexpected use of indexing operator `_' before `" << name
13051
        	        	                         << "', try leaving it out";
13052
        	        	                      PARSER_STATE->parseError(ss.str());
13053
        	        	                    }
13054
3985
        	        	                    if(args.empty()) {
13055
        	        	                      PARSER_STATE->parseError("Extra parentheses around sort name not "
13056
        	        	                                               "permitted in SMT-LIB");
13057
5261
        	        	                    } else if(name == "Array" &&
13058
1276
        	        	                       PARSER_STATE->isTheoryEnabled(theory::THEORY_ARRAYS) ) {
13059
1274
        	        	                      if(args.size() != 2) {
13060
        	        	                        PARSER_STATE->parseError("Illegal array type.");
13061
        	        	                      }
13062
1274
        	        	                      t = SOLVER->mkArraySort( args[0], args[1] );
13063
3962
        	        	                    } else if(name == "Set" &&
13064
1251
        	        	                              PARSER_STATE->isTheoryEnabled(theory::THEORY_SETS) ) {
13065
1227
        	        	                      if(args.size() != 1) {
13066
        	        	                        PARSER_STATE->parseError("Illegal set type.");
13067
        	        	                      }
13068
1227
        	        	                      t = SOLVER->mkSetSort( args[0] );
13069
        	        	                    }
13070
1538
        	        	                    else if(name == "Bag" &&
13071
54
        	        	                              PARSER_STATE->isTheoryEnabled(theory::THEORY_BAGS) ) {
13072
54
        	        	                      if(args.size() != 1) {
13073
        	        	                        PARSER_STATE->parseError("Illegal bag type.");
13074
        	        	                      }
13075
54
        	        	                      t = SOLVER->mkBagSort( args[0] );
13076
        	        	                    }
13077
1576
        	        	                    else if(name == "Seq" && !PARSER_STATE->strictModeEnabled() &&
13078
146
        	        	                              PARSER_STATE->isTheoryEnabled(theory::THEORY_STRINGS) ) {
13079
146
        	        	                      if(args.size() != 1) {
13080
        	        	                        PARSER_STATE->parseError("Illegal sequence type.");
13081
        	        	                      }
13082
146
        	        	                      t = SOLVER->mkSequenceSort( args[0] );
13083
1284
        	        	                    } else if (name == "Tuple" && !PARSER_STATE->strictModeEnabled()) {
13084
995
        	        	                      t = SOLVER->mkTupleSort(args);
13085
317
        	        	                    } else if(check == CHECK_DECLARED ||
13086
28
        	        	                              PARSER_STATE->isDeclared(name, SYM_SORT)) {
13087
289
        	        	                      t = PARSER_STATE->getSort(name, args);
13088
        	        	                    } else {
13089
        	        	                      // make unresolved type
13090
        	        	                      if(args.empty()) {
13091
        	        	                        t = PARSER_STATE->mkUnresolvedType(name);
13092
        	        	                        Debug("parser-param") << "param: make unres type " << name
13093
        	        	                                              << std::endl;
13094
        	        	                      } else {
13095
        	        	                        t = PARSER_STATE->mkUnresolvedTypeConstructor(name,args);
13096
        	        	                        t = t.instantiate( args );
13097
        	        	                        Debug("parser-param")
13098
        	        	                            << "param: make unres param type " << name << " " << args.size()
13099
        	        	                            << " " << PARSER_STATE->getArity( name ) << std::endl;
13100
        	        	                      }
13101
        	        	                    }
13102
13103
        	        	        }
13104
13105
13106
        	        	    }
13107
3983
        	        	    break;
13108
13109
        	            }
13110
        	        }
13111
13112
17185
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sortSymbol5013);
13113
17185
        	        if  (HASEXCEPTION())
13114
        	        {
13115
        	            goto rulesortSymbolEx;
13116
17185
        	        }
13117
13118
13119
        	    }
13120
17185
        	    break;
13121
373
        	case 3:
13122
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2118:5: LPAREN_TOK HO_ARROW_TOK sortList[args] RPAREN_TOK
13123
        	    {
13124
373
        	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_sortSymbol5019);
13125
373
        	        if  (HASEXCEPTION())
13126
        	        {
13127
        	            goto rulesortSymbolEx;
13128
        	        }
13129
13130
13131
373
        	         MATCHT(HO_ARROW_TOK, &FOLLOW_HO_ARROW_TOK_in_sortSymbol5021);
13132
373
        	        if  (HASEXCEPTION())
13133
        	        {
13134
        	            goto rulesortSymbolEx;
13135
        	        }
13136
13137
13138
373
        	        FOLLOWPUSH(FOLLOW_sortList_in_sortSymbol5023);
13139
373
        	        sortList(ctx, args);
13140
13141
373
        	        FOLLOWPOP();
13142
373
        	        if  (HASEXCEPTION())
13143
        	        {
13144
        	            goto rulesortSymbolEx;
13145
        	        }
13146
13147
13148
373
        	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_sortSymbol5026);
13149
373
        	        if  (HASEXCEPTION())
13150
        	        {
13151
        	            goto rulesortSymbolEx;
13152
        	        }
13153
13154
13155
        	        {
13156
13157
373
        	                  if(args.size()<2) {
13158
        	                    PARSER_STATE->parseError("Arrow types must have at least 2 arguments");
13159
        	                  }
13160
        	                  //flatten the type
13161
746
        	                  api::Sort rangeType = args.back();
13162
373
        	                  args.pop_back();
13163
373
        	                  t = PARSER_STATE->mkFlatFunctionType( args, rangeType );
13164
13165
373
        	        }
13166
13167
13168
        	    }
13169
373
        	    break;
13170
13171
            }
13172
        }
13173
    }
13174
13175
    // This is where rules clean up and exit
13176
    //
13177
208197
    goto rulesortSymbolEx; /* Prevent compiler warnings */
13178
208197
    rulesortSymbolEx: ;
13179
13180
208197
            if (HASEXCEPTION())
13181
            {
13182
                PREPORTERROR();
13183
                PRECOVER();
13184
            }
13185
416394
    return ;
13186
}
13187
/* $ANTLR end sortSymbol */
13188
13189
/**
13190
 * $ANTLR start symbolList
13191
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2134:1: symbolList[std::vector<std::string>& names,\n cvc5::parser::DeclarationCheck check,\n cvc5::parser::SymbolType type] : ( symbol[id,check,type] )* ;
13192
 */
13193
static void
13194
124
symbolList(pSmt2Parser ctx, std::vector<std::string>& names, cvc5::parser::DeclarationCheck check, cvc5::parser::SymbolType type)
13195
{
13196
13197
248
      std::string id;
13198
13199
    /* Initialize rule variables
13200
     */
13201
13202
    {
13203
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2140:3: ( ( symbol[id,check,type] )* )
13204
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2140:5: ( symbol[id,check,type] )*
13205
        {
13206
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2140:5: ( symbol[id,check,type] )*
13207
13208
            for (;;)
13209
            {
13210
126
                int alt67=2;
13211
126
                switch ( LA(1) )
13212
                {
13213
2
                case QUOTED_SYMBOL:
13214
                case SIMPLE_SYMBOL:
13215
                case UNTERMINATED_QUOTED_SYMBOL:
13216
                	{
13217
2
                		alt67=1;
13218
                	}
13219
2
                    break;
13220
13221
                }
13222
13223
126
                switch (alt67)
13224
                {
13225
2
            	case 1:
13226
            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2140:7: symbol[id,check,type]
13227
            	    {
13228
2
            	        FOLLOWPUSH(FOLLOW_symbol_in_symbolList5055);
13229
2
            	        symbol(ctx, id, check, type);
13230
13231
2
            	        FOLLOWPOP();
13232
2
            	        if  (HASEXCEPTION())
13233
            	        {
13234
            	            goto rulesymbolListEx;
13235
            	        }
13236
13237
13238
            	        {
13239
2
            	             names.push_back(id);
13240
            	        }
13241
13242
13243
            	    }
13244
2
            	    break;
13245
13246
124
            	default:
13247
124
            	    goto loop67;	/* break out of the loop */
13248
            	    break;
13249
                }
13250
2
            }
13251
124
            loop67: ; /* Jump out to here if this rule does not match */
13252
13253
13254
        }
13255
13256
    }
13257
13258
    // This is where rules clean up and exit
13259
    //
13260
124
    goto rulesymbolListEx; /* Prevent compiler warnings */
13261
124
    rulesymbolListEx: ;
13262
13263
124
            if (HASEXCEPTION())
13264
            {
13265
                PREPORTERROR();
13266
                PRECOVER();
13267
            }
13268
248
    return ;
13269
}
13270
/* $ANTLR end symbolList */
13271
13272
/**
13273
 * $ANTLR start symbol
13274
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2149:1: symbol[std::string& id,\n cvc5::parser::DeclarationCheck check,\n cvc5::parser::SymbolType type] : ( SIMPLE_SYMBOL | QUOTED_SYMBOL | UNTERMINATED_QUOTED_SYMBOL ( EOF | '\\\\' ) );
13275
 */
13276
static void
13277
5168461
symbol(pSmt2Parser ctx, std::string& id, cvc5::parser::DeclarationCheck check, cvc5::parser::SymbolType type)
13278
{
13279
    pANTLR3_COMMON_TOKEN    SIMPLE_SYMBOL19;
13280
    pANTLR3_COMMON_TOKEN    QUOTED_SYMBOL20;
13281
13282
    /* Initialize rule variables
13283
     */
13284
13285
5168461
    SIMPLE_SYMBOL19       = NULL;
13286
5168461
    QUOTED_SYMBOL20       = NULL;
13287
13288
    {
13289
        {
13290
            //  /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2152:3: ( SIMPLE_SYMBOL | QUOTED_SYMBOL | UNTERMINATED_QUOTED_SYMBOL ( EOF | '\\\\' ) )
13291
13292
            ANTLR3_UINT32 alt69;
13293
13294
5168461
            alt69=3;
13295
13296
5168461
            switch ( LA(1) )
13297
            {
13298
5167066
            case SIMPLE_SYMBOL:
13299
            	{
13300
5167066
            		alt69=1;
13301
            	}
13302
5167066
                break;
13303
1395
            case QUOTED_SYMBOL:
13304
            	{
13305
1395
            		alt69=2;
13306
            	}
13307
1395
                break;
13308
            case UNTERMINATED_QUOTED_SYMBOL:
13309
            	{
13310
            		alt69=3;
13311
            	}
13312
                break;
13313
13314
            default:
13315
                CONSTRUCTEX();
13316
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
13317
                EXCEPTION->message      = (void *)"";
13318
                EXCEPTION->decisionNum  = 69;
13319
                EXCEPTION->state        = 0;
13320
13321
13322
                goto rulesymbolEx;
13323
13324
            }
13325
13326
5168461
            switch (alt69)
13327
            {
13328
5167066
        	case 1:
13329
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2152:5: SIMPLE_SYMBOL
13330
        	    {
13331
5167066
        	        SIMPLE_SYMBOL19 = (pANTLR3_COMMON_TOKEN) MATCHT(SIMPLE_SYMBOL, &FOLLOW_SIMPLE_SYMBOL_in_symbol5077);
13332
5167066
        	        if  (HASEXCEPTION())
13333
        	        {
13334
        	            goto rulesymbolEx;
13335
        	        }
13336
13337
13338
        	        {
13339
5167066
        	             id = AntlrInput::tokenText(SIMPLE_SYMBOL19);
13340
5167066
        	                  if(!PARSER_STATE->isAbstractValue(id)) {
13341
        	                    // if an abstract value, SmtEngine handles declaration
13342
5167062
        	                    PARSER_STATE->checkDeclaration(id, check, type);
13343
        	                  }
13344
13345
        	        }
13346
13347
13348
        	    }
13349
5167064
        	    break;
13350
1395
        	case 2:
13351
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2159:5: QUOTED_SYMBOL
13352
        	    {
13353
1395
        	        QUOTED_SYMBOL20 = (pANTLR3_COMMON_TOKEN) MATCHT(QUOTED_SYMBOL, &FOLLOW_QUOTED_SYMBOL_in_symbol5089);
13354
1395
        	        if  (HASEXCEPTION())
13355
        	        {
13356
        	            goto rulesymbolEx;
13357
        	        }
13358
13359
13360
        	        {
13361
1395
        	             id = AntlrInput::tokenText(QUOTED_SYMBOL20);
13362
        	                  /* strip off the quotes */
13363
1395
        	                  id = id.substr(1, id.size() - 2);
13364
1395
        	                  if(!PARSER_STATE->isAbstractValue(id)) {
13365
        	                    // if an abstract value, SmtEngine handles declaration
13366
1395
        	                    PARSER_STATE->checkDeclaration(id, check, type);
13367
        	                  }
13368
13369
        	        }
13370
13371
13372
        	    }
13373
1395
        	    break;
13374
        	case 3:
13375
        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2168:5: UNTERMINATED_QUOTED_SYMBOL ( EOF | '\\\\' )
13376
        	    {
13377
        	         MATCHT(UNTERMINATED_QUOTED_SYMBOL, &FOLLOW_UNTERMINATED_QUOTED_SYMBOL_in_symbol5101);
13378
        	        if  (HASEXCEPTION())
13379
        	        {
13380
        	            goto rulesymbolEx;
13381
        	        }
13382
13383
13384
        	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2169:5: ( EOF | '\\\\' )
13385
        	        {
13386
        	            int alt68=2;
13387
        	            switch ( LA(1) )
13388
        	            {
13389
        	            case EOF:
13390
        	            	{
13391
        	            		alt68=1;
13392
        	            	}
13393
        	                break;
13394
        	            case 110:
13395
        	            	{
13396
        	            		alt68=2;
13397
        	            	}
13398
        	                break;
13399
13400
        	            default:
13401
        	                CONSTRUCTEX();
13402
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
13403
        	                EXCEPTION->message      = (void *)"";
13404
        	                EXCEPTION->decisionNum  = 68;
13405
        	                EXCEPTION->state        = 0;
13406
13407
13408
        	                goto rulesymbolEx;
13409
13410
        	            }
13411
13412
        	            switch (alt68)
13413
        	            {
13414
        	        	case 1:
13415
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2169:7: EOF
13416
        	        	    {
13417
        	        	         MATCHT(EOF, &FOLLOW_EOF_in_symbol5109);
13418
        	        	        if  (HASEXCEPTION())
13419
        	        	        {
13420
        	        	            goto rulesymbolEx;
13421
        	        	        }
13422
13423
13424
        	        	        {
13425
        	        	             PARSER_STATE->unexpectedEOF("unterminated |quoted| symbol");
13426
        	        	        }
13427
13428
13429
        	        	    }
13430
        	        	    break;
13431
        	        	case 2:
13432
        	        	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2171:7: '\\\\'
13433
        	        	    {
13434
        	        	         MATCHT(110, &FOLLOW_110_in_symbol5125);
13435
        	        	        if  (HASEXCEPTION())
13436
        	        	        {
13437
        	        	            goto rulesymbolEx;
13438
        	        	        }
13439
13440
13441
        	        	        {
13442
        	        	             PARSER_STATE->unexpectedEOF("backslash not permitted in |quoted| "
13443
        	        	                                                "symbol");
13444
        	        	        }
13445
13446
13447
        	        	    }
13448
        	        	    break;
13449
13450
        	            }
13451
        	        }
13452
13453
        	    }
13454
        	    break;
13455
13456
            }
13457
        }
13458
    }
13459
13460
    // This is where rules clean up and exit
13461
    //
13462
5168459
    goto rulesymbolEx; /* Prevent compiler warnings */
13463
5168459
    rulesymbolEx: ;
13464
13465
5168459
            if (HASEXCEPTION())
13466
            {
13467
                PREPORTERROR();
13468
                PRECOVER();
13469
            }
13470
5168459
    return ;
13471
}
13472
/* $ANTLR end symbol */
13473
13474
/**
13475
 * $ANTLR start nonemptyNumeralList
13476
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2181:1: nonemptyNumeralList[std::vector<uint64_t>& numerals] : ( INTEGER_LITERAL )+ ;
13477
 */
13478
static void
13479
102639
nonemptyNumeralList(pSmt2Parser ctx, std::vector<uint64_t>& numerals)
13480
{
13481
    pANTLR3_COMMON_TOKEN    INTEGER_LITERAL21;
13482
13483
    /* Initialize rule variables
13484
     */
13485
13486
102639
    INTEGER_LITERAL21       = NULL;
13487
13488
    {
13489
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2182:3: ( ( INTEGER_LITERAL )+ )
13490
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2182:5: ( INTEGER_LITERAL )+
13491
        {
13492
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2182:5: ( INTEGER_LITERAL )+
13493
            {
13494
102639
                int cnt70=0;
13495
13496
                for (;;)
13497
                {
13498
213971
                    int alt70=2;
13499
213971
            	switch ( LA(1) )
13500
            	{
13501
111332
            	case INTEGER_LITERAL:
13502
            		{
13503
111332
            			alt70=1;
13504
            		}
13505
111332
            	    break;
13506
13507
            	}
13508
13509
213971
            	switch (alt70)
13510
            	{
13511
111332
            	    case 1:
13512
            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2182:7: INTEGER_LITERAL
13513
            	        {
13514
111332
            	            INTEGER_LITERAL21 = (pANTLR3_COMMON_TOKEN) MATCHT(INTEGER_LITERAL, &FOLLOW_INTEGER_LITERAL_in_nonemptyNumeralList5157);
13515
111332
            	            if  (HASEXCEPTION())
13516
            	            {
13517
            	                goto rulenonemptyNumeralListEx;
13518
            	            }
13519
13520
13521
            	            {
13522
111332
            	                 numerals.push_back(AntlrInput::tokenToUnsigned(INTEGER_LITERAL21));
13523
            	            }
13524
13525
13526
            	        }
13527
111332
            	        break;
13528
13529
102639
            	    default:
13530
13531
102639
            		if ( cnt70 >= 1 )
13532
            		{
13533
102639
            		    goto loop70;
13534
            		}
13535
            		/* mismatchedSetEx()
13536
            		 */
13537
            		CONSTRUCTEX();
13538
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
13539
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
13540
13541
13542
            		goto rulenonemptyNumeralListEx;
13543
            	}
13544
111332
            	cnt70++;
13545
111332
                }
13546
102639
                loop70: ;	/* Jump to here if this rule does not match */
13547
            }
13548
13549
        }
13550
13551
    }
13552
13553
    // This is where rules clean up and exit
13554
    //
13555
102639
    goto rulenonemptyNumeralListEx; /* Prevent compiler warnings */
13556
102639
    rulenonemptyNumeralListEx: ;
13557
13558
102639
            if (HASEXCEPTION())
13559
            {
13560
                PREPORTERROR();
13561
                PRECOVER();
13562
            }
13563
102639
    return ;
13564
}
13565
/* $ANTLR end nonemptyNumeralList */
13566
13567
/**
13568
 * $ANTLR start datatypeDef
13569
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2190:1: datatypeDef[bool isCo, std::vector<cvc5::api::DatatypeDecl>& datatypes,\n std::vector< cvc5::api::Sort >& params] : symbol[id,CHECK_NONE,SYM_SORT] ( LPAREN_TOK constructorDef[datatypes.back()] RPAREN_TOK )+ ;
13570
 */
13571
static void
13572
datatypeDef(pSmt2Parser ctx, bool isCo, std::vector<cvc5::api::DatatypeDecl>& datatypes, std::vector< cvc5::api::Sort >& params)
13573
{
13574
    /* Initialize rule variables
13575
     */
13576
13577
13578
      std::string id;
13579
13580
    {
13581
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2199:3: ( symbol[id,CHECK_NONE,SYM_SORT] ( LPAREN_TOK constructorDef[datatypes.back()] RPAREN_TOK )+ )
13582
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2199:5: symbol[id,CHECK_NONE,SYM_SORT] ( LPAREN_TOK constructorDef[datatypes.back()] RPAREN_TOK )+
13583
        {
13584
            FOLLOWPUSH(FOLLOW_symbol_in_datatypeDef5199);
13585
            symbol(ctx, id, CHECK_NONE, SYM_SORT);
13586
13587
            FOLLOWPOP();
13588
            if  (HASEXCEPTION())
13589
            {
13590
                goto ruledatatypeDefEx;
13591
            }
13592
13593
13594
            {
13595
                 PARSER_STATE->pushScope();
13596
            }
13597
13598
13599
            {
13600
13601
                      datatypes.push_back(SOLVER->mkDatatypeDecl(id, params, isCo));
13602
13603
            }
13604
13605
13606
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2203:5: ( LPAREN_TOK constructorDef[datatypes.back()] RPAREN_TOK )+
13607
            {
13608
                int cnt71=0;
13609
13610
                for (;;)
13611
                {
13612
                    int alt71=2;
13613
            	switch ( LA(1) )
13614
            	{
13615
            	case LPAREN_TOK:
13616
            		{
13617
            			alt71=1;
13618
            		}
13619
            	    break;
13620
13621
            	}
13622
13623
            	switch (alt71)
13624
            	{
13625
            	    case 1:
13626
            	        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2203:7: LPAREN_TOK constructorDef[datatypes.back()] RPAREN_TOK
13627
            	        {
13628
            	             MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_datatypeDef5216);
13629
            	            if  (HASEXCEPTION())
13630
            	            {
13631
            	                goto ruledatatypeDefEx;
13632
            	            }
13633
13634
13635
            	            FOLLOWPUSH(FOLLOW_constructorDef_in_datatypeDef5218);
13636
            	            constructorDef(ctx, datatypes.back());
13637
13638
            	            FOLLOWPOP();
13639
            	            if  (HASEXCEPTION())
13640
            	            {
13641
            	                goto ruledatatypeDefEx;
13642
            	            }
13643
13644
13645
            	             MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_datatypeDef5221);
13646
            	            if  (HASEXCEPTION())
13647
            	            {
13648
            	                goto ruledatatypeDefEx;
13649
            	            }
13650
13651
13652
            	        }
13653
            	        break;
13654
13655
            	    default:
13656
13657
            		if ( cnt71 >= 1 )
13658
            		{
13659
            		    goto loop71;
13660
            		}
13661
            		/* mismatchedSetEx()
13662
            		 */
13663
            		CONSTRUCTEX();
13664
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
13665
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;
13666
13667
13668
            		goto ruledatatypeDefEx;
13669
            	}
13670
            	cnt71++;
13671
                }
13672
                loop71: ;	/* Jump to here if this rule does not match */
13673
            }
13674
13675
            {
13676
                 PARSER_STATE->popScope();
13677
            }
13678
13679
13680
        }
13681
13682
    }
13683
13684
    // This is where rules clean up and exit
13685
    //
13686
    goto ruledatatypeDefEx; /* Prevent compiler warnings */
13687
    ruledatatypeDefEx: ;
13688
13689
            if (HASEXCEPTION())
13690
            {
13691
                PREPORTERROR();
13692
                PRECOVER();
13693
            }
13694
    return ;
13695
}
13696
/* $ANTLR end datatypeDef */
13697
13698
/**
13699
 * $ANTLR start constructorDef
13700
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2210:1: constructorDef[cvc5::api::DatatypeDecl& type] : symbol[id,CHECK_NONE,SYM_VARIABLE] ( LPAREN_TOK selector[*ctor] RPAREN_TOK )* ;
13701
 */
13702
static void
13703
1761
constructorDef(pSmt2Parser ctx, cvc5::api::DatatypeDecl& type)
13704
{
13705
    /* Initialize rule variables
13706
     */
13707
13708
13709
3522
      std::string id;
13710
1761
      cvc5::api::DatatypeConstructorDecl* ctor = NULL;
13711
13712
    {
13713
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2215:3: ( symbol[id,CHECK_NONE,SYM_VARIABLE] ( LPAREN_TOK selector[*ctor] RPAREN_TOK )* )
13714
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2215:5: symbol[id,CHECK_NONE,SYM_VARIABLE] ( LPAREN_TOK selector[*ctor] RPAREN_TOK )*
13715
        {
13716
1761
            FOLLOWPUSH(FOLLOW_symbol_in_constructorDef5251);
13717
1761
            symbol(ctx, id, CHECK_NONE, SYM_VARIABLE);
13718
13719
1761
            FOLLOWPOP();
13720
1761
            if  (HASEXCEPTION())
13721
            {
13722
                goto ruleconstructorDefEx;
13723
            }
13724
13725
13726
            {
13727
13728
1761
                      ctor = new api::DatatypeConstructorDecl(
13729
1761
                          SOLVER->mkDatatypeConstructorDecl(id));
13730
13731
            }
13732
13733
13734
            // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2220:5: ( LPAREN_TOK selector[*ctor] RPAREN_TOK )*
13735
13736
            for (;;)
13737
            {
13738
3509
                int alt72=2;
13739
3509
                switch ( LA(1) )
13740
                {
13741
1748
                case LPAREN_TOK:
13742
                	{
13743
1748
                		alt72=1;
13744
                	}
13745
1748
                    break;
13746
13747
                }
13748
13749
3509
                switch (alt72)
13750
                {
13751
1748
            	case 1:
13752
            	    // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2220:7: LPAREN_TOK selector[*ctor] RPAREN_TOK
13753
            	    {
13754
1748
            	         MATCHT(LPAREN_TOK, &FOLLOW_LPAREN_TOK_in_constructorDef5266);
13755
1748
            	        if  (HASEXCEPTION())
13756
            	        {
13757
            	            goto ruleconstructorDefEx;
13758
            	        }
13759
13760
13761
1748
            	        FOLLOWPUSH(FOLLOW_selector_in_constructorDef5268);
13762
1748
            	        selector(ctx, *ctor);
13763
13764
1748
            	        FOLLOWPOP();
13765
1748
            	        if  (HASEXCEPTION())
13766
            	        {
13767
            	            goto ruleconstructorDefEx;
13768
            	        }
13769
13770
13771
1748
            	         MATCHT(RPAREN_TOK, &FOLLOW_RPAREN_TOK_in_constructorDef5271);
13772
1748
            	        if  (HASEXCEPTION())
13773
            	        {
13774
            	            goto ruleconstructorDefEx;
13775
            	        }
13776
13777
13778
            	    }
13779
1748
            	    break;
13780
13781
1761
            	default:
13782
1761
            	    goto loop72;	/* break out of the loop */
13783
            	    break;
13784
                }
13785
1748
            }
13786
1761
            loop72: ; /* Jump out to here if this rule does not match */
13787
13788
13789
            {
13790
                 // make the constructor
13791
1761
                      type.addConstructor(*ctor);
13792
1761
                      Debug("parser-idt") << "constructor: " << id.c_str() << std::endl;
13793
1761
                      delete ctor;
13794
13795
            }
13796
13797
13798
        }
13799
13800
    }
13801
13802
    // This is where rules clean up and exit
13803
    //
13804
1761
    goto ruleconstructorDefEx; /* Prevent compiler warnings */
13805
1761
    ruleconstructorDefEx: ;
13806
13807
1761
            if (HASEXCEPTION())
13808
            {
13809
                PREPORTERROR();
13810
                PRECOVER();
13811
            }
13812
3522
    return ;
13813
}
13814
/* $ANTLR end constructorDef */
13815
13816
/**
13817
 * $ANTLR start selector
13818
 * /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2228:1: selector[cvc5::api::DatatypeConstructorDecl& ctor] : symbol[id,CHECK_NONE,SYM_SORT] sortSymbol[t,CHECK_NONE] ;
13819
 */
13820
static void
13821
1748
selector(pSmt2Parser ctx, cvc5::api::DatatypeConstructorDecl& ctor)
13822
{
13823
    /* Initialize rule variables
13824
     */
13825
13826
13827
3496
      std::string id;
13828
3496
      cvc5::api::Sort t, t2;
13829
13830
    {
13831
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2233:3: ( symbol[id,CHECK_NONE,SYM_SORT] sortSymbol[t,CHECK_NONE] )
13832
        // /barrett/scratch/cvc4-nightly/src/cvc5-2021-09-29/src/parser/smt2/Smt2.g:2233:5: symbol[id,CHECK_NONE,SYM_SORT] sortSymbol[t,CHECK_NONE]
13833
        {
13834
1748
            FOLLOWPUSH(FOLLOW_symbol_in_selector5299);
13835
1748
            symbol(ctx, id, CHECK_NONE, SYM_SORT);
13836
13837
1748
            FOLLOWPOP();
13838
1748
            if  (HASEXCEPTION())
13839
            {
13840
                goto ruleselectorEx;
13841
            }
13842
13843
13844
1748
            FOLLOWPUSH(FOLLOW_sortSymbol_in_selector5302);
13845
1748
            sortSymbol(ctx, t, CHECK_NONE);
13846
13847
1748
            FOLLOWPOP();
13848
1748
            if  (HASEXCEPTION())
13849
            {
13850
                goto ruleselectorEx;
13851
            }
13852
13853
13854
            {
13855
13856
1748
                      ctor.addSelector(id, t);
13857
3496
                      Debug("parser-idt") << "selector: " << id.c_str()
13858
1748
                                          << " of type " << t << std::endl;
13859
13860
            }
13861
13862
13863
        }
13864
13865
    }
13866
13867
    // This is where rules clean up and exit
13868
    //
13869
1748
    goto ruleselectorEx; /* Prevent compiler warnings */
13870
1748
    ruleselectorEx: ;
13871
13872
1748
            if (HASEXCEPTION())
13873
            {
13874
                PREPORTERROR();
13875
                PRECOVER();
13876
            }
13877
3496
    return ;
13878
22731
}
13879
/* $ANTLR end selector */
13880
/* End of parsing rules
13881
 * ==============================================
13882
 */
13883
13884
/* ==============================================
13885
 * Syntactic predicates
13886
 */
13887
/* End of syntactic predicates
13888
 * ==============================================
13889
 */
13890
13891
13892
13893
13894
13895
13896
/* End of code
13897
 * =============================================================================
13898
 */