Commit 6cab2a70 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Removing warnings on automaton minimization

parent 72236ac6
......@@ -12,7 +12,7 @@ ext {
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.7
sourceCompatibility = 1.8
// version =
sourceSets {
......
......@@ -1035,16 +1035,22 @@ public class AUTGraph implements myutil.Graph {
public AUTGraph fromAutomaton(Automaton a) {
AUTGraph graph = new AUTGraph();
Set<Transition<String>> trs = (Set<Transition<String>>)(a.delta());
@SuppressWarnings("unchecked")
Set<Transition<String>> trs = (Set<Transition<String>>) a.delta();
//Set<?> trs = a.delta();
@SuppressWarnings("unchecked")
Set<State> sts = (Set<State>)(a.states());
Map<State, Integer> mapOfStates = new HashMap<>();
int cpt = 1;
for(State st: sts) {
if (st.isInitial()) {
//@SuppressWarnings("unchecked")
mapOfStates.put(st, new Integer(0));
} else {
//@SuppressWarnings("unchecked")
mapOfStates.put(st, new Integer(cpt));
cpt ++;
}
......@@ -1095,12 +1101,15 @@ public class AUTGraph implements myutil.Graph {
return a;
}
@SuppressWarnings("unchecked")
public AUTGraph reduceGraph() {
Automaton a = toAutomaton();
//TraceManager.addDev("Initial AUT:" + a.toString());
Automaton<String, Transition<String>, TransitionBuilder<String>> newA = (Automaton<String, Transition<String>, TransitionBuilder<String>>)(
@SuppressWarnings("unchecked")
Automaton<String, Transition<String>, TransitionBuilder<String>> newA =
new EpsilonTransitionRemover<String, Transition<String>,
TransitionBuilder<String>>().transform(a));
TransitionBuilder<String>>().transform((Automaton<String, Transition<String>, TransitionBuilder<String>>)a);
//TraceManager.addDev("Aut with no tau / epsilon:" + newA.toString());
newA = new Reducer<String, Transition<String>, TransitionBuilder<String>>().transform(newA);
......
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