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 <util/irep.h>
7 
8 #include "smt_terms.h"
9 
10 class smt_responset : protected irept
11 {
12 public:
13  // smt_responset does not support the notion of an empty / null state. Use
14  // std::optional<smt_responset> instead if an empty response is required.
15  smt_responset() = delete;
16 
17  using irept::pretty;
18 
19  bool operator==(const smt_responset &) const;
20  bool operator!=(const smt_responset &) const;
21 
22  template <typename sub_classt>
23  const sub_classt *cast() const &;
24 
25 protected:
26  using irept::irept;
27 };
28 
30 {
31 public:
33 };
34 
36 {
37 public:
38  // smt_responset does not support the notion of an empty / null state. Use
39  // std::optional<smt_responset> instead if an empty response is required.
41 
42  using irept::pretty;
43 
44  bool operator==(const smt_check_sat_response_kindt &) const;
45  bool operator!=(const smt_check_sat_response_kindt &) const;
46 
47  template <typename sub_classt>
48  const sub_classt *cast() const &;
49 
56  template <typename derivedt>
57  class storert
58  {
59  protected:
60  storert();
61  static irept upcast(smt_check_sat_response_kindt check_sat_response_kind);
62  static const smt_check_sat_response_kindt &downcast(const irept &);
63  };
64 
65 protected:
66  using irept::irept;
67 };
68 
70 {
71 public:
73 };
74 
76 {
77 public:
79 };
80 
82 {
83 public:
85 };
86 
88  : public smt_responset,
89  private smt_check_sat_response_kindt::storert<smt_check_sat_responset>
90 {
91 public:
93  const smt_check_sat_response_kindt &kind() const;
94 };
95 
97  : public smt_responset,
98  private smt_termt::storert<smt_get_value_responset>
99 {
100 public:
101  class valuation_pairt : private irept,
102  private smt_termt::storert<valuation_pairt>
103  {
104  public:
105  valuation_pairt() = delete;
106  valuation_pairt(smt_termt descriptor, smt_termt value);
107  valuation_pairt(irep_idt descriptor, const smt_termt &value);
108 
109  using irept::pretty;
110 
111  bool operator==(const valuation_pairt &) const;
112  bool operator!=(const valuation_pairt &) const;
113 
114  const smt_termt &descriptor() const;
115  const smt_termt &value() const;
116 
118  };
119 
120  explicit smt_get_value_responset(std::vector<valuation_pairt> pairs);
121  std::vector<std::reference_wrapper<const valuation_pairt>> pairs() const;
122 };
123 
125 {
126 public:
128 };
129 
131 {
132 public:
133  explicit smt_error_responset(irep_idt message);
134  const irep_idt &message() const;
135 };
136 
137 #endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_RESPONSES_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
There are a large number of kinds of tree structured or tree-like data in CPROVER.
Definition: irep.h:360
irept()=default
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition: irep.cpp:482
Class for adding the ability to up and down cast smt_check_sat_response_kindt to and from irept.
Definition: smt_responses.h:58
const sub_classt * cast() const &
smt_responset()=delete
const sub_classt * cast() const &
bool operator!=(const smt_responset &) const
bool operator==(const smt_responset &) const
Class for adding the ability to up and down cast smt_termt to and from irept.
Definition: smt_terms.h:44