CBMC
smt_responses.h
Go to the documentation of this file.
1 // Author: Diffblue Ltd.
2 
3 #ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_RESPONSES_H
4 #define CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_RESPONSES_H
5 
6 #include "smt_terms.h"
7 #include <util/irep.h>
8 
9 class smt_responset : protected irept
10 {
11 public:
12  // smt_responset does not support the notion of an empty / null state. Use
13  // optionalt<smt_responset> instead if an empty response is required.
14  smt_responset() = delete;
15 
16  using irept::pretty;
17 
18  bool operator==(const smt_responset &) const;
19  bool operator!=(const smt_responset &) const;
20 
21  template <typename sub_classt>
22  const sub_classt *cast() const &;
23 
24 protected:
25  using irept::irept;
26 };
27 
29 {
30 public:
32 };
33 
35 {
36 public:
37  // smt_responset does not support the notion of an empty / null state. Use
38  // optionalt<smt_responset> instead if an empty response is required.
40 
41  using irept::pretty;
42 
43  bool operator==(const smt_check_sat_response_kindt &) const;
44  bool operator!=(const smt_check_sat_response_kindt &) const;
45 
46  template <typename sub_classt>
47  const sub_classt *cast() const &;
48 
55  template <typename derivedt>
56  class storert
57  {
58  protected:
59  storert();
60  static irept upcast(smt_check_sat_response_kindt check_sat_response_kind);
61  static const smt_check_sat_response_kindt &downcast(const irept &);
62  };
63 
64 protected:
65  using irept::irept;
66 };
67 
69 {
70 public:
72 };
73 
75 {
76 public:
78 };
79 
81 {
82 public:
84 };
85 
87  : public smt_responset,
88  private smt_check_sat_response_kindt::storert<smt_check_sat_responset>
89 {
90 public:
92  const smt_check_sat_response_kindt &kind() const;
93 };
94 
96  : public smt_responset,
97  private smt_termt::storert<smt_get_value_responset>
98 {
99 public:
100  class valuation_pairt : private irept,
101  private smt_termt::storert<valuation_pairt>
102  {
103  public:
104  valuation_pairt() = delete;
107 
108  using irept::pretty;
109 
110  bool operator==(const valuation_pairt &) const;
111  bool operator!=(const valuation_pairt &) const;
112 
113  const smt_termt &descriptor() const;
114  const smt_termt &value() const;
115 
117  };
118 
119  explicit smt_get_value_responset(std::vector<valuation_pairt> pairs);
120  std::vector<std::reference_wrapper<const valuation_pairt>> pairs() const;
121 };
122 
124 {
125 public:
127 };
128 
130 {
131 public:
133  const irep_idt &message() const;
134 };
135 
136 #endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_RESPONSES_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
smt_error_responset
Definition: smt_responses.h:129
smt_error_responset::smt_error_responset
smt_error_responset(irep_idt message)
Definition: smt_responses.cpp:176
smt_unsat_responset::smt_unsat_responset
smt_unsat_responset()
Definition: smt_responses.cpp:63
smt_sat_responset
Definition: smt_responses.h:68
smt_check_sat_response_kindt::storert::storert
storert()
Definition: smt_responses.cpp:74
irept::pretty
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition: irep.cpp:495
smt_unsupported_responset
Definition: smt_responses.h:123
smt_get_value_responset::valuation_pairt::descriptor
const smt_termt & descriptor() const
Definition: smt_responses.cpp:126
smt_check_sat_response_kindt::storert::upcast
static irept upcast(smt_check_sat_response_kindt check_sat_response_kind)
Definition: smt_responses.cpp:83
smt_termt
Definition: smt_terms.h:20
smt_unsupported_responset::smt_unsupported_responset
smt_unsupported_responset()
Definition: smt_responses.cpp:171
smt_responset::smt_responset
smt_responset()=delete
smt_check_sat_response_kindt::storert
Class for adding the ability to up and down cast smt_check_sat_response_kindt to and from irept.
Definition: smt_responses.h:56
smt_check_sat_response_kindt
Definition: smt_responses.h:34
smt_unknown_responset::smt_unknown_responset
smt_unknown_responset()
Definition: smt_responses.cpp:68
smt_check_sat_response_kindt::smt_check_sat_response_kindt
smt_check_sat_response_kindt()=delete
smt_get_value_responset
Definition: smt_responses.h:95
irept::irept
irept()=default
smt_get_value_responset::valuation_pairt::valuation_pairt
valuation_pairt()=delete
smt_check_sat_response_kindt::operator!=
bool operator!=(const smt_check_sat_response_kindt &) const
Definition: smt_responses.cpp:48
smt_responset
Definition: smt_responses.h:9
smt_get_value_responset::valuation_pairt::operator==
bool operator==(const valuation_pairt &) const
Definition: smt_responses.cpp:137
smt_get_value_responset::valuation_pairt::operator!=
bool operator!=(const valuation_pairt &) const
Definition: smt_responses.cpp:143
smt_unsat_responset
Definition: smt_responses.h:74
smt_success_responset::smt_success_responset
smt_success_responset()
Definition: smt_responses.cpp:53
smt_check_sat_responset::smt_check_sat_responset
smt_check_sat_responset(smt_check_sat_response_kindt kind)
Definition: smt_responses.cpp:96
smt_check_sat_responset
Definition: smt_responses.h:86
smt_error_responset::message
const irep_idt & message() const
Definition: smt_responses.cpp:182
smt_termt::storert
Class for adding the ability to up and down cast smt_termt to and from irept.
Definition: smt_terms.h:43
smt_check_sat_response_kindt::operator==
bool operator==(const smt_check_sat_response_kindt &) const
Definition: smt_responses.cpp:42
smt_get_value_responset::smt_get_value_responset
smt_get_value_responset(std::vector< valuation_pairt > pairs)
Definition: smt_responses.cpp:148
smt_responset::operator==
bool operator==(const smt_responset &) const
Definition: smt_responses.cpp:13
smt_check_sat_response_kindt::cast
const sub_classt * cast() const &
smt_sat_responset::smt_sat_responset
smt_sat_responset()
Definition: smt_responses.cpp:58
smt_responset::operator!=
bool operator!=(const smt_responset &) const
Definition: smt_responses.cpp:18
smt_get_value_responset::valuation_pairt
Definition: smt_responses.h:100
irept
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition: irep.h:359
smt_get_value_responset::valuation_pairt::value
const smt_termt & value() const
Definition: smt_responses.cpp:131
smt_responset::cast
const sub_classt * cast() const &
Definition: smt_responses.cpp:36
smt_terms.h
smt_check_sat_response_kindt::storert::downcast
static const smt_check_sat_response_kindt & downcast(const irept &)
Definition: smt_responses.cpp:91
smt_unknown_responset
Definition: smt_responses.h:80
smt_get_value_responset::valuation_pairt::smt_get_value_responset
friend smt_get_value_responset
Definition: smt_responses.h:116
irep.h
smt_success_responset
Definition: smt_responses.h:28
smt_get_value_responset::pairs
std::vector< std::reference_wrapper< const valuation_pairt > > pairs() const
Definition: smt_responses.cpp:164
smt_check_sat_responset::kind
const smt_check_sat_response_kindt & kind() const
Definition: smt_responses.cpp:103