CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
smt_commands.h
Go to the documentation of this file.
1// Author: Diffblue Ltd.
2
3#ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_COMMANDS_H
4#define CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_COMMANDS_H
5
6#include <util/irep.h>
7
8#include "smt_logics.h"
9#include "smt_options.h"
10#include "smt_terms.h"
11
13
14class smt_commandt : protected irept
15{
16public:
17 // smt_commandt does not support the notion of an empty / null state. Use
18 // std::optional<smt_commandt> instead if an empty command is required.
19 smt_commandt() = delete;
20
21 using irept::pretty;
22
23 bool operator==(const smt_commandt &) const;
24 bool operator!=(const smt_commandt &) const;
25
28
29protected:
30 using irept::irept;
31};
32
34 private smt_termt::storert<smt_assert_commandt>
35{
36public:
38 const smt_termt &condition() const;
39};
40
42{
43public:
45};
46
48 : public smt_commandt,
49 private smt_sortt::storert<smt_declare_function_commandt>,
50 private smt_termt::storert<smt_declare_function_commandt>
51{
52public:
55 std::vector<smt_sortt> parameter_sorts);
56 const smt_identifier_termt &identifier() const;
57 const smt_sortt &return_sort() const;
58 std::vector<std::reference_wrapper<const smt_sortt>> parameter_sorts() const;
59
60private:
63};
64
66 : public smt_commandt,
67 private smt_termt::storert<smt_define_function_commandt>
68{
69public:
72 std::vector<smt_identifier_termt> parameters,
74 const smt_identifier_termt &identifier() const;
75 std::vector<std::reference_wrapper<const smt_identifier_termt>>
76 parameters() const;
77 const smt_sortt &return_sort() const;
78 const smt_termt &definition() const;
79};
80
82{
83public:
85};
86
88 protected smt_termt::storert<smt_assert_commandt>
89{
90public:
100 const smt_termt &descriptor() const;
101};
102
104{
105public:
106 explicit smt_push_commandt(std::size_t levels);
107 size_t levels() const;
108};
109
111{
112public:
113 explicit smt_pop_commandt(std::size_t levels);
114 size_t levels() const;
115};
116
118 : public smt_commandt,
119 private smt_logict::storert<smt_set_logic_commandt>
120{
121public:
123 const smt_logict &logic() const;
124};
125
127 : public smt_commandt,
128 private smt_optiont::storert<smt_set_option_commandt>
129{
130public:
132 const smt_optiont &option() const;
133};
134
136{
137public:
138#define COMMAND_ID(the_id) \
139 virtual void visit(const smt_##the_id##_commandt &) = 0;
140#include "smt_commands.def"
141#undef COMMAND_ID
142};
143
147{
148private:
149 std::vector<smt_sortt> parameter_sorts;
151
152public:
153 explicit smt_command_functiont(
155 explicit smt_command_functiont(
157 irep_idt identifier() const;
158 smt_sortt return_sort(const std::vector<smt_termt> &arguments) const;
159 void validate(const std::vector<smt_termt> &arguments) const;
160};
161
162#endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_COMMANDS_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
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:364
irept()=default
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
Definition irep.cpp:482
const smt_termt & condition() const
A function generated from a command.
std::vector< smt_sortt > parameter_sorts
irep_idt identifier() const
smt_sortt return_sort(const std::vector< smt_termt > &arguments) const
smt_identifier_termt _identifier
void validate(const std::vector< smt_termt > &arguments) const
void accept(smt_command_const_downcast_visitort &) const
bool operator==(const smt_commandt &) const
bool operator!=(const smt_commandt &) const
smt_commandt()=delete
const smt_identifier_termt & identifier() const
const smt_sortt & return_sort() const
std::vector< std::reference_wrapper< const smt_sortt > > parameter_sorts() const
const smt_termt & definition() const
const smt_identifier_termt & identifier() const
std::vector< std::reference_wrapper< const smt_identifier_termt > > parameters() const
const smt_sortt & return_sort() const
const smt_termt & descriptor() const
Stores identifiers in unescaped and unquoted form.
Definition smt_terms.h:93
Class for adding the ability to up and down cast smt_logict to and from irept.
Definition smt_logics.h:32
Class for adding the ability to up and down cast smt_optiont to and from irept.
Definition smt_options.h:32
size_t levels() const
size_t levels() const
const smt_logict & logic() const
const smt_optiont & option() const
Class for adding the ability to up and down cast smt_sortt to and from irept.
Definition smt_sorts.h:39
Class for adding the ability to up and down cast smt_termt to and from irept.
Definition smt_terms.h:44