ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
giaPat.c File Reference
#include "gia.h"
Include dependency graph for giaPat.c:

Go to the source code of this file.

Functions

void Gia_SatCollectCone_rec (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vVisit)
 FUNCTION DEFINITIONS ///.
 
void Gia_SatCollectCone (Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vVisit)
 
void Gia_SatVerifyPattern (Gia_Man_t *p, Gia_Obj_t *pRoot, Vec_Int_t *vCex, Vec_Int_t *vVisit)
 

Function Documentation

◆ Gia_SatCollectCone()

void Gia_SatCollectCone ( Gia_Man_t * p,
Gia_Obj_t * pObj,
Vec_Int_t * vVisit )

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

Synopsis [Collects nodes in the cone and initialized them to x.]

Description []

SideEffects []

SeeAlso []

Definition at line 73 of file giaPat.c.

74{
75 assert( !Gia_IsComplement(pObj) );
76 assert( !Gia_ObjIsConst0(pObj) );
77 assert( Sat_ObjXValue(pObj) == 0 );
78 Vec_IntClear( vVisit );
79 Gia_SatCollectCone_rec( p, pObj, vVisit );
80}
Cube * p
Definition exorList.c:222
void Gia_SatCollectCone_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vVisit)
FUNCTION DEFINITIONS ///.
Definition giaPat.c:48
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_SatCollectCone_rec()

void Gia_SatCollectCone_rec ( Gia_Man_t * p,
Gia_Obj_t * pObj,
Vec_Int_t * vVisit )

FUNCTION DEFINITIONS ///.

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

Synopsis [Collects nodes in the cone and initialized them to x.]

Description []

SideEffects []

SeeAlso []

Definition at line 48 of file giaPat.c.

49{
50 if ( Sat_ObjXValue(pObj) == GIA_UND )
51 return;
52 if ( Gia_ObjIsAnd(pObj) )
53 {
54 Gia_SatCollectCone_rec( p, Gia_ObjFanin0(pObj), vVisit );
55 Gia_SatCollectCone_rec( p, Gia_ObjFanin1(pObj), vVisit );
56 }
57 assert( Sat_ObjXValue(pObj) == 0 );
58 Sat_ObjSetXValue( pObj, GIA_UND );
59 Vec_IntPush( vVisit, Gia_ObjId(p, pObj) );
60}
#define GIA_UND
Definition gia.h:923
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gia_SatVerifyPattern()

void Gia_SatVerifyPattern ( Gia_Man_t * p,
Gia_Obj_t * pRoot,
Vec_Int_t * vCex,
Vec_Int_t * vVisit )

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

Synopsis [Checks if the counter-examples asserts the output.]

Description [Assumes that fMark0 and fMark1 are clean. Leaves them clean.]

SideEffects []

SeeAlso []

Definition at line 93 of file giaPat.c.

94{
95 Gia_Obj_t * pObj;
96 int i, Entry, Value, Value0, Value1;
97 assert( Gia_ObjIsCo(pRoot) );
98 assert( !Gia_ObjIsConst0(Gia_ObjFanin0(pRoot)) );
99 // collect nodes and initialized them to x
100 Gia_SatCollectCone( p, Gia_ObjFanin0(pRoot), vVisit );
101 // set binary values to nodes in the counter-example
102 Vec_IntForEachEntry( vCex, Entry, i )
103// Sat_ObjSetXValue( Gia_ManObj(p, Abc_Lit2Var(Entry)), Abc_LitIsCompl(Entry)? GIA_ZER : GIA_ONE );
104 Sat_ObjSetXValue( Gia_ManCi(p, Abc_Lit2Var(Entry)), Abc_LitIsCompl(Entry)? GIA_ZER : GIA_ONE );
105 // simulate
106 Gia_ManForEachObjVec( vVisit, p, pObj, i )
107 {
108 if ( Gia_ObjIsCi(pObj) )
109 continue;
110 assert( Gia_ObjIsAnd(pObj) );
111 Value0 = Sat_ObjXValue( Gia_ObjFanin0(pObj) );
112 Value1 = Sat_ObjXValue( Gia_ObjFanin1(pObj) );
113 Value = Gia_XsimAndCond( Value0, Gia_ObjFaninC0(pObj), Value1, Gia_ObjFaninC1(pObj) );
114 Sat_ObjSetXValue( pObj, Value );
115 }
116 Value = Sat_ObjXValue( Gia_ObjFanin0(pRoot) );
117 Value = Gia_XsimNotCond( Value, Gia_ObjFaninC0(pRoot) );
118 if ( Value != GIA_ONE )
119 printf( "Gia_SatVerifyPattern(): Verification FAILED.\n" );
120// else
121// printf( "Gia_SatVerifyPattern(): Verification succeeded.\n" );
122// assert( Value == GIA_ONE );
123 // clean the nodes
124 Gia_ManForEachObjVec( vVisit, p, pObj, i )
125 Sat_ObjSetXValue( pObj, 0 );
126}
void Gia_SatCollectCone(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vVisit)
Definition giaPat.c:73
#define GIA_ZER
Definition gia.h:921
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
Definition gia.h:1194
#define GIA_ONE
Definition gia.h:922
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
Here is the call graph for this function: