Sensitivity analysis using type-based constraints