q2 = ( -2 * c**2 + 4 * b**2 + 4 * a**2 - 7 ) * y**2 - x / c; print "q2 = " + str(q2); q3 = ( -7 * b + 4 * a + 12 ) + z; print "q3 = " + str(q3); q4 = q2 / q3; print "q4 = " + str(q4); q5 = ( 2 * c**2 - 4 * b**2 - 4 * a**2 + 7 + x * z ) / (7 * b - 4 * a - 12 ) + y**2; print "q5 = " + str(q5); print "q5.factory() = " + str(q5.factory()); q6 = q5.monic(); print "q6 = " + str(q6); print; print "------- RR( [QQ(),ZM(19),DD()] ) ---------"; r = RR( [QQ(),ZM(19),DD()] ); print "r = " + str(r); print "r.factory() = " + str(r.factory()); rc1 = RR( [ QQ(), ZM(19), DD() ] ); print [ str(x) for x in r.gens() ]; print "rc1.factory() = " + str(rc1.factory()); [pg0,pg1,pg2] = r.gens(); print "pg0 = " + str(pg0); print "pg1 = " + str(pg1); print "pg2 = " + str(pg2); r1 = pg1 + pg2 + pg0; print "r1 = " + str(r1); r2 = r1 * r1 + 7 * r1; print "r2 = " + str(r2); r3 = r2**3; print "r3 = " + str(r3);
import sys from jas import Ring, PolyRing, ParamIdeal, QQ, ZM, RR from jas import startLog, terminate # Boolean coefficient boolean GB # see S. Inoue and A. Nagai "On the Implementation of Boolean Groebner Bases" in ASCM 2009 # Z_2 regular ring coefficent example r = PolyRing(RR(ZM(2), 3), "a,x,y", PolyRing.lex) print "r = " + str(r) #print len(r.gens()) [s1, s2, s3, a, x, y] = r.gens() one = r.one() print "one = " + str(one) print "s1 = " + str(s1) print "s2 = " + str(s2) print "s3 = " + str(s3) print "a = " + str(a) print "x = " + str(x) print "y = " + str(y) #brel = [ a**2 - a, x**2 - x, y**2 - y ]; brel = [x**2 - x, y**2 - y] #print "brel = " + str(brel[0]) + ", " + str(brel[1]) + ", " + str(brel[2]); print "brel = " + str(brel[0]) + ", " + str(brel[1]) pl = [(one + s1 + s2) * (x * y + x + y), s1 * x + s1, a * y + a, x * y]