class_docstr: This class holds the state for learning a DFA. The current DFA can be
  accessed as the ``dfa`` member of this class. Such a DFA becomes invalid
  as soon as ``learn`` has been called, and should only be used until the
  next call to ``learn``.
  
  Note that many of the DFA methods are on this class, but it is not itself
  a DFA. The reason for this is that it stores mutable state which can cause
  the structure of the learned DFA to change in potentially arbitrary ways,
  making all cached properties become nonsense.
docstr: Equivalent to ``self.dfa.transition(i, c)```
docstr_tok: ["Equivalent","to","``","self.dfa.transition","(","i",",","c",")","``","`"]
code: def transition(self, i, c):
      """Equivalent to ``self.dfa.transition(i, c)```"""
      c = self.normalizer.normalize(c)
      state = self.__states[i]
      try:
          return state.transitions[c]
      except KeyError:
          pass
  
      # The state that we transition to when reading ``c`` is reached by
      # this string, because this state is reached by state.label. We thus
      # want our candidate for the transition to be some state with a label
      # equivalent to this string.
      #
      # We find such a state by looking for one such that all of its listed
      # experiments agree on the result for its state label and this string.
      string = state.label + bytes([c])
  
      # We keep track of some useful experiments for distinguishing this
      # string from other states, as this both allows us to more accurately
      # select the state to map to and, if necessary, create the new state
      # that this string corresponds to with a decent set of starting
      # experiments.
      accumulated = {}
      counts = Counter()
  
      def equivalent(t):
          """Checks if ``string`` could possibly lead to state ``t``."""
          for e, expected in accumulated.items():
              if self.member(t.label + e) != expected:
                  counts[e] += 1
                  return False
  
          for e, expected in t.experiments.items():
              result = self.member(string + e)
              if result != expected:
                  # We expect most experiments to return False so if we add
                  # only True ones to our collection of essential experiments
                  # we keep the size way down and select only ones that are
                  # likely to provide useful information in future.
                  if result:
                      accumulated[e] = result
                  return False
          return True
  
      try:
          destination = self.__self_organising_states.find(equivalent)
      except NotFound:
          i = len(self.__states)
          destination = DistinguishedState(
              index=i,
              label=string,
              experiments=accumulated,
              accepting=self.member(string),
          )
          self.__states.append(destination)
          self.__self_organising_states.add(destination)
      state.transitions[c] = destination.index
      return destination.index
  
imports: from bisect import bisect_right, insort
  from collections import Counter
  import attr
  from hypothesis.errors import InvalidState
  from hypothesis.internal.conjecture.dfa import DFA, cached
  from hypothesis.internal.conjecture.junkdrawer import IntList, NotFound, SelfOrganisingList, find_integer
label_desc: Use image node_id 5 for calling the LStar obj's underlying member method code with example usage: obj.transition(i, c) and returns: destination, state, True, False, False