=================================================================== RCS file: /home/cvs/OpenXM/src/k097/help.k,v retrieving revision 1.1.1.1 retrieving revision 1.6 diff -u -p -r1.1.1.1 -r1.6 --- OpenXM/src/k097/help.k 1999/10/08 02:12:15 1.1.1.1 +++ OpenXM/src/k097/help.k 2000/12/29 07:19:39 1.6 @@ -1,4 +1,4 @@ - +/* $OpenXM: OpenXM/src/k097/help.k,v 1.5 2000/12/28 00:08:13 takayama Exp $ */ if (K00_verbose) Println("help.k (help.ccc). 8/6, 1996 --- 8/7, 1996. 3/6, 1997 --- 12/21, 1997."); @@ -270,7 +270,11 @@ HelpAdd(["IsString", ["IsString(obj) returns true if << obj >> is a string (object obj).", "Example: if (IsString(\"abc\")) Println(\"Hello\"); ;"]]); +HelpAdd(["IsRing", +["IsRing(obj) returns true if << obj >> is a ring (object obj)." +]]); + HelpAdd(["IsSm1Integer", ["IsSm1Integer(obj) returns true if << obj >> is an integer of sm1(object obj)."]]); @@ -331,6 +335,7 @@ def RingPoly(vList,weightMatrix,pp) { sm1("[", vList, "ring_of_polynomials ( ) elimination_order 0 ] define_ring /tmp set "); + SetRingVariables(); return(tmp); } else ; if (argsize == 2) { @@ -351,6 +356,7 @@ def RingPoly(vList,weightMatrix,pp) { } new0[i] = newtmp; } + SetRingVariables(); ringpp = sm1("[", vList, "ring_of_polynomials ", new0, " weight_vector", pp, " ] define_ring"); @@ -366,7 +372,11 @@ def IsSm1Integer(ob) { sm1(ob , " isInteger /FunctionValue set "); } +def IsRing(ob) { + sm1(ob , " isRing /FunctionValue set "); +} + def CancelNumber(rn) { local tmp; sm1(" [(cancel) ",rn," ] mpzext /tmp set "); @@ -374,7 +384,13 @@ def CancelNumber(rn) { sm1(" tmp (denominator) dc (1).. eq { /FunctionValue tmp (numerator) dc def} { /FunctionValue tmp def } ifelse "); } +def DC_polynomial(obj) { + return(DC(obj,"polynomial")); +} def DC(obj,key) { + if (IsArray(obj) && key=="polynomial") { + return(Map(obj,"DC_polynomial")); + } if (key == "string") { return(ToString(obj)); } else if (key == "integer") { key = "universalNumber"; } else if (key == "sm1integer") { key = "integer"; } @@ -506,7 +522,6 @@ def RingDonIndexedVariables(vList, size, weightMatrix, if (argsize == 2) { vListD = AddString(["D",vList]); myring = RingD(IndexedVariables(vList,size)); - SetRingVariables(); tmp = NewArray(size); for (k00_i=0; k00_i