ABC: A System for Sequential Synthesis and Verification
Loading...
Searching...
No Matches
flags.hpp
Go to the documentation of this file.
1
#ifndef _flags_hpp_INCLUDED
2
#define _flags_hpp_INCLUDED
3
4
#include "
global.h
"
5
6
ABC_NAMESPACE_CXX_HEADER_START
7
8
namespace
CaDiCaL
{
9
10
struct
Flags
{
// Variable flags.
11
12
// The first set of flags is related to 'analyze' and 'minimize'.
13
//
14
bool
seen
: 1;
// seen in generating first UIP clause in 'analyze'
15
bool
keep
: 1;
// keep in learned clause in 'minimize'
16
bool
poison
: 1;
// can not be removed in 'minimize'
17
bool
removable
: 1;
// can be removed in 'minimize'
18
bool
shrinkable
: 1;
// can be removed in 'shrink'
19
bool
added
: 1;
// has already been added to lrat_chain (in 'minimize')
20
21
// These three variable flags are used to schedule clauses in subsumption
22
// ('subsume'), variables in bounded variable elimination ('elim') and in
23
// hyper ternary resolution ('ternary').
24
//
25
bool
elim
: 1;
// removed since last 'elim' round (*)
26
bool
subsume
: 1;
// added since last 'subsume' round (*)
27
bool
ternary
: 1;
// added in ternary clause since last 'ternary' (*)
28
bool
sweep
: 1;
29
bool
blockable
: 1;
30
31
unsigned
char
32
marked_signed
: 2;
// generate correct LRAT chains in decompose
33
unsigned
char
factor
: 2;
34
35
// These literal flags are used by blocked clause elimination ('block').
36
//
37
unsigned
char
block
: 2;
// removed since last 'block' round (*)
38
unsigned
char
skip
: 2;
// skip this literal as blocking literal
39
40
// Bits for handling assumptions.
41
//
42
unsigned
char
assumed
: 2;
43
unsigned
char
failed
: 2;
// 0 if not part of failure
44
// 1 if positive lit is in failure
45
// 2 if negated lit is in failure
46
47
enum
{
48
UNUSED
= 0,
49
ACTIVE
= 1,
50
FIXED
= 2,
51
ELIMINATED
= 3,
52
SUBSTITUTED
= 4,
53
PURE
= 5
54
};
55
56
unsigned
char
status
: 3;
57
58
// Initialized explicitly in 'Internal::init' through this function.
59
//
60
Flags
() {
61
seen
=
keep
=
poison
=
removable
=
shrinkable
=
added
=
sweep
=
false
;
62
subsume
=
elim
=
ternary
=
true
;
63
block
= 3u;
64
skip
=
assumed
=
failed
=
marked_signed
=
factor
= 0;
65
status
=
UNUSED
;
66
}
67
68
bool
unused
()
const
{
return
status
==
UNUSED
; }
69
bool
active
()
const
{
return
status
==
ACTIVE
; }
70
bool
fixed
()
const
{
return
status
==
FIXED
; }
71
bool
eliminated
()
const
{
return
status
==
ELIMINATED
; }
72
bool
substituted
()
const
{
return
status
==
SUBSTITUTED
; }
73
bool
pure
()
const
{
return
status
==
PURE
; }
74
75
// The flags marked with '(*)' are copied during 'External::copy_flags',
76
// which in essence means they are reset in the copy if they were clear.
77
// This avoids the effort of fruitless preprocessing the copy.
78
79
void
copy
(
Flags
&dst)
const
{
80
dst.
elim
=
elim
;
81
dst.
subsume
=
subsume
;
82
dst.
ternary
=
ternary
;
83
dst.
block
=
block
;
84
}
85
};
86
87
}
// namespace CaDiCaL
88
89
ABC_NAMESPACE_CXX_HEADER_END
90
91
#endif
ABC_NAMESPACE_CXX_HEADER_START
#define ABC_NAMESPACE_CXX_HEADER_START
Definition
abc_namespaces.h:52
ABC_NAMESPACE_CXX_HEADER_END
#define ABC_NAMESPACE_CXX_HEADER_END
Definition
abc_namespaces.h:53
global.h
CaDiCaL
Definition
arena.hpp:8
CaDiCaL::Flags::copy
void copy(Flags &dst) const
Definition
flags.hpp:79
CaDiCaL::Flags::keep
bool keep
Definition
flags.hpp:15
CaDiCaL::Flags::FIXED
@ FIXED
Definition
flags.hpp:50
CaDiCaL::Flags::ELIMINATED
@ ELIMINATED
Definition
flags.hpp:51
CaDiCaL::Flags::ACTIVE
@ ACTIVE
Definition
flags.hpp:49
CaDiCaL::Flags::UNUSED
@ UNUSED
Definition
flags.hpp:48
CaDiCaL::Flags::SUBSTITUTED
@ SUBSTITUTED
Definition
flags.hpp:52
CaDiCaL::Flags::PURE
@ PURE
Definition
flags.hpp:53
CaDiCaL::Flags::elim
bool elim
Definition
flags.hpp:25
CaDiCaL::Flags::eliminated
bool eliminated() const
Definition
flags.hpp:71
CaDiCaL::Flags::removable
bool removable
Definition
flags.hpp:17
CaDiCaL::Flags::added
bool added
Definition
flags.hpp:19
CaDiCaL::Flags::shrinkable
bool shrinkable
Definition
flags.hpp:18
CaDiCaL::Flags::sweep
bool sweep
Definition
flags.hpp:28
CaDiCaL::Flags::subsume
bool subsume
Definition
flags.hpp:26
CaDiCaL::Flags::poison
bool poison
Definition
flags.hpp:16
CaDiCaL::Flags::marked_signed
unsigned char marked_signed
Definition
flags.hpp:32
CaDiCaL::Flags::skip
unsigned char skip
Definition
flags.hpp:38
CaDiCaL::Flags::substituted
bool substituted() const
Definition
flags.hpp:72
CaDiCaL::Flags::Flags
Flags()
Definition
flags.hpp:60
CaDiCaL::Flags::seen
bool seen
Definition
flags.hpp:14
CaDiCaL::Flags::failed
unsigned char failed
Definition
flags.hpp:43
CaDiCaL::Flags::fixed
bool fixed() const
Definition
flags.hpp:70
CaDiCaL::Flags::status
unsigned char status
Definition
flags.hpp:56
CaDiCaL::Flags::blockable
bool blockable
Definition
flags.hpp:29
CaDiCaL::Flags::block
unsigned char block
Definition
flags.hpp:37
CaDiCaL::Flags::assumed
unsigned char assumed
Definition
flags.hpp:42
CaDiCaL::Flags::factor
unsigned char factor
Definition
flags.hpp:33
CaDiCaL::Flags::ternary
bool ternary
Definition
flags.hpp:27
CaDiCaL::Flags::unused
bool unused() const
Definition
flags.hpp:68
CaDiCaL::Flags::pure
bool pure() const
Definition
flags.hpp:73
CaDiCaL::Flags::active
bool active() const
Definition
flags.hpp:69
src
sat
cadical
flags.hpp
Generated by Doxygen 1.13.2 © 2025 EPTansuo. All rights reserved.
鲁ICP备2021046540号