ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
smt_tuple.h
Go to the documentation of this file.
1#ifndef _ESBMC_SOLVERS_SMT_TUPLE_SMT_TUPLE_H_
2#define _ESBMC_SOLVERS_SMT_TUPLE_SMT_TUPLE_H_
3
6
21 unsigned int idx,
22 std::size_t size,
23 const type2tc &tuple_type);
24
25// Abstract class defining the interface required for creating tuples.
27{
28public:
34 virtual smt_sortt mk_struct_sort(const type2tc &type) = 0;
35
40 virtual smt_astt tuple_create(const expr2tc &structdef) = 0;
41
45 virtual smt_astt tuple_fresh(smt_sortt s, std::string name = "") = 0;
46
47 // XXX XXX XXX docs gap
49 const type2tc &array_type,
50 smt_astt *inputargs,
51 bool const_array,
52 smt_sortt domain) = 0;
53
60 virtual smt_astt
61 tuple_array_of(const expr2tc &init_value, unsigned long domain_width) = 0;
62
64 virtual smt_astt mk_tuple_symbol(const std::string &name, smt_sortt s) = 0;
65
67 virtual smt_astt mk_tuple_array_symbol(const expr2tc &expr) = 0;
68
71 virtual expr2tc tuple_get(const expr2tc &expr) = 0;
72 virtual expr2tc tuple_get(const type2tc &type, smt_astt a) = 0;
73
76 uint64_t index,
77 const type2tc &subtype) = 0;
78
80 virtual void push_tuple_ctx() {};
81 virtual void pop_tuple_ctx() {};
82
83 virtual ~tuple_iface() = default;
84};
85
86#endif /* _ESBMC_SOLVERS_SMT_TUPLE_SMT_TUPLE_H_ */
Definition toml.hpp:6607
Definition smt_tuple.h:27
virtual void pop_tuple_ctx()
Definition smt_tuple.h:81
virtual smt_astt mk_tuple_array_symbol(const expr2tc &expr)=0
Like mk_tuple_symbol, but for arrays.
virtual smt_astt tuple_array_of(const expr2tc &init_value, unsigned long domain_width)=0
Create a potentially /large/ array of tuples.
virtual void add_tuple_constraints_for_solving()
Definition smt_tuple.h:79
virtual expr2tc tuple_get_array_elem(smt_astt array, uint64_t index, const type2tc &subtype)=0
virtual ~tuple_iface()=default
virtual smt_astt tuple_fresh(smt_sortt s, std::string name="")=0
Create a fresh tuple, with freely valued fields.
virtual smt_astt mk_tuple_symbol(const std::string &name, smt_sortt s)=0
Convert a symbol to a tuple_smt_ast.
virtual smt_astt tuple_array_create(const type2tc &array_type, smt_astt *inputargs, bool const_array, smt_sortt domain)=0
virtual smt_astt tuple_create(const expr2tc &structdef)=0
Create a new tuple from a struct definition.
virtual void push_tuple_ctx()
Definition smt_tuple.h:80
virtual expr2tc tuple_get(const expr2tc &expr)=0
Extract the assignment to a tuple-typed symbol from the SMT solvers model.
virtual expr2tc tuple_get(const type2tc &type, smt_astt a)=0
virtual smt_sortt mk_struct_sort(const type2tc &type)=0
Create a sort representing a struct.
irep_container< type2t > type2tc
Definition irep2.h:430
irep_container< expr2t > expr2tc
Definition irep2.h:431
const smt_ast * smt_astt
Definition smt_ast.h:30
const smt_sort * smt_sortt
Definition smt_sort.h:37
void check_tuple_field(unsigned int idx, std::size_t size, const type2tc &tuple_type)
Reject a tuple field index that the AST cannot hold.
Definition smt_tuple.cpp:6