stormpy icon indicating copy to clipboard operation
stormpy copied to clipboard

Segfault in get_integer_values_states

Open nmanginas opened this issue 6 days ago • 2 comments

Hi thanks for the library. I am trying to use the get_integer_values_states that was recently added to the library. I am using the master of Storm and of stormpy, since these functions were added after 1.9.0. I don't know if this is an issue of Storm or of the bindings. The types passed differ with the docs as prism_program.variables give a set of stormpy.storage.storage.Variable while get_integer_values_states seems to expect storm::expressions::Variable . I don't know if this might be a problem.

import stormpy

prism_program = stormpy.parse_prism_program(str(specification_path))  # type: ignore
options = stormpy.BuilderOptions()  # type: ignore
options.set_build_state_valuations()
options.set_build_choice_labels()

model = stormpy.build_sparse_model_with_options(prism_program, options)  # type: ignore

[
    model.state_valuations.get_integer_values_states(variable)
    for variable in prism_program.variables
]

You can repro with the simplest MDP:

mdp 

module test

a: bool;
b: bool;

[flip_a] (a=true) -> (a'=false);
[flip_a] (a=false) -> (a'=true);
[flip_b] (b=true) -> (b'=false);
[flip_b] (b=false) -> (b'=true);

endmodule

This gives: Segmentation fault (core dumped) after building the model. Any help is appreciated.

nmanginas avatar Feb 21 '25 11:02 nmanginas