@@ -704,26 +704,23 @@ struct app_flags {
704
704
unsigned m_ground:1 ; // application does not have free variables or nested quantifiers.
705
705
unsigned m_has_quantifiers:1 ; // application has nested quantifiers.
706
706
unsigned m_has_labels:1 ; // application has nested labels.
707
+ app_flags () : m_depth(1 ), m_ground(1 ), m_has_quantifiers(0 ), m_has_labels(0 ) {}
707
708
};
708
709
709
710
class app : public expr {
710
711
friend class ast_manager ;
711
712
712
713
func_decl * m_decl;
713
714
unsigned m_num_args;
715
+ app_flags m_flags;
714
716
expr * m_args[0 ];
715
717
716
- static app_flags g_constant_flags;
717
-
718
- // remark: store term depth in the end of the app. the depth is only stored if the num_args > 0
719
718
static unsigned get_obj_size (unsigned num_args) {
720
- return num_args == 0 ? sizeof (app) : sizeof (app) + num_args * sizeof (expr *) + sizeof (app_flags );
719
+ return sizeof (app) + num_args * sizeof (expr *);
721
720
}
722
721
723
722
friend class tmp_app ;
724
723
725
- app_flags * flags () const { return m_num_args == 0 ? &g_constant_flags : reinterpret_cast <app_flags*>(const_cast <expr**>(m_args + m_num_args)); }
726
-
727
724
app (func_decl * decl, unsigned num_args, expr * const * args);
728
725
public:
729
726
func_decl * get_decl () const { return m_decl; }
@@ -744,10 +741,10 @@ class app : public expr {
744
741
expr * const * end () const { return m_args + m_num_args; }
745
742
sort * _get_sort () const { return get_decl ()->get_range (); }
746
743
747
- unsigned get_depth () const { return flags ()-> m_depth ; }
748
- bool is_ground () const { return flags ()-> m_ground ; }
749
- bool has_quantifiers () const { return flags ()-> m_has_quantifiers ; }
750
- bool has_labels () const { return flags ()-> m_has_labels ; }
744
+ unsigned get_depth () const { return m_flags. m_depth ; }
745
+ bool is_ground () const { return m_flags. m_ground ; }
746
+ bool has_quantifiers () const { return m_flags. m_has_quantifiers ; }
747
+ bool has_labels () const { return m_flags. m_has_labels ; }
751
748
};
752
749
753
750
// -----------------------------------
0 commit comments