@ -1,5 +1,7 @@
# include "storm/generator/CompressedState.h"
# include <boost/algorithm/string/join.hpp>
# include "storm/generator/VariableInformation.h"
# include "storm/storage/expressions/ExpressionManager.h"
# include "storm/storage/expressions/SimpleValuation.h"
@ -43,6 +45,41 @@ namespace storm {
return result ;
}
void extractVariableValues ( CompressedState const & state , VariableInformation const & variableInformation , std : : vector < int64_t > & locationValues , std : : vector < bool > & booleanValues , std : : vector < int64_t > & integerValues ) {
for ( auto const & locationVariable : variableInformation . locationVariables ) {
if ( locationVariable . bitWidth ! = 0 ) {
locationValues . push_back ( state . getAsInt ( locationVariable . bitOffset , locationVariable . bitWidth ) ) ;
} else {
locationValues . push_back ( 0 ) ;
}
}
for ( auto const & booleanVariable : variableInformation . booleanVariables ) {
booleanValues . push_back ( state . get ( booleanVariable . bitOffset ) ) ;
}
for ( auto const & integerVariable : variableInformation . integerVariables ) {
integerValues . push_back ( state . getAsInt ( integerVariable . bitOffset , integerVariable . bitWidth ) + integerVariable . lowerBound ) ;
}
}
std : : string toString ( CompressedState const & state , VariableInformation const & variableInformation ) {
std : : vector < std : : string > assignments ;
for ( auto const & locationVariable : variableInformation . locationVariables ) {
assignments . push_back ( locationVariable . variable . getName ( ) + " = " ) ;
assignments . back ( ) + = std : : to_string ( locationVariable . bitWidth = = 0 ? 0 : state . getAsInt ( locationVariable . bitOffset , locationVariable . bitWidth ) ) ;
}
for ( auto const & booleanVariable : variableInformation . booleanVariables ) {
if ( ! state . get ( booleanVariable . bitOffset ) ) {
assignments . push_back ( " ! " + booleanVariable . variable . getName ( ) ) ;
} else {
assignments . push_back ( booleanVariable . variable . getName ( ) ) ;
}
}
for ( auto const & integerVariable : variableInformation . integerVariables ) {
assignments . push_back ( integerVariable . variable . getName ( ) + " = " + std : : to_string ( state . getAsInt ( integerVariable . bitOffset , integerVariable . bitWidth ) + integerVariable . lowerBound ) ) ;
}
return boost : : join ( assignments , " & " ) ;
}
storm : : storage : : BitVector computeObservabilityMask ( VariableInformation const & variableInformation ) {
storm : : storage : : BitVector result ( variableInformation . getTotalBitOffset ( true ) ) ;
for ( auto const & locationVariable : variableInformation . locationVariables ) {