choco.kernel.model.constraints.automaton
Class DFA

java.lang.Object
  extended by choco.kernel.model.constraints.automaton.DFA

public class DFA
extends Object

Created by IntelliJ IDEA. User: Hadrien A structure of DFA defined by a table of Transitions and a set of final states. The algorithm is based on the interesting paper: Gilles Pesant, A Regular Language Membership Constraint for Finite Sequences of Variables, CP 2004. Pages 482-495, LNCS 3258, Springer-Verlag, 2004. The layered graph used by the algorithm of Pesant is computed from the DFA. The algorithm is a bit less incremental : the lists of outgoing and ingoing edges are not stored upon backtracking. The size of the ingoing egdes is indeed bounded by the number of states of the previous layer which can be very big. An acyclic DFA is only defined by its layeredgraph attribute.


Field Summary
protected  Transition[] automaton
          The table of transitions
protected  List<Integer> finalStates
          The set of final states
protected  LayeredDFA graph
          The layered graph build according to that dfa
 LightLayeredDFA lightGraph
           
protected  int nbState
          Number of states
protected  int sizeword
          Only words of size sizeword will be recognized
 
Constructor Summary
DFA(List<int[]> tuples)
          Build a DFA based on a list of FEASIBLE tuples
DFA(List<int[]> tuples, int[] min, int[] max)
          Build a DFA based on a list of INFEASIBLE tuples As the relation is defined by infeasible tuples and we build the feasible automaton, we need to know the range of values by the max and min fields...
DFA(List<Transition> trans, List<Integer> finalStates, int sizeword)
          Build a DFA (deterministic finite automaton) to enforce a set of sizeword variables to be assigned to a word recognized by that dfa.
DFA(String strRegExp, int sizeword)
          Build a DFA (deterministic finite automaton) to enforce a set of sizeword variables to be assigned to a word matching the given regexp.
 
Method Summary
protected  void buildLayeredGraph(int nbvar)
           
protected  void forwardPhase(Hashtable<Integer,State>[] N, int nbvar)
          Build the layered graph made of all states reachable from the start state
 LayeredDFA getGraph()
           
 LightLayeredDFA getLightGraph()
           
 List<Transition> getOutEdges(int s)
           
 void setGraph(LayeredDFA graph)
           
 void setLightGraph(LightLayeredDFA lightGraph)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

automaton

protected Transition[] automaton
The table of transitions


nbState

protected int nbState
Number of states


finalStates

protected List<Integer> finalStates
The set of final states


sizeword

protected int sizeword
Only words of size sizeword will be recognized


graph

protected LayeredDFA graph
The layered graph build according to that dfa


lightGraph

public LightLayeredDFA lightGraph
Constructor Detail

DFA

public DFA(List<int[]> tuples)
Build a DFA based on a list of FEASIBLE tuples

Parameters:
tuples - : a list of int[] corresponding to tuple

DFA

public DFA(List<int[]> tuples,
           int[] min,
           int[] max)
Build a DFA based on a list of INFEASIBLE tuples As the relation is defined by infeasible tuples and we build the feasible automaton, we need to know the range of values by the max and min fields...

Parameters:
tuples - : a list of int[] corresponding to tuple
max - : The maximum value of the alphabet used for each layer (upper bound of each variables).
min - : The minimum value of the alphabet used for each layer (lower bound of each variables).

DFA

public DFA(List<Transition> trans,
           List<Integer> finalStates,
           int sizeword)
Build a DFA (deterministic finite automaton) to enforce a set of sizeword variables to be assigned to a word recognized by that dfa. The same dfa can be used for different propagators.

Parameters:
trans - : the list of transitions defining the dfa.
finalStates - : the set of final states.
sizeword - : Only words of size sizeword will be recognized

DFA

public DFA(String strRegExp,
           int sizeword)
Build a DFA (deterministic finite automaton) to enforce a set of sizeword variables to be assigned to a word matching the given regexp. For example regexp = "(1|2)(3*)(4|5)"; The same dfa can be used for different propagators.

Parameters:
strRegExp - :
sizeword - : Only words of size sizeword will be recognized
Method Detail

getGraph

public LayeredDFA getGraph()

setGraph

public void setGraph(LayeredDFA graph)

getLightGraph

public LightLayeredDFA getLightGraph()

setLightGraph

public void setLightGraph(LightLayeredDFA lightGraph)

getOutEdges

public List<Transition> getOutEdges(int s)

buildLayeredGraph

protected void buildLayeredGraph(int nbvar)

forwardPhase

protected void forwardPhase(Hashtable<Integer,State>[] N,
                            int nbvar)
Build the layered graph made of all states reachable from the start state



Copyright © 2012. All Rights Reserved.