reasoning under uncertainty factors_to_check |{ for in other_factors if var in variablesother_factors -factors_to_check set difference if other_factorsreturn [(component_factors,[ for in split_order if in component_variables])connected_components(contextother_factors[ for in split_order if not in component_variables]elsereturn [(component_factorssplit_order)testingprobrc py -(continued from probgraphicalmodels import bn_ cha, , , ,f_a,f_b,f_c,f_d bn_ chv probrc(bn_ ch#bn_ chv query( ,{}#bn_ chv query( ,{}#inferencemethod max_display_level show more detail in displaying #inferencemethod max_display_level show less detail in displaying #bn_ chv query( ,{ :true},[ , ]#bn_ chv query( ,{ :true, :false} from probgraphicalmodels import bn_report,alarm,fire,leaving,report,smoke,tamper bn_reportrc probrc(bn_reportanswers queries using recursive conditioning #bn_reportrc query(tamper,{}#inferencemethod max_display_level show no detail in displaying #bn_reportrc query(leaving,{}#bn_reportrc query(tamper,{}split_order=[smoke,fire,alarm,leaving,report]#bn_reportrc query(tamper,{report:true}#bn_reportrc query(tamper,{report:true,smoke:false}#note what happens to the cache when these are called in turn#bn_reportrc query(tamper,{report:true}split_order=[smoke,fire,alarm,leaving]#bn_reportrc query(smoke,{report:true}split_order=[tamper,fire,alarm,leaving] from probgraphicalmodels import bn_sprinklerseasonsprinklerrainedgrass_wetgrass_shinyshoes_wet bn_sprinklerv probrc(bn_sprinkler#bn_sprinklerv query(shoes_wet,{}#bn_sprinklerv query(shoes_wet,{rained:true}#bn_sprinklerv query(shoes_wet,{grass_shiny:true}#bn_sprinklerv query(shoes_wet,{grass_shiny:false,rained:true} version june