We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a93a523 commit 315aa4bCopy full SHA for 315aa4b
1 file changed
src/lib.rs
@@ -68,6 +68,9 @@ pub struct Lit {
68
sign: bool,
69
}
70
71
+pub const TRUE_LIT: Lit = Lit { x: 0, sign: true };
72
+pub const FALSE_LIT: Lit = Lit { x: 0, sign: false };
73
+
74
impl Lit {
75
pub fn new(x: usize, sign: bool) -> Self {
76
Lit { x, sign }
@@ -186,7 +189,7 @@ impl Default for Engine {
186
189
187
190
impl Engine {
188
191
pub fn new() -> Self {
- Engine {
192
+ let mut e = Engine {
193
assigns: Vec::new(),
194
reason: Vec::new(),
195
propagated_vars: Vec::new(),
@@ -198,7 +201,10 @@ impl Engine {
198
201
prop_q: VecDeque::new(),
199
202
learnt: Vec::new(),
200
203
listeners: HashMap::new(),
- }
204
+ };
205
+ e.add_var();
206
+ e.add_clause(vec![pos(0)]);
207
+ e
208
209
210
pub fn add_var(&mut self) -> usize {
0 commit comments