ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
simSymSat.c File Reference
#include "base/abc/abc.h"
#include "proof/fraig/fraig.h"
#include "sim.h"
Include dependency graph for simSymSat.c:

Go to the source code of this file.

Functions

int Sim_SymmsGetPatternUsingSat (Sym_Man_t *p, unsigned *pPattern)
 FUNCTION DEFINITIONS ///.
 

Function Documentation

◆ Sim_SymmsGetPatternUsingSat()

int Sim_SymmsGetPatternUsingSat ( Sym_Man_t * p,
unsigned * pPattern )

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Tries to prove the remaining pairs using SAT.]

Description [Continues to prove as long as it encounters symmetric pairs. Returns 1 if a non-symmetric pair is found (which gives a counter-example). Returns 0 if it finishes considering all pairs for all outputs.]

SideEffects []

SeeAlso []

Definition at line 51 of file simSymSat.c.

52{
53 Vec_Int_t * vSupport;
54 Extra_BitMat_t * pMatSym, * pMatNonSym;
55 int Index1, Index2, Index3, IndexU, IndexV;
56 int v, u, i, k, b, out;
57
58 // iterate through outputs
59 for ( out = p->iOutput; out < p->nOutputs; out++ )
60 {
61 pMatSym = (Extra_BitMat_t *)Vec_PtrEntry( p->vMatrSymms, out );
62 pMatNonSym = (Extra_BitMat_t *)Vec_PtrEntry( p->vMatrNonSymms, out );
63
64 // go through the remaining variable pairs
65 vSupport = Vec_VecEntryInt( p->vSupports, out );
66 Vec_IntForEachEntry( vSupport, v, Index1 )
67 Vec_IntForEachEntryStart( vSupport, u, Index2, Index1+1 )
68 {
69 if ( Extra_BitMatrixLookup1( pMatSym, v, u ) || Extra_BitMatrixLookup1( pMatNonSym, v, u ) )
70 continue;
71 p->nSatRuns++;
72
73 // collect the support variables that are symmetric with u and v
74 Vec_IntClear( p->vVarsU );
75 Vec_IntClear( p->vVarsV );
76 Vec_IntForEachEntry( vSupport, b, Index3 )
77 {
78 if ( Extra_BitMatrixLookup1( pMatSym, u, b ) )
79 Vec_IntPush( p->vVarsU, b );
80 if ( Extra_BitMatrixLookup1( pMatSym, v, b ) )
81 Vec_IntPush( p->vVarsV, b );
82 }
83
84 if ( Sim_SymmsSatProveOne( p, out, v, u, pPattern ) )
85 { // update the symmetric variable info
86 p->nSatRunsUnsat++;
87 Vec_IntForEachEntry( p->vVarsU, i, IndexU )
88 Vec_IntForEachEntry( p->vVarsV, k, IndexV )
89 {
90 Extra_BitMatrixInsert1( pMatSym, i, k ); // Theorem 1
91 Extra_BitMatrixInsert2( pMatSym, i, k ); // Theorem 1
92 Extra_BitMatrixOrTwo( pMatNonSym, i, k ); // Theorem 2
93 }
94 }
95 else
96 { // update the assymmetric variable info
97 p->nSatRunsSat++;
98 Vec_IntForEachEntry( p->vVarsU, i, IndexU )
99 Vec_IntForEachEntry( p->vVarsV, k, IndexV )
100 {
101 Extra_BitMatrixInsert1( pMatNonSym, i, k ); // Theorem 3
102 Extra_BitMatrixInsert2( pMatNonSym, i, k ); // Theorem 3
103 }
104
105 // remember the out
106 p->iOutput = out;
107 p->iVar1Old = p->iVar1;
108 p->iVar2Old = p->iVar2;
109 p->iVar1 = v;
110 p->iVar2 = u;
111 return 1;
112
113 }
114 }
115 // make sure that the symmetry matrix contains only cliques
116 assert( Extra_BitMatrixIsClique( pMatSym ) );
117 }
118
119 // mark that we finished all outputs
120 p->iOutput = p->nOutputs;
121 return 0;
122}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
struct Extra_BitMat_t_ Extra_BitMat_t
Definition extra.h:81
void Extra_BitMatrixInsert1(Extra_BitMat_t *p, int i, int k)
void Extra_BitMatrixOrTwo(Extra_BitMat_t *p, int i, int j)
void Extra_BitMatrixInsert2(Extra_BitMat_t *p, int i, int k)
int Extra_BitMatrixIsClique(Extra_BitMat_t *p)
int Extra_BitMatrixLookup1(Extra_BitMat_t *p, int i, int k)
#define assert(ex)
Definition util_old.h:213
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the call graph for this function:
Here is the caller graph for this function: