12#ifndef MCRL2_DATA_DETAIL_PROVER_BDD2DOT_H
13#define MCRL2_DATA_DETAIL_PROVER_BDD2DOT_H
15#include "mcrl2/data/detail/prover/bdd_info.h"
48 if (f_visited.count(a_bdd)>0)
55 f_dot_file <<
" " << f_node_number <<
" [shape=box, label=\"T\"];" << std::endl;
59 f_dot_file <<
" " << f_node_number <<
" [shape=box, label=\"F\"];" << std::endl;
67 std::size_t v_true_number = f_visited[v_true_branch].value();
68 std::size_t v_false_number = f_visited[v_false_branch].value();
70 f_dot_file <<
" " << f_node_number <<
" [label=\"" << mcrl2::data::pp(v_guard) <<
"\"];" << std::endl;
71 f_dot_file <<
" " << f_node_number <<
" -> " << v_true_number <<
";" << std::endl;
72 f_dot_file <<
" " << f_node_number <<
" -> " << v_false_number <<
" [style=dashed];" << std::endl;
76 f_dot_file <<
" " << f_node_number <<
" [shape=box, label=\"" << mcrl2::data::pp(a_bdd) <<
"\"];" << std::endl;
78 f_visited[a_bdd]= atermpp::aterm_int(f_node_number++);
93 f_dot_file.open(a_file_name);
94 f_dot_file <<
"digraph BDD {" << std::endl;
96 f_dot_file <<
"}" << std::endl;
The class BDD2Dot offers the ability to write binary decision diagrams to dot files....
std::ofstream f_dot_file
The file the output is written to.
void output_bdd(const data_expression &a_bdd, const std::string &a_file_name)
Writes the BDD it receives as input to a file.
std::map< atermpp::aterm, atermpp::aterm_int > f_visited
A table containing all the visited nodes. It maps these nodes to the corresponding node numbers.
void aux_output_bdd(const data_expression &a_bdd)
Writes the BDD it receives to BDD2Dot::f_dot_file.
BDD_Info f_bdd_info
A class that gives information about the structure of BDDs.
int f_node_number
The smallest unused node number.
The class BDD_Info provides information about the structure of binary decision diagrams.
static const mcrl2::data::data_expression & get_true_branch(const mcrl2::data::data_expression &a_bdd)
Method that returns the true-branch of a BDD.
static bool is_if_then_else(const data_expression &a_bdd)
Method that indicates wether or not the root of a BDD is a guard node.
static bool is_false(const data_expression &a_bdd)
Method that indicates whether or not a BDD equals false.
static const mcrl2::data::data_expression & get_guard(const mcrl2::data::data_expression &a_bdd)
Method that returns the guard of a BDD.
static const mcrl2::data::data_expression & get_false_branch(const mcrl2::data::data_expression &a_bdd)
Method that returns the false-branch of a BDD.
static bool is_true(const data_expression &a_bdd)
Method that indicates whether or not a BDD equals true.