Skip to content

Commit fedb324

Browse files
committed
Do not require BN when sanitizing.
1 parent 1384bd4 commit fedb324

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ path = "src/bin/convert_aeon_to_bnet.rs"
2727

2828
[dependencies]
2929
biodivine-lib-bdd = ">=0.5.7, <1.0.0"
30-
biodivine-lib-param-bn = ">=0.5.0, <1.0.0"
30+
biodivine-lib-param-bn = ">=0.5.1, <1.0.0"
3131
clap = { version = "4.1.4", features = ["derive"] }
3232
rand = "0.8.5"
3333
termcolor = "1.1.2"

src/postprocessing/sanitizing.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Contains operations to sanitize bdds of their additional symbolic variables,
22
//! making them compatible with remaining biodivine libraries.
33
use biodivine_lib_param_bn::symbolic_async_graph::{
4-
GraphColoredVertices, GraphColors, GraphVertices, SymbolicAsyncGraph, SymbolicContext,
4+
GraphColoredVertices, GraphColors, GraphVertices, SymbolicAsyncGraph,
55
};
66

77
/// Sanitize underlying BDD of a given coloured state set by removing the symbolic variables
@@ -11,10 +11,7 @@ pub fn sanitize_colored_vertices(
1111
stg: &SymbolicAsyncGraph,
1212
colored_vertices: &GraphColoredVertices,
1313
) -> GraphColoredVertices {
14-
let canonical_bn = stg.as_network().unwrap_or_else(|| {
15-
panic!("Cannot normalize STG with no associated network.");
16-
});
17-
let canonical_context = SymbolicContext::new(canonical_bn).unwrap();
14+
let canonical_context = stg.symbolic_context().as_canonical_context();
1815
let sanitized_result_bdd = canonical_context
1916
.transfer_from(colored_vertices.as_bdd(), stg.symbolic_context())
2017
.unwrap();
@@ -25,10 +22,7 @@ pub fn sanitize_colored_vertices(
2522
/// that were used for representing HCTL state-variables. At the moment, we remove all symbolic
2623
/// variables.
2724
pub fn sanitize_colors(stg: &SymbolicAsyncGraph, colors: &GraphColors) -> GraphColors {
28-
let canonical_bn = stg.as_network().unwrap_or_else(|| {
29-
panic!("Cannot normalize STG with no associated network.");
30-
});
31-
let canonical_context = SymbolicContext::new(canonical_bn).unwrap();
25+
let canonical_context = stg.symbolic_context().as_canonical_context();
3226
let sanitized_result_bdd = canonical_context
3327
.transfer_from(colors.as_bdd(), stg.symbolic_context())
3428
.unwrap();
@@ -39,10 +33,7 @@ pub fn sanitize_colors(stg: &SymbolicAsyncGraph, colors: &GraphColors) -> GraphC
3933
/// that were used for representing HCTL state-variables. At the moment, we remove all symbolic
4034
/// variables.
4135
pub fn sanitize_vertices(stg: &SymbolicAsyncGraph, vertices: &GraphVertices) -> GraphVertices {
42-
let canonical_bn = stg.as_network().unwrap_or_else(|| {
43-
panic!("Cannot normalize STG with no associated network.");
44-
});
45-
let canonical_context = SymbolicContext::new(canonical_bn).unwrap();
36+
let canonical_context = stg.symbolic_context().as_canonical_context();
4637
let sanitized_result_bdd = canonical_context
4738
.transfer_from(vertices.as_bdd(), stg.symbolic_context())
4839
.unwrap();

0 commit comments

Comments
 (0)