Skip to content

Commit 4e33b44

Browse files
committed
add lemma.is_empty()
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 5bda42e commit 4e33b44

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/math/lp/nla_core.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,12 @@ lemma_builder::~lemma_builder() {
10671067
TRACE(nla_solver, tout << name << " " << (++i) << "\n" << *this; );
10681068
}
10691069

1070-
lemma& lemma_builder::current() const {
1070+
lemma& lemma_builder::current() {
1071+
return c.m_lemmas.back();
1072+
}
1073+
const lemma& lemma_builder::current() const {
10711074
return c.m_lemmas.back();
10721075
}
1073-
10741076
lemma_builder& lemma_builder::operator&=(lp::explanation const& e) {
10751077
expl().add_expl(e);
10761078
return *this;

src/math/lp/nla_types.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ namespace nla {
6060
lp::explanation& expl() { return m_expl; }
6161
const lp::explanation& expl() const { return m_expl; }
6262
bool is_conflict() const { return m_ineqs.empty() && !m_expl.empty(); }
63+
bool is_empty() const { return m_ineqs.empty() && m_expl.empty(); }
6364
};
6465

6566
class core;
@@ -72,12 +73,13 @@ namespace nla {
7273
class lemma_builder {
7374
char const* name;
7475
core& c;
75-
lemma& current() const;
76+
// the non-const version is private
77+
lemma& current();
78+
const lemma& current() const;
7679

7780
public:
7881
lemma_builder(core& c, char const* name);
7982
~lemma_builder();
80-
lemma& operator()() { return current(); }
8183
std::ostream& display(std::ostream& out) const;
8284
lemma_builder& operator&=(lp::explanation const& e);
8385
lemma_builder& operator&=(const monic& m);

0 commit comments

Comments
 (0)