/usr/share/axiom-20170501/src/algebra/QALGSET2.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | )abbrev package QALGSET2 QuasiAlgebraicSet2
++ Author: William Sit
++ Date Created: March 13, 1992
++ Date Last Updated: June 12, 1992
++ References:William Sit, "An Algorithm for Parametric Linear Systems"
++ J. Sym. Comp., April, 1992
++ Description:
++ \spadtype{QuasiAlgebraicSet2} adds a function \spadfun{radicalSimplify}
++ which uses \spadtype{IdealDecompositionPackage} to simplify
++ the representation of a quasi-algebraic set. A quasi-algebraic set
++ is the intersection of a Zariski
++ closed set, defined as the common zeros of a given list of
++ polynomials (the defining polynomials for equations), and a principal
++ Zariski open set, defined as the complement of the common
++ zeros of a polynomial f (the defining polynomial for the inequation).
++ Quasi-algebraic sets are implemented in the domain
++ \spadtype{QuasiAlgebraicSet}, where two simplification routines are
++ provided:
++ \spadfun{idealSimplify} and \spadfun{simplify}.
++ The function
++ \spadfun{radicalSimplify} is added
++ for comparison study only. Because the domain
++ \spadtype{IdealDecompositionPackage} provides facilities for
++ computing with radical ideals, it is necessary to restrict
++ the ground ring to the domain \spadtype{Fraction Integer},
++ and the polynomial ring to be of type
++ \spadtype{DistributedMultivariatePolynomial}.
++ The routine \spadfun{radicalSimplify} uses these to compute groebner
++ basis of radical ideals and
++ is inefficient and restricted when compared to the
++ two in \spadtype{QuasiAlgebraicSet}.
QuasiAlgebraicSet2(vl,nv) : SIG == CODE where
vl : List Symbol
nv : NonNegativeInteger
R ==> Integer
F ==> Fraction R
Var ==> OrderedVariableList vl
NNI ==> NonNegativeInteger
Expon ==> DirectProduct(nv,NNI)
Dpoly ==> DistributedMultivariatePolynomial(vl,F)
QALG ==> QuasiAlgebraicSet(F, Var, Expon, Dpoly)
newExpon ==> DirectProduct(#newvl, NNI)
newPoly ==> DistributedMultivariatePolynomial(newvl,F)
newVar ==> OrderedVariableList newvl
Status ==> Union(Boolean,"failed") -- empty or not, or don't know
SIG ==> with
radicalSimplify : QALG -> QALG
++ radicalSimplify(s) returns a different and presumably simpler
++ representation of s with the defining polynomials for the
++ equations
++ forming a groebner basis, and the defining polynomial for the
++ inequation reduced with respect to the basis, using
++ using groebner basis of radical ideals
CODE ==> add
---- Local Functions ----
ts:=new()$Symbol
newvl:=concat(ts, vl)
tv:newVar:=(variable ts)::newVar
npoly : Dpoly -> newPoly
oldpoly : newPoly -> Union(Dpoly,"failed")
f : Var -> newPoly
g : newVar -> Dpoly
import PolynomialIdeals(F,newExpon,newVar,newPoly)
import GroebnerPackage(F,Expon,Var,Dpoly)
import GroebnerPackage(F,newExpon,newVar,newPoly)
import IdealDecompositionPackage(newvl,#newvl)
import QuasiAlgebraicSet(F, Var, Expon, Dpoly)
import PolynomialCategoryLifting(Expon,Var,F,Dpoly,newPoly)
import PolynomialCategoryLifting(newExpon,newVar,F,newPoly,Dpoly)
f(v:Var):newPoly ==
variable((convert v)@Symbol)@Union(newVar,"failed")::newVar
::newPoly
g(v:newVar):Dpoly ==
v = tv => 0
variable((convert v)@Symbol)@Union(Var,"failed")::Var::Dpoly
npoly(p:Dpoly) : newPoly == map(z1 +-> f z1, z2 +-> z2::newPoly, p)
oldpoly(q:newPoly) : Union(Dpoly,"failed") ==
(x:=mainVariable q) case "failed" => (leadingCoefficient q)::Dpoly
(x::newVar = tv) => "failed"
map(z1 +-> g z1, z2 +-> z2::Dpoly, q)
radicalSimplify x ==
status(x)$QALG = true => x -- x is empty
z0:=definingEquations x
n0:=definingInequation x
t:newPoly:= coerce(tv)$newPoly
tp:newPoly:= t * (npoly n0) - 1$newPoly
gen:List newPoly:= concat(tp, [npoly g for g in z0])
id:=ideal gen
ngb:=generators radical(id)
member? (1$newPoly, ngb) => empty()$QALG
gb:List Dpoly:=nil
while not empty? ngb repeat
if ((k:=oldpoly ngb.first) case Dpoly) then gb:=concat(k, gb)
ngb:=ngb.rest
y:=quasiAlgebraicSet(gb, primitivePart normalForm(n0, gb))
setStatus(y,false::Status)
|