RewriteResponse compactAbs (TNode node, bool) {
Assert(node.getKind() == kind::FLOATINGPOINT_ABS);
- if (node[0].getKind() == kind::FLOATINGPOINT_NEG ||
- node[0].getKind() == kind::FLOATINGPOINT_ABS) {
- return RewriteResponse(REWRITE_AGAIN, node[0][0]);
+ if (node[0].getKind() == kind::FLOATINGPOINT_NEG
+ || node[0].getKind() == kind::FLOATINGPOINT_ABS)
+ {
+ Node ret =
+ NodeManager::currentNM()->mkNode(kind::FLOATINGPOINT_ABS, node[0][0]);
+ return RewriteResponse(REWRITE_AGAIN, ret);
}
return RewriteResponse(REWRITE_DONE, node);
regress0/fmf/sort-infer-typed-082718.smt2
regress0/fmf/syn002-si-real-int.smt2
regress0/fmf/tail_rec.smt2
+ regress0/fp/abs-unsound.smt2
+ regress0/fp/abs-unsound2.smt2
regress0/fp/ext-rew-test.smt2
regress0/fp/simple.smt2
regress0/fuzz_1.smt
--- /dev/null
+; REQUIRES: symfpu
+; EXPECT: sat
+(set-logic QF_FP)
+(set-info :status sat)
+(declare-fun x () (_ FloatingPoint 3 5))
+(declare-fun y () (_ FloatingPoint 3 5))
+
+(assert (not (= (fp.abs (fp.abs x)) x)))
+(assert (not (= (fp.abs (fp.neg y)) y)))
+
+(check-sat)
--- /dev/null
+; REQUIRES: symfpu
+; EXPECT: unsat
+(set-logic QF_FP)
+(set-info :status unsat)
+(declare-fun x () (_ FloatingPoint 3 5))
+
+(assert (fp.isNegative (fp.abs (fp.neg x))))
+
+(check-sat)