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
c88a2421
Commit
c88a2421
authored
Dec 03, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New SAT-based optimization package.
parent
1bf289c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
src/opt/sbd/sbdCore.c
+0
-0
src/opt/sbd/sbdWin.c
+23
-3
No files found.
src/opt/sbd/sbdCore.c
View file @
c88a2421
This diff is collapsed.
Click to expand it.
src/opt/sbd/sbdWin.c
View file @
c88a2421
...
...
@@ -155,9 +155,9 @@ word Sbd_ManSolve( sat_solver * pSat, int PivotVar, int FreeVar, Vec_Int_t * vDi
int
nBTLimit
=
0
;
word
uCube
,
uTruth
=
0
;
int
status
,
i
,
iVar
,
nFinal
,
*
pFinal
,
pLits
[
2
],
nIter
=
0
;
assert
(
FreeVar
<
sat_solver_nvars
(
pSat
)
);
pLits
[
0
]
=
Abc_Var2Lit
(
PivotVar
,
0
);
// F = 1
pLits
[
1
]
=
Abc_Var2Lit
(
FreeVar
,
0
);
// iNewLit
assert
(
Vec_IntSize
(
vValues
)
<=
sat_solver_nvars
(
pSat
)
);
while
(
1
)
{
// find onset minterm
...
...
@@ -169,7 +169,7 @@ word Sbd_ManSolve( sat_solver * pSat, int PivotVar, int FreeVar, Vec_Int_t * vDi
assert
(
status
==
l_True
);
// remember variable values
for
(
i
=
0
;
i
<
Vec_IntSize
(
vValues
);
i
++
)
Vec_IntWriteEntry
(
vValues
,
i
,
sat_solver_var_value
(
pSat
,
i
)
);
Vec_IntWriteEntry
(
vValues
,
i
,
2
*
sat_solver_var_value
(
pSat
,
i
)
);
// collect divisor literals
Vec_IntClear
(
vTemp
);
Vec_IntPush
(
vTemp
,
Abc_LitNot
(
pLits
[
0
])
);
// F = 0
...
...
@@ -203,7 +203,27 @@ word Sbd_ManSolve( sat_solver * pSat, int PivotVar, int FreeVar, Vec_Int_t * vDi
assert
(
status
==
l_True
);
// store the counter-example
for
(
i
=
0
;
i
<
Vec_IntSize
(
vValues
);
i
++
)
Vec_IntAddToEntry
(
vValues
,
i
,
2
*
sat_solver_var_value
(
pSat
,
i
)
);
Vec_IntAddToEntry
(
vValues
,
i
,
sat_solver_var_value
(
pSat
,
i
)
);
for
(
i
=
0
;
i
<
Vec_IntSize
(
vValues
);
i
++
)
Vec_IntAddToEntry
(
vValues
,
i
,
0xC
);
/*
// reduce the counter example
for ( n = 0; n < 2; n++ )
{
Vec_IntClear( vTemp );
Vec_IntPush( vTemp, Abc_Var2Lit(PivotVar, n) ); // n = 0 => F = 1 (expanding offset against onset)
for ( i = 0; i < Vec_IntSize(vValues); i++ )
Vec_IntPush( vTemp, Abc_Var2Lit(i, !((Vec_IntEntry(vValues, i) >> n) & 1)) );
status = sat_solver_solve( pSat, Vec_IntArray(vTemp), Vec_IntArray(vTemp) + Vec_IntSize(vTemp), nBTLimit, 0, 0, 0 );
assert( status == l_False );
// compute cube and add clause
nFinal = sat_solver_final( pSat, &pFinal );
for ( i = 0; i < nFinal; i++ )
if ( Abc_Lit2Var(pFinal[i]) != PivotVar )
Vec_IntAddToEntry( vValues, Abc_Lit2Var(pFinal[i]), 1 << (n+2) );
}
*/
return
SBD_SAT_SAT
;
}
...
...
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