def getThirds(self):
     thirds = []
     for n in self.P1.notS:
             P2 = NumericalSemigroup( self.P1.gens + [n] )
             if P2.isIrreducible()==False and n > 3:
                     thirds.append( n )
     return thirds
Exemplo n.º 2
0
def checkit(situation):
    # print("working...")
    sety = NumericalSemigroup(situation).minGens
    # print( sety )
    nvect = ExhaustiveGame(NumericalSemigroup(situation)).thirds
    counter = 0

    if sety in good:
        return 1

    for n in nvect:

        P1 = NumericalSemigroup(sety + [n])
        gens = P1.minGens

        if gens in good:
            bad.append(sety)
            return 0
        elif gens in bad:
            counter += 1
        elif P1.isIrreducible() == True:
            bad.append(gens)
            counter += 1
        else:
            x = checkit(sety + [n])
            if x == 0:
                counter += 1
            elif x == 1:
                bad.append(sety)
                return 0

    if counter == len(nvect):
        if sety not in good:
            good.append(sety)
            return 1
 def generateOneGame(self, num):
     if num > 3:
         P2 = NumericalSemigroup( self.P1.gens + [num] )
         if P2.isIrreducible() == False:
             
             check = checker( P2 )
             self.soulDict[num] = check
             self.whichGamesGenerated()
             print("Generated {0} with {1} games".format( num, len(check)) )
             return check