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

fixed 2 more bugs. succes rate on testset of 300 benchmarks is now 100%.

static linking introduced errors on some pc's, so i included a dll file
in the bin directory instead.
parent 05fceb59
......@@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.8)
project(complete_ads)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-static-libgcc -static-libstdc++")
#set(CMAKE_CXX_FLAGS "-static-libgcc -static-libstdc++")
#set(CMAKE_CXX_FLAGS "-static-libgcc")
set(SOURCE_FILES main.cpp src/main_test.cpp)
add_subdirectory("lib")
add_subdirectory("src")
\ No newline at end of file
No preview for this file type
......@@ -296,9 +296,8 @@ splitting_tree create_splitting_tree(const mealy &g)
if (valid_set.empty())
targets = unordered_set<state>(boom.states.begin(),boom.states.end());
else
{
targets = unordered_set<state>(valid_set);
}
//a list of all the splits that were made.
//they are saved in a list so that they can be modified if required before they are pushed onto the work_list.
......@@ -370,6 +369,10 @@ splitting_tree create_splitting_tree(const mealy &g)
{
if (targets.empty())
break;
else
{
valid_target = *targets.begin();
}
vector<bool> successor_states(N, false);
for (auto &&state : boom.states)
......@@ -447,11 +450,12 @@ splitting_tree create_splitting_tree(const mealy &g)
//there are only two possible ways that this can happen. 1: the two states are equal, or 2: they could be split on output state but the work needed to
//determine the required separator is still in the work_list.
//option 1 is excluded because the specification is reduced and the names of the states differ.
//to resolve the problem we postpone this split and try to force progress elsewere first.
//to resolve the problem we postpone this split and try to force progress elsewhere first.
force_progress = true;
days_without_progress++;
//make sure we wont endlessly run in circles.
if(days_without_progress<= 3*work_list.size())
//the +1 is to account for the current boom that is not in the work list right now but will be put back later.
if(days_without_progress>= 3*(work_list.size()+1))
{
//if we get here then the algorithm has failed.
//we return the root anyway so we can inspect the partial solution in the output file.
......@@ -462,7 +466,7 @@ splitting_tree create_splitting_tree(const mealy &g)
} else
{
//if not, then queue it now using the stored info.
//if the best general split is not already queued, then queue it now using the stored info.
for (state s : targets)
{
best_seperator_valid_set.emplace(s);
......
......@@ -68,7 +68,8 @@ struct main_options
//"lee_yannakakis_distinguishable.dot";
//"esm-manual-controller.dot";
//"ABP_Sender.flat_0_1.dot";
string input_filename = input_directory + "ABP_Sender.flat_0_1.dot";
//"ex5_with_loops_with_hidden_states_minimized.dot";
string input_filename = input_directory + "learnresult_new_Rand_500_10-15_MC_fix.dot";
string output_filename = "";
};
......@@ -184,7 +185,7 @@ int main(int argc, char *argv[])
return read_mealy_from_dot(filename);
}();
//todo: check if this is required
const auto &reachable_machine = reachable_submachine(machine_and_translation.first, 0U);
const auto &machine = machine_and_translation.first;
if(machine.graph_size!=reachable_machine.graph_size)
......@@ -197,7 +198,7 @@ int main(int argc, char *argv[])
vector<string> state_translation = create_reverse_map(translation.state_indices);
//only useful for debugging
/*
ofstream translation_file(output_directory + "translations.txt");
translation_file << "input translation\n";
translation_file << input_translation;
......@@ -206,7 +207,8 @@ int main(int argc, char *argv[])
translation_file << "\nstate translation\n";
translation_file << state_translation;
translation_file.close();
*/
......@@ -216,7 +218,9 @@ int main(int argc, char *argv[])
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);
......@@ -225,9 +229,7 @@ int main(int argc, char *argv[])
assert(test_separating_family(family, machine));
ofstream out_file(args.output_filename);
out_file << "the splitting tree:\n\n";
rst_to_stream(translated_tree, out_file) << "\n\n\n";
out_file << "the separating family:\n\n";
separating_family_to_stream(out_file, family, input_translation, state_translation);
out_file.close();
......
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