153 std::shared_ptr<storm::analysis::Order> order;
154 std::shared_ptr<storm::analysis::LocalMonotonicityResult<VariableType>> localMonotonicityResult;
155 if (useMonotonicity && fractionOfUndiscoveredArea > thresholdAsCoefficient && !unprocessedRegions.empty()) {
158 orders.emplace(extendOrder(
nullptr, region));
159 assert(orders.front() !=
nullptr);
160 auto monRes = std::shared_ptr<storm::analysis::LocalMonotonicityResult<VariableType>>(
162 extendLocalMonotonicityResult(region, orders.front(), monRes);
163 localMonotonicityResults.emplace(monRes);
164 order = orders.front();
165 localMonotonicityResult = localMonotonicityResults.front();
167 if (!order->getDoneBuilding()) {
169 while (unprocessedRegions.size() > orders.size()) {
170 orders.emplace(order->copy());
171 localMonotonicityResults.emplace(localMonotonicityResult->copy());
173 }
else if (!localMonotonicityResult->isDone()) {
175 while (unprocessedRegions.size() > orders.size()) {
176 orders.emplace(order);
177 localMonotonicityResults.emplace(localMonotonicityResult->copy());
181 while (unprocessedRegions.size() > orders.size()) {
182 orders.emplace(order);
183 localMonotonicityResults.emplace(localMonotonicityResult);
187 STORM_PRINT(
"\nTime for orderBuilding and monRes initialization: " << monWatch <<
".\n\n");
189 bool useSameOrder = useMonotonicity && order->getDoneBuilding();
190 bool useSameLocalMonotonicityResult = useSameOrder && localMonotonicityResult->isDone();
193 while (useMonotonicity && fractionOfUndiscoveredArea > thresholdAsCoefficient && !unprocessedRegions.empty()) {
194 assert((useSameLocalMonotonicityResult && localMonotonicityResults.size() == 1) || unprocessedRegions.size() == localMonotonicityResults.size());
195 assert((useSameOrder && orders.size() == 1) || unprocessedRegions.size() == orders.size());
196 assert(unprocessedRegions.size() == refinementDepths.size());
197 currentDepth = refinementDepths.front();
198 STORM_LOG_INFO(
"Analyzing region #" << numOfAnalyzedRegions <<
" (Refinement depth " << currentDepth <<
"; "
199 << storm::utility::convertNumber<double>(fractionOfUndiscoveredArea) * 100 <<
"% still unknown)");
200 auto& currentRegion = unprocessedRegions.front().first;
201 auto& res = unprocessedRegions.front().second;
203 assert(!orders.empty());
205 order = orders.front();
206 if (!order->getDoneBuilding()) {
207 extendOrder(order, currentRegion);
210 if (!useSameLocalMonotonicityResult) {
211 localMonotonicityResult = localMonotonicityResults.front();
212 if (!localMonotonicityResult->isDone()) {
213 extendLocalMonotonicityResult(currentRegion, order, localMonotonicityResult);
217 res = analyzeRegion(env, currentRegion, hypothesis, res,
false, localMonotonicityResult);
221 fractionOfUndiscoveredArea -= currentRegion.area() / areaOfParameterSpace;
222 fractionOfAllSatArea += currentRegion.area() / areaOfParameterSpace;
223 STORM_LOG_INFO(
"Region " << unprocessedRegions.front() <<
" is AllSat");
224 result.push_back(std::move(unprocessedRegions.front()));
227 fractionOfUndiscoveredArea -= currentRegion.area() / areaOfParameterSpace;
228 fractionOfAllViolatedArea += currentRegion.area() / areaOfParameterSpace;
229 STORM_LOG_INFO(
"Region " << unprocessedRegions.front() <<
" is AllViolated");
231 result.push_back(std::move(unprocessedRegions.front()));
235 if (!depthThreshold || currentDepth < depthThreshold.get()) {
236 std::vector<storm::storage::ParameterRegion<ParametricType>> newRegions;
241 std::vector<storm::storage::ParameterRegion<ParametricType>> newKnownRegions;
243 splitSmart(currentRegion, newRegions, *(localMonotonicityResult->getGlobalMonotonicityResult()),
false);
244 assert(newRegions.size() != 0);
250 for (
auto& newRegion : newRegions) {
253 orders.emplace(order);
254 localMonotonicityResults.emplace(localMonotonicityResult);
257 if (!order->getDoneBuilding()) {
259 orders.emplace(order->copy());
260 localMonotonicityResults.emplace(localMonotonicityResult->copy());
261 }
else if (!localMonotonicityResult->isDone()) {
263 orders.emplace(order);
264 localMonotonicityResults.emplace(localMonotonicityResult->copy());
267 orders.emplace(order);
268 localMonotonicityResults.emplace(localMonotonicityResult);
271 }
else if (!useSameLocalMonotonicityResult) {
273 localMonotonicityResults.emplace(localMonotonicityResult);
276 if (!localMonotonicityResult->isDone()) {
277 localMonotonicityResults.emplace(localMonotonicityResult->copy());
279 localMonotonicityResults.emplace(localMonotonicityResult);
283 unprocessedRegions.emplace(std::move(newRegion), initResForNewRegions);
284 refinementDepths.push(currentDepth + 1);
288 result.push_back(std::move(unprocessedRegions.front()));
293 ++numOfAnalyzedRegions;
294 unprocessedRegions.pop();
295 refinementDepths.pop();
299 if (!useSameLocalMonotonicityResult) {
300 localMonotonicityResults.pop();
304 while (displayedProgress < storm::utility::one<CoefficientType>() - fractionOfUndiscoveredArea) {
306 displayedProgress += storm::utility::convertNumber<CoefficientType>(0.01);
312 while (!unprocessedRegions.empty()) {
313 result.push_back(std::move(unprocessedRegions.front()));
314 unprocessedRegions.pop();
318 while (displayedProgress < storm::utility::one<CoefficientType>()) {
320 displayedProgress += storm::utility::convertNumber<CoefficientType>(0.01);
327 if (useMonotonicity) {
328 STORM_PRINT_AND_LOG(
" " << numberOfRegionsKnownThroughMonotonicity <<
" regions where discovered with help of monotonicity.\n");
332 auto regionCopyForResult = region;
333 return std::make_unique<storm::modelchecker::RegionRefinementCheckResult<ParametricType>>(std::move(result), std::move(regionCopyForResult));
336template<
typename ParametricType>
340 STORM_LOG_WARN(
"Initializing local Monotonicity Results not implemented for RegionModelChecker.");
343template<
typename ParametricType>
346 ParametricType
const& precision,
bool absolutePrecision, std::optional<storm::logic::Bound>
const& terminationBound) {
347 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing extremal values is not supported for this region model checker.");
348 return std::pair<ParametricType, typename storm::storage::ParameterRegion<ParametricType>::Valuation>();
351template<
typename ParametricType>
353 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Checking extremal values is not supported for this region model checker.");
357template<
typename ParametricType>
362template<
typename ParametricType>
364 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Region split estimation is not supported by this region model checker.");
365 return std::map<typename RegionModelChecker<ParametricType>::VariableType,
double>();
368template<
typename ParametricType>
371 STORM_LOG_WARN(
"Extending order for RegionModelChecker not implemented");
376template<
typename ParametricType>
378 STORM_LOG_WARN(
"Setting constant entries fo local monotonicity result not implemented");
382template<
typename ParametricType>
384 STORM_LOG_WARN(
"Setting max splitting dimensions is not implemented for this model checker");
387template<
typename ParametricType>
389 STORM_LOG_WARN(
"Resetting max splitting dimensions is not implemented for this model checker");
392template<
typename ParametricType>
394 return useMonotonicity;
397template<
typename ParametricType>
402template<
typename ParametricType>
404 return useOnlyGlobal;
407template<
typename ParametricType>
409 this->useMonotonicity = monotonicity;
412template<
typename ParametricType>
414 assert(!bounds || useMonotonicity);
415 this->useBounds = bounds;
418template<
typename ParametricType>
420 assert(!global || useMonotonicity);
421 this->useOnlyGlobal = global;
424template<
typename ParametricType>
428 STORM_LOG_WARN(
"Smart splitting for this model checker not implemented");