STORM_LOG_ASSERT(manager,"Mutable expression manager required to define quantile bound variable.");
STORM_LOG_THROW(!manager->hasVariable(variableName),storm::exceptions::WrongFormatException,"Invalid quantile variable name '"<<variableName<<"' in property: variable already exists.");
STORM_LOG_WARN_COND(!dir.is_initialized(),"Optimization direction '"<<dir.get()<<"' for quantile variable "<<variableName<<" is ignored. This information will be derived from the subformula of the quantile.");
STORM_LOG_THROW(boundVariables.size()==1,storm::exceptions::InvalidArgumentException,"Requested unique bound variables. However, there are multiple bound variables defined.");
STORM_LOG_THROW(index<boundVariables.size(),storm::exceptions::InvalidArgumentException,"Requested bound variable with index"<<index<<". However, there are only "<<boundVariables.size()<<" bound variables.");
STORM_LOG_THROW(boundVariables.size()==1,storm::exceptions::InvalidArgumentException,"Requested unique optimization direction of the bound variables. However, there are multiple bound variables defined.");
STORM_LOG_THROW(index<boundVariables.size(),storm::exceptions::InvalidArgumentException,"Requested optimization direction with index"<<index<<". However, there are only "<<boundVariables.size()<<" bound variables.");
STORM_LOG_THROW(quantileVariables.count(quantileVariable.second)==0,storm::exceptions::NotSupportedException,"Quantile formula considers the same bound variable twice.");
STORM_LOG_THROW(quantileVariables.count(quantileVariable)==0,storm::exceptions::NotSupportedException,"Quantile formula considers the same bound variable twice.");
quantileVariables.insert(quantileVariable);
}
STORM_LOG_THROW(quantileFormula.getSubformula().isProbabilityOperatorFormula(),storm::exceptions::NotSupportedException,"Quantile formula needs probability operator inside. The formula "<<quantileFormula<<" is not supported.");
STORM_LOG_THROW(probOpFormula.hasBound(),storm::exceptions::InvalidOperationException,"Probability operator inside quantile formula needs to have a bound.");
STORM_LOG_THROW(!model.isNondeterministicModel()||probOpFormula.hasOptimalityType(),storm::exceptions::InvalidOperationException,"Probability operator inside quantile formula needs to have an optimality type.");
STORM_LOG_WARN_COND(probOpFormula.getBound().comparisonType==storm::logic::ComparisonType::Greater||probOpFormula.getBound().comparisonType==storm::logic::ComparisonType::LessEqual,"Probability operator inside quantile formula needs to have bound > or <=. The specified comparison type might lead to non-termination.");// This has to do with letting bound variables approach infinity, e.g., Pr>0.7 [F "goal"] holds iff Pr>0.7 [F<=B "goal"] holds for some B.
STORM_LOG_THROW(probOpFormula.getSubformula().isBoundedUntilFormula(),storm::exceptions::NotSupportedException,"Quantile formula needs bounded until probability operator formula as subformula. The formula "<<quantileFormula<<" is not supported.");
STORM_LOG_THROW(false,storm::exceptions::InvalidOperationException,"The bound variable '"<<dimVar.getName()<<"' is not specified within the quantile formula '"<<quantileFormula<<"'.");