summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-07-30 11:05:54 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-07-30 11:05:54 -0700
commitcd39fd6b0585659922908d172b0d058a5cb02dbb (patch)
tree47e0bce1b658026e15ba4f0d3373bb74b680c908 /src
parent401aa6994a63ad60d51ac894dc5ef4141ca33f1a (diff)
downloadabc-cd39fd6b0585659922908d172b0d058a5cb02dbb.tar.gz
abc-cd39fd6b0585659922908d172b0d058a5cb02dbb.tar.bz2
abc-cd39fd6b0585659922908d172b0d058a5cb02dbb.zip
Fixing performance bug with old proof-logging (adding clauses multiple times).
Diffstat (limited to 'src')
-rw-r--r--src/aig/gia/giaAbsGla.c26
-rw-r--r--src/misc/vec/vecInt.h22
-rw-r--r--src/sat/bsat/satProof.c1
3 files changed, 32 insertions, 17 deletions
diff --git a/src/aig/gia/giaAbsGla.c b/src/aig/gia/giaAbsGla.c
index b8c13e38..a76e291e 100644
--- a/src/aig/gia/giaAbsGla.c
+++ b/src/aig/gia/giaAbsGla.c
@@ -1180,7 +1180,8 @@ Gla_Man_t * Gla_ManStart( Gia_Man_t * pGia0, Gia_ParVta_t * pPars )
Vec_IntPush( p->vAbs, Gla_ObjId(p, pGla) );
}
// other
- p->pSat = sat_solver2_new();
+ p->pSat = sat_solver2_new();
+// p->pSat->pPrf1 = Vec_SetAlloc( 20 );
// p->pSat->fVerbose = p->pPars->fVerbose;
// sat_solver2_set_learntmax( p->pSat, pPars->nLearnedMax );
p->pSat->nLearntStart = p->pPars->nLearnedStart;
@@ -1574,7 +1575,7 @@ void Gia_GlaAddToCounters( Gla_Man_t * p, Vec_Int_t * vCore )
void Gia_GlaAddToAbs( Gla_Man_t * p, Vec_Int_t * vAbsAdd, int fCheck )
{
Gla_Obj_t * pGla;
- int i, Counter = 0;
+ int i, k = 0;
Gla_ManForEachObjAbsVec( vAbsAdd, p, pGla, i )
{
if ( fCheck )
@@ -1585,18 +1586,12 @@ void Gia_GlaAddToAbs( Gla_Man_t * p, Vec_Int_t * vAbsAdd, int fCheck )
}
if ( pGla->fAbs )
continue;
-
- if ( !fCheck )
- {
- Counter++;
-// printf( "%d ", Gla_ObjId(p, pGla) );
- }
-
pGla->fAbs = 1;
Vec_IntPush( p->vAbs, Gla_ObjId(p, pGla) );
+ // filter clauses to remove those contained in the abstraction
+ Vec_IntWriteEntry( vAbsAdd, k++, Gla_ObjId(p, pGla) );
}
-// if ( Counter )
-// printf( " Total = %d\n", Counter );
+ Vec_IntShrink( vAbsAdd, k );
}
void Gia_GlaAddTimeFrame( Gla_Man_t * p, int f )
{
@@ -1951,16 +1946,14 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
// assert( (vCore != NULL) == (Status == 1) );
if ( Status == -1 || (p->pSat->nRuntimeLimit && clock() > p->pSat->nRuntimeLimit) ) // resource limit is reached
{
- if ( p->pSat->pPrf2 )
- Prf_ManStopP( &p->pSat->pPrf2 );
+ Prf_ManStopP( &p->pSat->pPrf2 );
if ( Gia_ManRegNum(p->pGia) > 1 ) // for comb cases, return the abstration
Gla_ManRollBack( p );
goto finish;
}
if ( Status == 1 )
{
- if ( p->pSat->pPrf2 )
- Prf_ManStopP( &p->pSat->pPrf2 );
+ Prf_ManStopP( &p->pSat->pPrf2 );
p->timeUnsat += clock() - clk2;
break;
}
@@ -1987,8 +1980,7 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta )
vPPis = Gla_ManRefinement( p );
if ( vPPis == NULL )
{
- if ( p->pSat->pPrf2 )
- Prf_ManStopP( &p->pSat->pPrf2 );
+ Prf_ManStopP( &p->pSat->pPrf2 );
pCex = p->pGia->pCexSeq; p->pGia->pCexSeq = NULL;
break;
}
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index 84d53e46..6988c8ea 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -1055,6 +1055,28 @@ static inline int Vec_IntCountPositive( Vec_Int_t * p )
/**Function*************************************************************
+ Synopsis [Checks if two vectors are equal.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int Vec_IntEqual( Vec_Int_t * p1, Vec_Int_t * p2 )
+{
+ int i;
+ if ( p1->nSize != p2->nSize )
+ return 0;
+ for ( i = 0; i < p1->nSize; i++ )
+ if ( p1->pArray[i] != p2->pArray[i] )
+ return 0;
+ return 1;
+}
+
+/**Function*************************************************************
+
Synopsis [Counts the number of common entries.]
Description [Assumes that the entries are non-negative integers that
diff --git a/src/sat/bsat/satProof.c b/src/sat/bsat/satProof.c
index 5e2ce067..e70a60ef 100644
--- a/src/sat/bsat/satProof.c
+++ b/src/sat/bsat/satProof.c
@@ -921,6 +921,7 @@ void * Proof_DeriveCore( Vec_Set_t * vProof, int hRoot )
// collect core clauses
vCore = Sat_ProofCollectCore( vProof, vUsed );
Vec_IntFree( vUsed );
+ Vec_IntSort( vCore, 1 );
return vCore;
}