3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-05 09:04:07 +00:00

fixup build of example

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-02-27 11:31:06 -08:00
parent 58414ca6df
commit 5a357f9998
4 changed files with 27 additions and 5 deletions

View file

@ -41,7 +41,7 @@ jobs:
- script: sudo apt-get install ocaml opam libgmp-dev
- script: opam init -y
- script: eval `opam config env`; opam install zarith ocamlfind -y
- script: python scripts/mk_make.py --ml
- script: python scripts/mk_make.py --ml --staticlib
- script: |
set -e
cd build
@ -49,6 +49,7 @@ jobs:
make -j3
make -j3 examples
make -j3 test-z3
./ml_example
cd ..
- template: scripts/test-z3.yml
- template: scripts/test-regressions.yml

View file

@ -2215,10 +2215,10 @@ class MLExampleComponent(ExampleComponent):
for mlfile in get_ml_files(self.ex_dir):
out.write(' %s' % os.path.join(self.to_ex_dir, mlfile))
out.write('\n')
out.write('\t%s ' % OCAMLC)
out.write('\tocamlfind %s ' % OCAMLC)
if DEBUG_MODE:
out.write('-g ')
out.write('-custom -o ml_example.byte -I -zarith -I api/ml -cclib "-L. -lz3" zarith.cma z3ml.cma')
out.write('-custom -o ml_example.byte -package zarith -I api/ml -cclib "-L. -lpthread -lstdc++ -lz3" -linkpkg z3ml.cma')
for mlfile in get_ml_files(self.ex_dir):
out.write(' %s/%s' % (self.to_ex_dir, mlfile))
out.write('\n')
@ -2226,10 +2226,10 @@ class MLExampleComponent(ExampleComponent):
for mlfile in get_ml_files(self.ex_dir):
out.write(' %s' % os.path.join(self.to_ex_dir, mlfile))
out.write('\n')
out.write('\t%s ' % OCAMLOPT)
out.write('\tocamlfind %s ' % OCAMLOPT)
if DEBUG_MODE:
out.write('-g ')
out.write('-o ml_example$(EXE_EXT) -I -zarith -I api/ml -cclib "-L. -lz3" zarith.cmxa z3ml.cmxa')
out.write('-o ml_example$(EXE_EXT) -package zarith -I api/ml -cclib "-L. -lpthread -lstdc++ -lz3" -linkpkg z3ml.cmxa')
for mlfile in get_ml_files(self.ex_dir):
out.write(' %s/%s' % (self.to_ex_dir, mlfile))
out.write('\n')

View file

@ -445,5 +445,24 @@ namespace recfun {
UNREACHABLE();
return nullptr;
}
/**
* \brief compute ite nesting depth scores with each sub-expression of e.
*/
void plugin::compute_scores(expr* e, obj_map<expr, unsigned>& scores) {
unsigned max_depth = e->get_depth(e);
u_map<ptr_vector<expr>> by_depth;
obj_map<expr, ptr_vector<expr>> parents;
expr_mark marked;
ptr_vector<expr> es;
es.push_back(e);
by_depth.insert(max_depth, es);
for (unsigned i = max_depth; i > 0; --i) {
// walk deepest terms first.
}
}
void plugin::expand_
}
}

View file

@ -156,6 +156,8 @@ namespace recfun {
case_def_map m_case_defs; // case_pred->def
ast_manager & m() { return *m_manager; }
void compute_scores(expr* e, obj_map<expr, unsigned>& scores);
public:
plugin();
~plugin() override;