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
581f2e59
Commit
581f2e59
authored
Nov 14, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to the SAT solver.
parent
f95476b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
src/proof/cec/cecSatG2.c
+3
-3
src/sat/glucose2/Glucose2.cpp
+11
-4
src/sat/glucose2/Solver.h
+1
-1
No files found.
src/proof/cec/cecSatG2.c
View file @
581f2e59
...
@@ -1196,7 +1196,7 @@ int Cec4_ManCandIterNext( Cec4_Man_t * p )
...
@@ -1196,7 +1196,7 @@ int Cec4_ManCandIterNext( Cec4_Man_t * p )
while
(
Vec_IntSize
(
p
->
vCands
)
>
0
)
while
(
Vec_IntSize
(
p
->
vCands
)
>
0
)
{
{
int
fStop
,
iCand
=
Vec_IntEntry
(
p
->
vCands
,
p
->
iPosRead
);
int
fStop
,
iCand
=
Vec_IntEntry
(
p
->
vCands
,
p
->
iPosRead
);
if
(
fStop
=
(
Gia_ObjRepr
(
p
->
pAig
,
iCand
)
!=
GIA_VOID
)
)
if
(
(
fStop
=
(
Gia_ObjRepr
(
p
->
pAig
,
iCand
)
!=
GIA_VOID
)
)
)
Vec_IntWriteEntry
(
p
->
vCands
,
p
->
iPosWrite
++
,
iCand
);
Vec_IntWriteEntry
(
p
->
vCands
,
p
->
iPosWrite
++
,
iCand
);
if
(
++
p
->
iPosRead
==
Vec_IntSize
(
p
->
vCands
)
)
if
(
++
p
->
iPosRead
==
Vec_IntSize
(
p
->
vCands
)
)
{
{
...
@@ -1273,7 +1273,7 @@ void Cec4_ManSatSolverRecycle( Cec4_Man_t * p )
...
@@ -1273,7 +1273,7 @@ void Cec4_ManSatSolverRecycle( Cec4_Man_t * p )
int
Cec4_ManSolveTwo
(
Cec4_Man_t
*
p
,
int
iObj0
,
int
iObj1
,
int
fPhase
,
int
*
pfEasy
,
int
fVerbose
)
int
Cec4_ManSolveTwo
(
Cec4_Man_t
*
p
,
int
iObj0
,
int
iObj1
,
int
fPhase
,
int
*
pfEasy
,
int
fVerbose
)
{
{
abctime
clk
;
abctime
clk
;
int
nBTLimit
=
Vec_BitEntry
(
p
->
vFails
,
iObj0
)
||
Vec_BitEntry
(
p
->
vFails
,
iObj1
)
?
p
->
pPars
->
nBTLimit
/
10
:
p
->
pPars
->
nBTLimit
;
int
nBTLimit
=
(
Vec_BitEntry
(
p
->
vFails
,
iObj0
)
||
Vec_BitEntry
(
p
->
vFails
,
iObj1
)
)
?
p
->
pPars
->
nBTLimit
/
10
:
p
->
pPars
->
nBTLimit
;
int
nConfEnd
,
nConfBeg
,
status
,
iVar0
,
iVar1
,
Lits
[
2
];
int
nConfEnd
,
nConfBeg
,
status
,
iVar0
,
iVar1
,
Lits
[
2
];
int
UnsatConflicts
[
3
]
=
{
0
};
int
UnsatConflicts
[
3
]
=
{
0
};
if
(
iObj1
<
iObj0
)
if
(
iObj1
<
iObj0
)
...
@@ -1385,7 +1385,7 @@ int Cec4_ManSweepNode( Cec4_Man_t * p, int iObj, int iRepr )
...
@@ -1385,7 +1385,7 @@ int Cec4_ManSweepNode( Cec4_Man_t * p, int iObj, int iRepr )
assert
(
p
->
pAig
->
iPatsPi
>
0
&&
p
->
pAig
->
iPatsPi
<
64
*
p
->
pAig
->
nSimWords
);
assert
(
p
->
pAig
->
iPatsPi
>
0
&&
p
->
pAig
->
iPatsPi
<
64
*
p
->
pAig
->
nSimWords
);
//Vec_IntForEachEntryDouble( &p->pNew->vCopiesTwo, IdAig, IdSat, i )
//Vec_IntForEachEntryDouble( &p->pNew->vCopiesTwo, IdAig, IdSat, i )
// Cec4_ObjSimSetInputBit( p->pAig, IdAig, sat_solver_read_cex_varvalue(p->pSat, IdSat) );
// Cec4_ObjSimSetInputBit( p->pAig, IdAig, sat_solver_read_cex_varvalue(p->pSat, IdSat) );
pCex
=
NULL
;
//
sat_solver_read_cex( p->pSat );
pCex
=
sat_solver_read_cex
(
p
->
pSat
);
Vec_IntClear
(
p
->
vPat
);
Vec_IntClear
(
p
->
vPat
);
if
(
pCex
==
NULL
)
if
(
pCex
==
NULL
)
{
{
...
...
src/sat/glucose2/Glucose2.cpp
View file @
581f2e59
...
@@ -1153,6 +1153,13 @@ lbool Solver::search(int nof_conflicts)
...
@@ -1153,6 +1153,13 @@ lbool Solver::search(int nof_conflicts)
for
(;;){
for
(;;){
CRef
confl
=
propagate
();
CRef
confl
=
propagate
();
// exact conflict limit
if
(
!
withinBudget
()
&&
confl
!=
CRef_Undef
)
{
lbdQueue
.
fastclear
();
cancelUntil
(
0
);
return
l_Undef
;
}
if
(
confl
!=
CRef_Undef
){
if
(
confl
!=
CRef_Undef
){
// CONFLICT
// CONFLICT
...
@@ -1395,15 +1402,15 @@ printf("c ==================================[ Search Statistics (every %6d confl
...
@@ -1395,15 +1402,15 @@ printf("c ==================================[ Search Statistics (every %6d confl
if
(
status
==
l_True
){
if
(
status
==
l_True
){
if
(
justUsage
()
&&
false
){
if
(
justUsage
()
){
assert
(
jheap
.
empty
());
assert
(
jheap
.
empty
());
//JustModel.growTo(nVars());
//JustModel.growTo(nVars());
int
i
=
0
;
int
i
=
0
,
j
=
0
;
JustModel
.
push
(
toLit
(
0
));
JustModel
.
push
(
toLit
(
0
));
for
(;
i
<
trail
.
size
();
i
++
)
for
(;
i
<
trail
.
size
();
i
++
)
if
(
isRoundWatch
(
var
(
trail
[
i
]))
&&
!
isTwoFanin
(
var
(
trail
[
i
]))
)
if
(
isRoundWatch
(
var
(
trail
[
i
]))
&&
!
isTwoFanin
(
var
(
trail
[
i
]))
)
JustModel
.
push
(
trail
[
i
]);
JustModel
.
push
(
trail
[
i
])
,
j
++
;
JustModel
[
0
]
=
toLit
(
i
);
JustModel
[
0
]
=
toLit
(
j
);
}
else
{
}
else
{
// Extend & copy model:
// Extend & copy model:
model
.
growTo
(
nVars
());
model
.
growTo
(
nVars
());
...
...
src/sat/glucose2/Solver.h
View file @
581f2e59
...
@@ -546,7 +546,7 @@ inline int Solver::nClauses () const { return clauses.size(); }
...
@@ -546,7 +546,7 @@ inline int Solver::nClauses () const { return clauses.size(); }
inline
int
Solver
::
nLearnts
()
const
{
return
learnts
.
size
();
}
inline
int
Solver
::
nLearnts
()
const
{
return
learnts
.
size
();
}
inline
int
Solver
::
nVars
()
const
{
return
vardata
.
size
();
}
inline
int
Solver
::
nVars
()
const
{
return
vardata
.
size
();
}
inline
int
Solver
::
nFreeVars
()
const
{
return
(
int
)
dec_vars
-
(
trail_lim
.
size
()
==
0
?
trail
.
size
()
:
trail_lim
[
0
]);
}
inline
int
Solver
::
nFreeVars
()
const
{
return
(
int
)
dec_vars
-
(
trail_lim
.
size
()
==
0
?
trail
.
size
()
:
trail_lim
[
0
]);
}
inline
int
*
Solver
::
getCex
()
const
{
return
NULL
;
}
inline
int
*
Solver
::
getCex
()
const
{
return
(
int
*
)
&
JustModel
[
0
]
;
}
inline
void
Solver
::
setPolarity
(
Var
v
,
bool
b
)
{
polarity
[
v
]
=
b
;
}
inline
void
Solver
::
setPolarity
(
Var
v
,
bool
b
)
{
polarity
[
v
]
=
b
;
}
inline
void
Solver
::
setDecisionVar
(
Var
v
,
bool
b
)
inline
void
Solver
::
setDecisionVar
(
Var
v
,
bool
b
)
{
{
...
...
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