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 RefinementSetCases(RefinementSet positive, RefinementSet negative) { _positive = positive; _negative = negative; }