Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
complete-ads
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gijs van Cuyck
complete-ads
Commits
ea7ad25b
Commit
ea7ad25b
authored
Oct 30, 2018
by
Gijs van Cuyck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a bug that only apeared on bigger text cases.
parent
8d71fb95
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
lib/readable_splitting_tree.cpp
lib/readable_splitting_tree.cpp
+1
-1
lib/splitting_tree.cpp
lib/splitting_tree.cpp
+4
-4
src/main.cpp
src/main.cpp
+15
-13
No files found.
lib/readable_splitting_tree.cpp
View file @
ea7ad25b
...
...
@@ -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
);
}
...
...
lib/splitting_tree.cpp
View file @
ea7ad25b
...
...
@@ -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
)
...
...
src/main.cpp
View file @
ea7ad25b
...
...
@@ -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
<<
"
\n
state 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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment