-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Counter Exmaples Generation using Stormpy #209
Comments
The counterexample generation using It seems that you are interested in some of the paths reaching the target state. In this case, stormpy offers the possibility to enumerate the shortest paths leading to a desired state. The documentation provides an example how to use it and I would suggest to try it with this approach. |
Thank you so much for your help, I have tried this method with the following DTMC modelStorm model for DTMC: --------------------------------------------------------------
Unsafe States: {1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 16} when i run the shortest path to each unsafe state, I get the error of "Segmentation fault" This is my code to query the model def query_storm_model(self, query, dtmc, safety_critic_max):
|
To better debug the issue, can you send me the complete Python file via email to [email protected] ? |
Dear author,
I am building a stormpy model using my transition matrix. I will give a short description of the transition matrix (13 rows, each row contain a probability transition to other states). I label state 0 as "initial", other states are either "safe" or "unsafe" based on the safety values provided by an array. Here us the code to build the model using stormpy. Then, I perform a query 'P=? [F "unsafe"]', and the model return 1.0. In addition to the returned result, I want to get the counterexample that lead to the violation or results. May I ask you if you can provide me with some functions? I have tried the class SMTCounterExampleGenerator to generate counter example but get some errors, I will provide you my code below.
Thank you so much for your help.
this is my DTMC model
Storm model for DTMC: --------------------------------------------------------------
Model type: DTMC (sparse)
States: 13
Transitions: 16
Reward Models: coin_flips
State Labels: 3 labels
Choice Labels: none
This is the code to build the model
def build_storm_model(self, safety_critic_max, threshold):
rows = len(self.transitions)
cols = len(self.transitions[0])
builder = stormpy.SparseMatrixBuilder(rows=0, columns=0, entries=0, force_dimensions=False, has_custom_row_grouping=False)
for i in range(rows):
if i == rows - 1:
builder.add_next_value(row=i, column=i, value=1)
for j in range(cols):
builder.add_next_value(row=i, column=j, value=self.transitions[i][j])
This is a function to query and generate counter example
def query_storm_model(self, query, dtmc):
properties = stormpy.parse_properties(query)
formula = properties[0]
I have the error of
storm::storage::SymbolicModelDescription, model: storm::models::sparse::Model<double, storm::models::sparse::StandardRewardModel >, formula: storm::logic::Formula) -> storm::counterexamples::SMTMinimalLabelSetGenerator::CexInput
Invoked with: <stormpy.core.Environment object at 0x77f3ba96c6b0>, <stormpy.storage.storage.SparseDtmc object at 0x77f3bc031f70>, <stormpy.storage.storage.SparseDtmc object at 0x77f3bc031f70>, <stormpy.core.Property object at 0x77f3bb92ee30>
The text was updated successfully, but these errors were encountered: