abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
giaProp.c File Reference
#include "gia.h"

Go to the source code of this file.

Macros

#define GIA_SAT_SHIFT   12
 DECLARATIONS ///. More...
 
#define GIA_ROOT_MASK
 
#define GIA_PATH00_MASK
 
#define GIA_PATH10_MASK
 
#define GIA_PATH20_MASK
 
#define GIA_PATH30_MASK
 
#define GIA_PATH00_MASK
 
#define GIA_PATH10_MASK
 
#define GIA_PATH20_MASK
 
#define GIA_PATH30_MASK
 

Functions

static int Gia_SatObjIsRoot (Gia_Obj_t *p)
 
static int Gia_SatObjXorRoot (Gia_Obj_t *p)
 
static int Gia_SatObjIsAssigned (Gia_Obj_t *p)
 
static int Gia_SatObjIsHeld (Gia_Obj_t *p)
 
static int Gia_SatObjValue (Gia_Obj_t *p)
 
int Gia_SatPathCheckCutSat_rec (Gia_Obj_t *p, int fCompl)
 FUNCTION DEFINITIONS ///. More...
 
int Gia_SatPathCheckCutSat (Gia_Obj_t *p)
 
int Gia_SatPathUnbind_rec (Gia_Obj_t *p)
 
int Gia_SatPathStart_rec (Gia_Obj_t *p, int fDiffs, int fCompl)
 
int Gia_SatPathStart (Gia_Obj_t *p)
 

Macro Definition Documentation

#define GIA_PATH00_MASK

Definition at line 36 of file giaProp.c.

#define GIA_PATH00_MASK

Definition at line 36 of file giaProp.c.

#define GIA_PATH10_MASK

Definition at line 37 of file giaProp.c.

#define GIA_PATH10_MASK

Definition at line 37 of file giaProp.c.

#define GIA_PATH20_MASK

Definition at line 38 of file giaProp.c.

#define GIA_PATH20_MASK

Definition at line 38 of file giaProp.c.

#define GIA_PATH30_MASK

Definition at line 39 of file giaProp.c.

#define GIA_PATH30_MASK

Definition at line 39 of file giaProp.c.

#define GIA_ROOT_MASK

Definition at line 31 of file giaProp.c.

#define GIA_SAT_SHIFT   12

DECLARATIONS ///.

CFile****************************************************************

FileName [giaProp.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Constraint propagation on the AIG.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
giaProp.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]

Definition at line 30 of file giaProp.c.

Function Documentation

static int Gia_SatObjIsAssigned ( Gia_Obj_t p)
inlinestatic

Definition at line 45 of file giaProp.c.

45 { return 0; }
static int Gia_SatObjIsHeld ( Gia_Obj_t p)
inlinestatic

Definition at line 46 of file giaProp.c.

46 { return 0; }
static int Gia_SatObjIsRoot ( Gia_Obj_t p)
inlinestatic

Definition at line 41 of file giaProp.c.

41 { return 0; }
static int Gia_SatObjValue ( Gia_Obj_t p)
inlinestatic

Definition at line 47 of file giaProp.c.

47 { return 0; }
static int Gia_SatObjXorRoot ( Gia_Obj_t p)
inlinestatic

Definition at line 42 of file giaProp.c.

42 { return 0; }
int Gia_SatPathCheckCutSat ( Gia_Obj_t p)

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

Synopsis [Checks if the give cut is satisfied.]

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file giaProp.c.

88 {
89  int RetValue;
92  RetValue = Gia_SatPathCheckCutSat_rec( p );
94  return RetValue;
95 }
static int Gia_SatObjIsRoot(Gia_Obj_t *p)
Definition: giaProp.c:41
int Gia_SatPathCheckCutSat_rec(Gia_Obj_t *p, int fCompl)
FUNCTION DEFINITIONS ///.
Definition: giaProp.c:65
static int Gia_SatObjXorRoot(Gia_Obj_t *p)
Definition: giaProp.c:42
#define assert(ex)
Definition: util_old.h:213
int Gia_SatPathCheckCutSat_rec ( Gia_Obj_t p,
int  fCompl 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Checks if the give cut is satisfied.]

Description []

SideEffects []

SeeAlso []

Definition at line 65 of file giaProp.c.

66 {
67  if ( Gia_SatObjIsRoot(p) )
68  return Gia_ObjIsAssigned(p) && Gia_SatObjValue(p) == fCompl;
69  if ( Gia_SatObjPath0(p) && !Gia_SatPathCheckCutSat_rec( Gia_ObjFanin0(p), fCompl ^ Gia_ObjFaninC0(p) ) )
70  return 0;
71  if ( Gia_SatObjPath1(p) && !Gia_SatPathCheckCutSat_rec( Gia_ObjFanin1(p), fCompl ^ Gia_ObjFaninC1(p) ) )
72  return 0;
73  return 1;
74 }
static int Gia_SatObjIsRoot(Gia_Obj_t *p)
Definition: giaProp.c:41
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
Definition: gia.h:452
int Gia_SatPathCheckCutSat_rec(Gia_Obj_t *p, int fCompl)
FUNCTION DEFINITIONS ///.
Definition: giaProp.c:65
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
Definition: gia.h:451
static int Gia_SatObjValue(Gia_Obj_t *p)
Definition: giaProp.c:47
int Gia_SatPathStart ( Gia_Obj_t p)

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

Synopsis [Creates a feasible path from the node to a terminal.]

Description []

SideEffects []

SeeAlso []

Definition at line 160 of file giaProp.c.

161 {
162  int RetValue;
163  assert( Gia_SatObjIsRoot(p) );
165  RetValue = Gia_SatPathStart_rec( p, 0, 0 );
167  return RetValue;
168 }
static int Gia_SatObjIsRoot(Gia_Obj_t *p)
Definition: giaProp.c:41
int Gia_SatPathStart_rec(Gia_Obj_t *p, int fDiffs, int fCompl)
Definition: giaProp.c:123
static int Gia_SatObjXorRoot(Gia_Obj_t *p)
Definition: giaProp.c:42
#define assert(ex)
Definition: util_old.h:213
int Gia_SatPathStart_rec ( Gia_Obj_t p,
int  fDiffs,
int  fCompl 
)

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

Synopsis [Creates a feasible path from the node to a terminal.]

Description []

SideEffects []

SeeAlso []

Definition at line 123 of file giaProp.c.

124 {
125  if ( Gia_SatObjIsRoot(p) )
126  return fDiffs && (!Gia_ObjIsAssigned(p) || Gia_SatObjValue(p) != fCompl);
127  if ( fCompl == 0 )
128  {
129  if ( Gia_SatPathStart_rec( Gia_ObjFanin0(p), fDiffs + !Gia_SatObjPath0(p), fCompl ^ Gia_ObjFaninC0(p) ) &&
130  Gia_SatPathStart_rec( Gia_ObjFanin1(p), fDiffs + !Gia_SatObjPath1(p), fCompl ^ Gia_ObjFaninC1(p) ) )
131  return Gia_ObjSetDraftPath0(p) + Gia_ObjSetDraftPath1(p);
132  }
133  else
134  {
135  if ( Gia_SatPathStart_rec( Gia_ObjFanin0(p), fDiffs + !Gia_SatObjPath0(p), fCompl ^ Gia_ObjFaninC0(p) ) )
136  {
137  Gia_ObjUnsetDraftPath1(p);
138  return Gia_ObjSetDraftPath0(p);
139  }
140  if ( Gia_SatPathStart_rec( Gia_ObjFanin1(p), fDiffs + !Gia_SatObjPath1(p), fCompl ^ Gia_ObjFaninC1(p) ) )
141  {
142  Gia_ObjUnsetDraftPath0(p);
143  return Gia_ObjSetDraftPath1(p);
144  }
145  }
146  return 0;
147 }
static int Gia_SatObjIsRoot(Gia_Obj_t *p)
Definition: giaProp.c:41
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
Definition: gia.h:452
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
Definition: gia.h:454
int Gia_SatPathStart_rec(Gia_Obj_t *p, int fDiffs, int fCompl)
Definition: giaProp.c:123
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
Definition: gia.h:455
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
Definition: gia.h:451
static int Gia_SatObjValue(Gia_Obj_t *p)
Definition: giaProp.c:47
int Gia_SatPathUnbind_rec ( Gia_Obj_t p)

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

Synopsis [Unbinds literals on the path.]

Description []

SideEffects []

SeeAlso []

Definition at line 108 of file giaProp.c.

109 {
110 }