public class NFAAnalysisTools extends Object
| Constructor and Description |
|---|
NFAAnalysisTools() |
| Modifier and Type | Method and Description |
|---|---|
static NFAGraph |
complementDfa(NFAGraph dfa) |
static NFAGraph |
convertUpNFAToNFAGraph(NFAGraph m,
HashMap<NFAVertexND,UPNFAState> newStateMap) |
static NFAGraph |
createFilter()
Creates an NFA graph representing the Mohri filter.
|
static NFAGraph |
determinize(NFAGraph input,
Set<NFAVertexND> reachableFromStart,
Set<TransitionLabel> alphabet) |
static NFAGraph |
dfaIntersection(NFAGraph m1,
NFAGraph m2) |
static Set<TransitionLabel> |
getAlphabet(NFAGraph n) |
static LinkedList<NFAGraph> |
getEpsilonStronglyConnectedComponents(NFAGraph m)
Constructs a list of NFA graphs each representing a strongly connected
component containing only epsilon transitions in the graph given as
parameter.
|
static LinkedList<NFAGraph> |
getStronglyConnectedComponents(NFAGraph m)
Constructs a list of NFA graphs each representing a strongly connected
component in the graph given as parameter.
|
protected static boolean |
isInterrupted() |
static NFAGraph |
makeTrim(NFAGraph m)
Removes all useless states from an NFA graph.
|
static NFAGraph |
makeTrimAlternative(NFAGraph m)
Removes all useless states from an NFA graph.
|
static NFAGraph |
makeTrimFromStart(NFAGraph m) |
static NFAGraph |
makeTrimUPNFA(NFAGraph m,
NFAGraph upnfa) |
static Map<NFAVertexND,NFAGraph> |
mergeStronglyConnectedComponents(NFAGraph m,
boolean epsilon)
Creates a single state for each strongly connected component.
|
static HashMap<NFAVertexND,Integer> |
numWalksFrom(NFAGraph m,
NFAVertexND s)
Determines the number of walks between a vertex and all other vertices in
a given graph.
|
static void |
prepareForFilter(NFAGraph m,
String modifyLabel,
String selfloopLabel)
Modifies an NFA graph so that it can be used with the Mohri filter.
|
static NFAGraph |
productConstruction(NFAGraph m1,
NFAGraph m2,
HashMap<NFAEdge,TransitionLabel> originalWords) |
static NFAGraph |
productConstructionAFA(NFAGraph m)
Calculates the product construction of a graph using the the Mohri
filter.
|
static NFAGraph |
productConstructionAFAFA(NFAGraph m) |
static NFAGraph |
productConstructionAFB(NFAGraph a,
NFAGraph b) |
static HashSet<NFAVertexND> |
reachableWithEpsilon(NFAGraph n,
NFAVertexND v) |
static LinkedList<NFAEdge> |
shortestPathBetween(NFAGraph m,
NFAVertexND start,
NFAVertexND finish) |
static LinkedList<NFAEdge> |
shortestPathTo(NFAGraph m,
NFAVertexND finish)
This function finds the shortest path from the initial state in the NFA
to a certain finish state.
|
static HashMap<NFAVertexND,Integer> |
topologicalSort(NFAGraph originalM)
A function that uses Kahn's algorithm to find the topological order of the vertices in
the graph.
|
static boolean |
upNFAStateIsUseful(NFAGraph m,
NFAGraph upnfa,
UPNFAState upNFAState) |
public static void prepareForFilter(NFAGraph m, String modifyLabel, String selfloopLabel)
m - The NFA graph to modifymodifyLabel - The label to assign to the current epsilon transitions.selfloopLabel - The label to assign to the selfloops added to all states.public static NFAGraph createFilter()
public static NFAGraph productConstructionAFB(NFAGraph a, NFAGraph b) throws InterruptedException
InterruptedExceptionpublic static NFAGraph productConstructionAFA(NFAGraph m) throws InterruptedException
m - The NFA to get the product construction of.InterruptedExceptionpublic static NFAGraph productConstructionAFAFA(NFAGraph m) throws InterruptedException
InterruptedExceptionpublic static NFAGraph productConstruction(NFAGraph m1, NFAGraph m2, HashMap<NFAEdge,TransitionLabel> originalWords) throws InterruptedException
InterruptedExceptionpublic static NFAGraph makeTrimFromStart(NFAGraph m) throws InterruptedException
InterruptedExceptionpublic static NFAGraph makeTrimAlternative(NFAGraph m) throws InterruptedException
m - The NFA graph to remove all useless states from.InterruptedExceptionpublic static NFAGraph makeTrimUPNFA(NFAGraph m, NFAGraph upnfa) throws InterruptedException
InterruptedExceptionpublic static boolean upNFAStateIsUseful(NFAGraph m, NFAGraph upnfa, UPNFAState upNFAState) throws InterruptedException
InterruptedExceptionpublic static NFAGraph makeTrim(NFAGraph m) throws InterruptedException
m - The NFA graph to remove all useless states from.InterruptedExceptionpublic static NFAGraph convertUpNFAToNFAGraph(NFAGraph m, HashMap<NFAVertexND,UPNFAState> newStateMap)
public static LinkedList<NFAGraph> getStronglyConnectedComponents(NFAGraph m) throws InterruptedException
m - The NFA graph to find the strongly connected components in.InterruptedExceptionpublic static LinkedList<NFAGraph> getEpsilonStronglyConnectedComponents(NFAGraph m) throws InterruptedException
m - The NFA graph to find the strongly connected components in.InterruptedExceptionpublic static Map<NFAVertexND,NFAGraph> mergeStronglyConnectedComponents(NFAGraph m, boolean epsilon) throws InterruptedException
m - The NFA graph to merge the epsilon strongly connected
components in.epsilon - True if only epsilon strongly connected components should be
merged, false if all strongly connected components should be
merged.InterruptedExceptionpublic static HashMap<NFAVertexND,Integer> numWalksFrom(NFAGraph m, NFAVertexND s)
m - The graph to count the walks in.s - The starting vertex.public static Set<TransitionLabel> getAlphabet(NFAGraph n)
public static LinkedList<NFAEdge> shortestPathTo(NFAGraph m, NFAVertexND finish)
m - The graph representing the NFA.finish - The state to search to.public static LinkedList<NFAEdge> shortestPathBetween(NFAGraph m, NFAVertexND start, NFAVertexND finish)
public static HashSet<NFAVertexND> reachableWithEpsilon(NFAGraph n, NFAVertexND v)
public static NFAGraph determinize(NFAGraph input, Set<NFAVertexND> reachableFromStart, Set<TransitionLabel> alphabet) throws InterruptedException
InterruptedExceptionpublic static HashMap<NFAVertexND,Integer> topologicalSort(NFAGraph originalM)
originalM - The NFA graph to find the topological order for.protected static boolean isInterrupted()
Copyright © 2021. All rights reserved.