Package wyautl_old.lang.Automaton

Examples of wyautl_old.lang.Automaton.State


   * </p>
   */
  public static boolean isConcrete(Automaton automaton) {
    // First, check all states are deterministic
    for(int i=0;i!=automaton.size();++i) {
      State s = automaton.states[i];
      if(!s.deterministic) {
        return false;
      }
    }

View Full Code Here


    }

    visited.set(index);
    onStack.set(index);

    State state = automaton.states[index];
    for(int child : state.children) {
      if(!isConcrete(child,onStack,visited,automaton)) {
        return false;
      }
    }
View Full Code Here

  private final static void extract(int index, BitSet visited,
      ArrayList<Integer> extracted, State[] graph) {
    if(visited.get(index)) { return; } // node already visited}
    extracted.add(index);
    visited.set(index);
    State node = graph[index];
    for(int child : node.children) {
      extract(child,visited,extracted,graph);
    }
  }
View Full Code Here

  /*
   * Check whether two states are equivalent under the rules set out for
   * minimisation above.
   */
  private final static boolean equivalent(int i, int j, BinaryMatrix equivs, Automaton automaton) {
    State s1 = automaton.states[i];
    State s2 = automaton.states[j];

    // first, check supplementary data
    Object s1data = s1.data;
    Object s2data = s2.data;
    if(s1data == null) {
View Full Code Here

  }

  private static void extend(int index, Morphism candidate,
      ArrayList<Morphism> candidates, Automaton automaton) {
    State[] states = automaton.states;
    State s = states[candidate.i2n[index]];
    int[] children = s.children;
    if(s.deterministic) {
      // easy case
      for(int child : children) {
        if(!candidate.isAllocated(child)) {
View Full Code Here

      Automaton automaton, Comparator<State> dataComparator) {
    State[] states = automaton.states;
    int size = Math.min(morph1.free,morph2.free);

    for(int i=0;i!=size;++i) {
      State s1 = states[morph1.i2n[i]];
      State s2 = states[morph2.i2n[i]];
      if(s1.kind < s2.kind) {
        return true;
      } else if(s1.kind > s2.kind) {
        return false;
      } else if(s1.deterministic && !s2.deterministic) {
View Full Code Here

  public static Automaton reorder(Automaton automaton, int[] rmap) {
    State[] ostates = automaton.states;
    State[] nstates = new State[ostates.length];
    int length = ostates.length;
    for(int i=0;i!=length;++i) {
      State os = ostates[i];
      inplaceRemap(os,rmap);
      nstates[rmap[i]] = new Automaton.State(os);
    }
    return new Automaton(nstates);
  }
View Full Code Here

  public static Automaton remap(Automaton automaton, int[] rmap) {
    State[] ostates = automaton.states;
    State[] nstates = new State[ostates.length];
    int length = ostates.length;
    for(int i=0;i!=length;++i) {
      State os = ostates[rmap[i]];
      nstates[i] = remap(os,rmap);
    }
    return new Automaton(nstates);
  }
View Full Code Here

  public static void inplaceReorder(Automaton automaton, int[] rmap) {
    State[] ostates = automaton.states;
    State[] nstates = new State[ostates.length];
    int length = ostates.length;
    for(int i=0;i!=length;++i) {
      State os = ostates[i];
      inplaceRemap(os,rmap);
      nstates[rmap[i]] = os;
    }
    automaton.states = nstates;
  }
View Full Code Here

   */
  public static void inplaceRemap(Automaton automaton, int[] rmap) {
    State[] ostates = automaton.states;
    int length = ostates.length;
    for(int i=0;i!=length;++i) {
      State os = ostates[i];
      inplaceRemap(os,rmap);
    }
  }
View Full Code Here

TOP

Related Classes of wyautl_old.lang.Automaton.State

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.