From bc3d8580c9bf0c28e7aa2b4b9eadac59480dd0bd Mon Sep 17 00:00:00 2001 From: Bernhard Gleiss Date: Tue, 1 Aug 2017 10:12:29 +0200 Subject: [PATCH 1/3] fixed typo in optimized unsat core plugin code --- src/muz/spacer/spacer_unsat_core_plugin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/muz/spacer/spacer_unsat_core_plugin.cpp b/src/muz/spacer/spacer_unsat_core_plugin.cpp index 66abb32c6..5383fdc12 100644 --- a/src/muz/spacer/spacer_unsat_core_plugin.cpp +++ b/src/muz/spacer/spacer_unsat_core_plugin.cpp @@ -330,8 +330,7 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector Date: Tue, 1 Aug 2017 11:06:17 +0200 Subject: [PATCH 2/3] refactored variable names and added comments to min_cut-related methods for unsat-core-computation --- src/muz/spacer/spacer_unsat_core_plugin.cpp | 56 ++++++++++++++++----- src/muz/spacer/spacer_unsat_core_plugin.h | 2 +- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/muz/spacer/spacer_unsat_core_plugin.cpp b/src/muz/spacer/spacer_unsat_core_plugin.cpp index 5383fdc12..0d90d2653 100644 --- a/src/muz/spacer/spacer_unsat_core_plugin.cpp +++ b/src/muz/spacer/spacer_unsat_core_plugin.cpp @@ -588,6 +588,17 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector todo; @@ -603,21 +614,28 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector& todo2) + + void unsat_core_plugin_min_cut::advance_to_lowest_partial_cut(proof* step, ptr_vector& todo) { bool is_sink = true; ast_manager &m = m_learner.m; - ptr_vector todo; + ptr_vector todo_subproof; for (unsigned i = 0, sz = m.get_num_parents(step); i < sz; ++i) { @@ -625,16 +643,16 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vectorget_arg(i))); proof* premise = m.get_parent (current, i); - todo.push_back(premise); + todo_subproof.push_back(premise); } } } @@ -679,6 +699,12 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector cut_nodes; diff --git a/src/muz/spacer/spacer_unsat_core_plugin.h b/src/muz/spacer/spacer_unsat_core_plugin.h index 388a2bd38..743d7af4a 100644 --- a/src/muz/spacer/spacer_unsat_core_plugin.h +++ b/src/muz/spacer/spacer_unsat_core_plugin.h @@ -104,7 +104,7 @@ private: ast_mark m_visited; // saves for each node i whether the subproof with root i has already been added to the min-cut-problem obj_map m_proof_to_node_minus; // maps proof-steps to the corresponding minus-nodes (the ones which are closer to source) obj_map m_proof_to_node_plus; // maps proof-steps to the corresponding plus-nodes (the ones which are closer to sink) - void advance_to_lowest_partial_cut(proof* step, ptr_vector& todo2); + void advance_to_lowest_partial_cut(proof* step, ptr_vector& todo); void add_edge(proof* i, proof* j); vector m_node_to_formula; // maps each node to the corresponding formula in the original proof From 81a7f37acc4013f8ee82f24a2ff3b4918ed53608 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Tue, 1 Aug 2017 18:33:40 +0100 Subject: [PATCH 3/3] Fixed LP tests --- src/test/lp.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/lp.cpp b/src/test/lp.cpp index f76850e38..695a31cf4 100644 --- a/src/test/lp.cpp +++ b/src/test/lp.cpp @@ -2779,7 +2779,7 @@ If b becomes basic variable, then it is likely the old solver ends up with a row vector ev; ls.add_var_bound(a, LE, mpq(1)); ls.solve(); - bound_propagator bp(ls); + lp_bound_propagator bp(ls); ls.propagate_bounds_for_touched_rows(bp); std::cout << " bound ev from test_bound_propagation_one_small_sample1" << std::endl; for (auto & be : bp.m_ibounds) { @@ -2832,7 +2832,7 @@ void test_bound_propagation_one_row() { vector ev; ls.add_var_bound(x0, LE, mpq(1)); ls.solve(); - bound_propagator bp(ls); + lp_bound_propagator bp(ls); ls.propagate_bounds_for_touched_rows(bp); } void test_bound_propagation_one_row_with_bounded_vars() { @@ -2848,7 +2848,7 @@ void test_bound_propagation_one_row_with_bounded_vars() { ls.add_var_bound(x0, LE, mpq(3)); ls.add_var_bound(x0, LE, mpq(1)); ls.solve(); - bound_propagator bp(ls); + lp_bound_propagator bp(ls); ls.propagate_bounds_for_touched_rows(bp); } void test_bound_propagation_one_row_mixed() { @@ -2862,7 +2862,7 @@ void test_bound_propagation_one_row_mixed() { vector ev; ls.add_var_bound(x1, LE, mpq(1)); ls.solve(); - bound_propagator bp(ls); + lp_bound_propagator bp(ls); ls.propagate_bounds_for_touched_rows(bp); } @@ -2885,7 +2885,7 @@ void test_bound_propagation_two_rows() { vector ev; ls.add_var_bound(y, LE, mpq(1)); ls.solve(); - bound_propagator bp(ls); + lp_bound_propagator bp(ls); ls.propagate_bounds_for_touched_rows(bp); } @@ -2905,7 +2905,7 @@ void test_total_case_u() { vector ev; ls.add_var_bound(z, GE, zero_of_type()); ls.solve(); - bound_propagator bp(ls); + lp_bound_propagator bp(ls); ls.propagate_bounds_for_touched_rows(bp); } bool contains_j_kind(unsigned j, lconstraint_kind kind, const mpq & rs, const vector & ev) { @@ -2932,7 +2932,7 @@ void test_total_case_l(){ vector ev; ls.add_var_bound(z, LE, zero_of_type()); ls.solve(); - bound_propagator bp(ls); + lp_bound_propagator bp(ls); ls.propagate_bounds_for_touched_rows(bp); lean_assert(ev.size() == 4); lean_assert(contains_j_kind(x, GE, - one_of_type(), ev));