public LogicalCompositMathSpecification And(MathSpecification specification)
 {
     return(new AndMathSpecification(this, specification));
 }
 public OrMathSpecification(MathSpecification leftSpecification, MathSpecification rightSpecification)
 {
     _leftSpecification  = leftSpecification;
     _rightSpecification = rightSpecification;
 }
 public NotMathSpecification(MathSpecification specification)
 {
     _specification = specification;
 }
 public LogicalCompositMathSpecification Not(MathSpecification specification)
 {
     return(new NotMathSpecification(specification));
 }
 public LogicalCompositMathSpecification Or(MathSpecification specification)
 {
     return(new OrMathSpecification(this, specification));
 }
 public MathSpecification IsSpecialCaseOf(MathSpecification specification) => null;
 /// <summary>
 /// this methods must be implemented in subclass
 ///
 /// </summary>
 /// <param name="specification"></param>
 /// <returns></returns>
 public MathSpecification IsGeneralizationOf(MathSpecification specification) => null;
 private List <int> Filter(MathSpecification specification)
 {
     return(_numbers.Where(specification.IsSatisfiedBy).ToList());
 }