-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in synchronous product and ts.copy()
- Loading branch information
1 parent
e7e13c5
commit 9aff317
Showing
13 changed files
with
432 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"states": [ | ||
"s0", | ||
"s1" | ||
], | ||
"transitions": [ | ||
[ | ||
"s0", | ||
"s1" | ||
], | ||
[ | ||
"s1", | ||
"s1" | ||
] | ||
], | ||
"initialStates": [ | ||
"s0" | ||
], | ||
"atomicPropositions": [ | ||
"a", | ||
"a_0", | ||
"a_1" | ||
], | ||
"labelingFunction": { | ||
"s0": [], | ||
"s1": [ | ||
"a", | ||
"a_0", | ||
"a_1" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/me/paultristanwagner/modelchecking/ts/TransitionSystemLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package me.paultristanwagner.modelchecking.ts; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.GsonBuilder; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
|
||
public class TransitionSystemLoader { | ||
|
||
private static final Gson GSON; | ||
|
||
static { | ||
GSON = | ||
new GsonBuilder() | ||
.registerTypeAdapter(TSTransition.class, new TSTransition.TSTransitionAdapter()) | ||
.setPrettyPrinting() | ||
.create(); | ||
} | ||
|
||
public static TransitionSystem load(String path) throws IOException { | ||
File file = new File(path); | ||
return load(file); | ||
} | ||
|
||
public static TransitionSystem load(File file) throws IOException { | ||
String fileContent = new String(Files.readAllBytes(file.toPath())); | ||
return fromJson(fileContent); | ||
} | ||
|
||
public static TransitionSystem fromJson(String string) { | ||
return GSON.fromJson(string, TransitionSystem.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.