-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDP controller synthesis via SMT coloring
- Loading branch information
Roman Andriushchenko
committed
Jul 24, 2024
1 parent
7302697
commit a2ea997
Showing
25 changed files
with
1,182 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
mdp | ||
|
||
module m | ||
s : [0..4] init 0; | ||
s : [0..3] init 0; | ||
|
||
[up] s=0 -> (s'=1); | ||
[down] s=0 -> (s'=2); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import stormpy | ||
|
||
class ModelBuilder: | ||
|
||
@classmethod | ||
def default_builder_options(cls, specification = None): | ||
# builder options | ||
if specification is not None: | ||
formulae = specification.stormpy_formulae() | ||
builder_options = stormpy.BuilderOptions(formulae) | ||
else: | ||
builder_options = stormpy.BuilderOptions() | ||
builder_options.set_build_state_valuations(True) | ||
builder_options.set_build_with_choice_origins(True) | ||
builder_options.set_build_all_labels(True) | ||
builder_options.set_build_choice_labels(True) | ||
builder_options.set_add_overlapping_guards_label(True) | ||
builder_options.set_build_observation_valuations(True) | ||
# builder_options.set_exploration_checks(True) | ||
return builder_options | ||
|
||
@classmethod | ||
def from_jani(cls, program, specification = None): | ||
builder_options = cls.default_builder_options(specification) | ||
builder_options.set_build_choice_labels(False) | ||
model = stormpy.build_sparse_model_with_options(program, builder_options) | ||
return model | ||
|
||
@classmethod | ||
def from_prism(cls, program, specification = None): | ||
assert program.model_type in [stormpy.storage.PrismModelType.MDP, stormpy.storage.PrismModelType.POMDP] | ||
builder_options = cls.default_builder_options(specification) | ||
model = stormpy.build_sparse_model_with_options(program, builder_options) | ||
return model | ||
|
||
@classmethod | ||
def from_drn(cls, drn_path): | ||
builder_options = stormpy.core.DirectEncodingParserOptions() | ||
builder_options.build_choice_labels = True | ||
return stormpy.build_model_from_drn(drn_path, builder_options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.