Browse Source
PrctlFilter is operational but not yet complete (proper standard output missing).
PrctlFilter is operational but not yet complete (proper standard output missing).
- General function of the filters: The filter as an abstraction layer between the control flow and the formula/modelchecker.
|- It has a formula as child but is not a formula itself.
|- It invokes the modelchecking process on the child formula and manipulates the result.
|- For the purpose of result manipulation it keeps a list of filter actions.
|- Each action manipulates the result in a certain way. For example: It returns only the results for states 25 to 140.
|- Furthermore the printing of the result to standard out and the log is no longer done by the modelchecker but by the filter.
|- That way the tasks of each class becomes more clear: Modelchecker to compute the results, filter to prepare the computed results for write out.
- Battled with a major design problem: How to integrate the optimizing operator (aka. min or max probs for non-det. models) into the filter scheme.
|- It is now integrated as a separate filter action, which does not touch the results but hold the flag determining whether to maximize or to minimize.
|- This action must be the innermost filter action (i.e. the first list entry) to have any effect.
|- This is combined with a special fuction of the modelchecker that manipulates the mutable minimizationStack calculates the modelchecking result and resets the stack to its original state.
|- This way the information whether to min, to max or not to try is managed by the filter and propagated as needed.
|- Remark: Fixed a major risk of undefined behavior in the SparseMdpPrctlModelChecker.
|- If the formula to be checked did not have a NoBoundFormula as root then the minimumOperatorStack would be empty and minimumOperatorStack.top() would result in undefined behavior.
|- Added tests whether the stack is empty before trying to read out the possibly non existant top element.
Next up: Implement similar filters for LTL and CSL and try to get it compiled.
Former-commit-id: 577998e027
tempestpy_adaptions
masawei
11 years ago
7 changed files with 281 additions and 118 deletions
-
13src/formula/Actions/Action.h
-
60src/formula/Actions/MinMaxAction.h
-
7src/formula/Actions/RangeAction.h
-
85src/formula/Prctl/PrctlFilter.h
-
104src/modelchecker/prctl/AbstractModelChecker.h
-
51src/modelchecker/prctl/SparseDtmcPrctlModelChecker.h
-
79src/modelchecker/prctl/SparseMdpPrctlModelChecker.h
@ -0,0 +1,60 @@ |
|||
/* |
|||
* MinMaxAction.h |
|||
* |
|||
* Created on: Apr 30, 2014 |
|||
* Author: Manuel Sascha Weiand |
|||
*/ |
|||
|
|||
#ifndef STORM_FORMULA_ACTION_MINMAXACTION_H_ |
|||
#define STORM_FORMULA_ACTION_MINMAXACTION_H_ |
|||
|
|||
#include "src/formula/Actions/Action.h" |
|||
|
|||
namespace storm { |
|||
namespace property { |
|||
namespace action { |
|||
|
|||
template <class T> |
|||
class MinMaxAction : Action<T> { |
|||
|
|||
public: |
|||
|
|||
MinMaxAction() : minimize(true) { |
|||
//Intentionally left empty. |
|||
} |
|||
|
|||
explicit MinMaxAction(bool minimize) : minimize(minimize) { |
|||
//Intentionally left empty. |
|||
} |
|||
|
|||
/*! |
|||
* |
|||
*/ |
|||
virtual std::string toString() const override { |
|||
return minimize ? "min" : "max"; |
|||
} |
|||
|
|||
/*! |
|||
* |
|||
*/ |
|||
virtual std::string toFormulaString() const override { |
|||
return minimize ? "min" : "max"; |
|||
} |
|||
|
|||
/*! |
|||
* |
|||
*/ |
|||
bool getMinimize() { |
|||
return minimize; |
|||
} |
|||
|
|||
private: |
|||
bool minimize; |
|||
|
|||
}; |
|||
|
|||
} //namespace action |
|||
} //namespace property |
|||
} //namespace storm |
|||
|
|||
#endif /* STORM_FORMULA_ACTION_MINMAXACTION_H_ */ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue