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

lia2card simplifications, move up before elim01 (which could be deprecated)

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-02-07 12:56:30 -08:00
parent 43441d0fd5
commit bee4716a85
7 changed files with 55 additions and 10 deletions

View file

@ -735,8 +735,8 @@ namespace opt {
tactic_ref tac1, tac2, tac3, tac4;
if (optp.elim_01()) {
tac1 = mk_dt2bv_tactic(m);
tac2 = mk_elim01_tactic(m);
tac3 = mk_lia2card_tactic(m);
tac2 = mk_lia2card_tactic(m);
tac3 = mk_elim01_tactic(m);
tac4 = mk_eq2bv_tactic(m);
params_ref lia_p;
lia_p.set_bool("compile_equality", optp.pb_compile_equality());

View file

@ -386,6 +386,26 @@ private:
in.skip_line();
continue;
}
bool neg = false;
if (c == '-') {
in.next();
c = in.ch();
m_buffer.reset();
m_buffer.push_back('-');
if (is_num(c)) {
neg = true;
}
else {
while (!is_ws(c) && !in.eof()) {
m_buffer.push_back(c);
in.next();
c = in.ch();
}
m_buffer.push_back(0);
m_tokens.push_back(asymbol(symbol(m_buffer.c_ptr()), in.line()));
continue;
}
}
if (is_num(c)) {
rational n(0);
@ -405,6 +425,7 @@ private:
}
}
if (div > 1) n = n / rational(div);
if (neg) n.neg();
m_tokens.push_back(asymbol(n, in.line()));
continue;
}
@ -453,6 +474,7 @@ private:
c == '{' ||
c == '}' ||
c == ',' ||
c == '_' ||
c == '.' ||
c == ';' ||
c == '?' ||
@ -687,13 +709,16 @@ private:
tok.next(2);
}
}
if (peek_le(1) && tok.peek_num(2)) {
else if (peek_le(1) && tok.peek_num(2)) {
v = peek(0);
tok.next(2);
rational rhs = tok.get_num(0);
update_upper(v, rhs);
tok.next(1);
}
else {
error("bound expected");
}
}
void update_lower(rational const& r, symbol const& v) {