|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Base class for all types. More...
#include <irep2.h>
Classes | |
| class | symbolic_type_excp |
| Symbolic type exception class. More... | |
Public Types | |
| enum | type_ids { end_type_id } |
| Enumeration identifying each sort of type. More... | |
| typedef esbmct::function_ref< void(const type2tc &)> | const_subtype_delegate |
| typedef esbmct::function_ref< void(type2tc &)> | subtype_delegate |
| typedef type2tc | container_type |
| typedef type2t | base_type |
Public Member Functions | |
| virtual | ~type2t ()=default |
| unsigned int | get_width () const |
| Fetch bit width of this type. | |
| bool | operator== (const type2t &ref) const |
| bool | operator!= (const type2t &ref) const |
| bool | operator< (const type2t &ref) const |
| std::string | pretty (unsigned int indent=0) const |
| Produce a human-readable string representation of type. | |
| DUMP_METHOD void | dump () const |
| Dump object string representation to stdout. | |
| size_t | crc () const |
| Produce a checksum/hash of the current object. | |
| bool | cmp (const type2t &ref) const |
| Structural comparison. | |
| int | lt (const type2t &ref) const |
| Trinary structural ordering. | |
| list_of_memberst | tostring (unsigned int indent) const |
| Extract a list of members from type as strings. | |
| type2tc | clone () const |
| Clone method. | |
| template<typename T> | |
| void | foreach_subtype (T &&t) const |
| template<typename T> | |
| void | Foreach_subtype (T &&t) |
| Public Member Functions inherited from irep2t | |
| irep2t () noexcept | |
| irep2t (const irep2t &) noexcept | |
| irep2t & | operator= (const irep2t &)=delete |
| virtual | ~irep2t ()=default |
| void | mark_writer () const noexcept |
| void | clear_writer () const noexcept |
Public Attributes | |
| const type_ids | type_id |
| Instance of type_ids recording this types type. | |
| std::atomic< size_t > | crc_val |
| Public Attributes inherited from irep2t | |
| std::atomic< unsigned int > | refcount |
| std::atomic< std::uintptr_t > | writer_thread |
Protected Member Functions | |
| type2t (type_ids id) | |
| Primary constructor. | |
| type2t (const type2t &ref) | |
| Copy constructor. | |
| void | foreach_subtype_impl_const (const_subtype_delegate &t) const |
| void | foreach_subtype_impl (subtype_delegate &t) |
Additional Inherited Members | |
| Static Public Member Functions inherited from irep2t | |
| static std::uintptr_t | current_thread_tag () noexcept |
Base class for all types.
Contains only a type identifier enumeration - for some types (such as bool, or empty,) there's no need for any significant amount of data to be stored.
| typedef type2t type2t::base_type |
| typedef esbmct::function_ref<void(const type2tc &)> type2t::const_subtype_delegate |
| typedef type2tc type2t::container_type |
| typedef esbmct::function_ref<void(type2tc &)> type2t::subtype_delegate |
Enumeration identifying each sort of type.
Driven by type_kinds.inc; see that file's header for the IREP2_TYPE(kind, pretty_name) contract.
| Enumerator | |
|---|---|
| end_type_id | |
|
protected |
Primary constructor.
| id | Type ID of type being constructed |
|
protected |
Copy constructor.
|
virtualdefault |
| type2tc type2t::clone | ( | ) | const |
Clone method.
Self explanatory.
Structural comparison.
Switch-dispatches on type_id and walks the kind's K::fields; returns false immediately when the type_ids differ.
| ref | Reference to type to compare against |
| size_t type2t::crc | ( | ) | const |
Produce a checksum/hash of the current object.
Takes current object and produces a lossy digest of it. Originally used crc32, now uses a more hacky but faster hash function. For use in hash objects.
| void type2t::dump | ( | ) | const |
Dump object string representation to stdout.
This take the output of the pretty method, and dumps it to stdout. To be used for debugging and when single stepping in gdb.
|
protected |
|
protected |
| unsigned int type2t::get_width | ( | ) | const |
Fetch bit width of this type.
For a particular type, calculate its size in a bit representation of itself. May throw various exceptions depending on whether this operation is viable - for example, for symbol types, infinite sized or dynamically sized arrays.
Note that the bit width is not the same as the ansi-c byte model representation of this type.
| std::string type2t::pretty | ( | unsigned int | indent = 0 | ) | const |
Produce a human-readable string representation of type.
| indent | Number of spaces to indent lines by in the output |
| list_of_memberst type2t::tostring | ( | unsigned int | indent | ) | const |
Extract a list of members from type as strings.
Produces a list of pairs, mapping a member name to a string value. Used in the body of the pretty method.
| indent | Number of spaces to indent output strings with, if multiline |
|
mutable |