git.iko.soy/ikoHSE/SolveAvdoshin
on master help sign in
removed Not from VarExpression
commit72c03e8e2e873d1ea20c203af695670b9dbdcd6f authorIlya Gulkov <ifranked@gmail.com> dateWed 30 Sep 2015, 13:33 (11 years ago) parent1a44df8
1 file changed+4−6
SolveAvdoshin/BooleanFunctions.cs+4−6
SolveAvdoshin/BooleanFunctions.cs+4−6
@@ -460,23 +460,21 @@ namespace SolveAvdoshin
460460 static readonly string[] VarSymbols = new string[] { "A", "B", "C", "0", "1", };
461461
462462 BooleanVariable Var;
463− bool Not;
464463
465464 public VarExpression(BooleanVariable var, bool not = false)
466465 {
467466 Var = var;
468− Not = not;
469467 }
470468
471469 public override bool Eval(bool a, bool b, bool c)
472470 {
473471 switch(Var) {
474472 case BooleanVariable.A:
475− return a != Not;
473+ return a;
476474 case BooleanVariable.B:
477− return b != Not;
475+ return b;
478476 case BooleanVariable.C:
479− return c != Not;
477+ return c;
480478 case BooleanVariable.Zero:
481479 return false;
482480 case BooleanVariable.One:
@@ -488,7 +486,7 @@ namespace SolveAvdoshin
488486
489487 public override string ToString()
490488 {
491− return (Not ? "!" : "") + VarSymbols[(int)Var];
489+ return VarSymbols[(int)Var];
492490 }
493491
494492 public override int CountVariables()