Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
37fd73cf
Commit
37fd73cf
authored
Mar 30, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new code to verify invariant derived by 'pdr'.
parent
2f926f2f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
3 deletions
+87
-3
src/proof/pdr/pdrInv.c
+82
-0
src/proof/pdr/pdrMan.c
+1
-1
src/sat/bmc/bmcBmc3.c
+4
-2
No files found.
src/proof/pdr/pdrInv.c
View file @
37fd73cf
...
...
@@ -229,6 +229,87 @@ void Pdr_ManPrintClauses( Pdr_Man_t * p, int kStart )
SeeAlso []
***********************************************************************/
void
Pdr_SetPrintOne
(
Pdr_Set_t
*
p
)
{
int
i
;
printf
(
"Clause: {"
);
for
(
i
=
0
;
i
<
p
->
nLits
;
i
++
)
printf
(
" %s%d"
,
Abc_LitIsCompl
(
p
->
Lits
[
i
])
?
"!"
:
""
,
Abc_Lit2Var
(
p
->
Lits
[
i
])
);
printf
(
" }
\n
"
);
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Aig_Man_t
*
Pdr_ManDupAigWithClauses
(
Aig_Man_t
*
p
,
Vec_Ptr_t
*
vCubes
)
{
Aig_Man_t
*
pNew
;
Aig_Obj_t
*
pObj
,
*
pObjNew
,
*
pLit
;
Pdr_Set_t
*
pCube
;
int
i
,
n
;
// create the new manager
pNew
=
Aig_ManStart
(
Aig_ManObjNumMax
(
p
)
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
pNew
->
pSpec
=
Abc_UtilStrsav
(
p
->
pSpec
);
// create the PIs
Aig_ManCleanData
(
p
);
Aig_ManConst1
(
p
)
->
pData
=
Aig_ManConst1
(
pNew
);
Aig_ManForEachCi
(
p
,
pObj
,
i
)
pObj
->
pData
=
Aig_ObjCreateCi
(
pNew
);
// create outputs for each cube
Vec_PtrForEachEntry
(
Pdr_Set_t
*
,
vCubes
,
pCube
,
i
)
{
// Pdr_SetPrintOne( pCube );
pObjNew
=
Aig_ManConst1
(
pNew
);
for
(
n
=
0
;
n
<
pCube
->
nLits
;
n
++
)
{
assert
(
Abc_Lit2Var
(
pCube
->
Lits
[
n
])
<
Saig_ManRegNum
(
p
)
);
pLit
=
Aig_NotCond
(
Aig_ManCi
(
pNew
,
Saig_ManPiNum
(
p
)
+
Abc_Lit2Var
(
pCube
->
Lits
[
n
])),
Abc_LitIsCompl
(
pCube
->
Lits
[
n
])
);
pObjNew
=
Aig_And
(
pNew
,
pObjNew
,
pLit
);
}
Aig_ObjCreateCo
(
pNew
,
pObjNew
);
}
// duplicate internal nodes
Aig_ManForEachNode
(
p
,
pObj
,
i
)
pObj
->
pData
=
Aig_And
(
pNew
,
Aig_ObjChild0Copy
(
pObj
),
Aig_ObjChild1Copy
(
pObj
)
);
// add the POs
Saig_ManForEachLi
(
p
,
pObj
,
i
)
Aig_ObjCreateCo
(
pNew
,
Aig_ObjChild0Copy
(
pObj
)
);
Aig_ManCleanup
(
pNew
);
Aig_ManSetRegNum
(
pNew
,
Aig_ManRegNum
(
p
)
);
// check the resulting network
if
(
!
Aig_ManCheck
(
pNew
)
)
printf
(
"Aig_ManDupSimple(): The check has failed.
\n
"
);
return
pNew
;
}
void
Pdr_ManDumpAig
(
Aig_Man_t
*
p
,
Vec_Ptr_t
*
vCubes
)
{
extern
void
Ioa_WriteAiger
(
Aig_Man_t
*
pMan
,
char
*
pFileName
,
int
fWriteSymbols
,
int
fCompact
);
Aig_Man_t
*
pNew
=
Pdr_ManDupAigWithClauses
(
p
,
vCubes
);
Ioa_WriteAiger
(
pNew
,
"aig_with_clauses.aig"
,
0
,
0
);
Aig_ManStop
(
pNew
);
printf
(
"Dumped modified AIG into file
\"
aig_with_clauses.aig
\"
.
\n
"
);
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Pdr_ManDumpClauses
(
Pdr_Man_t
*
p
,
char
*
pFileName
,
int
fProved
)
{
int
fUseSupp
=
1
;
...
...
@@ -249,6 +330,7 @@ void Pdr_ManDumpClauses( Pdr_Man_t * p, char * pFileName, int fProved )
kStart
=
Pdr_ManFindInvariantStart
(
p
);
vCubes
=
Pdr_ManCollectCubes
(
p
,
kStart
);
Vec_PtrSort
(
vCubes
,
(
int
(
*
)(
void
))
Pdr_SetCompare
);
// Pdr_ManDumpAig( p->pAig, vCubes );
// collect variable appearances
vFlopCounts
=
fUseSupp
?
Pdr_ManCountFlops
(
p
,
vCubes
)
:
NULL
;
// output the header
...
...
src/proof/pdr/pdrMan.c
View file @
37fd73cf
...
...
@@ -54,7 +54,7 @@ Pdr_Man_t * Pdr_ManStart( Aig_Man_t * pAig, Pdr_Par_t * pPars, Vec_Int_t * vPrio
p
->
pOrder
=
ABC_ALLOC
(
int
,
Aig_ManRegNum
(
pAig
)
);
p
->
vActVars
=
Vec_IntAlloc
(
256
);
if
(
!
p
->
pPars
->
fMonoCnf
)
p
->
vVLits
=
Vec_WecStart
(
Abc_MaxInt
(
1
,
Aig_ManLevels
(
pAig
))
);
p
->
vVLits
=
Vec_WecStart
(
1
+
Abc_MaxInt
(
1
,
Aig_ManLevels
(
pAig
))
);
// internal use
p
->
vPrio
=
vPrioInit
?
vPrioInit
:
Vec_IntStart
(
Aig_ManRegNum
(
pAig
)
);
// priority flops
p
->
vLits
=
Vec_IntAlloc
(
100
);
// array of literals
...
...
src/sat/bmc/bmcBmc3.c
View file @
37fd73cf
...
...
@@ -1663,11 +1663,13 @@ nTimeSat += clkSatRun;
if
(
!
pPars
->
fNotVerbose
)
Abc_Print
(
1
,
"Output %*d was asserted in frame %2d (solved %*d out of %*d outputs).
\n
"
,
nOutDigits
,
k
,
f
,
nOutDigits
,
pPars
->
nFailOuts
,
nOutDigits
,
Saig_ManPoNum
(
pAig
)
);
// set the output number
pCexNew0
->
iPo
=
k
;
// report to the bridge
if
(
p
->
pPars
->
fUseBridge
)
{
// set the output number
pCexNew0
->
iPo
=
k
;
Gia_ManToBridgeResult
(
stdout
,
0
,
pCexNew0
,
pCexNew0
->
iPo
);
}
// remember solved output
Vec_PtrWriteEntry
(
p
->
vCexes
,
k
,
Abc_CexDup
(
pCexNew
,
Saig_ManRegNum
(
pAig
))
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment