Joachim Klein
9ea91f2dd2
PrismUtils.formatDouble: Improve previous commit, strip trailing zeros for .xxx0000 as well
We want to strip trailing zeros (after the .) as well. This commit, together with the
previous one should provide the previous functionality, but fixing the issue with trailing
zeros for integers.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11860 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
d960f4b513
Fix in PrismUtils.formatDouble methods: Only remove trailing .000 not trailing zeros for integers [with Linda Leuschner]
The regular expression for identifying the trailing .0* part of the string
did not require the . to actually occur, which would also strip the zeros from
integers ending with zeros.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11859 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
ebd19aa9d6
Fix bug (two bugs, actually) in Gauss-Seidel solution of MDP expected reward to a target for models with self-loops.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11841 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
93c2138383
TestModelGenerator: correctly setup and tear down CUDD
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11831 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
526b0e7d8d
ModelGenerator2MTBDD: fix use of ModelVariablesDD, actually allocate variables via ModelVariablesDD
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11829 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
937a6c2a43
VarList: add getIndexFromDeclaration()
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11828 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
994b6207d9
AcceptanceGeneric: add toRabin() and toStreett() methods
These methods work for the case where the generic acceptance condition
has the required structure or can be easily padded to have the required
structure for Rabin / Streett.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11827 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
30ed75086f
AcceptanceGeneric: add and() and or() methods
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11826 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
16bbd0b24b
Prism: reset currentModel and currentModelExpl to null in clearBuiltModel()
Generally, as soon as clearBuiltModel is called, the models should not be
touched anymore. In doBuildModel, keep the null assignments for the
model storage variable for the unused engine.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11825 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
3d48780b8d
Refactor: Switch MTBDD variable handling for symbolic models to ModelVariablesDD infrastructure
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11824 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
a69f3d2e3f
prism/ModelVariablesDD: for handling the MTBDD variable related logic for symbolic models
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11823 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
0fb6ab0a53
JDDVars: add mergeVarsFrom(), sortByIndex() and removeVar() methods
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11822 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
8b07176df3
ModelGenerator2MTBDD: simplify reference handling, use JDDNode.copy(), JDD.DerefArray()
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11821 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
410b38ab30
Modules2MTBDD: simplify reference handling, use JDDNode.copy(), JDD.DerefArray()
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11820 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
4340969f70
JDD: Add DerefArray convenience method
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11819 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
d7c915394c
JDDVars: deprecate addVars() and refAll(), instead use copy() or copyVarsFrom()
Methods addVars and refAll are not used anymore on trunk. Using the copy methods
improves debugging of the reference counting.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11818 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
c8d545b4f2
ast.RelOp: for negate, optionally keep the strictness of the operator [with Steffen Maercker and Marcus Daum]
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11817 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
f54feb473b
symbolic ProbModel: add method addUniqueLabelDD()
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11816 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
502faa6a26
explicit/symbolic: refactor checkExpressionLabel to use getLabelList()
For symbolic checkExpressionLabel, additionally ensure that no NullPointerException
is thrown if propertiesFile is null.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11815 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
b80f41d5bc
ModelExplicit: refactor addUniqueLabel to ensure that already defined label names are avoided
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11814 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
5a06f212a5
explicit/symbolic StateModelChecker: add methods getLabelList() and getDefinedLabelNames() to provide access to label namespace
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11813 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
eb5028dbf8
prism-auto: add --dd-warnings mode for printing the CUDD reference leak warnings
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11812 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
6bc5aefa50
Extend ModelGenerator2MTBDD to generate/store label info too.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11810 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
a7efdff3ca
Ignore "deadlock" label when loading from explicit files into symbolic engines (consistent with recent update to explicit engine import).
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11809 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
3f7c3c57c8
Comment typo
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11807 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
79ce4075b3
Add a default implementation of ModelInfo.rewardStructHasTransitionRewards in DefaultModelGenerator (which returns true), plus some notes about this in the JavaDoc for related methods.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11806 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
a2ab087a55
Explicit model import via the explicit engine now respects the "fix deadlocks" setting and adds self-loops in deadlock states if needed.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11805 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
f1ce3e4fa8
Unbreak ModelGenerator2MTBDD: max number of nondet choices had been set to 1 for testing purposes.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11803 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
e113bff2c7
ModelInfo: add method to query the existence of transition rewards, add check for explicit DTMC/CTMC reward construction
During reward construction in the explicit engine using the new ModelGenerator
functionality (see SVN 11772), the check for transition rewards was missing
(he explicit engine currently does not support transition rewards for DTMCs and CTMCs).
This commit adds functionality to ModelInfo to determine whether a reward structure
defines transition rewards and adds a corresponding check during reward construction.
Example: prism-examples/dice/dice.pm with R=?[ F s=7 ] and -explicit returns 0 instead
of an error message.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11802 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
002257286d
Align parametric model construction with the non-parametric a little more.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11801 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
048017bb24
NondetModelChecker.checkExpressionMultiObjective(): BDD cleanup when computeMultiReachProbs throws Exception
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11800 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
28f66c6c69
BigRational: extend static BigRational from(Object value) to accept String value
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11799 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
8b569b9e4e
BigRational: Make the static final constants (ONE, INF, NAN, etc) public
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11798 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
1f9fb4d505
BigRational: When canceling, preserve NaN instead of converting to ZERO
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11797 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
97c72b534e
prism.UndefinedConstants: provide additional method removeConstants(Collection<String> constNames)
Refactor removeConstants(String[] constNames) to use that method as well.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11796 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
7e51a56157
Code tidy
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11795 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
544c1cbe65
Missing part of previous bigfix.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11794 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
19ec2f0a76
Refactor parametric model construction to use an extension of ModelGenerator instead of reading specifically from a ModulesFile. Needs further refactoring.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11793 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
4f491f9e07
Bug fix in test mode comparisons where expected result is an expression comprising a single constant.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11792 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
37543a928d
Bug fix in test mode comparisons where expected result is an expression comprising a single constant.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11791 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
f4bae778ce
Bug fix in test mode comparisons where expected result is an expression comprising a single constant.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11790 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
d126a8ae21
prism/Makefile: remove lib/prism.jar on clean
If lib/prism.jar exists (built by 'binary' target), it takes
precedence over newly compiled .class files. This is confusing, as
changing some sources, running 'make clean all' and then running PRISM
results in the "old" behaviour contained in lib/prism.jar.
Now, we remove lib/prism.jar on 'make clean'.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11789 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
5fcf8f50e6
Makefile: compile ngprism with CFLAGS instead of CPPFLAGS options (calls C compiler)
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11788 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
72d08b9407
hybrid engine: consistently use delete[] when destroying solution vectors
Technically, using 'plain' delete for deleting objects allocated with
new[] is undefined behaviour. In practice, this didn't appear to be a
problem.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11787 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
9850ae3c71
sparse engine: consistently use delete[] when destroying solution vectors
Technically, using 'plain' delete for deleting objects allocated with new[] is
undefined behaviour. In practice, this didn't appear to be a problem.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11786 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
08482e9f0d
ExpressionReward: provide static variants of getRewardStructByIndexObject and getRewardStructIndexByIndexObject
Allows resolving of reward structure index objects when they occur outside of R operators.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11785 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
6935798edf
explicit.ProbModelChecker: provide constructRewards(model, rewardStructureIndex)
Deprecate the previous methods using RewardStruct, as those don't work with
arbitrary model generators.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11784 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
9890d74315
Various improvements focused on the ModelGenerator interface:
- Extended functionality available through the prism.Prism API when using ModelGenerators
- Improvements to ModelGenerator interface wrt handling of rewards (and also labels)
- Explicit engine model checkers now build rewards from a ModelGenerator, not a RewardStruct.
This is now (optionally) attached with the setModulesFileAndPropertiesFile method.
- New code to generate symbolic models from ModelGenerators (useful, if not super efficient)
- Move createVarList() method from ModelGenerator up to ModelInfo
- Some code tidying in LabelList
Code was previously at https://github.com/prismmodelchecker/prism-svn/tree/model-generator
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11772 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Dave Parker
4ad8e43e9f
Deal with module/model alphabets properly in PTAs, in particular when storing PTAs internally using pta.PTA. The definition of the alphabet of a PTA from a PRISM model is now correct and inline with the defition for other models.
Fixes https://github.com/prismmodelchecker/prism/issues/10
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11770 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago
Joachim Klein
e38ea63e89
Fix U>=t computations for CTMC, explicit engine [with Marcus Daum]
The unbounded until computation has to be carried out on the embedded DTMC.
Fixes issue prismmodelchecker/prism#9 .
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11768 bbc10eb1-c90d-0410-af57-cb519fbb1720
9 years ago