// ensure type is correct for equality
if (k == EQUAL)
{
- if (!vc.getType().isInteger() && val.getType().isInteger())
+ bool vci = vc.getType().isInteger();
+ bool vi = val.getType().isInteger();
+ if (!vci && vi)
{
val = nm->mkNode(TO_REAL, val);
}
- // note that conversely this utility will never use a real value as
- // the solution for an integer, thus the types should match now
- Assert(val.getType() == vc.getType());
+ else if (vci && !vi)
+ {
+ val = nm->mkNode(TO_INTEGER, val);
+ }
+ Assert(val.getType() == vc.getType())
+ << val << " " << vc << " " << val.getType() << " " << vc.getType();
}
veq = nm->mkNode(k, inOrder ? vc : val, inOrder ? val : vc);
}
regress0/arith/issue8159-rewrite-intreal.smt2
regress0/arith/issue8805-mixed-var-elim.smt2
regress0/arith/issue8905-pi-to-int.smt2
+ regress0/arith/issue8872-msum-types.smt2
+ regress0/arith/issue8872-2-msum-types.smt2
regress0/arith/ite-lift.smt2
regress0/arith/leq.01.smtv1.smt2
regress0/arith/miplib.cvc.smt2
--- /dev/null
+; COMMAND-LINE: --ext-rew-prep=agg
+; EXPECT: sat
+(set-logic ALL)
+(declare-fun a () Real)
+(declare-fun b () Int)
+(declare-fun c () Int)
+(declare-fun d () Int)
+(declare-fun e () Int)
+(assert (let ((?v_2 (* b 1)))(let ((?v_5 (* c 1)))
+(let ((?v_6 (* (ite (< ?v_2 0) ?v_2 0) (ite (< ?v_5 0) ?v_5 0))))
+(= (+ (* a d) e) (- ?v_6))))))
+(check-sat)