Closed oyendrila-dobe closed 1 year ago
All functions in storm are templated and you can provide the number type you want to use as a template argument. See for example this test which works with exact (rational) numbers.
You can create a DTMC with rational numbers from a Prism file as follows:
std::shared_ptr<storm::models::sparse::Dtmc<storm::RationalNumber>> dtmc =
storm::api::buildSparseModel<storm::RationalNumber>(program, formulas)->as<storm::models::sparse::Dtmc<storm::RationalNumber>>();
auto matrix = dtmc.getTransitionMatrix();
Thanks, Matthias. That was really helpful.
This has been previously discussed in this stormpy issue. I'm however, unable to locate the corresponding c++ method for exact sparse matrix builder. Is there any existing method that generates the model from PRISM files saving the transitions as Rational numbers? If not, can you point me to the c++ method that can be used to create such a matrix manually?