CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
validate_helpers.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Goto program validation helper templates
4
5Author: Daniel Poetzl
6
7\*******************************************************************/
8
9#ifndef CPROVER_UTIL_VALIDATE_HELPERS_H
10#define CPROVER_UTIL_VALIDATE_HELPERS_H
11
12#include <type_traits>
13
14class namespacet;
15enum class validation_modet;
16
17template <typename Base, typename T>
19{
20 static_assert(
21 std::is_base_of<Base, T>::value,
22 "T should be derived from Base");
23
24 void operator()(const Base &base, const validation_modet vm)
25 {
26 T::check(base, vm);
27 }
28};
29
30template <typename Base, typename T>
32{
33 static_assert(
34 std::is_base_of<Base, T>::value,
35 "T should be derived from Base");
36
37 void
38 operator()(const Base &base, const namespacet &ns, const validation_modet vm)
39 {
40 T::validate(base, ns, vm);
41 }
42};
43
44template <typename Base, typename T>
46{
47 static_assert(
48 std::is_base_of<Base, T>::value,
49 "T should be derived from Base");
50
51 void
52 operator()(const Base &base, const namespacet &ns, const validation_modet vm)
53 {
54 T::validate_full(base, ns, vm);
55 }
56};
57
58#endif /* CPROVER_UTIL_VALIDATE_HELPERS_H */
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
void operator()(const Base &base, const validation_modet vm)
void operator()(const Base &base, const namespacet &ns, const validation_modet vm)
void operator()(const Base &base, const namespacet &ns, const validation_modet vm)
validation_modet