Exemplo n.º 1
0
 def __init__(self, basis, quiet=False):
     self._basis = basis
     self._max_basis_length = max([len(b) for b in self._basis])
     self._class = AvClass(basis, 1)
     self._configs_checked = set()
     self._automaton_ready = False
     self._root = Configuration((0, ), self._basis, 'm')
     self._perm = Configuration((1, ), self._basis, 'f')
     self._tree = {self._root: self._root.children()}
     self._automaton = {self._root: list(self._root.children())}
     self._has_inssch = False
     self._reductions = {}
     self._automaton_ready = False
     if self.has_inssch():
         self._has_inssch = True
     else:
         syms = PermSet(self._basis).all_syms()
         for S in syms:
             self._basis = S
             if self.has_inssch():
                 self._has_inssch = True
                 if not quiet:
                     print(
                         'Av({}) does not have an insertion scheme, but its symmetry Av({}) does.'
                         .format(basis, S))
                 break
         if not self._has_inssch:
             if not quiet:
                 print(
                     'Neither this class nor its symmetries has an insertion scheme.'
                 )