Commit ea7ad25b authored by Gijs van Cuyck's avatar Gijs van Cuyck

fixed a bug that only apeared on bigger text cases.

parent 8d71fb95
......@@ -48,7 +48,7 @@ std::ostream& rst_to_stream(readable_splitting_tree & tree, std::ostream & outpu
output << "all states\n";
else
output << "{" << join(reverse_valid_map[i].begin(),reverse_valid_map[i].end(),",","}") << "\n";
output << indentations << join(tree.separators[i].begin(),tree.separators[i].end()) << "\n" ;
output << indentations << join(tree.separators[i].begin(),tree.separators[i].end(),",") << "\n" ;
for(auto & child : tree.children[i]) {
rst_to_stream(child,output,ident+1);
}
......
......@@ -176,7 +176,6 @@ splitting_tree create_splitting_tree(const mealy &g)
//when set to true the algorithm will select a split as best as it can for the current work set, even when there are no "valid" options.
bool force_progress = false;
// List of inputs, will be shuffled in case of randomizations
vector<input> all_inputs(P);
iota(begin(all_inputs), end(all_inputs), 0);
......@@ -430,12 +429,13 @@ splitting_tree create_splitting_tree(const mealy &g)
}
if (targets.size() == 0)
goto has_split;
break;
}
//if we get here, then there was a state for which there was no valid split.
//we use the recorded best general split so far instead.
//if we get here, then we tried all the possible partialy valid splits.
//there might however still be states left in targets for which there was no valid split.
//for these states we use the recorded best general split so far instead.
//if the best general split is already queued, update ists valid_list to include the remaining targets.
if(best_split_index !=-1)
......
......@@ -64,7 +64,7 @@ struct main_options {
//"coffe_machine.dot";
//"lee_yannakakis_difficult.dot";
//"lee_yannakakis_distinguishable.dot";
string input_filename = input_directory+"lee_yannakakis_difficult.dot";
string input_filename = input_directory+"model3.dot";
string output_filename = "";
};
......@@ -168,26 +168,28 @@ int main(int argc, char * argv[]){
const auto & translation = machine_and_translation.second;
splitting_tree complete_splitting_tree = create_splitting_tree(machine);
vector<string> input_translation = create_reverse_map(translation.input_indices);
vector<string> state_translation = create_reverse_map(translation.state_indices);
//only usefull for debugging
ofstream translation_file(output_directory+"translations.txt");
translation_file << "input translation\n";
translation_file << input_translation;
translation_file <<"\nstate translation\n";
translation_file << state_translation;
translation_file.close();
/* only usefull for debugging
ofstream translation_file(output_directory+"translations.txt");
translation_file << "input translation\n";
translation_file << input_translation;
translation_file <<"\nstate translation\n";
translation_file << state_translation;
translation_file.close();
*/
readable_splitting_tree translated_tree = translate_splitting_tree(complete_splitting_tree,input_translation,state_translation);
separating_family family = create_separating_family(complete_splitting_tree,machine);
cout <<"creating splitting tree\n";
splitting_tree complete_splitting_tree = create_splitting_tree(machine);
cout <<"creating readable splitting tree\n";
readable_splitting_tree translated_tree = translate_splitting_tree(complete_splitting_tree,input_translation,state_translation);
ofstream out_file(args.output_filename);
out_file<<"the splitting tree:\n\n";
rst_to_stream(translated_tree,out_file)<<"\n\n\n";
cout<<"creating separating family\n";
separating_family family = create_separating_family(complete_splitting_tree,machine);
out_file<<"the separating family:\n\n";
separating_family_to_stream(out_file,family,input_translation,state_translation);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment