Skip to content

Commit

Permalink
add back dotnet after adding ;*.cs to path
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
NikolajBjorner committed Oct 8, 2019
1 parent 5fa177a commit 66b38ea
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 13 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
MT:
cmdLine: 'python scripts/mk_make.py -d --java'
cmdLine: 'python scripts/mk_make.py -d --java --dotnet'
ST:
cmdLine: './configure --single-threaded'
steps:
Expand Down
2 changes: 1 addition & 1 deletion scripts/mk_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ def mk_makefile(self, out):
</PropertyGroup>
<ItemGroup>
<Compile Include="..\%s\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<Compile Include="..\%s\*.cs;*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup>
</Project>""" % (version, key, self.to_src_dir)
Expand Down
3 changes: 2 additions & 1 deletion src/ast/recfun_decl_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace recfun {

class replace {
public:
virtual ~replace() {}
virtual void reset() = 0;
virtual void insert(expr* d, expr* r) = 0;
virtual expr_ref operator()(expr* e) = 0;
Expand Down Expand Up @@ -197,7 +198,7 @@ namespace recfun {
};
}

// Varus utils for recursive functions
// Various utils for recursive functions
class util {
friend class decl::plugin;

Expand Down
1 change: 1 addition & 0 deletions src/ast/rewriter/recfun_replace.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class recfun_replace : public recfun::replace {
expr_safe_replace m_replace;
public:
recfun_replace(ast_manager& m): m(m), m_replace(m) {}
~recfun_replace() override {}
void reset() override { m_replace.reset(); }
void insert(expr* s, expr* t) override { m_replace.insert(s, t); }
expr_ref operator()(expr* e) override { expr_ref r(m); m_replace(e, r); return r; }
Expand Down
32 changes: 27 additions & 5 deletions src/nlsat/nlsat_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ namespace nlsat {
id_gen m_cid_gen;
clause_vector m_clauses; // set of clauses
clause_vector m_learned; // set of learned clauses
clause_vector m_valids;

unsigned m_num_bool_vars;
atom_vector m_atoms; // bool_var -> atom
Expand Down Expand Up @@ -716,11 +717,13 @@ namespace nlsat {
void del_clauses(ptr_vector<clause> & cs) {
for (clause* cp : cs)
del_clause(cp);
cs.reset();
}

void del_clauses() {
del_clauses(m_clauses);
del_clauses(m_learned);
del_clauses(m_valids);
}

// We use a simple heuristic to sort literals
Expand Down Expand Up @@ -843,8 +846,19 @@ namespace nlsat {
TRACE("nlsat", display(tout << "violdated clause: ", *c) << "\n";);
}
}
for (clause* c : m_valids) {
bool found = false;
for (literal lit: *c) {
literal tlit(tr[lit.var()], lit.sign());
found |= checker.value(tlit) == l_true;
}
if (!found) {
IF_VERBOSE(0, display(verbose_stream() << "violdated tautology clause: ", *c) << "\n");
TRACE("nlsat", display(tout << "violdated tautology clause: ", *c) << "\n";);
}
}
UNREACHABLE();
}
VERIFY(r == l_false);
for (bool_var b : tr) {
checker.dec_ref(b);
}
Expand All @@ -858,14 +872,20 @@ namespace nlsat {
out << "(check-sat)\n(reset)\n";
}

clause * mk_clause(unsigned num_lits, literal const * lits, bool learned, _assumption_set a) {
clause * mk_clause_core(unsigned num_lits, literal const * lits, bool learned, _assumption_set a) {
SASSERT(num_lits > 0);
unsigned cid = m_cid_gen.mk();
void * mem = m_allocator.allocate(clause::get_obj_size(num_lits));
clause * cls = new (mem) clause(cid, num_lits, lits, learned, a);
for (unsigned i = 0; i < num_lits; i++)
inc_ref(lits[i]);
inc_ref(a);
return cls;
}

clause * mk_clause(unsigned num_lits, literal const * lits, bool learned, _assumption_set a) {
SASSERT(num_lits > 0);
clause * cls = mk_clause_core(num_lits, lits, learned, a);
++m_lemma_count;
TRACE("nlsat_sort", display(tout << "mk_clause:\n", *cls) << "\n";);
std::sort(cls->begin(), cls->end(), lit_lt(*this));
Expand Down Expand Up @@ -1599,11 +1619,13 @@ namespace nlsat {
}
collect(assumptions, m_clauses);
collect(assumptions, m_learned);
del_clauses(m_valids);
if (m_check_lemmas) {
for (clause* c : m_learned) {
check_lemma(c->size(), c->c_ptr(), false, nullptr);
//check_lemma(c->size(), c->c_ptr(), false, nullptr);
}
}

#if 0
for (clause* c : m_learned) {
IF_VERBOSE(0, display(verbose_stream() << "KEEP: ", c->size(), c->c_ptr()) << "\n");
Expand Down Expand Up @@ -1756,8 +1778,8 @@ namespace nlsat {
tout << "new valid clause:\n";
display(tout, m_lazy_clause.size(), m_lazy_clause.c_ptr()) << "\n";);

if (false && m_check_lemmas) {
check_lemma(m_lazy_clause.size(), m_lazy_clause.c_ptr(), true, nullptr);
if (m_check_lemmas) {
m_valids.push_back(mk_clause_core(m_lazy_clause.size(), m_lazy_clause.c_ptr(), false, nullptr));
}

DEBUG_CODE({
Expand Down
23 changes: 18 additions & 5 deletions src/tactic/fd_solver/bounded_int2bv_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class bounded_int2bv_solver : public solver_na2as {
mutable obj_map<func_decl, rational> m_bv2offset;
mutable bv2int_rewriter_ctx m_rewriter_ctx;
mutable bv2int_rewriter_star m_rewriter;
mutable bool m_flushed;

public:

Expand All @@ -57,7 +58,8 @@ class bounded_int2bv_solver : public solver_na2as {
m_bv_fns(m),
m_int_fns(m),
m_rewriter_ctx(m, p, p.get_uint("max_bv_size", UINT_MAX)),
m_rewriter(m, m_rewriter_ctx)
m_rewriter(m, m_rewriter_ctx),
m_flushed(false)
{
solver::updt_params(p);
m_bounds.push_back(alloc(bound_manager, m));
Expand Down Expand Up @@ -309,6 +311,7 @@ class bounded_int2bv_solver : public solver_na2as {

void flush_assertions() const {
if (m_assertions.empty()) return;
m_flushed = true;
bound_manager& bm = *m_bounds.back();
for (expr* a : m_assertions) {
bm(a);
Expand Down Expand Up @@ -338,13 +341,23 @@ class bounded_int2bv_solver : public solver_na2as {
}

unsigned get_num_assertions() const override {
flush_assertions();
return m_solver->get_num_assertions();
if (m_flushed) {
flush_assertions();
return m_solver->get_num_assertions();
}
else {
return m_assertions.size();
}
}

expr * get_assertion(unsigned idx) const override {
flush_assertions();
return m_solver->get_assertion(idx);
if (m_flushed) {
flush_assertions();
return m_solver->get_assertion(idx);
}
else {
return m_assertions.get(idx);
}
}

};
Expand Down

0 comments on commit 66b38ea

Please sign in to comment.