11//! Contains operations to sanitize bdds of their additional symbolic variables,
22//! making them compatible with remaining biodivine libraries.
33use 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.
2724pub 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.
4135pub 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