Skip to content

Commit 2a93ac3

Browse files
fix #4200
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent 6f48c9c commit 2a93ac3

File tree

3 files changed

+33
-28
lines changed

3 files changed

+33
-28
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,39 +145,32 @@ jobs:
145145
- template: scripts/test-regressions.yml
146146

147147
- job: "WindowsLatest"
148-
displayName: "Windows Latest build"
148+
displayName: "Windows"
149149
pool:
150150
vmImage: "windows-latest"
151151
strategy:
152152
matrix:
153-
x64:
154-
arch: 'x64'
155-
setupCmd1: ''
156-
setupCmd2: ''
157-
setupCmd3: ''
158-
bindings: '-DZ3_BUILD_DOTNET_BINDINGS=True -DZ3_BUILD_JAVA_BINDINGS=True -DZ3_BUILD_PYTHON_BINDINGS=True'
159-
runTests: 'True'
160153
x86:
161154
arch: 'x86'
162155
setupCmd1: ''
163156
setupCmd2: ''
164157
setupCmd3: ''
165158
bindings: '-DZ3_BUILD_PYTHON_BINDINGS=True'
166159
runTests: 'False'
160+
x64:
161+
arch: 'x64'
162+
setupCmd1: 'julia -e "using Pkg; Pkg.add(PackageSpec(name=\"libcxxwrap_julia_jll\", version=\"0.7.0\"))"'
163+
setupCmd2: 'julia -e "using libcxxwrap_julia_jll; print(dirname(libcxxwrap_julia_jll.libcxxwrap_julia_path))" > tmp.env'
164+
setupCmd3: 'set /P JlCxxDir=<tmp.env'
165+
bindings: '-DJlCxx_DIR=%JlCxxDir%\..\lib\cmake\JlCxx -DZ3_BUILD_JULIA_BINDINGS=True -DZ3_BUILD_DOTNET_BINDINGS=True -DZ3_BUILD_JAVA_BINDINGS=True -DZ3_BUILD_PYTHON_BINDINGS=True'
166+
runTests: 'True'
167167
arm64:
168168
arch: 'amd64_arm64'
169169
setupCmd1: ''
170170
setupCmd2: ''
171171
setupCmd3: ''
172172
bindings: ''
173173
runTests: 'False'
174-
Julia:
175-
arch: 'x64'
176-
setupCmd1: 'julia -e "using Pkg; Pkg.add(PackageSpec(name=\"libcxxwrap_julia_jll\", version=\"0.7.0\"))"'
177-
setupCmd2: 'julia -e "using libcxxwrap_julia_jll; print(dirname(libcxxwrap_julia_jll.libcxxwrap_julia_path))" > tmp.env'
178-
setupCmd3: 'set /P JlCxxDir=<tmp.env'
179-
bindings: '-DJlCxx_DIR=%JlCxxDir%\..\lib\cmake\JlCxx -DZ3_BUILD_JULIA_BINDINGS=True'
180-
runTests: 'False'
181174
steps:
182175
- script: md build
183176
- script: |

src/model/model_evaluator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ struct evaluator_cfg : public default_rewriter_cfg {
254254
}
255255
func_interp * fi = m_model.get_func_interp(g);
256256
if (fi && (result = fi->get_array_interp(g))) {
257+
std::cout << g->get_name() << "\n";
258+
std::cout << result << "\n";
257259
model_evaluator ev(m_model, m_params);
258260
result = ev(result);
259261
m_pinned.push_back(result);

src/tactic/core/reduce_args_tactic.cpp

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Module Name:
1818
--*/
1919
#include "tactic/tactical.h"
2020
#include "ast/ast_smt2_pp.h"
21+
#include "ast/array_decl_plugin.h"
2122
#include "ast/has_free_vars.h"
2223
#include "util/map.h"
2324
#include "ast/rewriter/rewriter_def.h"
@@ -83,12 +84,14 @@ tactic * mk_reduce_args_tactic(ast_manager & m, params_ref const & p) {
8384
struct reduce_args_tactic::imp {
8485
ast_manager & m_manager;
8586
bv_util m_bv;
87+
array_util m_ar;
8688

8789
ast_manager & m() const { return m_manager; }
8890

8991
imp(ast_manager & m):
9092
m_manager(m),
91-
m_bv(m) {
93+
m_bv(m),
94+
m_ar(m) {
9295
}
9396

9497
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 {
118121
struct find_non_candidates_proc {
119122
ast_manager & m_manager;
120123
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;
122126

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):
124128
m_manager(m),
125129
m_bv(bv),
126-
m_non_cadidates(non_cadidates) {
130+
m_ar(ar),
131+
m_non_candidates(non_candidates) {
127132
}
128133

129134
void operator()(var * n) {}
130135

131-
void operator()(quantifier * n) {}
136+
void operator()(quantifier *n) {}
132137

133138
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+
}
134144
if (n->get_num_args() == 0)
135145
return; // ignore constants
136-
func_decl * d = n->get_decl();
146+
d = n->get_decl();
137147
if (d->get_family_id() != null_family_id)
138148
return; // ignore interpreted symbols
139-
if (m_non_cadidates.contains(d))
149+
if (m_non_candidates.contains(d))
140150
return; // it is already in the set.
141151
unsigned j = n->get_num_args();
142152
while (j > 0) {
143153
--j;
144154
if (may_be_unique(m_manager, m_bv, n->get_arg(j)))
145155
return;
146156
}
147-
m_non_cadidates.insert(d);
157+
m_non_candidates.insert(d);
148158
}
149159
};
150160

151161
/**
152-
\brief Populate the table non_cadidates with function declarations \c f
162+
\brief Populate the table non_candidates with function declarations \c f
153163
such that there is a function application (f t1 ... tn) where t1 ... tn are not values.
154164
*/
155165
void find_non_candidates(goal const & g, obj_hashtable<func_decl> & non_candidates) {
156166
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);
158168
expr_fast_mark1 visited;
159169
unsigned sz = g.size();
160170
for (unsigned i = 0; i < sz; i++) {
@@ -174,12 +184,12 @@ struct reduce_args_tactic::imp {
174184
struct populate_decl2args_proc {
175185
ast_manager & m_manager;
176186
bv_util & m_bv;
177-
obj_hashtable<func_decl> & m_non_cadidates;
187+
obj_hashtable<func_decl> & m_non_candidates;
178188
obj_map<func_decl, bit_vector> & m_decl2args;
179189
obj_map<func_decl, svector<expr*> > m_decl2base; // for args = base + offset
180190

181191
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) {}
183193

184194
void operator()(var * n) {}
185195
void operator()(quantifier * n) {}
@@ -189,7 +199,7 @@ struct reduce_args_tactic::imp {
189199
func_decl * d = n->get_decl();
190200
if (d->get_family_id() != null_family_id)
191201
return; // ignore interpreted symbols
192-
if (m_non_cadidates.contains(d))
202+
if (m_non_candidates.contains(d))
193203
return; // declaration is not a candidate
194204
unsigned j = n->get_num_args();
195205
obj_map<func_decl, bit_vector>::iterator it = m_decl2args.find_iterator(d);

0 commit comments

Comments
 (0)