GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/printer_options.h Lines: 3 5 60.0 %
Date: 2021-08-06 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mathias Preiner, Aina Niemetz
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 * in the top-level source directory and their institutional affiliations.
9
 * All rights reserved.  See the file COPYING in the top-level source
10
 * directory for licensing information.
11
 * ****************************************************************************
12
 *
13
 * Contains code for handling command-line options.
14
 *
15
 * For each <module>_options.toml configuration file, mkoptions.py
16
 * expands this template and generates a <module>_options.h file.
17
 */
18
19
#include "cvc5_private.h"
20
21
#ifndef CVC5__OPTIONS__PRINTER_H
22
#define CVC5__OPTIONS__PRINTER_H
23
24
#include "options/options.h"
25
26
// clang-format off
27
#include "options/printer_modes.h"
28
// clang-format on
29
30
namespace cvc5 {
31
namespace options {
32
33
// clang-format off
34
35
enum class ModelFormatMode
36
{
37
  DEFAULT,
38
  TABLE
39
};
40
41
static constexpr size_t ModelFormatMode__numValues = 2;
42
43
std::ostream& operator<<(std::ostream& os, ModelFormatMode mode);
44
ModelFormatMode stringToModelFormatMode(const std::string& optarg);
45
enum class PrintInstMode
46
{
47
  LIST,
48
  NUM
49
};
50
51
static constexpr size_t PrintInstMode__numValues = 2;
52
53
std::ostream& operator<<(std::ostream& os, PrintInstMode mode);
54
PrintInstMode stringToPrintInstMode(const std::string& optarg);
55
// clang-format on
56
57
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
58
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
59
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
60
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
61
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
62
63
27401
struct HolderPRINTER
64
{
65
// clang-format off
66
  bool flattenHOChains = false;
67
  bool flattenHOChainsWasSetByUser = false;
68
  InstFormatMode instFormatMode = InstFormatMode::DEFAULT;
69
  bool instFormatModeWasSetByUser = false;
70
  ModelFormatMode modelFormatMode = ModelFormatMode::DEFAULT;
71
  bool modelFormatModeWasSetByUser = false;
72
  bool printInstFull = true;
73
  bool printInstFullWasSetByUser = false;
74
  PrintInstMode printInstMode = PrintInstMode::LIST;
75
  bool printInstModeWasSetByUser = false;
76
// clang-format on
77
};
78
79
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
80
81
// clang-format off
82
extern struct flattenHOChains__option_t
83
{
84
  typedef bool type;
85
  type operator()() const;
86
} thread_local flattenHOChains;
87
extern struct instFormatMode__option_t
88
{
89
  typedef InstFormatMode type;
90
  type operator()() const;
91
} thread_local instFormatMode;
92
extern struct modelFormatMode__option_t
93
{
94
  typedef ModelFormatMode type;
95
  type operator()() const;
96
} thread_local modelFormatMode;
97
extern struct printInstFull__option_t
98
{
99
  typedef bool type;
100
  type operator()() const;
101
} thread_local printInstFull;
102
extern struct printInstMode__option_t
103
{
104
  typedef PrintInstMode type;
105
  type operator()() const;
106
} thread_local printInstMode;
107
// clang-format on
108
109
namespace printer
110
{
111
// clang-format off
112
static constexpr const char* flattenHOChains__name = "flatten-ho-chains";
113
static constexpr const char* instFormatMode__name = "inst-format";
114
static constexpr const char* modelFormatMode__name = "model-format";
115
static constexpr const char* printInstFull__name = "print-inst-full";
116
static constexpr const char* printInstMode__name = "print-inst";
117
// clang-format on
118
}
119
120
}  // namespace options
121
122
// clang-format off
123
124
// clang-format on
125
126
namespace options {
127
// clang-format off
128
inline bool flattenHOChains__option_t::operator()() const
129
{ return Options::current().printer.flattenHOChains; }
130
inline InstFormatMode instFormatMode__option_t::operator()() const
131
{ return Options::current().printer.instFormatMode; }
132
inline ModelFormatMode modelFormatMode__option_t::operator()() const
133
{ return Options::current().printer.modelFormatMode; }
134
2
inline bool printInstFull__option_t::operator()() const
135
2
{ return Options::current().printer.printInstFull; }
136
inline PrintInstMode printInstMode__option_t::operator()() const
137
{ return Options::current().printer.printInstMode; }
138
// clang-format on
139
140
namespace printer
141
{
142
// clang-format off
143
void setDefaultFlattenHOChains(Options& opts, bool value);
144
void setDefaultInstFormatMode(Options& opts, InstFormatMode value);
145
void setDefaultModelFormatMode(Options& opts, ModelFormatMode value);
146
void setDefaultPrintInstFull(Options& opts, bool value);
147
void setDefaultPrintInstMode(Options& opts, PrintInstMode value);
148
// clang-format on
149
}
150
151
}  // namespace options
152
}  // namespace cvc5
153
154
#endif /* CVC5__OPTIONS__PRINTER_H */