Skip to content
Snippets Groups Projects
Commit 47e68bc0 authored by Thomas's avatar Thomas
Browse files

fix dotfile

parent cc5bdfec
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,8 @@ import net.automatalib.words.impl.Alphabets;
import java.io.IOException;
import java.nio.file.Path;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.nio.file.Paths;
import java.util.*;
/**
* A class which is just able to parse the output generated by LearnLib (why is this not included in LearnLib itself?
......@@ -81,15 +79,16 @@ public class GraphvizParser {
String[] io = e.label.split("/");
for (String o : outputs){
if (e.from.equals("0") && e.to.equals("0") && accepting.contains(o) && accepting.contains(io[1].trim()))
if (e.from.equals("0") && e.to.equals("0") && accepting.contains(o) && accepting.contains(io[1].trim())) {
builder.from(e.from).on(io[0].trim()).to(e.to);
else if (e.from.equals("0") && accepting.contains(o))
} else if (e.from.equals("0") && accepting.contains(o)) {
builder.from(e.from).on(io[0].trim()).to(e.to + "_" + io[1].trim());
else if (e.to.equals("0") && accepting.contains(io[1].trim()))
} else if (e.to.equals("0") && accepting.contains(io[1].trim())) {
builder.from(e.from + "_" + o).on(io[0].trim()).to(e.to);
else
} else {
builder.from(e.from + "_" + o).on(io[0].trim()).to(e.to + "_" + io[1].trim());
}
}
if (accepting.contains(io[1].trim())){
if (e.to.equals("0"))
......@@ -118,4 +117,13 @@ public class GraphvizParser {
return builder.create();
}
public static void main(String[] args) throws IOException {
GraphvizParser parser = new GraphvizParser(Paths.get("mydotfile.dot"));
CompactDFA<String> target = parser.createDFA(Arrays.asList("0", "1K", "2K", "3K"));
GraphvizParser parser2 = new GraphvizParser(Paths.get("passport.flat_0_1.dot"));
CompactDFA<String> target2 = parser2.createDFAfromMealy(Collections.singletonList("OOK"));
}
}
......@@ -28,7 +28,7 @@ digraph {
1K -> 2K [label="ICOMPLETEBAC"]
1K -> 0N [label="IFAILBAC"]
1K -> 1N [label="IFAILEAC"]
1K -> 1N [label="IGETCHALLENGE"]
1K -> 1K [label="IGETCHALLENGE"]
1K -> 1N [label="IREADFILE_0"]
1K -> 1N [label="IREADFILE_1"]
1K -> 0 [label="IRESET"]
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment