18
18
#include < util/invariant.h>
19
19
#include < util/irep.h>
20
20
#include < util/mp_arith.h>
21
+ #include < util/optional.h>
21
22
22
23
// / Base class for Abstract Syntax Tree of SMT2 expressions.
23
24
// / Instances of this class are:
39
40
// / - \ref smt2_selector_declarationt, special case of \ref smt2_pairt
40
41
// / - \ref smt2_constructor_declarationt with id \c ID_declaration
41
42
// / - \ref smt2_datatype_declarationt with id \c ID_par
42
- class smt2_astt : public non_sharing_treet <smt2_astt>
43
+ class smt2_astt : public non_sharing_treet <smt2_astt, optionalt<irep_idt> >
43
44
{
44
45
public:
45
46
// / Empty constructor
@@ -69,9 +70,9 @@ class smt2_constantt : public smt2_astt
69
70
}
70
71
71
72
protected:
72
- explicit smt2_constantt (irep_idt id ) : smt2_astt(ID_constant)
73
+ explicit smt2_constantt (irep_idt value ) : smt2_astt(ID_constant)
73
74
{
74
- write ().named_sub [ID_value] = smt2_astt{ std::move (id)} ;
75
+ write ().named_sub = std::move (value) ;
75
76
}
76
77
};
77
78
@@ -96,7 +97,7 @@ class smt2_symbolt : public smt2_astt
96
97
public:
97
98
explicit smt2_symbolt (irep_idt symbol) : smt2_astt(ID_symbol)
98
99
{
99
- write ().named_sub [ID_value] = smt2_astt ( std::move (symbol) );
100
+ write ().named_sub = std::move (symbol);
100
101
}
101
102
};
102
103
@@ -106,7 +107,7 @@ class smt2_string_literalt : public smt2_astt
106
107
explicit smt2_string_literalt (irep_idt literal)
107
108
: smt2_astt(ID_string_constant)
108
109
{
109
- write ().named_sub [ID_value] = smt2_astt (std::move (literal));
110
+ write ().sub . emplace_back (std::move (literal));
110
111
}
111
112
};
112
113
0 commit comments