internal static SumOfProducts GetSOP(this IGate garg) { var gset = new SumOfProducts(); foreach (var i in garg.GetInputs()) { if (i is TrueGate) { gset.SetFixed(i); break; } else if (i is FalseGate) { // ignore } else { gset.Add(i.GetProduct()); } } return(gset); }
internal static SumOfProducts GetSOP(this IGate garg) { var gset = new SumOfProducts(); foreach (var i in garg.GetInputs()) { if (i is TrueGate) { gset.SetFixed(i); break; } else if (i is FalseGate) { // ignore } else { gset.Add(i.GetProduct()); } } return gset; }