|
cprover
|
Type equality. More...
#include "type_eq.h"#include "invariant.h"#include "namespace.h"#include "std_types.h"#include "symbol.h"
Include dependency graph for type_eq.cpp:Go to the source code of this file.
Functions | |
| bool | type_eq (const typet &type1, const typet &type2, const namespacet &ns) |
| Check types for equality at the top level. More... | |
Type equality.
Definition in file type_eq.cpp.
| bool type_eq | ( | const typet & | type1, |
| const typet & | type2, | ||
| const namespacet & | ns | ||
| ) |
Check types for equality at the top level.
If either of the types is a symbol type, i.e., a reference into the symbol table, retrieve it from the namespace and compare but don't do this recursively. For equality across all level in the hierarchy use base_type_eq. Example:
symbol_typet("a") and ns.lookup("a").type will compare equal,struct_typet {symbol_typet("a")} and struct_typet {ns.lookup("a") .type} will not compare equal. | type1 | The first type to compare. |
| type2 | The second type to compare. |
| ns | The namespace, needed for resolution of symbols. |
Definition at line 31 of file type_eq.cpp.