public static RefinementSetCases Conjunction(RefinementSetCases left, RefinementSetCases right) => new RefinementSetCases( RefinementSet.Join( left.Positive, right.Positive, outer: (refinement) => refinement.ToMaybe(), inner: (reference, leftType, rightType) => Refinement.Conjunction(reference, leftType, rightType) ), RefinementSet.Join( left.Positive, right.Positive, outer: (refinement) => Maybe.None <Refinement>(), // symbols in either left or right but not both LOSE their refinement due to the indecision inner: (reference, leftType, rightType) => Refinement.NegationOfConjunction(reference, leftType, rightType) ) );
public static RefinementSetCases Disjunction(RefinementSetCases left, RefinementSetCases right) =>
public RefinementSetCases Disjunction(RefinementSetCases other) => Disjunction(this, other);
public RefinementSetCases Conjunction(RefinementSetCases other) => Conjunction(this, other);