• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SRI-CSL / yices2 / 4792763362

pending completion
4792763362

push

github

Ahmed Irfan
fixes #440

2 of 2 new or added lines in 1 file covered. (100.0%)

76439 of 119009 relevant lines covered (64.23%)

949385.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/api/yices_error.c
1
/*
2
 * This file is part of the Yices SMT Solver.
3
 * Copyright (C) 2017 SRI International.
4
 *
5
 * Yices is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * Yices is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with Yices.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18

19
/*
20
 * ERROR MESSAGE
21
 */
22

23
#if defined(CYGWIN) || defined(MINGW)
24
#ifndef __YICES_DLLSPEC__
25
#define __YICES_DLLSPEC__ __declspec(dllexport)
26
#endif
27
#endif
28

29
#include <stdint.h>
30
#include <string.h>
31
#include <inttypes.h>
32

33
#include "api/yices_globals.h"
34
#include "utils/memalloc.h"
35
#include "yices.h"
36

37
/*
38
 * Conversion of term_kind to a string for diagnosis
39
 * - badval contains an integer that we intepret as a term_kind
40
 *   if it's between CONSTANT_TERM and BV_POLY
41
 * - if not we retun the empty string
42
 */
43
static const char* const term_kind2string[NUM_TERM_KINDS] = {
44
  NULL,             //  UNUSED_TERM
45
  NULL,             //  RESERVED_TERM
46

47
  "uninterpreted or Boolean constant",  // CONSTANT_TERM
48
  "rational constant",                  // ARITH_CONSTANT
49
  "bitvector constant",                 // BV64_CONSTANT
50
  "bitvector constant",                 // BV_CONSTANT
51
  "variable",                           // VARIABLE
52
  "uninterpreted term",                 // UNINTERPRETED_TERM
53
  "arithmetic equality",                // ARITH_EQ_ATOM
54
  "arithmetic inequality",              // ARITH_GE_ATOM
55
  "is-int atom",                        // ARITH_IS_INT_ATOM
56
  "floor",                              // ARITH_FLOOR
57
  "ceil",                               // ARITH_CEIL
58
  "absolute value",                     // ARITH_ABS
59
  "algebraic root",                     // ARITH_ROOT_ATOM
60
  "if-then-else",                       // ITE_TERM
61
  "if-then-else",                       // ITE_SPECIAL
62
  "uninterpreted function or predicate", // APP_TERM
63
  "function update",                     // UPDATE_TERM
64
  "tuple constructor",                   // TUPLE_TERM
65
  "equality",                            // EQ_TERM
66
  "distinct",                            // DISTINCT_TERM
67
  "quantifier",                          // FORALL_TERM
68
  "lambda term",                         // LAMBDA_TERM
69
  "or",                                  // OR_TERM
70
  "xor",                                 // XOR_TERM
71
  "arithmetic equality",                 // ARITH_BINEQ_ATOM
72
  "division",                            // ARITH_RDIV
73
  "integer division",                    // ARITH_IDIV
74
  "mod",                                 // ARITH_MOD
75
  "divides",                             // ARITH_DIVIDES_ATOM
76
  "bit-vector",                          // BV_ARRAY
77
  "bv-div",                              // BV_DIV
78
  "bv-rem",                              // BV_REM
79
  "bv-sdiv",                             // BV_SDIV
80
  "bv-srem",                             // BV_SREM
81
  "bv-smod",                             // BV_SMOD
82
  "bv-shl",                              // BV_SHL
83
  "bv-lshr",                             // BV_LSHR
84
  "bv-ashr",                             // BV_ASHR
85
  "bit-vector equality",                 // BV_EQ_ATOM
86
  "bit-vector inequality",               // BV_GE_ATOM
87
  "bit-vector inequality",               // BV_SGE_ATOM
88
  "tuple projection",                    // SELECT_TERM
89
  "bit extrction",                       // BIT_TERM
90
  "product",                             // POWER_PRODUCT
91
  "polynomial",                          // ARITH_POLY
92
  "bit-vector polynomial",               // BV64_POLY
93
  "bit-vector polynomial",               // BV_POLY
94
};
95

96
static const char *term_kind2str(int64_t badval) {
×
97
  if (CONSTANT_TERM <= badval && badval <= BV_POLY) {
×
98
    return term_kind2string[badval];
×
99
  } else {
100
    return "";
×
101
  }
102
}
103

104
int32_t print_error(FILE *f) {
×
105
  error_report_t *error;
106
  int code;
107

108
  error = yices_error_report();
×
109
  switch (error->code) {
×
110
  case NO_ERROR:
×
111
    code = fprintf(f, "no error\n");
×
112
    break;
×
113

114
    /*
115
     * Term/type construction errors
116
     */
117
  case INVALID_TYPE:
×
118
    code = fprintf(f, "invalid type: (index = %"PRId32")\n", error->type1);
×
119
    break;
×
120

121
  case INVALID_TERM:
×
122
    code = fprintf(f, "invalid term: (index = %"PRId32")\n", error->term1);
×
123
    break;
×
124

125
  case INVALID_CONSTANT_INDEX:
×
126
    code = fprintf(f, "invalid index %"PRId64" in constant creation\n", error->badval);
×
127
    break;
×
128

129
  case INVALID_VAR_INDEX:
×
130
    code = fprintf(f, "invalid index %"PRId64" in variable creation\n", error->badval);
×
131
    break;
×
132

133
  case INVALID_TUPLE_INDEX:
×
134
    code = fprintf(f, "invalid tuple index: %"PRId64"\n", error->badval);
×
135
    break;
×
136

137
  case INVALID_RATIONAL_FORMAT:
×
138
    code = fprintf(f, "invalid rational format\n");
×
139
    break;
×
140

141
  case INVALID_FLOAT_FORMAT:
×
142
    code = fprintf(f, "invalid floating-point format\n");
×
143
    break;
×
144

145
  case INVALID_BVBIN_FORMAT:
×
146
    code = fprintf(f, "invalid bitvector binary format\n");
×
147
    break;
×
148

149
  case INVALID_BVHEX_FORMAT:
×
150
    code = fprintf(f, "invalid bitvector hexadecimal format\n");
×
151
    break;
×
152

153
  case INVALID_BITSHIFT:
×
154
    code = fprintf(f, "invalid index in shift or rotate\n");
×
155
    break;
×
156

157
  case INVALID_BVEXTRACT:
×
158
    code = fprintf(f, "invalid indices in bv-extract\n");
×
159
    break;
×
160

161
  case INVALID_BITEXTRACT:
×
162
    code = fprintf(f, "invalid index in bit extraction\n");
×
163
    break;
×
164

165
  case TOO_MANY_ARGUMENTS:
×
166
    code = fprintf(f, "too many arguments (max arity is %"PRIu32")\n", YICES_MAX_ARITY);
×
167
    break;
×
168

169
  case TOO_MANY_VARS:
×
170
    code = fprintf(f, "too many variables in quantifier (max is %"PRIu32")\n", YICES_MAX_VARS);
×
171
    break;
×
172

173
  case MAX_BVSIZE_EXCEEDED:
×
174
    code = fprintf(f, "bitvector size is too large (max is %"PRIu32")\n", YICES_MAX_BVSIZE);
×
175
    break;
×
176

177
  case DEGREE_OVERFLOW:
×
178
    code = fprintf(f, "overflow in polynomial: degree is too large\n");
×
179
    break;
×
180

181
  case DIVISION_BY_ZERO:
×
182
    code = fprintf(f, "division by zero\n");
×
183
    break;
×
184

185
  case POS_INT_REQUIRED:
×
186
    code = fprintf(f, "integer argument must be positive\n");
×
187
    break;
×
188

189
  case NONNEG_INT_REQUIRED:
×
190
    code = fprintf(f, "integer argument must be non-negative\n");
×
191
    break;
×
192

193
  case SCALAR_OR_UTYPE_REQUIRED:
×
194
    code = fprintf(f, "invalid type in constant creation\n");
×
195
    break;
×
196

197
  case FUNCTION_REQUIRED:
×
198
    code = fprintf(f, "argument is not a function\n");
×
199
    break;
×
200

201
  case TUPLE_REQUIRED:
×
202
    code = fprintf(f, "argument is not a tuple\n");
×
203
    break;
×
204

205
  case VARIABLE_REQUIRED:
×
206
    code = fprintf(f, "argument is not a variable\n");
×
207
    break;
×
208

209
  case ARITHTERM_REQUIRED:
×
210
    code = fprintf(f, "argument is not an arithmetic term\n");
×
211
    break;
×
212

213
  case BITVECTOR_REQUIRED:
×
214
    code = fprintf(f, "argument is not a bitvector\n");
×
215
    break;
×
216

217
  case SCALAR_TERM_REQUIRED:
×
218
    code = fprintf(f, "argument is not a scalar term\n");
×
219
    break;
×
220

221
  case WRONG_NUMBER_OF_ARGUMENTS:
×
222
    code = fprintf(f, "wrong number of arguments\n");
×
223
    break;
×
224

225
  case TYPE_MISMATCH:
×
226
    code = fprintf(f, "type mismatch: invalid argument\n");
×
227
    break;
×
228

229
  case INCOMPATIBLE_TYPES:
×
230
    code = fprintf(f, "incompatible types\n");
×
231
    break;
×
232

233
  case DUPLICATE_VARIABLE:
×
234
    code = fprintf(f, "duplicate variable in quantifier or lambda\n");
×
235
    break;
×
236

237
  case INCOMPATIBLE_BVSIZES:
×
238
    code = fprintf(f, "arguments have incompatible bitsizes\n");
×
239
    break;
×
240

241
  case EMPTY_BITVECTOR:
×
242
    code = fprintf(f, "bitvector must have positive bitsize\n");
×
243
    break;
×
244

245
  case ARITHCONSTANT_REQUIRED:
×
246
    code = fprintf(f, "argument is not an arithmetic constant\n");
×
247
    break;
×
248

249
  case INVALID_MACRO:
×
250
    code = fprintf(f, "invalid macro id: %"PRId64"\n", error->badval);
×
251
    break;
×
252

253
  case TOO_MANY_MACRO_PARAMS:
×
254
    code = fprintf(f, "too many arguments in type constructor or macro (max = %"PRIu32")\n", TYPE_MACRO_MAX_ARITY);
×
255
    break;
×
256

257
  case TYPE_VAR_REQUIRED:
×
258
    code = fprintf(f, "argument is not a type variable\n");
×
259
    break;
×
260

261
  case DUPLICATE_TYPE_VAR:
×
262
    code = fprintf(f, "duplicate variable in type macro definition\n");
×
263
    break;
×
264

265
  case BVTYPE_REQUIRED:
×
266
    code = fprintf(f, "bitvector type required\n");
×
267
    break;
×
268

269
  case BAD_TERM_DECREF:
×
270
    code = fprintf(f, "Invalid decref: term has refcount zero\n");
×
271
    break;
×
272

273
  case BAD_TYPE_DECREF:
×
274
    code = fprintf(f, "Invalid decref: type has refcount zero\n");
×
275
    break;
×
276

277
  case INVALID_TYPE_OP:
×
278
    code = fprintf(f, "Invalid type-exploration query\n");
×
279
    break;
×
280

281
  case INVALID_TERM_OP:
×
282
    code = fprintf(f, "Invalid term-exploration query\n");
×
283
    break;
×
284

285
    /*
286
     * Parser errors
287
     */
288
  case INVALID_TOKEN:
×
289
    code = fprintf(f, "invalid token (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
290
    break;
×
291

292
  case SYNTAX_ERROR:
×
293
    code = fprintf(f, "syntax error (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
294
    break;
×
295

296
  case UNDEFINED_TYPE_NAME:
×
297
    code = fprintf(f, "undefined type name (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
298
    break;
×
299

300
  case UNDEFINED_TERM_NAME:
×
301
    code = fprintf(f, "undefined term name (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
302
    break;
×
303

304
  case REDEFINED_TYPE_NAME:
×
305
    code = fprintf(f, "cannot redefine type (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
306
    break;
×
307

308
  case REDEFINED_TERM_NAME:
×
309
    code = fprintf(f, "cannot redefine term (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
310
    break;
×
311

312
  case DUPLICATE_NAME_IN_SCALAR:
×
313
    code = fprintf(f, "duplicate name in scalar type definition (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
314
    break;
×
315

316
  case  DUPLICATE_VAR_NAME:
×
317
    code = fprintf(f, "duplicate variable in quantifier (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
318
    break;
×
319

320
  case INTEGER_OVERFLOW:
×
321
    code = fprintf(f, "integer overflow (constant does not fit in 32bits) (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
322
    break;
×
323

324
  case INTEGER_REQUIRED:
×
325
    code = fprintf(f, "integer required (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
326
    break;
×
327

328
  case RATIONAL_REQUIRED:
×
329
    code = fprintf(f, "numeric constant required (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
330
    break;
×
331

332
  case SYMBOL_REQUIRED:
×
333
    code = fprintf(f, "symbol required (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
334
    break;
×
335

336
  case TYPE_REQUIRED:
×
337
    code = fprintf(f, "type required (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
338
    break;
×
339

340
  case NON_CONSTANT_DIVISOR:
×
341
    code = fprintf(f, "invalid division (divisor is not a constant) (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
342
    break;
×
343

344
  case NEGATIVE_BVSIZE:
×
345
    code = fprintf(f, "invalid bitvector size (negative number) (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
346
    break;
×
347

348
  case INVALID_BVCONSTANT:
×
349
    code = fprintf(f, "invalid number in 'mk-bv' (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
350
    break;
×
351

352
  case TYPE_MISMATCH_IN_DEF:
×
353
    code = fprintf(f, "type mismatch in 'define' (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
354
    break;
×
355

356
  case ARITH_ERROR:
×
357
    code = fprintf(f, "error in arithmetic operation (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
358
    break;
×
359

360
  case BVARITH_ERROR:
×
361
    code = fprintf(f, "error in bitvector operation (line %"PRIu32", column %"PRIu32")\n", error->line, error->column);
×
362
    break;
×
363

364
    /*
365
     * Errors in assertion processing
366
     */
367
  case CTX_FREE_VAR_IN_FORMULA:
×
368
    code = fprintf(f, "assertion contains a free variable\n");
×
369
    break;
×
370

371
  case CTX_LOGIC_NOT_SUPPORTED:
×
372
    code = fprintf(f, "logic not supported\n");
×
373
    break;
×
374

375
  case CTX_UF_NOT_SUPPORTED:
×
376
    code = fprintf(f, "the context does not support uninterpreted functions\n");
×
377
    break;
×
378

379
  case CTX_ARITH_NOT_SUPPORTED:
×
380
    code = fprintf(f, "the context does not support arithmetic\n");
×
381
    break;
×
382

383
  case CTX_BV_NOT_SUPPORTED:
×
384
    code = fprintf(f, "the context does not support bitvectors\n");
×
385
    break;
×
386

387
  case CTX_ARRAYS_NOT_SUPPORTED:
×
388
    code = fprintf(f, "the context does not support arrays or function equalities\n");
×
389
    break;
×
390

391
  case CTX_QUANTIFIERS_NOT_SUPPORTED:
×
392
    code = fprintf(f, "the context does not support quantifiers\n");
×
393
    break;
×
394

395
  case CTX_LAMBDAS_NOT_SUPPORTED:
×
396
    code = fprintf(f, "the context does not support lambda terms\n");
×
397
    break;
×
398

399
  case CTX_NONLINEAR_ARITH_NOT_SUPPORTED:
×
400
    code = fprintf(f, "the context does not support non-linear arithmetic\n");
×
401
    break;
×
402

403
  case CTX_FORMULA_NOT_IDL:
×
404
    code = fprintf(f, "assertion is not in the IDL fragment\n");
×
405
    break;
×
406

407
  case CTX_FORMULA_NOT_RDL:
×
408
    code = fprintf(f, "assertion is not in the RDL fragment\n");
×
409
    break;
×
410

411
  case CTX_TOO_MANY_ARITH_VARS:
×
412
    code = fprintf(f, "too many variables for the arithmetic solver\n");
×
413
    break;
×
414

415
  case CTX_TOO_MANY_ARITH_ATOMS:
×
416
    code = fprintf(f, "too many atoms for the arithmetic solver\n");
×
417
    break;
×
418

419
  case CTX_TOO_MANY_BV_VARS:
×
420
    code = fprintf(f, "too many variables for the bitvector solver\n");
×
421
    break;
×
422

423
  case CTX_TOO_MANY_BV_ATOMS:
×
424
    code = fprintf(f, "too many atoms for the bitvector solver\n");
×
425
    break;
×
426

427
  case CTX_ARITH_SOLVER_EXCEPTION:
×
428
    code = fprintf(f, "arithmetic solver exception\n");
×
429
    break;
×
430

431
  case CTX_BV_SOLVER_EXCEPTION:
×
432
    code = fprintf(f, "bitvector solver exception\n");
×
433
    break;
×
434

435
  case CTX_ARRAY_SOLVER_EXCEPTION:
×
436
    code = fprintf(f, "array solver exception\n");
×
437
    break;
×
438

439
  case CTX_SCALAR_NOT_SUPPORTED:
×
440
    code = fprintf(f, "the context does not support scalar types\n");
×
441
    break;
×
442

443
  case CTX_TUPLE_NOT_SUPPORTED:
×
444
    code = fprintf(f, "the context does not support tuples\n");
×
445
    break;
×
446

447
  case CTX_UTYPE_NOT_SUPPORTED:
×
448
    code = fprintf(f, "the context does not support uninterpreted types\n");
×
449
    break;
×
450

451
  case  CTX_HIGH_ORDER_FUN_NOT_SUPPORTED:
×
452
    code = fprintf(f, "the context does not support high-order functions\n");
×
453
    break;
×
454

455
  case CTX_INVALID_OPERATION:
×
456
    code = fprintf(f, "the context state does not allow operation\n");
×
457
    break;
×
458

459
  case CTX_OPERATION_NOT_SUPPORTED:
×
460
    code = fprintf(f, "operation not supported by the context\n");
×
461
    break;
×
462

463
  case CTX_UNKNOWN_DELEGATE:
×
464
    code = fprintf(f, "unknown delegate\n");
×
465
    break;
×
466

467
  case CTX_DELEGATE_NOT_AVAILABLE:
×
468
    code = fprintf(f, "delegate not available\n");
×
469
    break;
×
470

471
  case CTX_EF_ASSERTIONS_CONTAIN_UF:
×
472
    code = fprintf(f, "uninterpreted functions not supported by the exists/forall solver\n");
×
473
    break;
×
474

475
  case CTX_EF_NOT_EXISTS_FORALL:
×
476
    code = fprintf(f, "assertions are not in the exists/forall fragment\n");
×
477
    break;
×
478

479
  case CTX_EF_HIGH_ORDER_VARS:
×
480
    code = fprintf(f, "high-order and tuple variables are not supported\n");
×
481
    break;
×
482

483
  case CTX_EF_INTERNAL_ERROR:
×
484
    code = fprintf(f, "the exists/forall solver failed\n");
×
485
    break;
×
486

487
  case CTX_INVALID_CONFIG:
×
488
    code = fprintf(f, "invalid context configuration\n");
×
489
    break;
×
490

491
  case CTX_UNKNOWN_PARAMETER:
×
492
    code = fprintf(f, "invalid parameter\n");
×
493
    break;
×
494

495
  case CTX_INVALID_PARAMETER_VALUE:
×
496
    code = fprintf(f, "value not valid for parameter\n");
×
497
    break;
×
498

499
  case CTX_UNKNOWN_LOGIC:
×
500
    code = fprintf(f, "unknown logic\n");
×
501
    break;
×
502

503
  case EVAL_UNKNOWN_TERM:
×
504
    code = fprintf(f, "eval error: term value not available in the model\n");
×
505
    break;
×
506

507
  case EVAL_FREEVAR_IN_TERM:
×
508
    code = fprintf(f, "eval error: free variable in term\n");
×
509
    break;
×
510

511
  case EVAL_QUANTIFIER:
×
512
    code = fprintf(f, "eval error: term contains quantifiers\n");
×
513
    break;
×
514

515
  case EVAL_LAMBDA:
×
516
    code = fprintf(f, "eval error: term contains lambdas\n");
×
517
    break;
×
518

519
  case EVAL_OVERFLOW:
×
520
    code = fprintf(f, "eval error: the term value does not fit the expected type\n");
×
521
    break;
×
522

523
  case EVAL_FAILED:
×
524
    code = fprintf(f, "exception in term evaluation\n");
×
525
    break;
×
526

527
  case EVAL_CONVERSION_FAILED:
×
528
    code = fprintf(f, "could not convert value (in model) to a term\n");
×
529
    break;
×
530

531
  case EVAL_NO_IMPLICANT:
×
532
    code = fprintf(f, "can't build an implicant: input formula is false in the model\n");
×
533
    break;
×
534

535
  case MDL_UNINT_REQUIRED:
×
536
    code = fprintf(f, "argument is not an uninterpreted term\n");
×
537
    break;
×
538

539
  case MDL_CONSTANT_REQUIRED:
×
540
    code = fprintf(f, "value is not a constant term\n");
×
541
    break;
×
542

543
  case MDL_DUPLICATE_VAR:
×
544
    code = fprintf(f, "duplicate term in input array\n");
×
545
    break;
×
546

547
  case MDL_FTYPE_NOT_ALLOWED: // not used
×
548
    code = fprintf(f, "function-types are not supported\n");
×
549
    break;
×
550

551
  case MDL_CONSTRUCTION_FAILED: // not used
×
552
    code = fprintf(f, "model-construction failed\n");
×
553
    break;
×
554

555
  case MDL_NONNEG_INT_REQUIRED:
×
556
    code = fprintf(f, "model value must be non-negative\n");
×
557
    break;
×
558

559
  case YVAL_INVALID_OP:
×
560
    code = fprintf(f, "invalid operation on yval\n");
×
561
    break;
×
562

563
  case YVAL_OVERFLOW:
×
564
    code = fprintf(f, "yval overflow: rational does not fit the expected type\n");
×
565
    break;
×
566

567
  case MDL_GEN_TYPE_NOT_SUPPORTED:
×
568
    code = fprintf(f, "generalization failed: bad variable type\n");
×
569
    break;
×
570

571
  case MDL_GEN_NONLINEAR:
×
572
    code = fprintf(f, "generalization failed: nonlinear arithmetic\n");
×
573
    break;
×
574

575
  case MDL_GEN_FAILED:
×
576
    code = fprintf(f, "generalization failed\n");
×
577
    break;
×
578

579
  case MDL_GEN_UNSUPPORTED_TERM:
×
580
    code = fprintf(f, "generalization failed: unsupported term: %s\n", term_kind2str(error->badval));
×
581
    break;
×
582

583
  case OUTPUT_ERROR:
×
584
    code = fprintf(f, "output error\n");
×
585
    break;
×
586

587
  case MCSAT_ERROR_UNSUPPORTED_THEORY:
×
588
    code = fprintf(f, "mcsat: unsupported theory\n");
×
589
    break;
×
590

591
  case MCSAT_ERROR_ASSUMPTION_TERM_NOT_SUPPORTED:
×
592
    code = fprintf(f, "mcsat: checking with assumptions only supports variables as assumptions\n");
×
593
    break;
×
594

595
  case INTERNAL_EXCEPTION:
×
596
  default:
597
    code = fprintf(f, "internal error\n");
×
598
    break;
×
599
  }
600

601
  if (code >= 0) {
×
602
    fflush(f);
×
603
    code = 0;
×
604
  } else {
605
    code = -1;
×
606
  }
607

608
  return code;
×
609
}
610

611

612
/*
613
 * Construct an error string:
614
 * - we use an internal buffer and sprintf then we clone the result
615
 */
616
#define BUFFER_SIZE 200
617

618
char *error_string(void) {
×
619
  char buffer[BUFFER_SIZE];
620
  error_report_t *error;
621
  char *result;
622
  size_t size;
623
  int nchar;
624

625
  error = yices_error_report();
×
626
  switch (error->code) {
×
627
  case NO_ERROR:
×
628
    nchar = snprintf(buffer, BUFFER_SIZE, "no error");
×
629
    break;
×
630

631
    /*
632
     * Term/type construction errors
633
     */
634
  case INVALID_TYPE:
×
635
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid type: (index = %"PRId32")", error->type1);
×
636
    break;
×
637

638
  case INVALID_TERM:
×
639
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid term: (index = %"PRId32")", error->term1);
×
640
    break;
×
641

642
  case INVALID_CONSTANT_INDEX:
×
643
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid index %"PRId64" in constant creation", error->badval);
×
644
    break;
×
645

646
  case INVALID_VAR_INDEX:
×
647
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid index %"PRId64" in variable creation", error->badval);
×
648
    break;
×
649

650
  case INVALID_TUPLE_INDEX:
×
651
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid tuple index: %"PRId64, error->badval);
×
652
    break;
×
653

654
  case INVALID_RATIONAL_FORMAT:
×
655
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid rational format");
×
656
    break;
×
657

658
  case INVALID_FLOAT_FORMAT:
×
659
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid floating-point format");
×
660
    break;
×
661

662
  case INVALID_BVBIN_FORMAT:
×
663
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid bitvector binary format");
×
664
    break;
×
665

666
  case INVALID_BVHEX_FORMAT:
×
667
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid bitvector hexadecimal format");
×
668
    break;
×
669

670
  case INVALID_BITSHIFT:
×
671
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid index in shift or rotate");
×
672
    break;
×
673

674
  case INVALID_BVEXTRACT:
×
675
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid indices in bv-extract");
×
676
    break;
×
677

678
  case INVALID_BITEXTRACT:
×
679
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid index in bit extraction");
×
680
    break;
×
681

682
  case TOO_MANY_ARGUMENTS:
×
683
    nchar = snprintf(buffer, BUFFER_SIZE, "too many arguments (max arity is %"PRIu32")", YICES_MAX_ARITY);
×
684
    break;
×
685

686
  case TOO_MANY_VARS:
×
687
    nchar = snprintf(buffer, BUFFER_SIZE, "too many variables in quantifier (max is %"PRIu32")", YICES_MAX_VARS);
×
688
    break;
×
689

690
  case MAX_BVSIZE_EXCEEDED:
×
691
    nchar = snprintf(buffer, BUFFER_SIZE, "bitvector size is too large (max is %"PRIu32")", YICES_MAX_BVSIZE);
×
692
    break;
×
693

694
  case DEGREE_OVERFLOW:
×
695
    nchar = snprintf(buffer, BUFFER_SIZE, "overflow in polynomial: degree is too large");
×
696
    break;
×
697

698
  case DIVISION_BY_ZERO:
×
699
    nchar = snprintf(buffer, BUFFER_SIZE, "division by zero");
×
700
    break;
×
701

702
  case POS_INT_REQUIRED:
×
703
    nchar = snprintf(buffer, BUFFER_SIZE, "integer argument must be positive");
×
704
    break;
×
705

706
  case NONNEG_INT_REQUIRED:
×
707
    nchar = snprintf(buffer, BUFFER_SIZE, "integer argument must be non-negative");
×
708
    break;
×
709

710
  case SCALAR_OR_UTYPE_REQUIRED:
×
711
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid type in constant creation");
×
712
    break;
×
713

714
  case FUNCTION_REQUIRED:
×
715
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not a function");
×
716
    break;
×
717

718
  case TUPLE_REQUIRED:
×
719
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not a tuple");
×
720
    break;
×
721

722
  case VARIABLE_REQUIRED:
×
723
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not a variable");
×
724
    break;
×
725

726
  case ARITHTERM_REQUIRED:
×
727
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not an arithmetic term");
×
728
    break;
×
729

730
  case BITVECTOR_REQUIRED:
×
731
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not a bitvector");
×
732
    break;
×
733

734
  case SCALAR_TERM_REQUIRED:
×
735
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not a scalar term");
×
736
    break;
×
737

738
  case WRONG_NUMBER_OF_ARGUMENTS:
×
739
    nchar = snprintf(buffer, BUFFER_SIZE, "wrong number of arguments");
×
740
    break;
×
741

742
  case TYPE_MISMATCH:
×
743
    nchar = snprintf(buffer, BUFFER_SIZE, "type mismatch: invalid argument");
×
744
    break;
×
745

746
  case INCOMPATIBLE_TYPES:
×
747
    nchar = snprintf(buffer, BUFFER_SIZE, "incompatible types");
×
748
    break;
×
749

750
  case DUPLICATE_VARIABLE:
×
751
    nchar = snprintf(buffer, BUFFER_SIZE, "duplicate variable in quantifier or lambda");
×
752
    break;
×
753

754
  case INCOMPATIBLE_BVSIZES:
×
755
    nchar = snprintf(buffer, BUFFER_SIZE, "arguments have incompatible bitsizes");
×
756
    break;
×
757

758
  case EMPTY_BITVECTOR:
×
759
    nchar = snprintf(buffer, BUFFER_SIZE, "bitvector must have positive bitsize");
×
760
    break;
×
761

762
  case ARITHCONSTANT_REQUIRED:
×
763
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not an arithmetic constant");
×
764
    break;
×
765

766
  case INVALID_MACRO:
×
767
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid macro id: %"PRId64, error->badval);
×
768
    break;
×
769

770
  case TOO_MANY_MACRO_PARAMS:
×
771
    nchar = snprintf(buffer, BUFFER_SIZE, "too many arguments in type constructor or macro (max = %"PRIu32")", TYPE_MACRO_MAX_ARITY);
×
772
    break;
×
773

774
  case TYPE_VAR_REQUIRED:
×
775
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not a type variable");
×
776
    break;
×
777

778
  case DUPLICATE_TYPE_VAR:
×
779
    nchar = snprintf(buffer, BUFFER_SIZE, "duplicate variable in type macro definition");
×
780
    break;
×
781

782
  case BVTYPE_REQUIRED:
×
783
    nchar = snprintf(buffer, BUFFER_SIZE, "bitvector type required");
×
784
    break;
×
785

786
  case BAD_TERM_DECREF:
×
787
    nchar = snprintf(buffer, BUFFER_SIZE, "Invalid decref: term has refcount zero");
×
788
    break;
×
789

790
  case BAD_TYPE_DECREF:
×
791
    nchar = snprintf(buffer, BUFFER_SIZE, "Invalid decref: type has refcount zero");
×
792
    break;
×
793

794
  case INVALID_TYPE_OP:
×
795
    nchar = snprintf(buffer, BUFFER_SIZE, "Invalid type-exploration query");
×
796
    break;
×
797

798
  case INVALID_TERM_OP:
×
799
    nchar = snprintf(buffer, BUFFER_SIZE, "Invalid term-exploration query");
×
800
    break;
×
801

802
    /*
803
     * Parser errors
804
     */
805
  case INVALID_TOKEN:
×
806
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid token (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
807
    break;
×
808

809
  case SYNTAX_ERROR:
×
810
    nchar = snprintf(buffer, BUFFER_SIZE, "syntax error (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
811
    break;
×
812

813
  case UNDEFINED_TYPE_NAME:
×
814
    nchar = snprintf(buffer, BUFFER_SIZE, "undefined type name (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
815
    break;
×
816

817
  case UNDEFINED_TERM_NAME:
×
818
    nchar = snprintf(buffer, BUFFER_SIZE, "undefined term name (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
819
    break;
×
820

821
  case REDEFINED_TYPE_NAME:
×
822
    nchar = snprintf(buffer, BUFFER_SIZE, "cannot redefine type (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
823
    break;
×
824

825
  case REDEFINED_TERM_NAME:
×
826
    nchar = snprintf(buffer, BUFFER_SIZE, "cannot redefine term (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
827
    break;
×
828

829
  case DUPLICATE_NAME_IN_SCALAR:
×
830
    nchar = snprintf(buffer, BUFFER_SIZE, "duplicate name in scalar type definition (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
831
    break;
×
832

833
  case  DUPLICATE_VAR_NAME:
×
834
    nchar = snprintf(buffer, BUFFER_SIZE, "duplicate variable in quantifier (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
835
    break;
×
836

837
  case INTEGER_OVERFLOW:
×
838
    nchar = snprintf(buffer, BUFFER_SIZE, "integer overflow (constant does not fit in 32bits) (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
839
    break;
×
840

841
  case INTEGER_REQUIRED:
×
842
    nchar = snprintf(buffer, BUFFER_SIZE, "integer required (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
843
    break;
×
844

845
  case RATIONAL_REQUIRED:
×
846
    nchar = snprintf(buffer, BUFFER_SIZE, "numeric constant required (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
847
    break;
×
848

849
  case SYMBOL_REQUIRED:
×
850
    nchar = snprintf(buffer, BUFFER_SIZE, "symbol required (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
851
    break;
×
852

853
  case TYPE_REQUIRED:
×
854
    nchar = snprintf(buffer, BUFFER_SIZE, "type required (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
855
    break;
×
856

857
  case NON_CONSTANT_DIVISOR:
×
858
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid division (divisor is not a constant) (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
859
    break;
×
860

861
  case NEGATIVE_BVSIZE:
×
862
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid bitvector size (negative number) (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
863
    break;
×
864

865
  case INVALID_BVCONSTANT:
×
866
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid number in 'mk-bv' (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
867
    break;
×
868

869
  case TYPE_MISMATCH_IN_DEF:
×
870
    nchar = snprintf(buffer, BUFFER_SIZE, "type mismatch in 'define' (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
871
    break;
×
872

873
  case ARITH_ERROR:
×
874
    nchar = snprintf(buffer, BUFFER_SIZE, "error in arithmetic operation (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
875
    break;
×
876

877
  case BVARITH_ERROR:
×
878
    nchar = snprintf(buffer, BUFFER_SIZE, "error in bitvector operation (line %"PRIu32", column %"PRIu32")", error->line, error->column);
×
879
    break;
×
880

881
    /*
882
     * Errors in assertion processing
883
     */
884
  case CTX_FREE_VAR_IN_FORMULA:
×
885
    nchar = snprintf(buffer, BUFFER_SIZE, "assertion contains a free variable");
×
886
    break;
×
887

888
  case CTX_LOGIC_NOT_SUPPORTED:
×
889
    nchar = snprintf(buffer, BUFFER_SIZE, "logic not supported");
×
890
    break;
×
891

892
  case CTX_UF_NOT_SUPPORTED:
×
893
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support uninterpreted functions");
×
894
    break;
×
895

896
  case CTX_ARITH_NOT_SUPPORTED:
×
897
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support arithmetic");
×
898
    break;
×
899

900
  case CTX_BV_NOT_SUPPORTED:
×
901
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support bitvectors");
×
902
    break;
×
903

904
  case CTX_ARRAYS_NOT_SUPPORTED:
×
905
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support arrays or function equalities");
×
906
    break;
×
907

908
  case CTX_QUANTIFIERS_NOT_SUPPORTED:
×
909
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support quantifiers");
×
910
    break;
×
911

912
  case CTX_LAMBDAS_NOT_SUPPORTED:
×
913
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support lambda terms");
×
914
    break;
×
915

916
  case CTX_NONLINEAR_ARITH_NOT_SUPPORTED:
×
917
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support non-linear arithmetic");
×
918
    break;
×
919

920
  case CTX_FORMULA_NOT_IDL:
×
921
    nchar = snprintf(buffer, BUFFER_SIZE, "assertion is not in the IDL fragment");
×
922
    break;
×
923

924
  case CTX_FORMULA_NOT_RDL:
×
925
    nchar = snprintf(buffer, BUFFER_SIZE, "assertion is not in the RDL fragment");
×
926
    break;
×
927

928
  case CTX_TOO_MANY_ARITH_VARS:
×
929
    nchar = snprintf(buffer, BUFFER_SIZE, "too many variables for the arithmetic solver");
×
930
    break;
×
931

932
  case CTX_TOO_MANY_ARITH_ATOMS:
×
933
    nchar = snprintf(buffer, BUFFER_SIZE, "too many atoms for the arithmetic solver");
×
934
    break;
×
935

936
  case CTX_TOO_MANY_BV_VARS:
×
937
    nchar = snprintf(buffer, BUFFER_SIZE, "too many variables for the bitvector solver");
×
938
    break;
×
939

940
  case CTX_TOO_MANY_BV_ATOMS:
×
941
    nchar = snprintf(buffer, BUFFER_SIZE, "too many atoms for the bitvector solver");
×
942
    break;
×
943

944
  case CTX_ARITH_SOLVER_EXCEPTION:
×
945
    nchar = snprintf(buffer, BUFFER_SIZE, "arithmetic solver exception");
×
946
    break;
×
947

948
  case CTX_BV_SOLVER_EXCEPTION:
×
949
    nchar = snprintf(buffer, BUFFER_SIZE, "bitvector solver exception");
×
950
    break;
×
951

952
  case CTX_ARRAY_SOLVER_EXCEPTION:
×
953
    nchar = snprintf(buffer, BUFFER_SIZE, "array solver exception");
×
954
    break;
×
955

956
  case CTX_SCALAR_NOT_SUPPORTED:
×
957
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support scalar types");
×
958
    break;
×
959

960
  case CTX_TUPLE_NOT_SUPPORTED:
×
961
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support tuples");
×
962
    break;
×
963

964
  case CTX_UTYPE_NOT_SUPPORTED:
×
965
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support uninterpreted types");
×
966
    break;
×
967

968
  case CTX_HIGH_ORDER_FUN_NOT_SUPPORTED:
×
969
    nchar = snprintf(buffer, BUFFER_SIZE, "the context does not support high-order functions");
×
970
    break;
×
971

972
  case CTX_INVALID_OPERATION:
×
973
    nchar = snprintf(buffer, BUFFER_SIZE, "the context state does not allow operation");
×
974
    break;
×
975

976
  case CTX_OPERATION_NOT_SUPPORTED:
×
977
    nchar = snprintf(buffer, BUFFER_SIZE, "operation not supported by the context");
×
978
    break;
×
979

980
  case CTX_UNKNOWN_DELEGATE:
×
981
    nchar = snprintf(buffer, BUFFER_SIZE, "unknown delegate");
×
982
    break;
×
983

984
  case CTX_DELEGATE_NOT_AVAILABLE:
×
985
    nchar = snprintf(buffer, BUFFER_SIZE, "delegate not available");
×
986
    break;
×
987

988
  case CTX_EF_ASSERTIONS_CONTAIN_UF:
×
989
    nchar = snprintf(buffer, BUFFER_SIZE, "uninterpreted functions not supported by the exists/forall solver\n");
×
990
    break;
×
991

992
  case CTX_EF_NOT_EXISTS_FORALL:
×
993
    nchar = snprintf(buffer, BUFFER_SIZE, "assertions are not in the exists/forall fragment\n");
×
994
    break;
×
995

996
  case CTX_EF_HIGH_ORDER_VARS:
×
997
    nchar = snprintf(buffer, BUFFER_SIZE, "high-order and tuple variables are not supported\n");
×
998
    break;
×
999

1000
  case CTX_EF_INTERNAL_ERROR:
×
1001
    nchar = snprintf(buffer, BUFFER_SIZE, "the exists/forall solver failed\n");
×
1002
    break;
×
1003

1004
  case CTX_INVALID_CONFIG:
×
1005
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid context configuration");
×
1006
    break;
×
1007

1008
  case CTX_UNKNOWN_PARAMETER:
×
1009
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid parameter");
×
1010
    break;
×
1011

1012
  case CTX_INVALID_PARAMETER_VALUE:
×
1013
    nchar = snprintf(buffer, BUFFER_SIZE, "value not valid for parameter");
×
1014
    break;
×
1015

1016
  case CTX_UNKNOWN_LOGIC:
×
1017
    nchar = snprintf(buffer, BUFFER_SIZE, "unknown logic");
×
1018
    break;
×
1019

1020
  case EVAL_UNKNOWN_TERM:
×
1021
    nchar = snprintf(buffer, BUFFER_SIZE, "eval error: term value not available in the model");
×
1022
    break;
×
1023

1024
  case EVAL_FREEVAR_IN_TERM:
×
1025
    nchar = snprintf(buffer, BUFFER_SIZE, "eval error: free variable in term");
×
1026
    break;
×
1027

1028
  case EVAL_QUANTIFIER:
×
1029
    nchar = snprintf(buffer, BUFFER_SIZE, "eval error: term contains quantifiers");
×
1030
    break;
×
1031

1032
  case EVAL_LAMBDA:
×
1033
    nchar = snprintf(buffer, BUFFER_SIZE, "eval error: term contains lambdas");
×
1034
    break;
×
1035

1036
  case EVAL_OVERFLOW:
×
1037
    nchar = snprintf(buffer, BUFFER_SIZE, "eval error: the term value does not fit the expected type");
×
1038
    break;
×
1039

1040
  case EVAL_FAILED:
×
1041
    nchar = snprintf(buffer, BUFFER_SIZE, "exception in term evaluation");
×
1042
    break;
×
1043

1044
  case EVAL_CONVERSION_FAILED:
×
1045
    nchar = snprintf(buffer, BUFFER_SIZE, "could not convert value (in model) to a term");
×
1046
    break;
×
1047

1048
  case EVAL_NO_IMPLICANT:
×
1049
    nchar = snprintf(buffer, BUFFER_SIZE, "can't build an implicant: input formula is false in the model");
×
1050
    break;
×
1051

1052
  case MDL_UNINT_REQUIRED:
×
1053
    nchar = snprintf(buffer, BUFFER_SIZE, "argument is not an uninterpreted term");
×
1054
    break;
×
1055

1056
  case MDL_CONSTANT_REQUIRED:
×
1057
    nchar = snprintf(buffer, BUFFER_SIZE, "value is not a constant term");
×
1058
    break;
×
1059

1060
  case MDL_DUPLICATE_VAR:
×
1061
    nchar = snprintf(buffer, BUFFER_SIZE, "duplicate term in input array");
×
1062
    break;
×
1063

1064
  case MDL_FTYPE_NOT_ALLOWED: // not used
×
1065
    nchar = snprintf(buffer, BUFFER_SIZE, "function-types are not supported");
×
1066
    break;
×
1067

1068
  case MDL_CONSTRUCTION_FAILED: // not used
×
1069
    nchar = snprintf(buffer, BUFFER_SIZE, "model-construction failed");
×
1070
    break;
×
1071

1072
  case MDL_NONNEG_INT_REQUIRED:
×
1073
    nchar = snprintf(buffer, BUFFER_SIZE, "value must be non-negative");
×
1074
    break;
×
1075

1076
  case YVAL_INVALID_OP:
×
1077
    nchar = snprintf(buffer, BUFFER_SIZE, "invalid operation on yval");
×
1078
    break;
×
1079

1080
  case YVAL_OVERFLOW:
×
1081
    nchar = snprintf(buffer, BUFFER_SIZE, "yval overflow: rational does not fit the expected type");
×
1082
    break;
×
1083

1084
  case MDL_GEN_TYPE_NOT_SUPPORTED:
×
1085
    nchar = snprintf(buffer, BUFFER_SIZE, "generalization failed: bad variable type");
×
1086
    break;
×
1087

1088
  case MDL_GEN_NONLINEAR:
×
1089
    nchar = snprintf(buffer, BUFFER_SIZE, "generalization failed: nonlinear arithmetic");
×
1090
    break;
×
1091

1092
  case MDL_GEN_FAILED:
×
1093
    nchar = snprintf(buffer, BUFFER_SIZE, "generalization failed");
×
1094
    break;
×
1095

1096
  case MDL_GEN_UNSUPPORTED_TERM:
×
1097
    nchar = snprintf(buffer, BUFFER_SIZE, "generalization failed: unsupported term: %s\n", term_kind2str(error->badval));
×
1098
    break;
×
1099

1100
  case OUTPUT_ERROR:
×
1101
    nchar = snprintf(buffer, BUFFER_SIZE, "output error");
×
1102
    break;
×
1103

1104
  case MCSAT_ERROR_UNSUPPORTED_THEORY:
×
1105
    nchar = snprintf(buffer, BUFFER_SIZE, "mcsat: unsupported theory");
×
1106
    break;
×
1107

1108
  case MCSAT_ERROR_ASSUMPTION_TERM_NOT_SUPPORTED:
×
1109
    nchar = snprintf(buffer, BUFFER_SIZE,  "mcsat: checking with assumptions only supports variables as assumptions\n");
×
1110
    break;
×
1111

1112
  case INTERNAL_EXCEPTION:
×
1113
  default:
1114
    nchar = snprintf(buffer, BUFFER_SIZE, "internal error");
×
1115
    break;
×
1116
  }
1117

1118
  // make a copy
1119
  size = nchar + 1;
×
1120
  if (size > BUFFER_SIZE) {
×
1121
    // the buffer is too small
1122
    size = BUFFER_SIZE;
×
1123
  }
1124
  result = (char *) safe_malloc(size);
×
1125
  assert(strlen(buffer) < size);
1126
  strcpy(result, buffer);
×
1127

1128
  return result;
×
1129
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc