version 1.1.1.1, 1999/10/08 02:12:15 |
version 1.4, 2001/01/08 05:26:51 |
|
|
|
|
/* SSWork/yacc/debug/asir0.k, 1997, 3/5 cf. debug/asir1.ccc */ |
/* SSWork/yacc/debug/asir0.k, 1997, 3/5 cf. debug/asir1.ccc */ |
if (K00_verbose) { |
if (K00_verbose) { |
Println("debug/asir0.k you need to start k0 with -f option. "); |
Println("debug/asir0.k you need ox_asir module. "); |
} |
} |
|
|
|
def loadOXasir() { |
|
Load_sm1(["oxasir.sm1",AddString([GetEnv("OpenXM_HOME"), |
|
"/lib/sm1/oxasir.sm1"])], |
|
"oxasir.sm1.loaded"); |
|
} |
|
|
/* x = Poly("x"); |
/* x = Poly("x"); |
f = (x+2)^10; |
f = (x+2)^10; |
Println(f); */ |
Println(f); */ |
|
|
def Factor(f) { |
def Factor(f) { |
sm1(f, " factor /FunctionValue set"); |
loadOXasir(); |
sm1(" clean-workfiles "); |
sm1(f, " f fctr /FunctionValue set"); |
} |
} |
HelpAdd(["Factor",[" Not Yet. <<need asir, start k0 with -f option.>>"]]); |
HelpAdd(["Factor",["Factor a given polynomial."]]); |
|
|
def Cancel(f) { |
def Cancel(f) { |
local tmp,den,num; |
local tmp,den,num,r; |
|
loadOXasir(); |
if (IsRational(f)) { |
if (IsRational(f)) { |
den = Cancel(Denominator(f)); |
den = Cancel(Denominator(f)); |
num = Cancel(Numerator(f)); |
num = Cancel(Numerator(f)); |
|
|
if (IsInteger(f)) return(f); |
if (IsInteger(f)) return(f); |
if (IsPolynomial(f)) { |
if (IsPolynomial(f)) { |
if (f == Poly("0")) return(0); |
if (f == Poly("0")) return(0); |
if (Characteristic(Ringp(f)) != 0) return(f); |
if (Characteristic(GetRing(f)) != 0) return(f); |
if (IsConstant(f)) return(DC(f,"integer")); |
if (IsConstant(f)) return(DC(f,"integer")); |
return(f); |
return(f); |
} |
} |
sm1(f," cancel /FunctionValue set"); |
sm1("[[num den]] reduceByAsir /r set "); |
sm1(" clean-workfiles "); |
if (IsInteger(r[1])) { |
|
if (r[1] == 1) return(r[0]); |
|
} |
|
return(r[0]/r[1]); |
} |
} |
HelpAdd(["Cancel",[" Not Yet. <<need asir, start k0 with -f option>>"]]); |
HelpAdd(["Cancel",["Cancel the greatest common multiple of the denominators and the numerator. "]]); |
|
|
|
|
|
|
|
/* BUG: It has not yet been rewritten. |
def Primadec(f,g) { |
def Primadec(f,g) { |
sm1(f,g," primadec /FunctionValue set"); |
sm1(f,g," primadec /FunctionValue set"); |
sm1(" clean-workfiles "); |
sm1(" clean-workfiles "); |
} |
} |
HelpAdd(["Primadec",[" Not Yet. <<need asir, start k0 with -f option.>>"]]); |
HelpAdd(["Primadec",[" Not Yet. <<need asir, start k0 with -f option.>>"]]); |
|
*/ |
|
|
|
|