GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/printer_options.h Lines: 3 5 60.0 %
Date: 2021-05-22 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
  TABLE,
38
  DEFAULT
39
};
40
std::ostream& operator<<(std::ostream& os, ModelFormatMode mode);
41
ModelFormatMode stringToModelFormatMode(const std::string& optarg);
42
enum class PrintInstMode
43
{
44
  LIST,
45
  NUM
46
};
47
std::ostream& operator<<(std::ostream& os, PrintInstMode mode);
48
PrintInstMode stringToPrintInstMode(const std::string& optarg);
49
// clang-format on
50
51
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
52
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
53
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
54
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
55
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
56
57
25268
struct HolderPRINTER
58
{
59
// clang-format off
60
  bool flattenHOChains = false;\
61
  bool flattenHOChains__setByUser__ = false;
62
  InstFormatMode instFormatMode = InstFormatMode::DEFAULT;\
63
  bool instFormatMode__setByUser__ = false;
64
  ModelFormatMode modelFormatMode = ModelFormatMode::DEFAULT;\
65
  bool modelFormatMode__setByUser__ = false;
66
  bool printInstFull = true;\
67
  bool printInstFull__setByUser__ = false;
68
  PrintInstMode printInstMode = PrintInstMode::LIST;\
69
  bool printInstMode__setByUser__ = false;
70
// clang-format on
71
};
72
73
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
74
75
// clang-format off
76
extern struct flattenHOChains__option_t
77
{
78
  typedef bool type;
79
  type operator()() const;
80
} thread_local flattenHOChains;
81
extern struct instFormatMode__option_t
82
{
83
  typedef InstFormatMode type;
84
  type operator()() const;
85
} thread_local instFormatMode;
86
extern struct modelFormatMode__option_t
87
{
88
  typedef ModelFormatMode type;
89
  type operator()() const;
90
} thread_local modelFormatMode;
91
extern struct printInstFull__option_t
92
{
93
  typedef bool type;
94
  type operator()() const;
95
} thread_local printInstFull;
96
extern struct printInstMode__option_t
97
{
98
  typedef PrintInstMode type;
99
  type operator()() const;
100
} thread_local printInstMode;
101
// clang-format on
102
103
namespace printer
104
{
105
// clang-format off
106
static constexpr const char* flattenHOChains__name = "flatten-ho-chains";
107
static constexpr const char* instFormatMode__name = "inst-format";
108
static constexpr const char* modelFormatMode__name = "model-format";
109
static constexpr const char* printInstFull__name = "print-inst-full";
110
static constexpr const char* printInstMode__name = "print-inst";
111
// clang-format on
112
}
113
114
}  // namespace options
115
116
// clang-format off
117
template <> options::flattenHOChains__option_t::type& Options::ref(
118
    options::flattenHOChains__option_t);
119
template <> const options::flattenHOChains__option_t::type& Options::operator[](
120
    options::flattenHOChains__option_t) const;
121
template <> bool Options::wasSetByUser(options::flattenHOChains__option_t) const;
122
template <> options::instFormatMode__option_t::type& Options::ref(
123
    options::instFormatMode__option_t);
124
template <> const options::instFormatMode__option_t::type& Options::operator[](
125
    options::instFormatMode__option_t) const;
126
template <> bool Options::wasSetByUser(options::instFormatMode__option_t) const;
127
template <> options::modelFormatMode__option_t::type& Options::ref(
128
    options::modelFormatMode__option_t);
129
template <> const options::modelFormatMode__option_t::type& Options::operator[](
130
    options::modelFormatMode__option_t) const;
131
template <> bool Options::wasSetByUser(options::modelFormatMode__option_t) const;
132
template <> options::printInstFull__option_t::type& Options::ref(
133
    options::printInstFull__option_t);
134
template <> const options::printInstFull__option_t::type& Options::operator[](
135
    options::printInstFull__option_t) const;
136
template <> bool Options::wasSetByUser(options::printInstFull__option_t) const;
137
template <> options::printInstMode__option_t::type& Options::ref(
138
    options::printInstMode__option_t);
139
template <> const options::printInstMode__option_t::type& Options::operator[](
140
    options::printInstMode__option_t) const;
141
template <> bool Options::wasSetByUser(options::printInstMode__option_t) const;
142
// clang-format on
143
144
namespace options {
145
// clang-format off
146
inline flattenHOChains__option_t::type flattenHOChains__option_t::operator()() const
147
{
148
  return Options::current()[*this];
149
}
150
inline instFormatMode__option_t::type instFormatMode__option_t::operator()() const
151
{
152
  return Options::current()[*this];
153
}
154
inline modelFormatMode__option_t::type modelFormatMode__option_t::operator()() const
155
{
156
  return Options::current()[*this];
157
}
158
2
inline printInstFull__option_t::type printInstFull__option_t::operator()() const
159
{
160
2
  return Options::current()[*this];
161
}
162
inline printInstMode__option_t::type printInstMode__option_t::operator()() const
163
{
164
  return Options::current()[*this];
165
}
166
// clang-format on
167
168
}  // namespace options
169
}  // namespace cvc5
170
171
#endif /* CVC5__OPTIONS__PRINTER_H */