sandmark.obfuscate.loop.dfa
Class DFA
java.lang.Object
|
+--sandmark.obfuscate.loop.dfa.DFA
- Direct Known Subclasses:
- PostprohibitDFA, PostreqDFA, PreprohibitDFA, PrereqDFA
- public class DFA
- extends java.lang.Object
Method Summary |
static DFA |
createDFA(Algorithm[] algs,
ApplicationObject[] objects)
|
void |
dotInFile(java.lang.String filename)
|
protected static java.lang.Object[][] |
getAlphabet(Algorithm[] allAlgs,
ApplicationObject[] allObjs)
Returns a list of tuples (algorithm, target) of valid algorithm
to target pairs. |
protected java.util.HashMap |
getNodeRangeMap(ApplicationObject[] allObjs)
|
protected static java.util.ArrayList[] |
getPowerset(java.lang.Object[] set)
Returns an array of arrays, that is the powerset of a given set. |
DFANode |
getStartState()
|
protected boolean |
hasProp(Algorithm a,
RequisiteProperty prop)
|
protected boolean |
isLoopEdge(Algorithm alg1,
Algorithm a,
ApplicationObject t,
RequisiteProperty prop,
java.util.ArrayList s_q,
java.util.ArrayList r_t)
|
protected boolean |
isNonLoopEdge(Algorithm alg1,
Algorithm a,
ApplicationObject t,
RequisiteProperty prop,
java.util.ArrayList s_q,
java.util.ArrayList s_qp,
java.util.ArrayList r_t)
|
void |
reassignWeights(DFANode node,
WeightMap weightMap)
|
java.lang.String |
toDot()
|
protected void |
trimDeadStates()
|
protected void |
trimUnreachable()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myStartState
protected DFANode myStartState
myStates
protected DFANode[] myStates
myEdges
protected DFAEdge[] myEdges
rangeMap
protected static java.util.HashMap rangeMap
stateMap
protected java.util.HashMap stateMap
DFA
protected DFA(Algorithm alg1,
RequisiteProperty prop,
Algorithm[] allAlgs,
ApplicationObject[] allObjects,
boolean accept)
- Constructs common structure between every dfa type.
Initializes the set of states to be the powerset of the set of all
application objects that are a target of alg1.
- Parameters:
alg1
- the algorithm that is involved in the dependencyaccept
- initial value of every state's accept field
createDFA
public static DFA createDFA(Algorithm[] algs,
ApplicationObject[] objects)
reassignWeights
public void reassignWeights(DFANode node,
WeightMap weightMap)
getStartState
public DFANode getStartState()
toDot
public java.lang.String toDot()
dotInFile
public void dotInFile(java.lang.String filename)
getAlphabet
protected static java.lang.Object[][] getAlphabet(Algorithm[] allAlgs,
ApplicationObject[] allObjs)
- Returns a list of tuples (algorithm, target) of valid algorithm
to target pairs.
getPowerset
protected static java.util.ArrayList[] getPowerset(java.lang.Object[] set)
- Returns an array of arrays, that is the powerset of a given set.
- Parameters:
set
- the given set
- Returns:
- the P(set)
trimUnreachable
protected void trimUnreachable()
trimDeadStates
protected void trimDeadStates()
getNodeRangeMap
protected java.util.HashMap getNodeRangeMap(ApplicationObject[] allObjs)
hasProp
protected boolean hasProp(Algorithm a,
RequisiteProperty prop)
isNonLoopEdge
protected boolean isNonLoopEdge(Algorithm alg1,
Algorithm a,
ApplicationObject t,
RequisiteProperty prop,
java.util.ArrayList s_q,
java.util.ArrayList s_qp,
java.util.ArrayList r_t)
isLoopEdge
protected boolean isLoopEdge(Algorithm alg1,
Algorithm a,
ApplicationObject t,
RequisiteProperty prop,
java.util.ArrayList s_q,
java.util.ArrayList r_t)