@@ -18,6 +18,7 @@ Module Name:
18
18
--*/
19
19
#include " tactic/tactical.h"
20
20
#include " ast/ast_smt2_pp.h"
21
+ #include " ast/array_decl_plugin.h"
21
22
#include " ast/has_free_vars.h"
22
23
#include " util/map.h"
23
24
#include " ast/rewriter/rewriter_def.h"
@@ -83,12 +84,14 @@ tactic * mk_reduce_args_tactic(ast_manager & m, params_ref const & p) {
83
84
struct reduce_args_tactic ::imp {
84
85
ast_manager & m_manager;
85
86
bv_util m_bv;
87
+ array_util m_ar;
86
88
87
89
ast_manager & m () const { return m_manager; }
88
90
89
91
imp (ast_manager & m):
90
92
m_manager (m),
91
- m_bv (m) {
93
+ m_bv (m),
94
+ m_ar (m) {
92
95
}
93
96
94
97
static bool is_var_plus_offset (ast_manager& m, bv_util& bv, expr* e, expr*& base) {
@@ -118,43 +121,50 @@ struct reduce_args_tactic::imp {
118
121
struct find_non_candidates_proc {
119
122
ast_manager & m_manager;
120
123
bv_util & m_bv;
121
- obj_hashtable<func_decl> & m_non_cadidates;
124
+ array_util & m_ar;
125
+ obj_hashtable<func_decl> & m_non_candidates;
122
126
123
- find_non_candidates_proc (ast_manager & m, bv_util & bv, obj_hashtable<func_decl> & non_cadidates ):
127
+ find_non_candidates_proc (ast_manager & m, bv_util & bv, array_util& ar, obj_hashtable<func_decl> & non_candidates ):
124
128
m_manager (m),
125
129
m_bv (bv),
126
- m_non_cadidates (non_cadidates) {
130
+ m_ar (ar),
131
+ m_non_candidates (non_candidates) {
127
132
}
128
133
129
134
void operator ()(var * n) {}
130
135
131
- void operator ()(quantifier * n) {}
136
+ void operator ()(quantifier *n) {}
132
137
133
138
void operator ()(app * n) {
139
+ func_decl * d;
140
+ if (m_ar.is_as_array (n, d)) {
141
+ m_non_candidates.insert (d);
142
+ return ;
143
+ }
134
144
if (n->get_num_args () == 0 )
135
145
return ; // ignore constants
136
- func_decl * d = n->get_decl ();
146
+ d = n->get_decl ();
137
147
if (d->get_family_id () != null_family_id)
138
148
return ; // ignore interpreted symbols
139
- if (m_non_cadidates .contains (d))
149
+ if (m_non_candidates .contains (d))
140
150
return ; // it is already in the set.
141
151
unsigned j = n->get_num_args ();
142
152
while (j > 0 ) {
143
153
--j;
144
154
if (may_be_unique (m_manager, m_bv, n->get_arg (j)))
145
155
return ;
146
156
}
147
- m_non_cadidates .insert (d);
157
+ m_non_candidates .insert (d);
148
158
}
149
159
};
150
160
151
161
/* *
152
- \brief Populate the table non_cadidates with function declarations \c f
162
+ \brief Populate the table non_candidates with function declarations \c f
153
163
such that there is a function application (f t1 ... tn) where t1 ... tn are not values.
154
164
*/
155
165
void find_non_candidates (goal const & g, obj_hashtable<func_decl> & non_candidates) {
156
166
non_candidates.reset ();
157
- find_non_candidates_proc proc (m_manager, m_bv, non_candidates);
167
+ find_non_candidates_proc proc (m_manager, m_bv, m_ar, non_candidates);
158
168
expr_fast_mark1 visited;
159
169
unsigned sz = g.size ();
160
170
for (unsigned i = 0 ; i < sz; i++) {
@@ -174,12 +184,12 @@ struct reduce_args_tactic::imp {
174
184
struct populate_decl2args_proc {
175
185
ast_manager & m_manager;
176
186
bv_util & m_bv;
177
- obj_hashtable<func_decl> & m_non_cadidates ;
187
+ obj_hashtable<func_decl> & m_non_candidates ;
178
188
obj_map<func_decl, bit_vector> & m_decl2args;
179
189
obj_map<func_decl, svector<expr*> > m_decl2base; // for args = base + offset
180
190
181
191
populate_decl2args_proc (ast_manager & m, bv_util & bv, obj_hashtable<func_decl> & nc, obj_map<func_decl, bit_vector> & d):
182
- m_manager (m), m_bv(bv), m_non_cadidates (nc), m_decl2args(d) {}
192
+ m_manager (m), m_bv(bv), m_non_candidates (nc), m_decl2args(d) {}
183
193
184
194
void operator ()(var * n) {}
185
195
void operator ()(quantifier * n) {}
@@ -189,7 +199,7 @@ struct reduce_args_tactic::imp {
189
199
func_decl * d = n->get_decl ();
190
200
if (d->get_family_id () != null_family_id)
191
201
return ; // ignore interpreted symbols
192
- if (m_non_cadidates .contains (d))
202
+ if (m_non_candidates .contains (d))
193
203
return ; // declaration is not a candidate
194
204
unsigned j = n->get_num_args ();
195
205
obj_map<func_decl, bit_vector>::iterator it = m_decl2args.find_iterator (d);
0 commit comments