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

Go to the source code of this file.

Classes

struct  Msat_Order_t_
 DECLARATIONS ///. More...
 

Macros

#define HLEFT(i)
 
#define HRIGHT(i)
 
#define HPARENT(i)
 
#define HCOMPARE(p, i, j)
 
#define HHEAP(p, i)
 
#define HSIZE(p)
 
#define HOKAY(p, i)
 
#define HINHEAP(p, i)
 
#define HEMPTY(p)
 

Functions

Msat_Order_tMsat_OrderAlloc (Msat_Solver_t *pSat)
 FUNCTION DEFINITIONS ///.
 
void Msat_OrderSetBounds (Msat_Order_t *p, int nVarsMax)
 
void Msat_OrderClean (Msat_Order_t *p, Msat_IntVec_t *vCone)
 
int Msat_OrderCheck (Msat_Order_t *p)
 
void Msat_OrderFree (Msat_Order_t *p)
 
int Msat_OrderVarSelect (Msat_Order_t *p)
 
void Msat_OrderVarAssigned (Msat_Order_t *p, int Var)
 
void Msat_OrderVarUnassigned (Msat_Order_t *p, int Var)
 
void Msat_OrderUpdate (Msat_Order_t *p, int Var)
 

Variables

abctime timeSelect
 DECLARATIONS ///.
 

Macro Definition Documentation

◆ HCOMPARE

#define HCOMPARE ( p,
i,
j )
Value:
((p)->pSat->pdActivity[i] > (p)->pSat->pdActivity[j])
Cube * p
Definition exorList.c:222

Definition at line 47 of file msatOrderH.c.

◆ HEMPTY

#define HEMPTY ( p)
Value:
(HSIZE(p) == 1)
#define HSIZE(p)
Definition msatOrderH.c:49

Definition at line 52 of file msatOrderH.c.

◆ HHEAP

#define HHEAP ( p,
i )
Value:
((p)->vHeap->pArray[i])

Definition at line 48 of file msatOrderH.c.

◆ HINHEAP

#define HINHEAP ( p,
i )
Value:
(HOKAY(p, i) && (p)->vIndex->pArray[i] != 0)
#define HOKAY(p, i)
Definition msatOrderH.c:50

Definition at line 51 of file msatOrderH.c.

◆ HLEFT

#define HLEFT ( i)
Value:
((i)<<1)

Definition at line 44 of file msatOrderH.c.

◆ HOKAY

#define HOKAY ( p,
i )
Value:
((i) >= 0 && (i) < (p)->vIndex->nSize)

Definition at line 50 of file msatOrderH.c.

◆ HPARENT

#define HPARENT ( i)
Value:
((i)>>1)

Definition at line 46 of file msatOrderH.c.

◆ HRIGHT

#define HRIGHT ( i)
Value:
(((i)<<1)+1)

Definition at line 45 of file msatOrderH.c.

◆ HSIZE

#define HSIZE ( p)
Value:
((p)->vHeap->nSize)

Definition at line 49 of file msatOrderH.c.

Function Documentation

◆ Msat_OrderAlloc()

Msat_Order_t * Msat_OrderAlloc ( Msat_Solver_t * pSat)

FUNCTION DEFINITIONS ///.

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

Synopsis [Allocates the ordering structure.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file msatOrderH.c.

79{
81 p = ABC_ALLOC( Msat_Order_t, 1 );
82 memset( p, 0, sizeof(Msat_Order_t) );
83 p->pSat = pSat;
84 p->vIndex = Msat_IntVecAlloc( 0 );
85 p->vHeap = Msat_IntVecAlloc( 0 );
86 Msat_OrderSetBounds( p, pSat->nVarsAlloc );
87 return p;
88}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
struct Msat_Order_t_ Msat_Order_t
Definition msatInt.h:59
void Msat_OrderSetBounds(Msat_Order_t *p, int nVarsMax)
Definition msatOrderH.c:101
Msat_IntVec_t * Msat_IntVecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition msatVec.c:48
char * memset()

◆ Msat_OrderCheck()

int Msat_OrderCheck ( Msat_Order_t * p)

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

Synopsis [Checks that the J-boundary is okay.]

Description []

SideEffects []

SeeAlso []

Definition at line 147 of file msatOrderH.c.

148{
149 return Msat_HeapCheck_rec( p, 1 );
150}

◆ Msat_OrderClean()

void Msat_OrderClean ( Msat_Order_t * p,
Msat_IntVec_t * vCone )

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

Synopsis [Cleans the ordering structure.]

Description []

SideEffects []

SeeAlso []

Definition at line 120 of file msatOrderH.c.

121{
122 int i;
123 for ( i = 0; i < p->vIndex->nSize; i++ )
124 p->vIndex->pArray[i] = 0;
125 for ( i = 0; i < vCone->nSize; i++ )
126 {
127 assert( i+1 < p->vHeap->nCap );
128 p->vHeap->pArray[i+1] = vCone->pArray[i];
129
130 assert( vCone->pArray[i] < p->vIndex->nSize );
131 p->vIndex->pArray[vCone->pArray[i]] = i+1;
132 }
133 p->vHeap->nSize = vCone->nSize + 1;
134}
#define assert(ex)
Definition util_old.h:213

◆ Msat_OrderFree()

void Msat_OrderFree ( Msat_Order_t * p)

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

Synopsis [Frees the ordering structure.]

Description []

SideEffects []

SeeAlso []

Definition at line 163 of file msatOrderH.c.

164{
165 Msat_IntVecFree( p->vHeap );
166 Msat_IntVecFree( p->vIndex );
167 ABC_FREE( p );
168}
#define ABC_FREE(obj)
Definition abc_global.h:267
void Msat_IntVecFree(Msat_IntVec_t *p)
Definition msatVec.c:160

◆ Msat_OrderSetBounds()

void Msat_OrderSetBounds ( Msat_Order_t * p,
int nVarsMax )

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

Synopsis [Sets the bound of the ordering structure.]

Description [Should be called whenever the SAT solver is resized.]

SideEffects []

SeeAlso []

Definition at line 101 of file msatOrderH.c.

102{
103 Msat_IntVecGrow( p->vIndex, nVarsMax );
104 Msat_IntVecGrow( p->vHeap, nVarsMax + 1 );
105 p->vIndex->nSize = nVarsMax;
106 p->vHeap->nSize = 0;
107}
void Msat_IntVecGrow(Msat_IntVec_t *p, int nCapMin)
Definition msatVec.c:299
Here is the caller graph for this function:

◆ Msat_OrderUpdate()

void Msat_OrderUpdate ( Msat_Order_t * p,
int Var )

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

Synopsis [Updates the order after a variable changed weight.]

Description []

SideEffects []

SeeAlso []

Definition at line 257 of file msatOrderH.c.

258{
259// if (heap.inHeap(x))
260// heap.increase(x);
261
262 abctime clk = Abc_Clock();
263 if ( HINHEAP(p,Var) )
264 Msat_HeapIncrease( p, Var );
265timeSelect += Abc_Clock() - clk;
266}
ABC_INT64_T abctime
Definition abc_global.h:332
int Var
Definition exorList.c:228
ABC_NAMESPACE_IMPL_START abctime timeSelect
DECLARATIONS ///.
Definition fraigMan.c:28
#define HINHEAP(p, i)
Definition msatOrderH.c:51

◆ Msat_OrderVarAssigned()

void Msat_OrderVarAssigned ( Msat_Order_t * p,
int Var )

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

Synopsis [Updates J-boundary when the variable is assigned.]

Description []

SideEffects []

SeeAlso []

Definition at line 220 of file msatOrderH.c.

221{
222}

◆ Msat_OrderVarSelect()

int Msat_OrderVarSelect ( Msat_Order_t * p)

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

Synopsis [Selects the next variable to assign.]

Description []

SideEffects []

SeeAlso []

Definition at line 183 of file msatOrderH.c.

184{
185 // Activity based decision:
186// while (!heap.empty()){
187// Var next = heap.getmin();
188// if (toLbool(assigns[next]) == l_Undef)
189// return next;
190// }
191// return var_Undef;
192
193 int Var;
194 abctime clk = Abc_Clock();
195
196 while ( !HEMPTY(p) )
197 {
198 Var = Msat_HeapGetTop(p);
199 if ( (p)->pSat->pAssigns[Var] == MSAT_VAR_UNASSIGNED )
200 {
201//assert( Msat_OrderCheck(p) );
202timeSelect += Abc_Clock() - clk;
203 return Var;
204 }
205 }
206 return MSAT_ORDER_UNKNOWN;
207}
#define MSAT_VAR_UNASSIGNED
Definition msatInt.h:68
#define MSAT_ORDER_UNKNOWN
Definition msatInt.h:70
#define HEMPTY(p)
Definition msatOrderH.c:52

◆ Msat_OrderVarUnassigned()

void Msat_OrderVarUnassigned ( Msat_Order_t * p,
int Var )

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

Synopsis [Updates the order after a variable is unassigned.]

Description []

SideEffects []

SeeAlso []

Definition at line 235 of file msatOrderH.c.

236{
237// if (!heap.inHeap(x))
238// heap.insert(x);
239
240 abctime clk = Abc_Clock();
241 if ( !HINHEAP(p,Var) )
242 Msat_HeapInsert( p, Var );
243timeSelect += Abc_Clock() - clk;
244}

Variable Documentation

◆ timeSelect

abctime timeSelect
extern

DECLARATIONS ///.

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

FileName [fraigMan.c]

PackageName [FRAIG: Functionally reduced AND-INV graphs.]

Synopsis [Implementation of the FRAIG manager.]

Author [Alan Mishchenko alanm.nosp@m.i@ee.nosp@m.cs.be.nosp@m.rkel.nosp@m.ey.ed.nosp@m.u]

Affiliation [UC Berkeley]

Date [Ver. 2.0. Started - October 1, 2004]

Revision [

Id
fraigMan.c,v 1.11 2005/07/08 01:01:31 alanmi Exp

]

Definition at line 28 of file fraigMan.c.