From 3abd02a6234690f1214a9c34e61cc0dc39312c3a Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Tue, 3 Apr 2012 15:08:25 +0000 Subject: [PATCH] Improvement to cbipt. Run unsigned division propagagtor instead of the signed division propagator if both values are positive. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1621 e59a4935-1847-0410-ae03-e826735625c1 --- src/simplifier/constantBitP/ConstantBitP_Division.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/simplifier/constantBitP/ConstantBitP_Division.cpp b/src/simplifier/constantBitP/ConstantBitP_Division.cpp index 34da917..bb485a8 100644 --- a/src/simplifier/constantBitP/ConstantBitP_Division.cpp +++ b/src/simplifier/constantBitP/ConstantBitP_Division.cpp @@ -1119,8 +1119,12 @@ Result bvSignedDivisionBothWays(vector& children, return NO_CHANGE; } - - return bvSignedDivisionRemainderBothWays(children, output, bm, + // unsigned division propagates much better than signed division does! + const int top = children[0]->getWidth(); + if ((*children[0])[top-1] == '0' && (*children[1])[top-1] == '0') + return bvUnsignedDivisionBothWays(children, output, bm); + else + return bvSignedDivisionRemainderBothWays(children, output, bm, bvUnsignedDivisionBothWays, SIGNED_DIVISION); } } -- 2.47.3