@@ -154,9 +154,9 @@ fn select<F: Formula>(
154154 ( rhs, lhs, OperandSide :: Rhs )
155155 } else if is_constant ( f, rhs) {
156156 ( lhs, rhs, OperandSide :: Lhs )
157- } else if is_essential ( f, lhs, OperandSide :: Lhs , rhs , t, ab) {
157+ } else if is_essential ( f, idx , lhs, OperandSide :: Lhs , t, ab) {
158158 ( lhs, rhs, OperandSide :: Lhs )
159- } else if is_essential ( f, rhs, OperandSide :: Rhs , lhs , t, ab) {
159+ } else if is_essential ( f, idx , rhs, OperandSide :: Rhs , t, ab) {
160160 ( rhs, lhs, OperandSide :: Rhs )
161161 } else if random ( ) {
162162 ( rhs, lhs, OperandSide :: Rhs )
@@ -440,15 +440,15 @@ fn value<F: Formula>(
440440
441441fn is_essential < F : Formula > (
442442 formula : & F ,
443+ n : SymbolId ,
443444 this : SymbolId ,
444445 on_side : OperandSide ,
445- other : SymbolId ,
446446 t : BitVector ,
447447 ab : & [ BitVector ] ,
448448) -> bool {
449449 let ab_nx = ab[ this] ;
450450
451- match & formula[ other ] {
451+ match & formula[ n ] {
452452 Symbol :: Operator ( op) => !is_invertible ( * op, ab_nx, t, on_side. other ( ) ) ,
453453 // TODO: not mentioned in paper => improvised. is that really true?
454454 Symbol :: Constant ( _) | Symbol :: Input ( _) => false ,
@@ -637,7 +637,9 @@ fn sat<F: Formula>(
637637 n = nx;
638638 }
639639
640- update_assignment ( formula, & mut ab, n, t) ;
640+ if formula. is_input ( n) {
641+ update_assignment ( formula, & mut ab, n, t) ;
642+ }
641643 }
642644
643645 let assignment: Assignment = formula. symbol_ids ( ) . map ( |i| ( i, ab[ i] ) ) . collect ( ) ;
0 commit comments