Exemplo n.º 1
0
def test():
        
    D = Diagram()
    A = Object(D,"A")
    AxA = Object(D,"AxA")
    f = Morphism(AxA,A,)
    g = Morphism(AxA,A)
    ProductProperty(f,g)
    
    RM = RuleMaster(D,prioritiser = UltimateWeightPriotiser)
    for _ in xrange(10):
        RM.rule(numberOfExtensions=3,verbose=True)
    D.printCommutativity()
    print D.Objects

#test()
#from cProfile import run
#run("test()")
Exemplo n.º 2
0
def abeliantest():
    D = Diagram(category = AbelianCategory)
    
    A = Object(D,"A")
    B = Object(D,"B")
    f = Morphism(A,B,"f")
    
    #K = Object(D,"K")
    #iker = Morphism(K,A,"ker_f")
    #Kernel(f,iker)
    
    C = Object(D,"C")
    g = Morphism(C,A,"g")
    
    SetEqualZero(f*g)

    Rules = abelianRules+[ComposeRule,ExistIdentity]
    RM = RuleMaster(D,Rules = Rules, prioritiser = UltimateWeightPriotiser)
    for _ in xrange(40):
        RM.rule(verbose=True)
    D.printCommutativity()